libisoburn-1.5.4/0000755000175700017510000000000014005267033010702 500000000000000libisoburn-1.5.4/README0000644000175700017510000003503714005265240011510 00000000000000------------------------------------------------------------------------------ http:libburnia-project.org ------------------------------------------------------------------------------ libisoburn and xorriso. By Vreixo Formoso and Thomas Schmitt Integrated sub project of libburnia-project.org. http://files.libburnia-project.org/releases/libisoburn-1.5.4.tar.gz Copyright (C) 2006-2009 Vreixo Formoso, Copyright (C) 2006-2021 Thomas Schmitt. Provided under GPL version 2 or later. ------------------------------------------------------------------------------ libisoburn is a frontend for libraries libburn and libisofs which enables creation and expansion of ISO-9660 filesystems on all CD/DVD/BD media supported by libburn. This includes media like DVD+RW, which do not support multi-session management on media level and even plain disk files or block devices. The price for that is thorough specialization on data files in ISO-9660 filesystem images. So libisoburn is not suitable for audio (CD-DA) or any other CD layout which does not entirely consist of ISO-9660 sessions. xorriso is an application of libisoburn, libisofs, and libburn, which reads commands from program arguments, files, stdin, or readline. Its features are also available via a C language API of libisoburn. Currently they are fully supported on Linux with kernels >= 2.4, on FreeBSD with ATAPI/CAM support enabled in the kernel, see atapicam(4), on OpenSolaris (tested with kernel 5.11), on NetBSD (tested with 6.1.2 and 6.1.3). On other X/Open compliant systems libburn will only offer POSIX i/o with disk file objects, but no direct MMC operation on CD/DVD/BD drives. By using this software you agree to the disclaimer at the end of this text: "... without even the implied warranty ..." Compilation, First Glimpse, Installation Dynamic library and compile time header requirements for libisoburn-1.5.4 : - libburn.so.4 , version libburn-1.5.4 or higher - libisofs.so.6 , version libisofs-1.5.4 or higher libisoburn and xorriso will not start with libraries which are older than their include headers seen at compile time. Obtain libisoburn-1.5.4.tar.gz, take it to a directory of your choice and do: tar xzf libisoburn-1.5.4.tar.gz cd libisoburn-1.5.4 Within that directory execute: ./configure --prefix=/usr make Then become superuser and execute make install which will make available libisoburn.so.1 and the program xorriso. On GNU/Linux it will try to run program ldconfig with the library installation directory as only argument. Failure to do so will not abort installation. One may disable ldconfig by ./configure option --disable-ldconfig-at-install . By use of a version script, the libisoburn.so library exposes no other function names but those of the API definitions in and . If -Wl,--version-script=... makes problems with the local compiler, then disable this encapsulation feature by ./configure --disable-versioned-libs make clean ; make The ./configure script of libisoburn can check via pkg-config whether suitable libburn and libisoburn are installed. Regrettably this test failed on several systems due to local pkg-config problems. So it is disabled by default and may be enabled by: ./configure --enable-pkg-check-modules In this case, ./configure fails if no suitable installations are found. xorriso libisoburn comes with a command line and dialog application named xorriso, which offers a substantial part of libisoburn features to shell scripts and users. Its file xorriso/README_gnu_xorriso describes the tarball of the derived package GNU xorriso as first preference for a statically linked xorriso installation. The libisoburn installation described above produces a dynamically linked xorriso binary depending on libburn.so, libisofs.so, libisoburn.so. After installation documentation is available via man xorriso man xorrisofs man xorrecord Several alias links point to the xorriso binary: xorrisofs starts xorriso with -as mkisofs emulation already enabled xorrecord starts xorriso with -as cdrecord emulation already enabled osirrox starts with -osirrox image-to-disk copying already enabled By default libisoburn will depend on libreadline if the library and its development header files are present at compile time. If not, then it will try to depend on libedit and its header file. Both conditional dependencies can be avoided by running ./configure --prefix=/usr --disable-libreadline make clean ; make Never omit the "make clean" command after switching enabling of libreadline. Note that depending on libreadline-6 will cause libisoburn's license to become "GPL version 3 or later". If you want to explictely allow only the use of libedit, then do ./configure --prefix=/usr --disable-libreadline --enable-libedit Other deliberate dependency reduction options of ./configure are: --disable-libacl avoid use of ACL functions like acl_to_text() --disable-xattr avoid use of xattr functions like listxattr() on Linux or extattr_list_file() on FreeBSD --disable-zlib avoid use of zlib functions like compress2() --disable-libjte avoid use of libjte for -jigdo command xorriso allows to use external processes as file content filters. This is a potential security risk which may be avoided by ./configure option --disable-external-filters By default the filter feature is disabled if effective user id and real user id differ. This ban can be lifted by --enable-external-filters-setuid In some situations Linux may deliver a better write performance to DVD drives if 64 KB rather than 32 KB are transmitted in each write operation. 64k can be made default at configure time by: --enable-dvd-obs-64k libisoburn, libisofs, and libburn C language API For the lower API concepts and calls see ./libisoburn/libisoburn.h as well as /usr/include/libisofs/libisofs.h /usr/include/libburn/libburn.h xorriso C language API Actually the dynamically linked xorriso binary is only a small start program for the xorriso API that is implemented inside libisoburn. There are API calls for command readers and interpreters, and there are API calls for each single command of xorriso. Interested programmers should have a look into the API definition at xorriso/xorriso.h and the start program xorriso/xorriso_main.c The header file xorriso.h gets installed suitable for #include 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 intended. On Solaris one needs privileges "basic,sys_devices" and r-permission, even if writing is intended. A list of rw-accessible drives can be obtained by xorriso -devices or by xorriso API call Xorriso_option_devices() or by libburn API call burn_drive_scan() A possible source of problems are hald or other automounters. If you can spot a process "hald-addon-storage" with the address of your desired drive, then consider to kill it. A similar process "udisks-daemon: polling ..." can be seen on newer Linuxes. On Debian GNU/Linux 6.0.2 amd64 there is /lib/udev/rules.d/80-udisks.rules where one can remove all CD drives ("sr*") from the list of automountable devices: KERNEL=="sd*|hd*|mmcblk*|mspblk*", ENV{UDISKS_PRESENTATION_NOPOLICY}="0" # KERNEL=="sd*|hd*|sr*|mmcblk*|mspblk*", ENV{UDISKS_PRESENTATION_NOPOLICY}="0" Copying the recognition criterion from /etc/udev/rules.d/70-persistent-cd.rules one can prevent automounting a single drive, too. E.g.: SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:11.0-scsi-2:0:0:0", ENV{UDISKS_PRESENTATION_NOPOLICY}:="1" If you cannot get rid of the automounter, try whether it helps to always load the drive tray manually before starting a write run of xorriso. Wait until the drive light is off and the mounted media appears. Then try to unmount the mounted media before a write run. Besides true optical drives, libisoburn can also address disk files as input or output drives. The addresses of the disk files have to be preceded by "stdio:". Like: "stdio:/tmp/pseudo_drive" Note: xorriso by default prefixes "stdio:" to addresses outside the /dev tree if they do not lead to an optical drive device file. 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 on disk. It uses the normal POSIX filesystem calls, i.e. no libburnia stuff. This program is not installed systemwide but stays in the installation directory of the libisoburn tarball as test/compare_file . Usually it is run as -exec payload of a find command. It demands at least three arguments: The path of the file to compare, the prefix1 to be cut off from path and the prefix2 which gets prepended afterwards to obtain the path of the second file to compare. As further argument there can be -no_ctime which suppresses the comparison of ctime date stamps. The exit value is 0 if no difference was detected, non-0 else. Example: After xorriso ... -pathspecs on -add /=/original/dir -- mount /media/dvd cd test compare tree /media/dvd with tree /original/dir : find /original/dir -exec ./compare_file '{}' /original/dir /media/dvd ';' \ | less and vice versa: find /media/dvd -exec ./compare_file '{}' /media/dvd /original/dir ';' \ | less ------------------------------------------------------------------------------ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 or later as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------------------------ Based on and sub project of: libburnia-project.org By Mario Danic , Vreixo Formoso Thomas Schmitt Copyright (C) 2006-2019 Mario Danic, Vreixo Formoso, Thomas Schmitt. We will not raise any legal protest to dynamic linking of our libraries with applications that are not under GPL, as long as they fulfill the condition of offering the library source code used, whether altered or unaltered, under the GPLv2+, along with the application. Nevertheless, the safest legal position is not to link libburn with non-GPL compatible programs. libburnia-project.org is inspired by and in other components still containing parts of old Libburn. By Derek Foreman and Ben Jansens 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 libisoburn-1.5.4/libisoburn/0000755000175700017510000000000014005267033013052 500000000000000libisoburn-1.5.4/libisoburn/burn_wrap.c0000644000175700017510000017504713701321754015156 00000000000000 /* cc -g -c \ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE \ burn_wrap.c */ /* libburn wrappers for libisoburn Copyright 2007 - 2017 Thomas Schmitt, Provided under GPL version 2 or later. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif /* <<< A70929 : hardcoded CD-RW with fabricated -msinfo #define Hardcoded_cd_rW 1 #define Hardcoded_cd_rw_c1 12999 #define Hardcoded_cd_rw_nwA 152660 */ #include #include #include #include #include #include #include #include #include #include #ifndef Xorriso_standalonE #include #include #ifdef Xorriso_with_libjtE #include #endif #else /* ! Xorriso_standalonE */ #include "../libisofs/libisofs.h" #include "../libburn/libburn.h" #ifdef Xorriso_with_libjtE #include "../libjte/libjte.h" #endif #endif /* Xorriso_standalonE */ #include "libisoburn.h" #include "isoburn.h" /* The global list of isoburn objects. Usually there is only one. */ extern struct isoburn *isoburn_list_start; /* in isoburn.c */ /* Default values for application provided msgs_submit methods. To be attached to newly acquired drives. Storage location is isoburn.c */ extern int (*libisoburn_default_msgs_submit) (void *handle, int error_code, char msg_text[], int os_errno, char severity[], int flag); extern void *libisoburn_default_msgs_submit_handle; extern int libisoburn_default_msgs_submit_flag; static int isoburn_emulate_toc(struct burn_drive *d, int flag); int isoburn_initialize(char msg[1024], int flag) { int major, minor, micro, bad_match= 0, no_iso_init= 0; /* First the ugly compile time checks for header version compatibility. If everything matches, then they produce no C code. In case of mismatch, intentionally faulty C code will be inserted. */ #ifdef iso_lib_header_version_major /* The minimum requirement of libisoburn towards the libisofs header at compile time is defined in libisoburn/libisoburn.h : isoburn_libisofs_req_major isoburn_libisofs_req_minor isoburn_libisofs_req_micro It gets compared against the version macros in libisofs/libisofs.h : iso_lib_header_version_major iso_lib_header_version_minor iso_lib_header_version_micro If the header is too old then the following code shall cause failure of libisoburn compilation rather than to allow production of a program with unpredictable bugs or memory corruption. The compiler messages supposed to appear in this case are: error: 'LIBISOFS_MISCONFIGURATION' undeclared (first use in this function) error: 'INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libisofs_dot_h_TOO_OLD__SEE_libisoburn_dot_h_AND_burn_wrap_dot_h' undeclared (first use in this function) error: 'LIBISOFS_MISCONFIGURATION_' undeclared (first use in this function) */ /* The indentation is an advise of man gcc to help old compilers ignoring */ #if isoburn_libisofs_req_major > iso_lib_header_version_major #define Isoburn_libisofs_dot_h_too_olD 1 #endif #if isoburn_libisofs_req_major == iso_lib_header_version_major && isoburn_libisofs_req_minor > iso_lib_header_version_minor #define Isoburn_libisofs_dot_h_too_olD 1 #endif #if isoburn_libisofs_req_minor == iso_lib_header_version_minor && isoburn_libisofs_req_micro > iso_lib_header_version_micro #define Isoburn_libisofs_dot_h_too_olD 1 #endif #ifdef Isoburn_libisofs_dot_h_too_olD LIBISOFS_MISCONFIGURATION = 0; INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libisofs_dot_h_TOO_OLD__SEE_libisoburn_dot_h_AND_burn_wrap_dot_c = 0; LIBISOFS_MISCONFIGURATION_ = 0; #endif #endif /* iso_lib_header_version_major */ /* The minimum requirement of libisoburn towards the libburn header at compile time is defined in libisoburn/libisoburn.h : isoburn_libburn_req_major isoburn_libburn_req_minor isoburn_libburn_req_micro It gets compared against the version macros in libburn/libburn.h : burn_header_version_major burn_header_version_minor burn_header_version_micro If the header is too old then the following code shall cause failure of cdrskin compilation rather than to allow production of a program with unpredictable bugs or memory corruption. The compiler messages supposed to appear in this case are: error: 'LIBBURN_MISCONFIGURATION' undeclared (first use in this function) error: 'INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libburn_dot_h_TOO_OLD__SEE_libisoburn_dot_h_and_burn_wrap_dot_h' undeclared (first use in this function) error: 'LIBBURN_MISCONFIGURATION_' undeclared (first use in this function) */ /* The indentation is an advise of man gcc to help old compilers ignoring */ #if isoburn_libburn_req_major > burn_header_version_major #define Isoburn_libburn_dot_h_too_olD 1 #endif #if isoburn_libburn_req_major == burn_header_version_major && isoburn_libburn_req_minor > burn_header_version_minor #define Isoburn_libburn_dot_h_too_olD 1 #endif #if isoburn_libburn_req_minor == burn_header_version_minor && isoburn_libburn_req_micro > burn_header_version_micro #define Isoburn_libburn_dot_h_too_olD 1 #endif #ifdef Isoburn_libburn_dot_h_too_olD LIBBURN_MISCONFIGURATION = 0; INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libburn_dot_h_TOO_OLD__SEE_libisoburn_dot_h_and_burn_wrap_dot_h = 0; LIBBURN_MISCONFIGURATION_ = 0; #endif #ifdef Xorriso_with_libjtE /* The minimum requirement of libisoburn towards the libjte header at compile time is the same as the one of a usable libisofs towards libjte. So the requirement is defined in libisofs/libisofs.h : iso_libjte_req_major , iso_libjte_req_minor , iso_libjte_req_micro */ /* The indentation is an advise of man gcc to help old compilers ignoring */ #if iso_libjte_req_major > LIBJTE_VERSION_MAJOR #define Libisofs_libjte_dot_h_too_olD 1 #endif #if iso_libjte_req_major == LIBJTE_VERSION_MAJOR && iso_libjte_req_minor > LIBJTE_VERSION_MINOR #define Libisofs_libjte_dot_h_too_olD 1 #endif #if iso_libjte_req_minor == LIBJTE_VERSION_MINOR && iso_libjte_req_micro > LIBJTE_VERSION_MICRO #define Libisofs_libjte_dot_h_too_olD 1 #endif #ifdef Libisofs_libjte_dot_h_too_olD LIBJTE_MISCONFIGURATION = 0; INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libjte_dot_h_TOO_OLD__SEE_libisofs_dot_h_AND_burn_wrap.c_c = 0; LIBJTE_MISCONFIGURATION_ = 0; #endif #endif /* Xorriso_with_libjtE */ /* End of ugly compile time tests (scroll up for explanation) */ msg[0]= 0; #ifdef Xorriso_with_libjtE libjte__version(&major, &minor, µ); sprintf(msg + strlen(msg), "libjte-%d.%d.%d ", major, minor, micro); if (libjte__is_compatible(LIBJTE_VERSION_MAJOR, LIBJTE_VERSION_MINOR, LIBJTE_VERSION_MICRO, 0)) { sprintf(msg+strlen(msg), "ok, "); } else { sprintf(msg + strlen(msg), "- TOO OLD -, need at least libjte-%d.%d.%d ,\n", LIBJTE_VERSION_MAJOR, LIBJTE_VERSION_MINOR, LIBJTE_VERSION_MICRO); bad_match= 1; no_iso_init= 1; /* iso_init() will fail anyway */ } #endif /* Xorriso_with_libjtE */ if(!no_iso_init) { if(iso_init()<0) { sprintf(msg+strlen(msg), "Cannot initialize libisofs\n"); return(0); } } iso_lib_version(&major, &minor, µ); sprintf(msg+strlen(msg), "libisofs-%d.%d.%d ", major, minor, micro); #ifdef iso_lib_header_version_major if(iso_lib_is_compatible(iso_lib_header_version_major, iso_lib_header_version_minor, iso_lib_header_version_micro)) { sprintf(msg+strlen(msg), "ok, "); } else { sprintf(msg+strlen(msg),"- TOO OLD -, need at least libisofs-%d.%d.%d ,\n", iso_lib_header_version_major, iso_lib_header_version_minor, iso_lib_header_version_micro); bad_match= 1; } #else if(iso_lib_is_compatible(isoburn_libisofs_req_major, isoburn_libisofs_req_minor, isoburn_libisofs_req_micro)) { sprintf(msg+strlen(msg), "suspicious, "); } else { sprintf(msg+strlen(msg),"- TOO OLD -, need at least libisofs-%d.%d.%d ,\n", isoburn_libisofs_req_major, isoburn_libisofs_req_minor, isoburn_libisofs_req_micro); bad_match= 1; } #endif /* ! iso_lib_header_version_major */ if(!burn_initialize()) { sprintf(msg+strlen(msg), "Cannot initialize libburn\n"); return(0); } burn_version(&major, &minor, µ); sprintf(msg+strlen(msg), "libburn-%d.%d.%d ", major, minor, micro); if(major > burn_header_version_major || (major == burn_header_version_major && (minor > burn_header_version_minor || (minor == burn_header_version_minor && micro >= burn_header_version_micro)))) { sprintf(msg+strlen(msg), "ok, "); } else { sprintf(msg+strlen(msg), "- TOO OLD -, need at least libburn-%d.%d.%d ,\n", burn_header_version_major, burn_header_version_minor, burn_header_version_micro); bad_match= 1; } isoburn_version(&major, &minor, µ); sprintf(msg+strlen(msg), "for libisoburn-%d.%d.%d", major, minor, micro); if(bad_match) return(0); isoburn_destroy_all(&isoburn_list_start, 0); /* isoburn_list_start= NULL */ return(1); } /* API @since 0.1.0 */ int isoburn_libisofs_req(int *major, int *minor, int *micro) { *major= iso_lib_header_version_major; *minor= iso_lib_header_version_minor; *micro= iso_lib_header_version_micro; return(1); } /* API @since 0.1.0 */ int isoburn_libburn_req(int *major, int *minor, int *micro) { *major= burn_header_version_major; *minor= burn_header_version_minor; *micro= burn_header_version_micro; return(1); } /* API @since 0.6.4 */ int isoburn_libjte_req(int *major, int *minor, int *micro) { #ifdef Xorriso_with_libjtE *major= LIBJTE_VERSION_MAJOR; *minor= LIBJTE_VERSION_MINOR; *micro= LIBJTE_VERSION_MICRO; #else *major= *minor= *micro= 0; #endif /* ! Xorriso_with_libjtE */ return(1); } int isoburn_set_msgs_submit(int (*msgs_submit)(void *handle, int error_code, char msg_text[], int os_errno, char severity[], int flag), void *submit_handle, int submit_flag, int flag) { libisoburn_default_msgs_submit= msgs_submit; libisoburn_default_msgs_submit_handle= submit_handle; libisoburn_default_msgs_submit_flag= submit_flag; return(1); } int isoburn_is_intermediate_dvd_rw(struct burn_drive *d, int flag) { int profile, ret= 0, format_status, num_formats; char profile_name[80]; enum burn_disc_status s; off_t format_size= -1; unsigned bl_sas; s= isoburn_disc_get_status(d); ret= burn_disc_get_profile(d, &profile, profile_name); if(ret>0 && profile==0x13) ret= burn_disc_get_formats(d, &format_status, &format_size, &bl_sas, &num_formats); if(ret>0 && profile==0x13 && s==BURN_DISC_BLANK && format_status==BURN_FORMAT_IS_UNKNOWN) return(1); return(0); } /** Examines the medium and sets appropriate emulation if needed. @param flag bit0= pretent blank on overwritable media bit3= if the drive reports a -ROM profile then try to read table of content by scanning for ISO image headers. bit4= do not emulate TOC on overwritable media bit5= ignore ACL from external filesystems bit6= ignore POSIX Extended Attributes from external filesystems bit7= pretend -ROM and scan for table of content bit9= when scanning for ISO 9660 sessions on overwritable media: Do not demand a valid superblock at LBA 0 and scan until end of medium. bit10= if not bit6: accept all xattr namespaces from external filesystems, not only "user.". */ static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d, int flag) { int ret, profile, readonly= 0, role, random_access; int emulation_started= 0; struct burn_multi_caps *caps= NULL; struct isoburn_toc_entry *t; char profile_name[80]; struct isoburn_toc_disc *disc= NULL; struct isoburn_toc_session **sessions; struct isoburn_toc_track **tracks; int num_sessions= 0, num_tracks= 0, track_count= 0, session_no= 0; char msg[80]; enum burn_disc_status s; #ifndef Hardcoded_cd_rW int lba, nwa; #endif s= burn_disc_get_status(d); profile_name[0]= 0; ret= burn_disc_get_profile(d, &profile, profile_name); if(ret<=0) profile= 0x00; ret= burn_disc_get_multi_caps(d, BURN_WRITE_NONE, &caps, 0); if(ret<0) /*== 0 is read-only medium, but it is too early to reject it here */ goto ex; if(ret==0 || (flag & 128)) readonly= 1; if(flag & 128) flag = (flag & ~ 16) | 8; ret= isoburn_find_emulator(o, d, 0); if(ret >= 0 && *o != NULL) isoburn_destroy(o, 0); ret= isoburn_new(o, 0); if(ret<=0) goto ex; (*o)->drive= d; (*o)->msgs_submit= libisoburn_default_msgs_submit; (*o)->msgs_submit_handle= libisoburn_default_msgs_submit_handle; (*o)->msgs_submit_flag= libisoburn_default_msgs_submit_flag; iso_image_set_ignore_aclea((*o)->image, ((flag >> 5 ) & 3) | ((!!(flag & 1024)) << 3)); #ifdef Hardcoded_cd_rW /* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */ caps->start_adr= 0; (*o)->fabricated_disc_status= BURN_DISC_APPENDABLE; #endif role= burn_drive_get_drive_role(d); random_access= caps->start_adr || role == 4; if(random_access) (*o)->emulation_mode= 1; if(random_access && !readonly) { /* set emulation to overwritable */ ret= isoburn_is_intermediate_dvd_rw(d, 0); if(ret>0) { (*o)->min_start_byte= 0; (*o)->nwa= 0; (*o)->zero_nwa= 0; } if((flag & 1) && role != 4 && role != 5) { (*o)->nwa= (*o)->zero_nwa; (*o)->fabricated_disc_status= BURN_DISC_BLANK; } else { ret= isoburn_start_emulation(*o, 0); if(ret<=0) { (*o)->emulation_mode= -1; goto ex; } emulation_started= 1; /* try to read emulated toc */ ret= isoburn_emulate_toc(d, (flag & 16) | ((!!(flag & 512)) << 1)); if(ret<0) { (*o)->emulation_mode= -1; goto ex; } } } else { /* >>> recognize unsuitable media (but allow read-only media) */; if(readonly && s != BURN_DISC_EMPTY) { /* >>> ts B10712: This maps BURN_DISC_UNSUITABLE to BURN_DISC_FULL which can hardly be correct in general. ??? What reason does this have ? */ (*o)->fabricated_disc_status= BURN_DISC_FULL; /* This might be an overwritable medium in a -ROM drive. Pitfall: Multi-session media which bear a xorriso image for overwritables in their first session would get a TOC of that first image rather than of the medium. It is not possible to distinguish a BD-RE from a single session BD-R with an image for overwritables. But as soon as the medium bears 2 logical tracks it cannot be overwritable. So count the number of tracks first. */ disc= isoburn_toc_drive_get_disc(d); if(disc != NULL) { sessions= isoburn_toc_disc_get_sessions(disc, &num_sessions); for(session_no= 0; session_no < num_sessions; session_no++) { tracks= isoburn_toc_session_get_tracks(sessions[session_no], &num_tracks); if(tracks != NULL) track_count+= num_tracks; } isoburn_toc_disc_free(disc); } sprintf(msg, "ROM medium has libburn track count = %d", track_count); isoburn_msgs_submit(*o, 0x00060000, msg, 0, "DEBUG", 0); if((flag & 16) || track_count >= 2) { ret= 0; /* toc emulation off, or not overwritable */ } else { ret= isoburn_start_emulation(*o, 1); if(ret<=0) { (*o)->emulation_mode= -1; goto ex; } emulation_started= 1; ret= isoburn_emulate_toc(d, 1 | ((!!(flag & 512)) << 1)); if(ret<0) goto ex; else if(ret > 0) (*o)->emulation_mode= 1; } if(ret == 0 && (profile != 0x08 || (flag & 128)) && (flag & 8)) { /* This might also be multi-session media which do not get shown with a decent TOC. CD-R TOC (profile 0x08) can be trusted. Others not. Do a scan search of ISO headers. */ if(!emulation_started) { ret= isoburn_start_emulation(*o, 1); if(ret<=0) { (*o)->emulation_mode= -1; goto ex; } } ret= isoburn_emulate_toc(d, 1 | 2); if(ret<0) goto ex; if(ret>0) { /* point msc1 to last session */ if((*o)->toc!=NULL) { for(t= (*o)->toc; t->next!=NULL; t= t->next) ; /* clang wants newline in empty loops */ (*o)->fabricated_msc1= t->start_lba; } } } } #ifdef Hardcoded_cd_rW (*o)->nwa= Hardcoded_cd_rw_nwA; #else ret= burn_disc_track_lba_nwa(d, NULL, 0, &lba, &nwa); if(ret>0) (*o)->nwa= nwa; if((*o)->nwa < (*o)->zero_nwa) (*o)->zero_nwa= 0; #endif } ret= 1; ex: if(caps!=NULL) burn_disc_free_multi_caps(&caps); return(ret); } /** @param flag bit0= load bit1= regard overwritable media as blank bit2= if the drive is a regular disk file: truncate it to the write start address bit3= if the drive reports a -ROM profile then try to read table of content by scanning for ISO image headers. (depending on media type and drive state this might help or it might make the resulting toc even worse) bit4= do not emulate TOC on overwritable media bit5= ignore ACL from external filesystems bit6= ignore POSIX Extended Attributes from external filesystems bit7= pretend -ROM profile and scan for table of content bit8= re-assess (*drive_infos)[0] rather than acquiring adr bit9= when scanning for ISO 9660 sessions on overwritable media: Do not demand a valid superblock at LBA 0 and scan until end of medium. bit10= if not bit6: accept all xattr namespaces from external filesystems, not only "user.". */ int isoburn_drive_aquire(struct burn_drive_info *drive_infos[], char *adr, int flag) { int ret, drive_grabbed= 0; struct isoburn *o= NULL; int conv_ret; char *libburn_drive_adr= NULL; /* Should be obsolete by new drive addressing of libburn-0.5.2 */ /* but helps with kernel 2.4 to use /dev/sr */ libburn_drive_adr= calloc(1, BURN_DRIVE_ADR_LEN); if(libburn_drive_adr == NULL) {ret= -1; goto ex;} conv_ret= burn_drive_convert_fs_adr(adr, libburn_drive_adr); if(conv_ret<=0) strcpy(libburn_drive_adr, adr); if(flag & 256) ret= burn_drive_re_assess((*drive_infos)[0].drive, 0); else ret= burn_drive_scan_and_grab(drive_infos, libburn_drive_adr, flag&1); if(ret<=0) goto ex; drive_grabbed= 1; ret= isoburn_welcome_media(&o, (*drive_infos)[0].drive, (flag & (8 | 16 | 32 | 64 | 128 | 512 | 1024)) | !!(flag&2)); if(ret<=0) goto ex; if(flag&4) { ret= isoburn_find_emulator(&o, (*drive_infos)[0].drive, 0); if(ret>0 && o!=NULL) o->truncate= 1; } ret= 1; ex: if(ret<=0) { if(drive_grabbed) burn_drive_release((*drive_infos)[0].drive, 0); isoburn_destroy(&o, 0); } if(libburn_drive_adr != NULL) free(libburn_drive_adr); return(ret); } int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[], char *adr, int load) { int ret; ret= isoburn_drive_aquire(drive_infos, adr, !!load); return(ret); } int isoburn_drive_grab(struct burn_drive *drive, int load) { int ret; struct isoburn *o= NULL; ret= burn_drive_grab(drive, load); if(ret<=0) goto ex; ret= isoburn_welcome_media(&o, drive, 0); if(ret<=0) goto ex; ret= 1; ex: if(ret<=0) isoburn_destroy(&o,0); return(ret); } /** Retrieve medium emulation and eventual isoburn emulator of drive. @return -1 unsuitable medium, 0 generic medium, 1 emulated medium. */ int isoburn_find_emulator(struct isoburn **pt, struct burn_drive *drive, int flag) { int ret; ret= isoburn_find_by_drive(pt, drive, 0); if(ret<=0) return(0); if((*pt)->emulation_mode==-1) { isoburn_msgs_submit(*pt, 0x00060000, "Unsuitable drive and medium state", 0, "FAILURE", 0); return(-1); } if((*pt)->emulation_mode==0) return(0); return(1); } enum burn_disc_status isoburn_disc_get_status(struct burn_drive *drive) { int ret; struct isoburn *o; ret= isoburn_find_emulator(&o, drive, 0); if(ret<0) return(BURN_DISC_UNSUITABLE); if(o!=NULL) if(o->fabricated_disc_status!=BURN_DISC_UNREADY) return(o->fabricated_disc_status); if(ret==0) return(burn_disc_get_status(drive)); /* emulated status */ if(o->emulation_mode==-1) return(BURN_DISC_UNSUITABLE); if(o->nwa>o->zero_nwa) return(BURN_DISC_APPENDABLE); return(BURN_DISC_BLANK); } int isoburn_disc_pretend_full_uncond(struct burn_drive *drive) { int ret; struct isoburn *o; ret= isoburn_find_emulator(&o, drive, 0); if(ret > 0 && o != NULL) o->fabricated_disc_status= BURN_DISC_FULL; ret= burn_disc_pretend_full_uncond(drive); return(ret); } int isoburn_disc_erasable(struct burn_drive *d) { int ret; struct isoburn *o; ret= isoburn_find_emulator(&o, d, 0); if(ret>0) if(o->emulation_mode==1) return(1); return burn_disc_erasable(d); } static int isoburn_is_overwritable(struct burn_drive *drive, int flag) { char name[80]; int profile, ret; ret= burn_disc_get_profile(drive, &profile, name); if(ret <= 0) return(0); if(profile == 0x12 || profile == 0x13 || profile == 0x1a || profile == 0x43) return(1); return(0); } void isoburn_disc_erase(struct burn_drive *drive, int fast) { int ret, do_pseudo_blank= 0, role; struct isoburn *o; enum burn_disc_status s; char *zero_buffer= NULL; struct burn_multi_caps *caps= NULL; zero_buffer= calloc(1, Libisoburn_target_head_sizE); if(zero_buffer == NULL) { /* To cause a negative reply with burn_drive_wrote_well() */ burn_drive_cancel(drive); goto ex; } ret= isoburn_find_emulator(&o, drive, 0); if(ret>0) { if(o->emulation_mode==-1) { /* To cause a negative reply with burn_drive_wrote_well() */ burn_drive_cancel(drive); goto ex; } role = burn_drive_get_drive_role(drive); if (role == 5) { /* libburn will truncate the random-access write-only file to zero size and change its state */ burn_disc_erase(drive, fast); o->fabricated_disc_status= burn_disc_get_status(drive); o->nwa= o->zero_nwa= 0; goto ex; } if(o->emulation_mode > 0) { /* might be readonly with emulated sessions */ ret= burn_disc_get_multi_caps(drive, BURN_WRITE_NONE, &caps, 0); if(ret <= 0) /* Maybe because of burn_disc_pretend_full() */ do_pseudo_blank= isoburn_is_overwritable(drive, 0); /* known profiles */ else if(caps->start_adr) do_pseudo_blank= 1; } if(do_pseudo_blank) { s= isoburn_disc_get_status(drive); if(s==BURN_DISC_FULL) { /* unknown data format in first 64 kB */ memset(zero_buffer, 0, Libisoburn_target_head_sizE); ret= burn_random_access_write(drive, (off_t) 0, zero_buffer, (off_t) Libisoburn_target_head_sizE, 1); } else { ret= isoburn_invalidate_iso(o, 0); } if(ret<=0) burn_drive_cancel(drive); /* mark run as failure */ goto ex; } } burn_disc_erase(drive, fast); ex:; if(caps!=NULL) burn_disc_free_multi_caps(&caps); if(zero_buffer != NULL) free(zero_buffer); } off_t isoburn_disc_available_space(struct burn_drive *d, struct burn_write_opts *opts) { int ret; struct isoburn *o; struct burn_write_opts *eff_opts= NULL, *local_opts= NULL; enum burn_disc_status s; off_t avail; eff_opts= opts; ret= isoburn_find_emulator(&o, d, 0); if(ret>0 && o!=NULL) if(o->emulation_mode!=0) { s= isoburn_disc_get_status(d); if(s==BURN_DISC_FULL) /* unknown data format in first 64 kB */ return((off_t) 0); local_opts= burn_write_opts_new(d); eff_opts= local_opts; burn_write_opts_set_start_byte(eff_opts, ((off_t) o->nwa) * (off_t) 2048); } avail= burn_disc_available_space(d, eff_opts); if(local_opts!=NULL) burn_write_opts_free(local_opts); local_opts= NULL; return(avail); } int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba) { int ret; struct isoburn *o; #ifdef Hardcoded_cd_rW /* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */ *start_lba= Hardcoded_cd_rw_c1; return(1); #endif if(isoburn_disc_get_status(d)!=BURN_DISC_APPENDABLE && isoburn_disc_get_status(d)!=BURN_DISC_FULL) { isoburn_msgs_submit(NULL, 0x00060000, "Medium contains no recognizable data", 0, "SORRY", 0); return(0); } ret= isoburn_find_emulator(&o, d, 0); if(ret<0) return(0); if(o->fabricated_msc1>=0) { *start_lba= o->fabricated_msc1; return(1); } if(ret>0) if(o->emulation_mode>0) { *start_lba= 0; return(1); } return(burn_disc_get_msc1(d, start_lba)); } int isoburn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *opts, int trackno, int *lba, int *nwa) { int ret; struct isoburn *o; enum burn_disc_status s; #ifdef Hardcoded_cd_rW /* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */ *lba= Hardcoded_cd_rw_c1; *nwa= Hardcoded_cd_rw_nwA; return(1); #endif *nwa= *lba= 0; ret= isoburn_find_emulator(&o, d, 0); if(ret<0) return(0); if(ret>0) if(o->emulation_mode>0) { *lba= 0; *nwa= o->nwa; return(1); } if(burn_drive_get_drive_role(d) != 1) return(1); s= isoburn_disc_get_status(d); if(s == BURN_DISC_BLANK) /* We do not believe in anything but nwa = lba = 0 */ return(1); return(burn_disc_track_lba_nwa(d, opts, trackno, lba, nwa)); } int isoburn_get_msc2(struct isoburn *o, struct burn_write_opts *opts, int *msc2, int flag) { int ret, lba, nwa; if(o->fabricated_msc2>=0) *msc2= o->fabricated_msc2; else { ret= isoburn_disc_track_lba_nwa(o->drive, opts, 0, &lba, &nwa); if(ret<=0) return(ret); *msc2= nwa; } return(1); } /* @param flag bit0= truncate (else do not truncate) bit1= do not warn if call is inappropriate to drive bit2= only set if truncation is currently enabled */ int isoburn_set_truncate(struct burn_drive *drive, int flag) { int ret; struct isoburn *o; ret= isoburn_find_emulator(&o, drive, 0); if(ret < 0) return ret; if(o == NULL) { if(!(flag & (2 | 4))) isoburn_msgs_submit(o, 0x00060000, "Drive type or role is inappropriate for truncation", 0, "WARNING", 0); return(0); } if(o->truncate || !(flag & 4)) o->truncate= flag & 1; return(1); } void isoburn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc) { int ret; off_t nwa= 0; struct isoburn *o; struct burn_drive *drive; char *reasons= NULL, *msg= NULL, *adr= NULL; struct stat stbuf; enum burn_write_types write_type; drive= burn_write_opts_get_drive(opts); reasons= calloc(1, BURN_REASONS_LEN); msg= calloc(1, 160+BURN_REASONS_LEN); adr= calloc(1, BURN_DRIVE_ADR_LEN); if(reasons == NULL || msg == NULL || adr == NULL) { /* To cause a negative reply with burn_drive_wrote_well() */ burn_drive_cancel(drive); goto ex; } ret= isoburn_find_emulator(&o, drive, 0); if(ret<0) goto ex; if(o == NULL) { sprintf(msg, "Program error: Cannot find isoburn object associated to the drive"); isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0); burn_drive_cancel(drive); goto ex; } o->wrote_well= -1; if(o->emulation_mode!=0) { burn_write_opts_set_multi(opts, 0); if(o->emulation_mode>0 && o->nwa >= 0) { nwa= o->nwa; /* This caters for unwritten formatted DVD-RW. They need to be written sequentially on the first use. Only written areas are random access. If the first session is not written to LBA 0, then re-opening of formatting and padding is needed. This can be done. But when the track gets closed after padding, this lasts a long time. There is a high risk that an app will not poll the message queue while waiting for isoburn_disc_write() to return. The pacifier loop usually happens only afterwards. So automatic formatting might cause a nervous clueless user. */ ret= isoburn_is_intermediate_dvd_rw(drive, 0); if(ret>0 && nwa>0 && nwa <= o->zero_nwa) { /* actually this should not happen since such media get recognized by isoburn_welcome_media and o->zero_nwa gets set to 0 */ sprintf(msg, "DVD-RW insufficiently formatted. (Intermediate State, size unknown)"); isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0); sprintf(msg, "It might help to first deformat it and then format it again"); isoburn_msgs_submit(o, 0x00060000, msg, 0, "HINT", 0); burn_drive_cancel(drive); /* mark run as failure */ goto ex; } /* end of DVD-RW oriented check */ burn_write_opts_set_start_byte(opts, nwa * (off_t) 2048); } } if(o->do_tao) { if (o->do_tao > 0) burn_write_opts_set_write_type(opts, BURN_WRITE_TAO, BURN_BLOCK_MODE1); else burn_write_opts_set_write_type(opts, BURN_WRITE_SAO, BURN_BLOCK_SAO); ret = burn_precheck_write(opts, disc, reasons, 0); if(ret <= 0) { sprintf(msg, "Cannot set write type %s for this medium.", o->do_tao > 0 ? "TAO" : "SAO"); sprintf(msg + strlen(msg), "Reasons given:\n %s", reasons); goto no_write_type; } sprintf(msg, "Explicitly chosen write type: %s", o->do_tao > 0 ? "TAO" : "SAO"); isoburn_msgs_submit(o, 0x00060000, msg, 0, "NOTE", 0); } else { write_type= burn_write_opts_auto_write_type(opts, disc, reasons, 0); if (write_type == BURN_WRITE_NONE) { sprintf(msg, "Failed to find a suitable write type:\n%s", reasons); no_write_type:; isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0); if(o!=NULL) o->wrote_well= 0; /* To cause a negative reply with burn_drive_wrote_well() */ burn_drive_cancel(drive); goto ex; } sprintf(reasons, "%d", (int) write_type); sprintf(msg, "Write_type = %s\n", (write_type == BURN_WRITE_SAO ? "SAO" : (write_type == BURN_WRITE_TAO ? "TAO" : reasons))); isoburn_msgs_submit(o, 0x00060000, msg, 0, "DEBUG", 0); } #ifdef Hardcoded_cd_rW /* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */ fprintf(stderr, "Setting write address to LBA %d\n", Hardcoded_cd_rw_nwA); burn_write_opts_set_start_byte(opts, ((off_t) Hardcoded_cd_rw_nwA) * (off_t) 2048); #endif if(o->truncate) { ret= burn_drive_get_drive_role(drive); if(ret == 2 || ret == 5) { ret= burn_drive_d_get_adr(drive, adr); if(ret>0) { ret= lstat(adr, &stbuf); if(ret!=-1) if(S_ISREG(stbuf.st_mode)) ret= truncate(adr, nwa * (off_t) 2048); /* (result of truncate intentionally ignored) */ } } } burn_disc_write(opts, disc); ex:; if(reasons != NULL) free(reasons); if(msg != NULL) free(msg); if(adr != NULL) free(adr); } void isoburn_drive_release(struct burn_drive *drive, int eject) { int ret; struct isoburn *o; ret= isoburn_find_emulator(&o, drive, 0); if(ret<0) return; if(o!=NULL) { isoburn_destroy(&o, 0); } burn_drive_release(drive, eject); } void isoburn_finish(void) { isoburn_destroy_all(&isoburn_list_start, 0); burn_finish(); iso_finish(); } int isoburn_needs_emulation(struct burn_drive *drive) { int ret; struct isoburn *o; enum burn_disc_status s; s= isoburn_disc_get_status(drive); if(s!=BURN_DISC_BLANK && s!=BURN_DISC_APPENDABLE) return(-1); ret= isoburn_find_emulator(&o, drive, 0); if(ret<0) return(-1); if(ret>0) if(o->emulation_mode>0) return(1); return(0); } int isoburn_set_start_byte(struct isoburn *o, off_t value, int flag) { int ret; struct burn_drive *drive = o->drive; struct burn_multi_caps *caps= NULL; ret= burn_disc_get_multi_caps(drive, BURN_WRITE_NONE, &caps, 0); if(ret<=0) goto ex; if(!caps->start_adr) { isoburn_msgs_submit(o, 0x00060000, "Cannot set start byte address with this type of media", 0, "FAILURE", 0); {ret= 0; goto ex;} } o->min_start_byte= value; if(value % caps->start_alignment) value+= caps->start_alignment - (value % caps->start_alignment); o->nwa= value/2048; if(o->nwa < o->zero_nwa) o->zero_nwa= 0; /* If suitable for media alignment, round up to Libisoburn_nwa_alignemenT */ if((o->nwa % Libisoburn_nwa_alignemenT) && ((Libisoburn_nwa_alignemenT*2048) % caps->start_alignment)==0 ) o->nwa+= Libisoburn_nwa_alignemenT - (o->nwa % Libisoburn_nwa_alignemenT); ret= 1; ex: if(caps!=NULL) burn_disc_free_multi_caps(&caps); return(ret); } int isoburn_get_min_start_byte(struct burn_drive *d, off_t *start_byte, int flag) { int ret; struct isoburn *o; ret= isoburn_find_emulator(&o, d, 0); if(ret<0) return(-1); if(ret==0) return(0); *start_byte= o->min_start_byte; if(o->min_start_byte<=0) return(0); return(1); } int isoburn_drive_wrote_well(struct burn_drive *d) { int ret; struct isoburn *o; ret= isoburn_find_emulator(&o, d, 0); if(ret<0) return(-1); if(o!=NULL) if(o->wrote_well>=0) return(o->wrote_well); ret= burn_drive_wrote_well(d); return ret; } int isoburn_get_fifo_status(struct burn_drive *d, int *size, int *free_bytes, char **status_text) { int ret; struct isoburn *o; size_t hsize= 0, hfree_bytes= 0; ret= isoburn_find_emulator(&o, d, 0); if(ret<0) return(-1); if(o==NULL) return(-1); if(o->iso_source==NULL) return(-1); ret= iso_ring_buffer_get_status(o->iso_source, &hsize, &hfree_bytes); if(hsize > 1024*1024*1024) *size= 1024*1024*1024; else *size= hsize; if(hfree_bytes > 1024*1024*1024) *free_bytes= 1024*1024*1024; else *free_bytes= hfree_bytes; *status_text= ""; if(ret==0) *status_text= "standby"; else if(ret==1) *status_text= "active"; else if(ret==2) *status_text= "ending"; else if(ret==3) *status_text= "failing"; else if(ret==4) *status_text= "unused"; else if(ret==5) *status_text= "abandoned"; else if(ret==6) *status_text= "ended"; else if(ret==7) *status_text= "aborted"; return(ret); } /* @param flag bit0= -reserved- bit1= this is a libburn severity */ int isoburn__sev_to_text(int severity, char **severity_name, int flag) { int ret; ret= iso_sev_to_text(severity, severity_name); if(ret>0) return(ret); ret= burn_sev_to_text(severity, severity_name, 0); return(ret); } int isoburn__text_to_sev(char *severity_name, int *severity_number, int flag) { int ret= 1; ret= iso_text_to_sev(severity_name, severity_number); if(ret>0) return(ret); ret= burn_text_to_sev(severity_name, severity_number, 0); return(ret); } int isoburn_report_iso_error(int iso_error_code, char msg_text[], int os_errno, char min_severity[], int flag) { int error_code, iso_sev, min_sev, ret; char *sev_text_pt, *msg_text_pt= NULL; error_code= iso_error_get_code(iso_error_code); if(error_code < 0x00030000 || error_code >= 0x00040000) error_code= (error_code & 0xffff) | 0x00050000; if(iso_error_code<0) msg_text_pt= (char *) iso_error_to_msg(iso_error_code); if(msg_text_pt==NULL) msg_text_pt= msg_text; iso_sev= iso_error_get_severity(iso_error_code); sev_text_pt= min_severity; isoburn__text_to_sev(min_severity, &min_sev, 0); if(min_sev < iso_sev) isoburn__sev_to_text(iso_sev, &sev_text_pt, 0); ret= iso_msgs_submit(error_code, msg_text_pt, os_errno, sev_text_pt, 0); return(ret); } /* @param flag bit0-7: info return mode 0= do not return anything in info (do not even touch it) 1= copy volume id to info (info needs 33 bytes) 2= do not touch info (caller will copy 64 kB header to it) bit14= -reserved - bit15= -reserved- @return 1 seems to be a valid ISO image , 0 format not recognized, <0 error */ int isoburn_read_iso_head_parse(unsigned char *data, int *image_blocks, char *info, int flag) { int i, info_mode; /* is this an ISO image ? */ if(data[0]!=1) return(0); if(strncmp((char *) (data+1),"CD001",5)!=0) return(0); /* believe so */ *image_blocks= data[80] | (data[81]<<8) | (data[82]<<16) | (data[83]<<24); info_mode= flag&255; if(info_mode==0) { ; } else if(info_mode==1) { strncpy(info, (char *) (data+40), 32); info[32]= 0; for(i= strlen(info)-1; i>=0; i--) if(info[i]!=' ') break; else info[i]= 0; } else if(info_mode==2) { ; } else { isoburn_msgs_submit(NULL, 0x00060000, "Program error: Unknown info mode with isoburn_read_iso_head()", 0, "FATAL", 0); return(-1); } return(1); } /* API @param flag bit0-7: info return mode 0= do not return anything in info (do not even touch it) 1= copy volume id to info (info needs 33 bytes) 2= copy 64 kB header to info (needs 65536 bytes) bit13= do not read head from media but use first 64 kB from info bit14= check both half buffers (not only second) return 2 if found in first block bit15= return-1 on read error @return 1 seems to be a valid ISO image , 2 found in first half buffer, 0 format not recognized, <0 error */ int isoburn_read_iso_head(struct burn_drive *d, int lba, int *image_blocks, char *info, int flag) { unsigned char *buffer= NULL; int ret, info_mode, capacity, role; off_t data_count, to_read; struct isoburn *o; buffer= calloc(1, 64 * 1024); if(buffer == NULL) {ret= -1; goto ex;} info_mode= flag&255; *image_blocks= 0; if(flag&(1<<13)) { memcpy(buffer, info, 64*1024); } else { memset(buffer, 0, 64 * 1024); role = burn_drive_get_drive_role(d); if (role == 3 || role == 5) /* >>> ??? return always 0 ? */ {ret= (-1*!!(flag&(1<<15))); goto ex;} ret = burn_get_read_capacity(d, &capacity, 0); if (ret <= 0 && (role == 2 || role == 4)) { /* Might be a block device on a system where libburn cannot determine its size. Try to read anyway. */ capacity = 0x7ffffff0; ret = 1; } to_read= (off_t) capacity * ((off_t) 2048); if(ret > 0 && to_read >= (off_t) (36 * 1024)) { ret= isoburn_find_emulator(&o, d, 0); if(ret > 0) if(o->media_read_error) {ret= (-1 * !!(flag & (1 << 15))); goto ex;} if(to_read >= (off_t) (64 * 1024)) to_read= 64 * 1024; ret = burn_read_data(d, ((off_t) lba) * (off_t) 2048, (char *) buffer, to_read, &data_count, 32); /* error messages as DEBUG */ } else ret= 0; if(ret<=0) {ret= (-1*!!(flag&(1<<15))); goto ex;} if(info_mode==2) memcpy(info, buffer, 64*1024); } if(flag&(1<<14)) { ret= isoburn_read_iso_head_parse(buffer, image_blocks, info, info_mode); if(ret<0) goto ex; if(ret>0) {ret= 2; goto ex;} } ret= isoburn_read_iso_head_parse(buffer+32*1024, image_blocks, info, info_mode); if(ret<=0) goto ex; ret= 1; ex:; if(buffer != NULL) free(buffer); return(ret); } int isoburn_make_toc_entry(struct isoburn *o, int *session_count, int lba, int track_blocks, char *volid, int flag) { int ret; struct isoburn_toc_entry *item; ret= isoburn_toc_entry_new(&item, o->toc, 0); if(ret<=0) { no_memory:; isoburn_msgs_submit(o, 0x00060000, "Not enough memory for emulated TOC entry object", 0, "FATAL", 0); return(-1); } if(o->toc==NULL) o->toc= item; (*session_count)++; item->session= *session_count; item->track_no= *session_count; item->start_lba= lba; item->track_blocks= track_blocks; if(volid != NULL) { item->volid= strdup(volid); if(item->volid == NULL) goto no_memory; } return(1); } /* @param flag bit0= allow unemulated media bit1= free scanning without enclosing LBA-0-header bit4= represent emulated media as one single session (not with bit1) @return -1 severe error, 0= no neat header chain, 1= credible chain read */ int isoburn_emulate_toc(struct burn_drive *d, int flag) { int ret, image_size= 0, lba, track_blocks, session_count= 0, read_flag= 0; int scan_start= 0, scan_count= 0, probe_minus_16= 0, growisofs_nwa, role; int with_enclosure= 0, readable_blocks= -1; struct isoburn *o; char *msg= NULL, *size_text= NULL, *sev, volid[33], *volid_pt= NULL; time_t start_time, last_pacifier, now; msg= calloc(1, 160); size_text= calloc(1, 80); if(msg == NULL || size_text == NULL) {ret= -1; goto ex;} /* is the medium emulated multi-session ? */ ret= isoburn_find_emulator(&o, d, 0); if(ret<0) {ret= -1; goto ex;} if(o==NULL) {ret= -1; goto ex;} if(o->emulation_mode<=0 && !(flag&1)) {ret= 0; goto ex;} ret= burn_get_read_capacity(d, &readable_blocks, 0); if(ret <= 0) { role = burn_drive_get_drive_role(d); if (role == 2 || role == 4) /* Might be a block device on a system where libburn cannot determine its size. Try to read anyway. */ readable_blocks= 0x7ffffff0; /* try to read anyway */ else readable_blocks= -1; } if(o->fabricated_disc_status == BURN_DISC_BLANK) {ret= 0; goto failure;} start_time= last_pacifier= time(NULL); lba= 0; if(flag & 2) { /* If there is a PVD at LBA 32 then this is an image with emulated TOC */ ret= isoburn_read_iso_head(d, 32, &image_size, NULL, 0); if(ret > 0) lba= 32; } else { ret= isoburn_read_iso_head(d, lba, &image_size, NULL, 0); if(ret<=0) {ret= 0; goto failure;} lba= o->target_iso_head_size / 2048; with_enclosure= 1; if((flag & 16) && o->emulation_mode == 1) { ret= 1; goto failure; /* This will represent the medium as single session */ } } while(lba= 5) { last_pacifier= now; if(scan_count>=10*512) sprintf(size_text, "%.f MB", ((double) scan_count) / 512.0); else sprintf(size_text, "%.f kB", 2 * (double) scan_count); sprintf(msg, "Found %d ISO sessions by scanning %s in %.f seconds", session_count, size_text, (double) (now - start_time)); isoburn_msgs_submit(o, 0x00060000, msg, 0, "UPDATE", 0); } read_flag= 1; if(flag&2) read_flag|= (1<<15)|((session_count>0)<<14); else { /* growisofs aligns to 16 rather than 32. Overwritable TOC emulation relies on not accidentally seeing inter-session trash data. But one can safely access 16 blocks earlier because a xorriso header would have been overwritten with the unused 16 blocks at its start. If libisoburn alignment would increase, then this would not be possible any more. */ if(probe_minus_16) read_flag|= (1<<14); probe_minus_16= 0; } ret= isoburn_read_iso_head(d, lba, &track_blocks, volid, read_flag); if(ret > 0) { volid_pt= volid; } else { volid_pt= NULL; if(session_count>0) { if(flag&2) { if(ret==0) { /* try at next 64 k block (check both 32 k halves) */ lba+= 32; scan_count+= 32; if(lba-scan_start <= Libisoburn_toc_scan_max_gaP) continue; } break; } sprintf(msg, "Chain of ISO session headers broken at #%d, LBA %ds", session_count+1, lba); isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0); if(with_enclosure) { ret= isoburn_make_toc_entry(o, &session_count, 0, image_size, NULL,0); if(ret<=0) goto failure; } break; /* do not return failure */ } {ret= 0; goto failure;} } if(ret==2) /* ISO header was found in first half block */ lba-= 16; if(readable_blocks >= 0 && lba + track_blocks > readable_blocks) { sprintf(msg, "ISO image size %ds larger than readable size %ds", lba + track_blocks, readable_blocks); isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0); track_blocks= readable_blocks - lba; } ret= isoburn_make_toc_entry(o, &session_count, lba, track_blocks, volid_pt, 0); if(ret<=0) goto failure; lba+= track_blocks; scan_count+= 32; /* growisofs aligns to 16 rather than 32 */ growisofs_nwa= lba; if(growisofs_nwa % 16) growisofs_nwa+= 16 - (growisofs_nwa % 16); if(lba % Libisoburn_nwa_alignemenT) lba+= Libisoburn_nwa_alignemenT - (lba % Libisoburn_nwa_alignemenT); scan_start= lba; if(lba - growisofs_nwa == 16) probe_minus_16= 1; } if(last_pacifier != start_time) sev= "UPDATE"; else sev= "DEBUG"; now= time(NULL); if(scan_count>=10*512) sprintf(size_text, "%.f MB", ((double) scan_count) / 512.0); else sprintf(size_text, "%.f kB", 2 * (double) scan_count); sprintf(msg, "Found %d ISO sessions by scanning %s in %.f seconds", session_count, size_text, (double) (now - start_time)); isoburn_msgs_submit(o, 0x00060000, msg, 0, sev, 0); {ret= 1; goto ex;} failure:; isoburn_toc_entry_destroy(&(o->toc), 1); if(with_enclosure && o->emulation_mode == 1) { if(readable_blocks >= 0 && image_size > readable_blocks) { sprintf(msg, "ISO image size %ds larger than readable size %ds", image_size, readable_blocks); isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0); image_size= readable_blocks; } session_count= 0; ret= isoburn_make_toc_entry(o, &session_count, 0, image_size, NULL, 0); } ex:; if(msg != NULL) free(msg); if(size_text != NULL) free(size_text); return(ret); } int isoburn_toc_new_arrays(struct isoburn_toc_disc *o, int session_count, int track_count, int flag) { int i; int isoburn_toc_destroy_arrays(struct isoburn_toc_disc *o, int flag); o->sessions= calloc(session_count, sizeof(struct isoburn_toc_session)); o->session_pointers= calloc(session_count, sizeof(struct isoburn_toc_session *)); o->tracks= calloc(track_count, sizeof(struct isoburn_toc_track)); o->track_pointers= calloc(track_count, sizeof(struct isoburn_toc_track *)); if(o->sessions!=NULL && o->session_pointers!=NULL && o->tracks!=NULL && o->track_pointers!=NULL) { for(i= 0; isessions[i].session= NULL; o->sessions[i].track_pointers= NULL; o->sessions[i].track_count= 0; o->sessions[i].toc_entry= NULL; o->session_pointers[i]= NULL; } for(i= 0; itracks[i].track= NULL; o->tracks[i].toc_entry= NULL; o->track_pointers[i]= NULL; } return(1); } /* failed */ isoburn_toc_destroy_arrays(o, 0); return(-1); } int isoburn_toc_destroy_arrays(struct isoburn_toc_disc *o, int flag) { if(o->sessions!=NULL) free((char *) o->sessions); o->sessions= NULL; if(o->session_pointers!=NULL) free((char *) o->session_pointers); o->session_pointers= NULL; if(o->tracks!=NULL) free((char *) o->tracks); o->tracks= NULL; if(o->track_pointers!=NULL) free((char *) o->track_pointers); o->track_pointers= NULL; return(1); } struct isoburn_toc_disc *isoburn_toc_drive_get_disc(struct burn_drive *d) { int ret, session_count= 0, track_count= 0, num_tracks= 0, i, j; int open_sessions= 0; struct isoburn *o; struct isoburn_toc_entry *t; struct isoburn_toc_disc *toc_disc= NULL; struct burn_session **s; struct burn_track **tracks; toc_disc= calloc(1, sizeof(struct isoburn_toc_disc)); if(toc_disc==NULL) return(NULL); toc_disc->disc= NULL; toc_disc->sessions= NULL; toc_disc->session_pointers= NULL; toc_disc->tracks= NULL; toc_disc->track_pointers= NULL; toc_disc->session_count= 0; toc_disc->incomplete_session_count= 0; toc_disc->track_count= 0; toc_disc->toc= NULL; /* is the medium emulated multi-session ? */ ret= isoburn_find_emulator(&o, d, 0); if(ret<0) goto libburn; if(o->toc==NULL) goto libburn; /* This is an emulated TOC */ toc_disc->toc= o->toc; for(t= toc_disc->toc; t!=NULL; t= t->next) session_count++; ret= isoburn_toc_new_arrays(toc_disc, session_count, session_count, 0); if(ret<=0) goto failure; t= toc_disc->toc; for(i= 0; isessions[i].track_pointers= toc_disc->track_pointers+i; toc_disc->sessions[i].track_count= 1; toc_disc->sessions[i].toc_entry= t; toc_disc->session_pointers[i]= toc_disc->sessions+i; toc_disc->tracks[i].toc_entry= t; toc_disc->track_pointers[i]= toc_disc->tracks+i; t= t->next; } toc_disc->session_count= session_count; toc_disc->track_count= session_count; return(toc_disc); libburn:; /* This is a libburn provided TOC */ toc_disc->disc= burn_drive_get_disc(d); if(toc_disc->disc == NULL) { failure:; free((char *) toc_disc); return(NULL); } s= burn_disc_get_sessions(toc_disc->disc, &session_count); open_sessions= burn_disc_get_incomplete_sessions(toc_disc->disc); for(i= 0; i < session_count + open_sessions; i++) { tracks = burn_session_get_tracks(s[i], &num_tracks); if(i == session_count + open_sessions - 1 && open_sessions > 0) { /* Do not count the invisible track of the last incomplete session */ num_tracks--; } track_count+= num_tracks; } if(session_count + open_sessions <= 0 || track_count <= 0) goto failure; ret= isoburn_toc_new_arrays(toc_disc, session_count + open_sessions, track_count, 0); if(ret<=0) goto failure; track_count= 0; for(i= 0; i < session_count + open_sessions; i++) { tracks = burn_session_get_tracks(s[i], &num_tracks); if(i == session_count + open_sessions - 1 && open_sessions > 0) num_tracks--; toc_disc->sessions[i].session= s[i]; toc_disc->sessions[i].track_pointers= toc_disc->track_pointers+track_count; toc_disc->sessions[i].track_count= num_tracks; toc_disc->session_pointers[i]= toc_disc->sessions+i; for(j= 0; jtracks[track_count+j].track= tracks[j]; toc_disc->track_pointers[track_count+j]= toc_disc->tracks+(track_count+j); } track_count+= num_tracks; } toc_disc->session_count= session_count; toc_disc->incomplete_session_count= open_sessions; toc_disc->track_count= track_count; return(toc_disc); } int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc) { struct isoburn_toc_entry *t; int ret= 0, num_sessions, num_tracks, open_sessions= 0, session_idx= -1; struct burn_session **sessions; struct burn_track **tracks; struct burn_toc_entry entry; if(disc==NULL) return(0); if(disc->toc!=NULL) { for(t= disc->toc; t!=NULL; t= t->next) ret= t->start_lba + t->track_blocks; } else if(disc->disc!=NULL) { sessions= burn_disc_get_sessions(disc->disc, &num_sessions); open_sessions= burn_disc_get_incomplete_sessions(disc->disc); if(num_sessions + open_sessions > 0) { session_idx= num_sessions + open_sessions - 1; tracks = burn_session_get_tracks(sessions[session_idx], &num_tracks); if(open_sessions > 0) { /* Do not count the invisible track of the last incomplete session */ num_tracks--; } if(num_tracks <= 0) session_idx--; } if(session_idx >= 0) { tracks = burn_session_get_tracks(sessions[session_idx], &num_tracks); if(session_idx == num_sessions + open_sessions - 1 && open_sessions > 0) { /* Do not count the invisible track of the last incomplete session */ num_tracks--; } if(num_tracks > 0) { burn_track_get_entry(tracks[num_tracks - 1], &entry); if(entry.extensions_valid & 1) ret= entry.start_lba + entry.track_blocks; } } /* ret= burn_disc_get_sectors(disc->disc); */ } return(ret); } struct isoburn_toc_session **isoburn_toc_disc_get_sessions( struct isoburn_toc_disc *disc, int *num) { *num= disc->session_count; return(disc->session_pointers); } int isoburn_toc_disc_get_incmpl_sess(struct isoburn_toc_disc *disc) { return(disc->incomplete_session_count); } int isoburn_toc_session_get_sectors(struct isoburn_toc_session *s) { struct isoburn_toc_entry *t; int count= 0, i; if(s==NULL) return(0); if(s->toc_entry!=NULL) { t= s->toc_entry; for(i= 0; itrack_count; i++) { count+= t->track_blocks; t= t->next; } } else if(s->session!=NULL) count= burn_session_get_sectors(s->session); return(count); } int isoburn_toc_entry_finish(struct burn_toc_entry *entry, int session_no, int track_no, int flag) { int pmin, psec, pframe; entry->extensions_valid= 1; entry->adr= 1; entry->control= 4; entry->session= session_no & 255; entry->session_msb= (session_no >> 8) & 255; entry->point= track_no & 255; entry->point_msb= (track_no >> 8) & 255; burn_lba_to_msf(entry->start_lba, &pmin, &psec, &pframe); if(pmin<=255) entry->pmin= pmin; else entry->pmin= 255; entry->psec= psec; entry->pframe= pframe; return(1); } void isoburn_toc_session_get_leadout_entry(struct isoburn_toc_session *s, struct burn_toc_entry *entry) { struct isoburn_toc_track *t; if(s==NULL) return; if(s->session!=NULL && s->toc_entry==NULL) { burn_session_get_leadout_entry(s->session, entry); return; } if(s->track_count<=0 || s->track_pointers==NULL || s->toc_entry==NULL) return; t= s->track_pointers[s->track_count-1]; entry->start_lba= t->toc_entry->start_lba + t->toc_entry->track_blocks; entry->track_blocks= 0; isoburn_toc_entry_finish(entry, s->toc_entry->session, t->toc_entry->track_no, 0); } struct isoburn_toc_track **isoburn_toc_session_get_tracks( struct isoburn_toc_session *s, int *num) { *num= s->track_count; return(s->track_pointers); } void isoburn_toc_track_get_entry(struct isoburn_toc_track *t, struct burn_toc_entry *entry) { if(t==0) return; if(t->track!=NULL && t->toc_entry==NULL) { burn_track_get_entry(t->track, entry); return; } if(t->toc_entry==NULL) return; entry->start_lba= t->toc_entry->start_lba; entry->track_blocks= t->toc_entry->track_blocks; isoburn_toc_entry_finish(entry, t->toc_entry->session, t->toc_entry->track_no, 0); } int isoburn_toc_track_get_emul(struct isoburn_toc_track *t, int *start_lba, int *image_blocks, char volid[33], int flag) { if(t->toc_entry == NULL) return(0); if(t->toc_entry->volid == NULL) return(0); *start_lba= t->toc_entry->start_lba; *image_blocks= t->toc_entry->track_blocks; strncpy(volid, t->toc_entry->volid, 32); volid[32]= 0; return(1); } void isoburn_toc_disc_free(struct isoburn_toc_disc *d) { if(d->disc!=NULL) burn_disc_free(d->disc); isoburn_toc_destroy_arrays(d, 0); free((char *) d); } int isoburn_get_track_lba(struct isoburn_toc_track *track, int *lba, int flag) { struct burn_toc_entry entry; isoburn_toc_track_get_entry(track, &entry); if (entry.extensions_valid & 1) *lba= entry.start_lba; else *lba= burn_msf_to_lba(entry.pmin, entry.psec, entry.pframe); return(1); } int isoburn_drive_set_msgs_submit(struct burn_drive *d, int (*msgs_submit)(void *handle, int error_code, char msg_text[], int os_errno, char severity[], int flag), void *submit_handle, int submit_flag, int flag) { struct isoburn *o; int ret; ret= isoburn_find_emulator(&o, d, 0); if(ret<0 || o==NULL) return(-1); o->msgs_submit= msgs_submit; o->msgs_submit_handle= submit_handle; o->msgs_submit_flag= submit_flag; return(1); } /* @param flag bit0= with adr_mode 3: adr_value might be 16 blocks too high bit1= insist in seeing a disc object with at least one session bit2= with adr_mode 4: use adr_value as regular expression */ int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value, int flag) { int ret, num_sessions= 0, num_tracks, adr_num, i, j, total_tracks; int lba, best_lba, size, re_valid= 0, track_count= 0; time_t start_time= 0, last_pacifier= 0, now; char volid[33], *msg= NULL; struct isoburn *o; struct isoburn_toc_disc *disc= NULL; struct isoburn_toc_session **sessions= NULL; struct isoburn_toc_track **tracks= NULL; static char mode_names[][20]= {"auto", "session", "track", "lba", "volid"}; static int max_mode_names= 4; regex_t re; regmatch_t match[1]; enum burn_disc_status s; ret= isoburn_find_emulator(&o, d, 0); if(ret<0) return(-1); if(o==NULL) return(-1); msg= calloc(1, 160); if(msg == NULL) {ret= -1; goto ex;} start_time= last_pacifier= time(NULL); adr_num= atoi(adr_value); if(adr_mode!=3 || (flag & 2)) { disc= isoburn_toc_drive_get_disc(d); if(disc==NULL) { not_found:; if(adr_mode<0 || adr_mode>max_mode_names) goto unknown_mode; sprintf(msg, "Failed to find %s %s", mode_names[adr_mode], strlen(adr_value)<=80 ? adr_value : "-oversized-string-"); isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0); ret= 0; goto ex; } sessions= isoburn_toc_disc_get_sessions(disc, &num_sessions); if(sessions==NULL || num_sessions<=0) goto not_found; } if(adr_mode==0) { /* Set fabricated_msc1 to last session in TOC */ tracks= isoburn_toc_session_get_tracks(sessions[num_sessions-1], &num_tracks); if(tracks==NULL || num_tracks<=0) goto not_found; isoburn_get_track_lba(tracks[0], &(o->fabricated_msc1), 0); } else if(adr_mode==1) { /* Use adr_num as session index (first session is 1, not 0) */ if(adr_num<1 || adr_num>num_sessions) goto not_found; tracks= isoburn_toc_session_get_tracks(sessions[adr_num-1], &num_tracks); if(tracks==NULL || num_tracks<=0) goto not_found; isoburn_get_track_lba(tracks[0], &(o->fabricated_msc1), 0); } else if(adr_mode==2) { /* use adr_num as track index */ total_tracks= 0; for(i=0; ifabricated_msc1), 0); ret= 1; goto ex; } } } goto not_found; } else if(adr_mode==3) { o->fabricated_msc1= adr_num; s= isoburn_disc_get_status(d); if(o->fabricated_msc1 > 0 && s != BURN_DISC_FULL && s != BURN_DISC_APPENDABLE) { isoburn_msgs_submit(o, 0x00060000, "Non-zero load offset given with blank input media", 0, "FAILURE", 0); ret= 0; goto ex; } if((flag & 1) && o->fabricated_msc1 >= 16) { /* adr_num is possibly 16 blocks too high */ ret= isoburn_read_iso_head(d, o->fabricated_msc1, &size,volid, 1|(1<<14)); if(ret==2) o->fabricated_msc1-= 16; } } else if(adr_mode==4) { /* search for volume id that is equal to adr_value */ if(flag & 4) { ret= regcomp(&re, adr_value, 0); if(ret != 0) flag&= ~4; else re_valid= 1; } best_lba= -1; for(i=0; i= 5 && track_count > 0) { last_pacifier= now; sprintf(msg, "Scanned %d tracks for matching volid in %.f seconds", track_count, (double) (now - start_time)); isoburn_msgs_submit(o, 0x00060000, msg, 0, "UPDATE", 0); } track_count++; ret= isoburn_toc_track_get_emul(tracks[0], &lba, &size, volid, 0); if(ret < 0) continue; if(ret == 0) { isoburn_get_track_lba(tracks[0], &lba, 0); ret= isoburn_read_iso_head(d, lba, &size, volid, 1); if(ret<=0) continue; } if(flag & 4) { ret= regexec(&re, volid, 1, match, 0); if(ret != 0) continue; } else { if(strcmp(volid, adr_value)!=0) continue; } best_lba= lba; } } if(best_lba<0) goto not_found; o->fabricated_msc1= best_lba; } else { unknown_mode:; sprintf(msg, "Program error: Unknown msc1 address mode %d", adr_mode); isoburn_msgs_submit(o, 0x00060000, msg, 0, "FATAL", 0); ret= 0; goto ex; } ret= 1; ex:; if(start_time != last_pacifier && track_count > 0) { now= time(NULL); sprintf(msg, "Scanned %d tracks for matching volid in %.f seconds", track_count, (double) (now - start_time)); isoburn_msgs_submit(o, 0x00060000, msg, 0, "UPDATE", 0); } if(disc!=NULL) isoburn_toc_disc_free(disc); if((flag & 4) && re_valid) regfree(&re); if(msg != NULL) free(msg); return(ret); } int isoburn_get_mount_params(struct burn_drive *d, int adr_mode, char *adr_value, int *lba, int *track, int *session, char volid[33], int flag) { int msc1_mem, ret, total_tracks, num_sessions, num_tracks, i, j, track_lba; int size, is_iso= 0; struct isoburn *o; struct isoburn_toc_disc *disc= NULL; struct isoburn_toc_session **sessions= NULL; struct isoburn_toc_track **tracks= NULL; *lba= *track= *session= -1; volid[0]= 0; ret= isoburn_find_emulator(&o, d, 0); if(ret < 0 || o == NULL) return(-1); msc1_mem= o->fabricated_msc1; ret= isoburn_set_msc1(d, adr_mode, adr_value, 2 | (flag & 4)); if(ret <= 0) return(ret); *lba= o->fabricated_msc1; disc= isoburn_toc_drive_get_disc(d); if(disc==NULL) {ret= -1; goto ex;} /* cannot happen because checked by isoburn_set_msc1 */ sessions= isoburn_toc_disc_get_sessions(disc, &num_sessions); if(sessions==NULL || num_sessions<=0) {ret= -1; goto ex;} /* cannot happen because checked by isoburn_set_msc1 */ total_tracks= 0; for(i=0; ifabricated_msc1= msc1_mem; if(disc != NULL) isoburn_toc_disc_free(disc); return(2 - is_iso); } libisoburn-1.5.4/libisoburn/libisoburn.ver0000644000175700017510000002265213763473120015675 00000000000000LIBISOBURN1 { global: isoburn_activate_session; isoburn_attach_image; isoburn_attach_start_lba; isoburn_conv_name_chars; isoburn_cancel_prepared_write; isoburn_disc_available_space; isoburn_disc_erasable; isoburn_disc_erase; isoburn_disc_get_msc1; isoburn_disc_get_status; isoburn_disc_pretend_full_uncond; isoburn_disc_track_lba_nwa; isoburn_disc_write; isoburn_drive_aquire; isoburn_drive_grab; isoburn_drive_release; isoburn_drive_scan_and_grab; isoburn_drive_set_msgs_submit; isoburn_drive_wrote_well; isoburn_finish; isoburn_get_attached_image; isoburn_get_attached_start_lba; isoburn_get_fifo_status; isoburn_get_min_start_byte; isoburn_get_mount_params; isoburn_igopt_attach_jte; isoburn_igopt_destroy; isoburn_igopt_detach_jte; isoburn_igopt_get_appended_as_apm; isoburn_igopt_get_appended_as_gpt; isoburn_igopt_get_data_start; isoburn_igopt_get_disc_label; isoburn_igopt_get_effective_lba; isoburn_igopt_get_efi_bootp; isoburn_igopt_get_extensions; isoburn_igopt_get_fifo_size; isoburn_igopt_get_gpt_guid; isoburn_igopt_get_hfsp_block_size; isoburn_igopt_get_hfsp_serial_number; isoburn_igopt_get_iso_mbr_part_type; isoburn_igopt_get_iso_type_guid; isoburn_igopt_get_level; isoburn_igopt_get_out_charset; isoburn_igopt_get_over_mode; isoburn_igopt_get_over_ugid; isoburn_igopt_get_part_flags; isoburn_igopt_get_part_like_isohybrid; isoburn_igopt_get_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_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; isoburn_libisofs_req; isoburn_libjte_req; isoburn_needs_emulation; isoburn_prepare_blind_grow; isoburn_prepare_disc; isoburn_prepare_new_image; isoburn_read_image; isoburn_read_iso_head; isoburn_ropt_destroy; isoburn_ropt_get_auto_incharset; isoburn_ropt_get_data_cache; isoburn_ropt_get_default_dirperms; isoburn_ropt_get_default_perms; isoburn_ropt_get_displacement; isoburn_ropt_get_extensions; isoburn_ropt_get_input_charset; isoburn_ropt_get_size_what; isoburn_ropt_get_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; isoburn_toc_session_get_leadout_entry; isoburn_toc_session_get_sectors; isoburn_toc_session_get_tracks; isoburn_toc_track_get_emul; isoburn_toc_track_get_entry; isoburn_version; Xorriso__dispose_words; Xorriso__get_patch_level_text; Xorriso__is_compatible; Xorriso__preset_signal_behavior; Xorriso__severity_cmp; Xorriso__severity_list; Xorriso__version; Xorriso_change_is_pending; Xorriso_destroy; Xorriso_dialog; Xorriso_eval_problem_status; Xorriso_execute_option; Xorriso_fetch_outlists; Xorriso_get_problem_status; Xorriso_interpreter; Xorriso_lst_destroy_all; Xorriso_lst_get_next; Xorriso_lst_get_prev; Xorriso_lst_get_text; Xorriso_make_return_value; Xorriso_msgs_submit; Xorriso_msgs_submit_void; Xorriso_new; Xorriso_option_abort_on; Xorriso_option_abstract_file; Xorriso_option_acl; Xorriso_option_add; Xorriso_option_add_plainly; Xorriso_option_alter_date; Xorriso_option_append_partition; Xorriso_option_application_id; Xorriso_option_application_use; Xorriso_option_as; Xorriso_option_assert_volid; Xorriso_option_auto_charset; Xorriso_option_backslash_codes; Xorriso_option_ban_stdio_write; Xorriso_option_biblio_file; Xorriso_option_blank; Xorriso_option_boot_image; Xorriso_option_calm_drive; Xorriso_option_cdi; Xorriso_option_cdx; Xorriso_option_changes_pending; Xorriso_option_charset; Xorriso_option_check_md5; Xorriso_option_check_media; Xorriso_option_check_media_defaults; Xorriso_option_chgrpi; Xorriso_option_chmodi; Xorriso_option_chowni; Xorriso_option_clone; Xorriso_option_close; Xorriso_option_close_damaged; Xorriso_option_close_filter_list; Xorriso_option_commit; Xorriso_option_commit_eject; Xorriso_option_compare; Xorriso_option_compliance; Xorriso_option_concat; Xorriso_option_copyright_file; Xorriso_option_cp_clone; Xorriso_option_cpri; Xorriso_option_cpx; Xorriso_option_cut_out; Xorriso_option_data_cache_size; Xorriso_option_dev; Xorriso_option_devices; Xorriso_option_dialog; Xorriso_option_disk_dev_ino; Xorriso_option_disk_pattern; Xorriso_option_displacement; Xorriso_option_drive_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; Xorriso_option_fs; Xorriso_option_getfacli; Xorriso_option_gid; Xorriso_option_grow_blindly; Xorriso_option_hardlinks; Xorriso_option_help; Xorriso_option_hfsplus; Xorriso_option_hide; Xorriso_option_history; Xorriso_option_iso_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; Xorriso_option_lsx; Xorriso_option_map; Xorriso_option_map_l; Xorriso_option_mark; Xorriso_option_md5; Xorriso_option_mkdiri; Xorriso_option_modesty_on_drive; Xorriso_option_mount; Xorriso_option_mount_opts; Xorriso_option_move; Xorriso_option_msg_op; Xorriso_option_mvi; Xorriso_option_named_pipe_loop; Xorriso_option_no_rc; Xorriso_option_not_leaf; Xorriso_option_not_list; Xorriso_option_not_mgt; Xorriso_option_not_paths; Xorriso_option_options_from_file; Xorriso_option_osirrox; Xorriso_option_overwrite; Xorriso_option_pacifier; Xorriso_option_padding; Xorriso_option_page; Xorriso_option_paste_in; Xorriso_option_path_list; Xorriso_option_pathspecs; Xorriso_option_pkt_output; Xorriso_option_preparer_id; Xorriso_option_print; Xorriso_option_print_size; Xorriso_option_prog; Xorriso_option_prog_help; Xorriso_option_prompt; Xorriso_option_publisher; Xorriso_option_pvd_info; Xorriso_option_pwdi; Xorriso_option_pwdx; Xorriso_option_read_fs; Xorriso_option_read_mkisofsrc; Xorriso_option_reassure; Xorriso_option_report_about; Xorriso_option_report_el_torito; Xorriso_option_report_system_area; Xorriso_option_return_with; Xorriso_option_rmi; Xorriso_option_rockridge; Xorriso_option_rollback; Xorriso_option_rom_toc_scan; Xorriso_option_rr_reloc_dir; Xorriso_option_scdbackup_tag; Xorriso_option_scsi_dev_family; Xorriso_option_scsi_log; Xorriso_option_session_log; Xorriso_option_set_filter; Xorriso_option_setfacl_listi; Xorriso_option_setfacli; Xorriso_option_setfattr_listi; Xorriso_option_setfattri; Xorriso_option_sh_style_result; Xorriso_option_signal_handling; Xorriso_option_sleep; Xorriso_option_speed; Xorriso_option_split_size; Xorriso_option_status; Xorriso_option_status_history_max; Xorriso_option_stdio_sync; Xorriso_option_stream_recording; Xorriso_option_system_id; Xorriso_option_tell_media_space; Xorriso_option_temp_mem_limit; Xorriso_option_toc; Xorriso_option_toc_of; Xorriso_option_uid; Xorriso_option_unregister_filter; Xorriso_option_update; Xorriso_option_use_immed_bit; Xorriso_option_use_readline; Xorriso_option_version; Xorriso_option_volid; Xorriso_option_volset_id; Xorriso_option_volume_date; Xorriso_option_write_type; Xorriso_option_xattr; Xorriso_option_zisofs; Xorriso_parse_line; Xorriso_peek_outlists; Xorriso_prescan_args; Xorriso_process_errfile; Xorriso_process_msg_queues; Xorriso_program_arg_bsl; Xorriso_pull_outlists; Xorriso_push_outlists; Xorriso_read_rc; Xorriso_set_problem_status; Xorriso_sieve_add_filter; Xorriso_sieve_big; Xorriso_sieve_clear_results; Xorriso_sieve_dispose; Xorriso_sieve_get_result; Xorriso_start_msg_watcher; Xorriso_startup_libraries; Xorriso_stop_msg_watcher; local: *; }; libisoburn-1.5.4/libisoburn/isoburn.h0000644000175700017510000007126513763472717014660 00000000000000 /* Class struct of libisoburn. Copyright 2007 - 2009 Vreixo Formoso Lopes Copyright 2007 - 2020 Thomas Schmitt Provided under GPL version 2 or later. */ #ifndef Isoburn_includeD #define Isoburn_includeD /* for uint8_t */ #ifdef HAVE_STDINT_H #include #else #ifdef HAVE_INTTYPES_H #include #endif #endif /* For emulated TOC of overwritable media. Provides minimal info for faking a struct burn_toc_entry. */ struct isoburn_toc_entry { int session; int track_no; /* point */ int start_lba; int track_blocks; char *volid; /* For caching a volume id from emulated toc on overwritables */ struct isoburn_toc_entry *next; }; int isoburn_toc_entry_new(struct isoburn_toc_entry **objpt, struct isoburn_toc_entry *boss, int flag); /* @param flag bit0= delete all subordinates too */ int isoburn_toc_entry_destroy(struct isoburn_toc_entry **o, int flag); /* Minimal size of target_iso_head which is to be written during isoburn_activate_session(). Within this size there is everything that is needed for image access with no partition offset. The actual target_iso_head buffer must be larger by the evential partition offset. */ #define Libisoburn_target_head_sizE (32*2048) /* Maximum number of appended partitions. Effectively usable number depends on system area type. */ #define Libisoburn_max_appended_partitionS 8 /* Maximum length of a disc label text plus 1. */ #define Libisoburn_disc_label_sizE 129 struct isoburn { /* The libburn drive to which this isoburn object is related Most isoburn calls will use a burn_drive as object handle */ struct burn_drive *drive; /* -1= inappropriate medium state detected 0= libburn multi-session medium, resp. undecided yet 1= random access medium */ int emulation_mode; /* Although rarely used, libburn can operate on several drives simultaneously. */ struct isoburn *prev; struct isoburn *next; /* If >= 0, this address is used as reply for isoburn_disc_get_msc1() */ int fabricated_msc1; /* If >= 0, this address is used in isoburn_disc_track_lba_nwa() as reply parameter nwa. (The other nwa parameters below apply only to the effective write address on random access media. msc2 is handed to libisofs but not to libburn.) */ int fabricated_msc2; /* The nwa to be used for a first session on the present kind of overwritable media (usually Libisoburn_overwriteable_starT, but might be forced to 0) */ int zero_nwa; /* Start address as given by image examination (bytes, not blocks) */ off_t min_start_byte; /* Aligned start address to be used for processing (counted in blocks) */ int nwa; /* Truncate to .nwa an eventual regular file serving as output drive */ int truncate; /* Eventual freely fabricated isoburn_disc_get_status(). BURN_DISC_UNREADY means that this variable is disabled and normally emulated status is in effect. */ enum burn_disc_status fabricated_disc_status; /* To be set if read errors occurred during media evaluation. */ int media_read_error; /* Eventual emulated table of content read from the chain of ISO headers on overwritable media. */ struct isoburn_toc_entry *toc; /* Indicator whether the most recent burn run worked : -1 = undetermined, ask libburn , 0 = failure , 1 = success To be inquired by isoburn_drive_wrote_well() */ int wrote_well; /* ISO head buffer to be filled by write run */ int target_iso_head_size; uint8_t *target_iso_head; /* The 2k offset which was read from a loaded image. */ uint32_t loaded_partition_offset; /* Libisofs image context */ IsoImage *image; /* The start LBA of the image */ int image_start_lba; /* The block data source from which the existing image is read. */ IsoDataSource *iso_data_source; /* The burn source which transfers data from libisofs to libburn. It has its own fifo. */ struct burn_source *iso_source; /* For iso_tree_set_report_callback() */ int (*read_pacifier)(IsoImage*, IsoFileSource*); /* For iso_image_attach_data() */ void *read_pacifier_handle; /* An application provided method to immediately deliver messages */ int (*msgs_submit)(void *handle, int error_code, char msg_text[], int os_errno, char severity[], int flag); void *msgs_submit_handle; /* specific to application method */ int msgs_submit_flag; /* specific to application method */ /* Forwarding an image generation option to the burn wrapper */ int do_tao; /* Forwarding an image generation option to the burn wrapper */ int do_fsync; }; /* Creation and disposal function */ int isoburn_new(struct isoburn **objpt, int flag); int isoburn_destroy(struct isoburn **objpt, int flag); /* Eventual readers for public attributes */ /* ( put into separate .h file then ) */ int isoburn_get_emulation_mode(struct isoburn *o, int *pt, int flag); int isoburn_get_target_volset(struct isoburn *o, IsoImage **pt, int flag); /* List management */ int isoburn_get_prev(struct isoburn *o, struct isoburn **pt, int flag); int isoburn_get_next(struct isoburn *o, struct isoburn **pt, int flag); int isoburn_destroy_all(struct isoburn **objpt, int flag); int isoburn_link(struct isoburn *o, struct isoburn *link, int flag); int isoburn_count(struct isoburn *o, int flag); int isoburn_by_idx(struct isoburn *o, int idx, struct isoburn **pt, int flag); int isoburn_find_by_drive(struct isoburn **pt, struct burn_drive *d, int flag); /* Non API inner interfaces */ /* Submit a libisofs error to the libburn messenger. An application message reader shall recognize the error code range and attribute it to the libisofs message channel to which one cannot submit via API. @param iso_error_code return value <= 0 from a libisofs API call. @param default_msg_text is to be put out if iso_error_code leads to no error message @param os_errno operating system errno, submit 0 if none is known @param min_severity minimum severity, might be be increased if libisofs error severity surpasses min_severity. @param flag Bitfield, submit 0 for now */ int isoburn_report_iso_error(int iso_error_code, char default_msg_text[], int os_errno, char min_severity[], int flag); /* Calls from burn_wrap.c into isofs_wrap.c */ int isoburn_start_emulation(struct isoburn *o, int flag); int isoburn_invalidate_iso(struct isoburn *o, int flag); /* Calls from isofs_wrap.c into burn_wrap.c */ /** Get an eventual isoburn object which is wrapped around the drive. @param pt Eventually returns a pointer to the found object. It is allowed to become NULL if return value is -1 or 0. In this case, the drive is a genuine libburn drive with no emulation activated by isoburn. @param drive The drive to be searched for @param flag unused yet @return -1 unsuitable medium, 0 generic medium, 1 emulated medium. */ int isoburn_find_emulator(struct isoburn **pt, struct burn_drive *drive, int flag); /* Deliver an event message. Either via a non-NULL o->msgs_submit() method or via burn_msgs_submit() of libburn. */ int isoburn_msgs_submit(struct isoburn *o, int error_code, char msg_text[], int os_errno, char severity[], int flag); /** Set the start address for an emulated add-on session. The value will be rounded up to the alignment necessary for the medium. The aligned value will be divided by 2048 and then put into o->nwa . @param o The isoburn object to be programmed. @param value The start address in bytes @param flag unused yet @return <=0 is failure , >0 success */ int isoburn_set_start_byte(struct isoburn *o, off_t value, int flag); /** Obtains the image address offset to be used with image generation. This is either the (emulated) drive nwa or a value set by isoburn_prepare_blind_grow(). In any case this is the address to tell to iso_write_opts_set_ms_block(). @param o The isoburn object to be inquired @param opts If not NULL: write parameters to be set on drive before query @param msc2 The value to be used with iso_write_opts_set_ms_block() @param flag unused yet @return <=0 is failure , >0 success */ int isoburn_get_msc2(struct isoburn *o, struct burn_write_opts *opts, int *msc2, int flag); /** Get a data source suitable for read from a drive using burn_read_data() function. @param d drive to read from. Must be grabbed. @param displacement will be added or subtracted to any block address @param displacement_sign +1 = add , -1= subtract , else keep unaltered @return the data source, NULL on error. Must be freed with libisofs iso_data_source_unref() function. Note: this doesn't release the drive. */ IsoDataSource * isoburn_data_source_new(struct burn_drive *d, uint32_t displacement, int displacement_sign, int cache_tiles, int tile_blocks); /** Default settings for above cache_tiles, tile_blocks in newly created struct isoburn_read_opts. */ #define Libisoburn_default_cache_tileS 32 #define Libisoburn_default_tile_blockS 32 /** Maximum size of the cache in 2 kB blocks (1 GB) */ #define Libisoburn_cache_max_sizE (1024 * 512) /** Disable read capabilities of a data source which was originally created by isoburn_data_source_new(). After this any attempt to read will yield a FATAL programming error event. This is usually done to allow libburn to release the drive while libisofs still holds a reference to the data source object. libisofs is not supposed to use this object for reading any more, nevertheless. The disabled state of the data source is a safety fence around this daring situation. @param src The data source to be disabled @param flag unused yet @return <=0 is failure , >0 success */ int isoburn_data_source_shutdown(IsoDataSource *src, int flag); /** Check whether the size of target_iso_head matches the given partition offset. Eventually adjust size. */ int isoburn_adjust_target_iso_head(struct isoburn *o, uint32_t offst, int flag); /** Initialize the root directory attributes of a freshly created image. */ int isoburn_root_defaults(IsoImage *image, int flag); /** * Options for image reading. (Comments here may be outdated. API getter/setter function descriptions may override the descriptions here. Any difference is supposed to be a minor correction only.) */ struct isoburn_read_opts { int cache_tiles; /* number of cache tiles */ int cache_tile_blocks; unsigned int norock:1; /*< Do not read Rock Ridge extensions */ unsigned int nojoliet:1; /*< Do not read Joliet extensions */ unsigned int noiso1999:1; /*< Do not read ISO 9660:1999 enhanced tree */ unsigned int do_ecma119_map:1; /* call iso_read_opts_set_ecma119_map() */ unsigned int map_mode:2; /* argument for do_ecma119_map */ 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 */ unsigned int noea:1; /* Do not read XFS-style EA from externals */ /* ts A90508 */ unsigned int noino:1; /* Discard eventual PX inode numbers */ /* ts A90810 */ unsigned int nomd5:2; /* Do not read eventual MD5 array */ unsigned int preferjoliet:1; /*< When both Joliet and RR extensions are present, the RR * tree is used. If you prefer using Joliet, set this to 1. */ uid_t uid; /**< Default uid when no RR */ gid_t gid; /**< Default uid when no RR */ mode_t mode; /**< Default mode when no RR (only permissions) */ mode_t dirmode; /**< Default mode for directories when no RR (only permissions) */ /** * Input charset for RR file names. NULL to use default locale charset. */ char *input_charset; /** * Enable or disable methods to automatically choose an input charset. * This eventually overrides input_charset. * * bit0= set the input character set automatically from * attribute "isofs.cs" of root directory */ int auto_input_charset; /** * What to do in case of name longer than truncate_length: * 0= throw FAILURE * 1= truncate to truncate_length with MD5 of whole name at end */ int truncate_mode; int truncate_length; /* modified by the function isoburn_read_image */ unsigned int hasRR:1; /*< It will be set to 1 if RR extensions are present, to 0 if not. */ unsigned int hasJoliet:1; /*< It will be set to 1 if Joliet extensions are present, to 0 if not. */ /** * It will be set to 1 if the image is an ISO 9660:1999, i.e. it has * a version 2 Enhanced Volume Descriptor. */ unsigned int hasIso1999:1; /** It will be set to 1 if El-Torito boot record is present, to 0 if not.*/ unsigned int hasElTorito:1; uint32_t size; /**< Will be filled with the size (in 2048 byte block) of * the image, as reported in the PVM. */ 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; }; /** * Options for image generation by libisofs and image transport to libburn. (Comments here may be outdated. API getter/setter function descriptions may override the descriptions here. Any difference is supposed to be a minor correction only.) */ struct isoburn_imgen_opts { /* Options for image generation */ int will_cancel :1; int level; /**< ISO level to write at. */ /** Which extensions to support. */ unsigned int rockridge :1; unsigned int joliet :1; unsigned int iso1999 :1; unsigned int hfsplus :1; unsigned int fat :1; /* Whether to mark suitable IsoNode as hardlinks in RRIP PX */ unsigned int hardlinks :1; /* Write eventual AAIP info containing ACL and EA */ unsigned int aaip :1; /* Produce and write a MD5 checksum of the whole session stream. */ unsigned int session_md5 :1; /* Produce and write MD5 checksums for each single IsoFile. See parameter "files" of iso_write_opts_set_record_md5(). */ unsigned int file_md5 :2; /* On overwritable media or random access files do not write the first session to LBA 32, but rather to LBA 0 directly. */ unsigned int no_emul_toc :1; /* For empty files, symbolic links, and devices use the old ECMA-119 block addresses in the range [0,31] rather than the address of the dedicated empty block. */ unsigned int old_empty :1; /* relaxed constraints */ /* * Relaxed constraints. Setting any of these to 1 break the specifications, * but it is supposed to work on most moderns systems. Use with caution. */ /* * Extra Caution: This option breaks any assumptions about names that * are supported by ECMA-119 specifications. * Omit any translation which would make a file name compliant to the * ECMA-119 rules. This includes and exceeds omit_version_numbers, * max_37_char_filenames, no_force_dots bit0, allow_lowercase. */ unsigned int untranslated_name_len; /* * Convert directory names for ECMA-119 similar to other file names, but do * not force a dot or add a version number. * This violates ECMA-119 by allowing one "." and especially ISO level 1 * by allowing DOS style 8.3 names rather than only 8 characters. * (mkisofs and its clones seem to do this violation.) */ unsigned int allow_dir_id_ext :1; /** * Omit the version number (";1") at the end of the ISO-9660 identifiers. * Version numbers are usually not used. * bit0= omit version number with ECMA-119 and Joliet * bit1= omit version number with Joliet alone */ unsigned int omit_version_numbers :2; /** * Allow ISO-9660 directory hierarchy to be deeper than 8 levels. */ unsigned int allow_deep_paths :1; /** * If not allow_deep_paths is in effect, then it may become * necessary to relocate directories so that no ECMA-119 file path * has more than 8 components. These directories are grafted into either * the root directory of the ISO image or into a dedicated relocation * directory. For details see libisofs.h, iso_write_opts_set_rr_reloc(). */ char *rr_reloc_dir; /* IsoNode name in root directory. NULL or empty text means root itself. */ int rr_reloc_flags; /* bit0= mark auto-created rr_reloc_dir by RE bit1= not settable via API (used internally) */ /** * Allow path in the ISO-9660 tree to have more than 255 characters. */ unsigned int allow_longer_paths :1; /** * Allow a single file or directory hierarchy to have up to 37 characters. * This is larger than the 31 characters allowed by ISO level 2, and the * extra space is taken from the version number, so this also forces * omit_version_numbers. */ unsigned int max_37_char_filenames :1; /** * ISO-9660 forces filenames to have a ".", that separates file name from * extension. libisofs adds it if original filename doesn't has one. Set * this to 1 to prevent this behavior * bit0= no forced dot with ECMA-119 * bit1= no forced dot with Joliet */ unsigned int no_force_dots :2; /** * Allow lowercase characters in ISO-9660 filenames. By default, only * uppercase characters, numbers and a few other characters are allowed. */ unsigned int allow_lowercase :1; /** * Allow all ASCII characters to be appear on an ISO-9660 filename. Note * that "/" and "\0" characters are never allowed, even in RR names. */ unsigned int allow_full_ascii :1; /** * Like allow_full_ascii, but only allowing 7-bit characters. * Lowercase letters get mapped to uppercase if not allow_lowercase is set. * Gets overridden if allow_full_ascii is enabled. */ unsigned int allow_7bit_ascii :1; /** * Allow paths in the Joliet tree to have more than 240 characters. */ unsigned int joliet_longer_paths :1; /** * Allow leaf names in the Joliet tree to have up to 103 characters * rather than 64. */ unsigned int joliet_long_names :1; /** * Use UTF-16BE rather than its subset UCS-2 */ unsigned int joliet_utf16 :1; /** * Store timestamps as GMT rather than in local time. */ unsigned int always_gmt :1; /** * Write Rock Ridge info as of specification RRIP-1.10 rather than * RRIP-1.12: signature "RRIP_1991A" rather than "IEEE_1282", * field PX without file serial number */ unsigned int rrip_version_1_10 :1; /** * Store as ECMA-119 Directory Record timestamp the mtime * of the source rather than the image creation time. * The same can be ordered for Joliet and ISO 9660:1999 */ unsigned int dir_rec_mtime :1; unsigned int joliet_rec_mtime :1; unsigned int iso1999_rec_mtime :1; /** * Write AAIP as extension according to SUSP 1.10 rather than SUSP 1.12. * I.e. without announcing it by an ER field and thus without the need * to precede the RRIP fields by an ES and to precede the AA field by ES. */ unsigned int aaip_susp_1_10 :1; unsigned int sort_files:1; /**< If files should be sorted based on their weight. */ /** * The following options set the default values for files and directory * permissions, gid and uid. All these take one of three values: 0, 1 or 2. * If 0, the corresponding attribute will be kept as set in the IsoNode. * Unless you have changed it, it corresponds to the value on disc, so it * is suitable for backup purposes. If set to 1, the corresponding attrib. * will be changed by a default suitable value. Finally, if you set it to * 2, the attrib. will be changed with the value specified in the options * below. Note that for mode attributes, only the permissions are set, the * file type remains unchanged. */ unsigned int replace_dir_mode :2; unsigned int replace_file_mode :2; unsigned int replace_uid :2; unsigned int replace_gid :2; mode_t dir_mode; /** Mode to use on dirs when replace_dir_mode == 2. */ mode_t file_mode; /** Mode to use on files when replace_file_mode == 2. */ uid_t uid; /** uid to use when replace_uid == 2. */ gid_t gid; /** gid to use when replace_gid == 2. */ char *output_charset; /**< NULL to use default charset */ /* Options for image transport */ /** The number of bytes to be used for the fifo which decouples libisofs and libburn for better throughput and for reducing the risk of interrupting signals hitting the libburn thread which operates the MMC drive. The size will be rounded up to the next full 2048. Minimum is 64kiB, maximum is 1 GiB (but that is too much anyway). */ int fifo_size; /** Output value: Block address of session start as evaluated from medium and other options by libisoburn and libburn. If <0 : Invalid If >=0: Valid block number. Block size is always 2 KiB. */ int effective_lba; /** Output value: Block address of data section start as predicted by libisofs. If < 16: Invalid If >=16: Valid block number. Block size is always 2 KiB. */ int data_start_lba; /** * If not empty: Parameters "name" and "timestamp" for a scdbackup stream * checksum tag. See scdbackup/README appendix VERIFY. * It makes sense only for single session images which start at LBA 0. * Such a tag may be part of a libisofs checksum tag block after the * session tag line. It then covers the whole session up to its own start * position. * If scdbackup_tag_written is not NULL then it is a pointer to an * application provided array with at least 512 characters. The effectively * written scdbackup tag will be copied to this memory location. */ char scdbackup_tag_name[81]; char scdbackup_tag_time[19]; char *scdbackup_tag_written; /* Content of an embedded boot image. Valid if not NULL. * In that case it must point to a memory buffer at least 32 kB. */ char *system_area_data; /* * bit0= make bytes 446 - 512 of the system area a partition * table which reserves partition 1 from byte 63*512 to the * end of the ISO image. Assumed are 63 secs/hed, 255 head/cyl. * (GRUB protective msdos label.) * This works with and without system_area_data. */ int system_area_options; /* User settable PVD time stamps */ time_t vol_creation_time; time_t vol_modification_time; time_t vol_expiration_time; time_t vol_effective_time; /* To eventually override vol_modification_time by unconverted string and timezone 0 */ char vol_uuid[17]; /* The number of unclaimed 2K blocks before start of partition 1 as of the MBR in system area. If not 0 this will cause double volume descriptor sets and double tree. */ uint32_t partition_offset; /* Partition table parameter: 1 to 63, 0= disabled/default */ int partition_secs_per_head; /* 1 to 255, 0= disabled/default */ int partition_heads_per_cyl; /* Parameters and state of Jigdo Template Export environment. */ void *libjte_handle; /* A trailing padding of zero bytes which belongs to the image */ uint32_t tail_blocks; /* Disk file paths of content of PreP partition and EFI system partition */ char *prep_partition; int prep_part_flag; char *efi_boot_partition; int efi_boot_part_flag; /* 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. */ 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]; /* 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; }; /* Alignment for session starts on overwritable media. (Increased from 16 to 32 blocks for aligning to BD-RE clusters.) */ #define Libisoburn_nwa_alignemenT 32 /* Alignment for outer session scanning with -ROM drives. (E.g. my DVD-ROM drive shows any DVD type as 0x10 "DVD-ROM" with more or less false capacity and TOC.) */ #define Libisoburn_toc_scan_alignemenT 16 /* Maximum gap to be bridged during a outer TOC scan. Gaps appear between the end of a session and the start of the next session. The longest gap found so far was about 38100 after the first session of a DVD-R. */ #define Libisoburn_toc_scan_max_gaP 65536 /* Creating a chain of image headers which form a TOC: The header of the first session is written after the LBA 0 header. So it persists and can give the end of its session. By help of Libisoburn_nwa_alignemenT it should be possible to predict the start of the next session header. The LBA 0 header is written by isoburn_activate_session() already with the first session. So the medium is mountable. A problem arises with DVD-RW in Intermediate State. They cannot be written by random access before they were written sequentially. In this case, no copy of the session 1 header is maintained and no TOC will be possible. Thus writing begins sequentially at LBA 0. IMPORTANT: This macro gives the minimal size of an image header. It has to be enlarged by the eventual partition offset. */ #define Libisoburn_overwriteable_starT \ ((off_t) (Libisoburn_target_head_sizE/2048)) /* Wrappers for emulation of TOC on overwritable media */ struct isoburn_toc_track { /* Either track or toc_entry are supposed to be NULL */ struct burn_track *track; struct isoburn_toc_entry *toc_entry; }; struct isoburn_toc_session { /* Either session or tracks and toc_entry are supposed to be NULL */ struct burn_session *session; struct isoburn_toc_track **track_pointers; int track_count; struct isoburn_toc_entry *toc_entry; }; struct isoburn_toc_disc { /* Either disc or sessions and toc are supposed to be NULL */ struct burn_disc *disc; struct isoburn_toc_session *sessions; /* storage array */ struct isoburn_toc_session **session_pointers; /* storage array */ struct isoburn_toc_track *tracks; /* storage array */ struct isoburn_toc_track **track_pointers; /* storage array */ int session_count; int incomplete_session_count; int track_count; struct isoburn_toc_entry *toc; }; #endif /* Isoburn_includeD */ libisoburn-1.5.4/libisoburn/data_source.c0000644000175700017510000002115513701321754015436 00000000000000/* data source for libisoburn. Copyright 2007 - 2012 Vreixo Formoso Lopes and Thomas Schmitt Provided under GPL version 2 or later. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #ifndef Xorriso_standalonE #include #include #else /* ! Xorriso_standalonE */ #include "../libisofs/libisofs.h" #include "../libburn/libburn.h" #endif /* Xorriso_standalonE */ #include "isoburn.h" /* Cached reading of image tree data by multiple tiles */ /* Debugging only: This reports cache loads on stderr. #define Libisoburn_read_cache_reporT 1 */ struct isoburn_cache_tile { char *cache_data; uint32_t cache_lba; uint32_t last_error_lba; uint32_t last_aligned_error_lba; int cache_hits; int age; }; struct isoburn_cached_drive { struct burn_drive *drive; struct isoburn_cache_tile **tiles; int num_tiles; int tile_blocks; int current_age; /** Offset to be applied to all block addresses to compensate for an eventual displacement of the block addresses relative to the image start block address that was assumed when the image was created. E.g. if track number 2 gets copied into a disk file and shall then be loaded as ISO filesystem. If displacement_sign is 1 then the displacement number will be added to .read_block() addresses, if -1 it will be subtracted. Else it will be ignored. */ uint32_t displacement; int displacement_sign; }; #define Libisoburn_max_agE 2000000000 static int ds_inc_age(struct isoburn_cached_drive *icd, int idx, int flag); int ds_read_block(IsoDataSource *src, uint32_t lba, uint8_t *buffer) { int ret, i, oldest, oldest_age; struct burn_drive *d; off_t count; uint32_t aligned_lba; char msg[80]; struct isoburn_cache_tile **tiles; struct isoburn_cached_drive *icd; if(src == NULL || buffer == NULL) /* It is not required by the specs of libisofs but implicitly assumed by its current implementation that a data source read result <0 is a valid libisofs error code. */ return ISO_NULL_POINTER; icd = (struct isoburn_cached_drive *) src->data; d = (struct burn_drive*) icd->drive; if(d == NULL) { /* This would happen if libisoburn saw output data in the fifo and performed early drive release and afterwards libisofs still tries to read data. That would constitute a bad conceptual problem in libisoburn. */ isoburn_msgs_submit(NULL, 0x00060000, "Programming error: Drive released while libisofs still attempts to read", 0, "FATAL", 0); return ISO_ASSERT_FAILURE; } tiles = icd->tiles; if(icd->displacement_sign == 1) { if(lba + icd->displacement < lba) { address_rollover:; return ISO_DISPLACE_ROLLOVER; } else lba += icd->displacement; } else if(icd->displacement_sign == -1) { if(lba < icd->displacement ) goto address_rollover; else lba -= icd->displacement; } aligned_lba= lba & ~(icd->tile_blocks - 1); for (i = 0; i < icd->num_tiles; i++) { if(aligned_lba == tiles[i]->cache_lba && tiles[i]->cache_lba != 0xffffffff) { (tiles[i]->cache_hits)++; memcpy(buffer, tiles[i]->cache_data + (lba - aligned_lba) * 2048, 2048); count= 2048; ds_inc_age(icd, i, 0); return 1; } } /* find oldest tile */ oldest_age= Libisoburn_max_agE; oldest= 0; for(i = 0; i < icd->num_tiles; i++) { if(tiles[i]->cache_lba == 0xffffffff) { oldest= i; break; } if(tiles[i]->age < oldest_age) { oldest_age= tiles[i]->age; oldest= i; } } tiles[oldest]->cache_lba= 0xffffffff; /* invalidate cache */ if(tiles[oldest]->last_aligned_error_lba == aligned_lba) { ret = 0; } else { ret = burn_read_data(d, (off_t) aligned_lba * (off_t) 2048, (char *) tiles[oldest]->cache_data, icd->tile_blocks * 2048, &count, 2); } if (ret <= 0 ) { tiles[oldest]->last_aligned_error_lba = aligned_lba; /* Read-ahead failure ? Try to read 2048 directly. */ if(tiles[oldest]->last_error_lba == lba) ret = 0; else ret = burn_read_data(d, (off_t) lba * (off_t) 2048, (char *) buffer, 2048, &count, 0); if (ret > 0) return 1; tiles[oldest]->last_error_lba = lba; sprintf(msg, "ds_read_block(%lu) returns %lX", (unsigned long) lba, (unsigned long) ret); isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "DEBUG", 0); return ISO_DATA_SOURCE_MISHAP; } #ifdef Libisoburn_read_cache_reporT fprintf(stderr, "Tile %2.2d : After %3d hits, new load from %8x , count= %d\n", oldest, tiles[oldest]->cache_hits, aligned_lba, (int) count); #endif tiles[oldest]->cache_lba= aligned_lba; tiles[oldest]->cache_hits= 1; ds_inc_age(icd, oldest, 0); memcpy(buffer, tiles[oldest]->cache_data + (lba - aligned_lba) * 2048, 2048); count= 2048; return 1; } static int ds_open(IsoDataSource *src) { /* nothing to do, device is always grabbed */ return 1; } static int ds_close(IsoDataSource *src) { /* nothing to do, device is always grabbed */ return 1; } static int isoburn_cache_tile_destroy(struct isoburn_cache_tile **o, int flag) { if (*o == NULL) return(0); if ((*o)->cache_data != NULL) free((*o)->cache_data); free(*o); *o = NULL; return(1); } static int isoburn_cache_tile_new(struct isoburn_cache_tile **o, int tile_blocks, int flag) { struct isoburn_cache_tile *t; *o = t = calloc(1, sizeof(struct isoburn_cache_tile)); if (t == NULL) goto fail; t->cache_data = NULL; t->cache_lba = 0xffffffff; t->cache_hits = 0; t->last_error_lba = 0xffffffff; t->last_aligned_error_lba = 0xffffffff; t->age= 0; t->cache_data = calloc(1, tile_blocks * 2048); if (t->cache_data == NULL) goto fail; return(1); fail:; isoburn_cache_tile_destroy(o, 0); return(-1); } static int isoburn_cached_drive_destroy(struct isoburn_cached_drive **o, int flag) { struct isoburn_cached_drive *c; int i; if (*o == NULL) return(0); c= *o; if (c->tiles != NULL) { for (i = 0; i < c->num_tiles; i++) isoburn_cache_tile_destroy(&(c->tiles[i]), 0); free(c->tiles); } free(c); *o= NULL; return(1); } static int isoburn_cached_drive_new(struct isoburn_cached_drive **o, struct burn_drive *d, int cache_tiles, int tile_blocks, int flag) { struct isoburn_cached_drive *icd; int i, ret; *o = icd = calloc(1,sizeof(struct isoburn_cached_drive)); if (*o == NULL) return(-1); icd->drive = d; icd->tiles = NULL; icd->num_tiles = cache_tiles; icd->tile_blocks = tile_blocks; icd->current_age = 0; icd->displacement = 0; icd->displacement_sign = 0; icd->tiles = calloc(1, sizeof(struct isoburn_cache_tile *) * icd->num_tiles); if (icd->tiles == NULL) goto fail; for (i = 0; i < icd->num_tiles; i++) { ret = isoburn_cache_tile_new(&(icd->tiles[i]), icd->tile_blocks, 0); if (ret <= 0) goto fail; } return(1); fail:; isoburn_cached_drive_destroy(o, 0); return(-1); } static void ds_free_data(IsoDataSource *src) { struct isoburn_cached_drive *icd; if(src->data != NULL) { icd= (struct isoburn_cached_drive *) src->data; isoburn_cached_drive_destroy(&icd, 0); } src->data= NULL; } int isoburn_data_source_shutdown(IsoDataSource *src, int flag) { struct isoburn_cached_drive *icd; if(src==NULL) return(0); icd= (struct isoburn_cached_drive *) src->data; icd->drive= NULL; return(1); } IsoDataSource *isoburn_data_source_new(struct burn_drive *d, uint32_t displacement, int displacement_sign, int cache_tiles, int tile_blocks) { IsoDataSource *src; struct isoburn_cached_drive *icd= NULL; int ret; if (d==NULL) return NULL; src = malloc(sizeof(IsoDataSource)); if (src == NULL) return NULL; ret = isoburn_cached_drive_new(&icd, d, cache_tiles, tile_blocks, 0); if (ret <= 0) { free(src); return NULL; } src->version = 0; src->refcount = 1; src->read_block = ds_read_block; src->open = ds_open; src->close = ds_close; src->free_data = ds_free_data; src->data = icd; icd->displacement = displacement; icd->displacement_sign = displacement_sign; return src; } static int ds_inc_age(struct isoburn_cached_drive *icd, int idx, int flag) { int i; (icd->current_age)++; if(icd->current_age>=Libisoburn_max_agE) { /* reset all ages (allow waste) */ for(i = 0; i < icd->num_tiles; i++) (icd->tiles)[i]->age= 0; icd->current_age= 1; } (icd->tiles)[idx]->age= icd->current_age; return(1); } libisoburn-1.5.4/libisoburn/isoburn.c0000644000175700017510000015554713763473051014651 00000000000000 /* cc -g -c isoburn.c */ /* Class core of libisoburn. Copyright 2007 - 2009 Vreixo Formoso Lopes Copyright 2007 - 2020 Thomas Schmitt Provided under GPL version 2 or later. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif /* ( derived from stub generated by CgeN on Sat, 01 Sep 2007 12:04:36 GMT ) */ #include #include #include #include #include #include #ifndef Xorriso_standalonE #include #include #else /* ! Xorriso_standalonE */ #include "../libisofs/libisofs.h" #include "../libburn/libburn.h" #endif /* Xorriso_standalonE */ #include "libisoburn.h" #include "isoburn.h" /* Default values for application provided msgs_submit methods. To be attached to newly acquired drives. */ int (*libisoburn_default_msgs_submit) (void *handle, int error_code, char msg_text[], int os_errno, char severity[], int flag)= NULL; void *libisoburn_default_msgs_submit_handle= NULL; int libisoburn_default_msgs_submit_flag= 0; /* ----------------------- isoburn_toc_entry ---------------------- */ int isoburn_toc_entry_new(struct isoburn_toc_entry **objpt, struct isoburn_toc_entry *boss, int flag) { struct isoburn_toc_entry *o, *s; *objpt= o= (struct isoburn_toc_entry *) malloc(sizeof(struct isoburn_toc_entry)); if(o==NULL) { isoburn_msgs_submit(NULL, 0x00060000, "Cannot allocate memory for isoburn toc entry", 0, "FATAL", 0); return(-1); } o->session= 0; o->track_no= 0; o->start_lba= -1; o->track_blocks= 0; o->volid= NULL; o->next= NULL; if(boss!=NULL) { for(s= boss; s->next!=NULL; s= s->next); s->next= o; } return(1); } /* @param flag bit0= delete all subordinates too */ int isoburn_toc_entry_destroy(struct isoburn_toc_entry **o, int flag) { if(*o==NULL) return(0); if(flag&1) isoburn_toc_entry_destroy(&((*o)->next), flag); if((*o)->volid != NULL) free((*o)->volid); free((char *) (*o)); *o= NULL; return(1); } /* --------------------- end isoburn_toc_entry -------------------- */ /* -------------------------- isoburn ----------------------- */ /* The global list of isoburn objects. Usually there is only one. >>> we are not ready for multiple control threads yet. See >>> mutex . Multiple burns under one control thread should work. */ struct isoburn *isoburn_list_start= NULL; int isoburn_new(struct isoburn **objpt, int flag) { struct isoburn *o; int ret; *objpt= o= (struct isoburn *) malloc(sizeof(struct isoburn)); if(o==NULL) { isoburn_msgs_submit(NULL, 0x00060000, "Cannot allocate memory for isoburn control object", 0, "FATAL", 0); return(-1); } o->drive= NULL; o->emulation_mode= 0; o->fabricated_msc1= -1; o->fabricated_msc2= -1; o->zero_nwa= Libisoburn_overwriteable_starT; o->min_start_byte= o->zero_nwa * 2048; o->nwa= o->zero_nwa; o->truncate= 0; o->iso_source= NULL; o->fabricated_disc_status= BURN_DISC_UNREADY; o->media_read_error= 0; o->toc= NULL; o->wrote_well= -1; o->loaded_partition_offset= 0; o->target_iso_head_size= Libisoburn_target_head_sizE; o->target_iso_head= NULL; o->image= NULL; o->image_start_lba= -1; o->iso_data_source= NULL; o->read_pacifier= NULL; o->read_pacifier_handle= NULL; o->msgs_submit= NULL; o->msgs_submit_handle= NULL; o->msgs_submit_flag= 0; o->do_tao= 0; o->do_fsync= 1; o->prev= NULL; o->next= NULL; o->target_iso_head= calloc(1, o->target_iso_head_size); if(o->target_iso_head == NULL) { isoburn_report_iso_error(ISO_OUT_OF_MEM, "Cannot allocate overwrite buffer", 0, "FATAL", 0); goto failed; } ret= iso_image_new("ISOIMAGE", &o->image); if(ret<0) { isoburn_report_iso_error(ret, "Cannot create image object", 0, "FATAL", 0); goto failed; } ret= isoburn_root_defaults(o->image, 0); if(ret <= 0) goto failed; isoburn_link(o, isoburn_list_start, 1); return(1); failed:; isoburn_destroy(objpt, 0); return(-1); } int isoburn_destroy(struct isoburn **objpt, int flag) { struct isoburn *o; o= *objpt; if(o==NULL) return(0); /* >>> mutex */ if(o==isoburn_list_start) isoburn_list_start= o->next; if(o->prev!=NULL) o->prev->next= o->next; if(o->next!=NULL) o->next->prev= o->prev; /* >>> end mutex */ if(o->image!=NULL) iso_image_unref(o->image); if(o->toc!=NULL) isoburn_toc_entry_destroy(&(o->toc), 1); /* all */ if(o->iso_source!=NULL) burn_source_free(o->iso_source); if(o->iso_data_source!=NULL) iso_data_source_unref(o->iso_data_source); if(o->target_iso_head != NULL) free(o->target_iso_head); free((char *) o); *objpt= NULL; return(1); } int isoburn_destroy_all(struct isoburn **objpt, int flag) { struct isoburn *o,*n; o= *objpt; if(o==NULL) return(0); for(;o->prev!=NULL;o= o->prev); for(;o!=NULL;o= n) { n= o->next; isoburn_destroy(&o,0); } *objpt= NULL; return(1); } int isoburn_get_target_image(struct isoburn *o, IsoImage **pt, int flag) { *pt= o->image; return(1); } int isoburn_get_prev(struct isoburn *o, struct isoburn **pt, int flag) { *pt= o->prev; return(1); } int isoburn_get_next(struct isoburn *o, struct isoburn **pt, int flag) { *pt= o->next; return(1); } int isoburn_link(struct isoburn *o, struct isoburn *link, int flag) /* bit0= insert as link->prev rather than as link->next */ { /* >>> mutex */ if(isoburn_list_start==NULL || (isoburn_list_start==link && (flag&1))) isoburn_list_start= o; if(o->prev!=NULL) o->prev->next= o->next; if(o->next!=NULL) o->next->prev= o->prev; o->prev= o->next= NULL; if(link==NULL) return(1); if(flag&1) { o->next= link; o->prev= link->prev; if(o->prev!=NULL) o->prev->next= o; link->prev= o; } else { o->prev= link; o->next= link->next; if(o->next!=NULL) o->next->prev= o; link->next= o; } /* >>> end mutex */ return(1); } int isoburn_count(struct isoburn *o, int flag) /* flag: bit1= count from start of list */ { int counter= 0; if(flag&2) for(;o->prev!=NULL;o= o->prev); for(;o!=NULL;o= o->next) counter++; return(counter); } int isoburn_by_idx(struct isoburn *o, int idx, struct isoburn **pt, int flag) /* flag: bit0= fetch first (idx<0) or last (idx>0) item in list bit1= address from start of list */ { int i,abs_idx; struct isoburn *npt; if(flag&2) for(;o->prev!=NULL;o= o->prev); abs_idx= (idx>0?idx:-idx); *pt= o; for(i= 0;(i0) npt= o->next; else npt= o->prev; if(npt==NULL && (flag&1)) break; *pt= npt; } return(*pt!=NULL); } int isoburn_find_by_drive(struct isoburn **pt, struct burn_drive *d, int flag) { struct isoburn *o; *pt= NULL; for(o= isoburn_list_start;o!=NULL;o= o->next) if(o->drive==d) { *pt= o; return(1); } return(0); } int isoburn_msgs_submit(struct isoburn *o, int error_code, char msg_text[], int os_errno, char severity[], int flag) { int ret, use_drive_method= 0; if(o!=NULL) if(o->msgs_submit!=NULL) use_drive_method= 1; if(use_drive_method) { ret= o->msgs_submit(o->msgs_submit_handle, error_code, msg_text, os_errno, severity, o->msgs_submit_flag); return(ret); } if(libisoburn_default_msgs_submit != NULL) { ret= libisoburn_default_msgs_submit(libisoburn_default_msgs_submit_handle, error_code, msg_text, os_errno, severity, libisoburn_default_msgs_submit_flag); return(ret); } /* Fallback: use message queue of libburn */ burn_msgs_submit(error_code, msg_text, os_errno, severity, NULL); return(1); } /** Check whether the size of target_iso_head matches the given partition offset. Eventually adjust size. */ int isoburn_adjust_target_iso_head(struct isoburn *o, uint32_t offst, int flag) { uint8_t *new_buf; uint32_t new_size; if((uint32_t) o->target_iso_head_size == Libisoburn_target_head_sizE + 2048 * offst) return(1); new_size= Libisoburn_target_head_sizE + 2048 * offst; new_buf= calloc(1, new_size); if(new_buf == NULL) { isoburn_msgs_submit(o, 0x00060000, "Cannot re-allocate overwrite buffer", 0, "FATAL", 0); return(-1); } memcpy(new_buf, o->target_iso_head, (uint32_t) o->target_iso_head_size < new_size ? (uint32_t) o->target_iso_head_size : new_size); free(o->target_iso_head); o->target_iso_head= new_buf; o->target_iso_head_size= new_size; if(o->nwa == o->zero_nwa) o->nwa= Libisoburn_overwriteable_starT + offst; o->zero_nwa= Libisoburn_overwriteable_starT + offst; return(1); } /* @param out_o The output isoburn object may be NULL if no real write run is desired with opts. @param flag bit0= modifying rather than growing */ static int isoburn_make_iso_write_opts(struct isoburn *out_o, struct isoburn_imgen_opts *opts, int fifo_chunks, IsoWriteOpts *wopts, int flag) { int ret, rec_mtime, new_img, lba, nwa, i, guid_mode; struct burn_drive *out_d; new_img= flag&1; iso_write_opts_set_will_cancel(wopts, opts->will_cancel); iso_write_opts_set_iso_level(wopts, opts->level); iso_write_opts_set_rockridge(wopts, opts->rockridge); iso_write_opts_set_joliet(wopts, opts->joliet); iso_write_opts_set_hfsplus(wopts, opts->hfsplus); iso_write_opts_set_hfsp_block_size(wopts, opts->hfsp_block_size, opts->apm_block_size); iso_write_opts_set_fat(wopts, opts->fat); iso_write_opts_set_iso1999(wopts, opts->iso1999); iso_write_opts_set_hardlinks(wopts, opts->hardlinks); if(opts->hardlinks) iso_write_opts_set_rrip_1_10_px_ino(wopts, 1); iso_write_opts_set_aaip(wopts, opts->aaip); iso_write_opts_set_old_empty(wopts, !!opts->old_empty); iso_write_opts_set_untranslated_name_len(wopts, opts->untranslated_name_len); iso_write_opts_set_allow_dir_id_ext(wopts, opts->allow_dir_id_ext); iso_write_opts_set_omit_version_numbers(wopts, opts->omit_version_numbers); iso_write_opts_set_allow_deep_paths(wopts, opts->allow_deep_paths); iso_write_opts_set_rr_reloc(wopts, opts->rr_reloc_dir, opts->rr_reloc_flags); iso_write_opts_set_allow_longer_paths(wopts, opts->allow_longer_paths); iso_write_opts_set_max_37_char_filenames(wopts, opts->max_37_char_filenames); iso_write_opts_set_no_force_dots(wopts, opts->no_force_dots); iso_write_opts_set_allow_lowercase(wopts, opts->allow_lowercase); iso_write_opts_set_allow_full_ascii(wopts, opts->allow_full_ascii); iso_write_opts_set_allow_7bit_ascii(wopts, opts->allow_7bit_ascii); iso_write_opts_set_relaxed_vol_atts(wopts, 1); iso_write_opts_set_joliet_longer_paths(wopts, opts->joliet_longer_paths); iso_write_opts_set_joliet_long_names(wopts, opts->joliet_long_names); iso_write_opts_set_joliet_utf16(wopts, opts->joliet_utf16); iso_write_opts_set_always_gmt(wopts, opts->always_gmt); iso_write_opts_set_rrip_version_1_10(wopts, opts->rrip_version_1_10); rec_mtime= 0; if(opts->dir_rec_mtime) rec_mtime|= 1; else rec_mtime|= (1 << 14); if(opts->joliet_rec_mtime) rec_mtime|= 2; if(opts->iso1999_rec_mtime) rec_mtime|= 4; iso_write_opts_set_dir_rec_mtime(wopts, rec_mtime); iso_write_opts_set_aaip_susp_1_10(wopts, opts->aaip_susp_1_10); iso_write_opts_set_sort_files(wopts, opts->sort_files); iso_write_opts_set_record_md5(wopts, opts->session_md5, opts->file_md5 & 3); if(opts->scdbackup_tag_name[0] && opts->scdbackup_tag_time[0]) iso_write_opts_set_scdbackup_tag(wopts, opts->scdbackup_tag_name, opts->scdbackup_tag_time, opts->scdbackup_tag_written); iso_write_opts_set_replace_mode(wopts, opts->replace_dir_mode, opts->replace_file_mode, opts->replace_uid, opts->replace_gid); iso_write_opts_set_default_dir_mode(wopts, opts->dir_mode); iso_write_opts_set_default_file_mode(wopts, opts->file_mode); iso_write_opts_set_default_uid(wopts, opts->uid); iso_write_opts_set_default_gid(wopts, opts->gid); iso_write_opts_set_output_charset(wopts, opts->output_charset); iso_write_opts_set_fifo_size(wopts, fifo_chunks); ret = iso_write_opts_set_system_area(wopts, opts->system_area_data, opts->system_area_options, 0); if (ret < 0) { isoburn_report_iso_error(ret, "Cannot set content of System Area", 0, "FAILURE", 0); {ret= -1; goto ex;} } iso_write_opts_set_pvd_times(wopts, opts->vol_creation_time, opts->vol_modification_time, opts->vol_expiration_time, opts->vol_effective_time, opts->vol_uuid); guid_mode= opts->gpt_guid_mode; if(opts->vol_uuid[0] == 0 && opts->gpt_guid_mode == 2) guid_mode= 0; iso_write_opts_set_gpt_guid(wopts, opts->gpt_guid, guid_mode); iso_write_opts_attach_jte(wopts, opts->libjte_handle); iso_write_opts_set_hfsp_serial_number(wopts, opts->hfsp_serial_number); if(out_o != NULL) { out_d= out_o->drive; ret= isoburn_adjust_target_iso_head(out_o, opts->partition_offset, 0); if(ret <= 0) {ret= -1; goto ex;} if(out_o->nwa < out_o->zero_nwa) out_o->zero_nwa= 0; if(opts->no_emul_toc || opts->libjte_handle != NULL) { if(out_o->nwa == out_o->zero_nwa && out_o->zero_nwa == Libisoburn_overwriteable_starT + opts->partition_offset && out_o->emulation_mode == 1) { out_o->nwa= 0; out_o->zero_nwa= 0; out_o->min_start_byte= 0; } } ret = isoburn_disc_track_lba_nwa(out_d, NULL, 0, &lba, &nwa); opts->effective_lba= nwa; ret= isoburn_get_msc2(out_o, NULL, &nwa, 0); if (ret != 1) { isoburn_msgs_submit(out_o, 0x00060000, "Cannot determine next writeable address", 0, "FAILURE", 0); /* >>> NWA_V : If burn_next_track_damaged: ??? Close track and session ? ??? Issue a hint for a repair command ? */; {ret= -3; goto ex;} } iso_write_opts_set_ms_block(wopts, nwa); iso_write_opts_set_appendable(wopts, !new_img); iso_write_opts_set_overwrite_buf(wopts, nwa>0 ? out_o->target_iso_head : NULL); } iso_write_opts_set_part_offset(wopts, opts->partition_offset, opts->partition_secs_per_head, opts->partition_heads_per_cyl); iso_write_opts_set_tail_blocks(wopts, opts->tail_blocks); if(opts->prep_partition != NULL) { ret = iso_write_opts_set_prep_img(wopts, opts->prep_partition, opts->prep_part_flag & 1); if(ret < 0) { isoburn_report_iso_error(ret, "Cannot set path for PreP partition", 0, "FAILURE", 0); {ret= -1; goto ex;} } } if(opts->efi_boot_partition != NULL) { ret = iso_write_opts_set_efi_bootp(wopts, opts->efi_boot_partition, opts->efi_boot_part_flag & 1); if(ret < 0) { isoburn_report_iso_error(ret, "Cannot set path for EFI system partition", 0, "FAILURE", 0); {ret= -1; goto ex;} } } for(i= 0; i < Libisoburn_max_appended_partitionS; i++) { if(opts->appended_partitions[i] == NULL) continue; ret= iso_write_opts_set_partition_img(wopts, i + 1, opts->appended_part_types[i], opts->appended_partitions[i], opts->appended_part_flags[i]); if(ret < 0) { isoburn_report_iso_error(ret, "Cannot set path for appended partition", 0, "FAILURE", 0); {ret= -1; goto ex;} } iso_write_opts_set_part_type_guid(wopts, i + 1, opts->appended_part_type_guids[i], opts->appended_part_gpt_flags[i] & 1); } iso_write_opts_set_appended_as_gpt(wopts, opts->appended_as_gpt); iso_write_opts_set_appended_as_apm(wopts, opts->appended_as_apm); iso_write_opts_set_part_like_isohybrid(wopts, opts->part_like_isohybrid); iso_write_opts_set_iso_mbr_part_type(wopts, opts->iso_mbr_part_type); iso_write_opts_set_iso_type_guid(wopts, opts->iso_gpt_type_guid, opts->iso_gpt_flag & 1); iso_write_opts_set_disc_label(wopts, opts->ascii_disc_label); ret= 1; ex: return(ret); } /* @param flag bit0= modifying rather than growing bit1= prepare for early release of input drive: wait until input and then disable image data source */ static int isoburn_prepare_disc_aux(struct burn_drive *in_d, struct burn_drive *out_d, struct burn_disc **disc, struct isoburn_imgen_opts *opts, int flag) { struct burn_source *wsrc; struct burn_session *session; struct burn_track *track; struct isoburn *in_o, *out_o; IsoWriteOpts *wopts= NULL; enum burn_disc_status state; int ret, fifo_chunks, i, new_img, early_indev_release; uint32_t data_start= -1; size_t buffer_size= 0, buffer_free= 0; char *msg= NULL; msg= calloc(1, 160); if(msg == NULL) {ret= -1; goto ex;} new_img= flag&1; early_indev_release= flag&2; ret= isoburn_find_emulator(&in_o, in_d, 0); if(ret<0 || in_o==NULL) {ret= -1; goto ex;} ret= isoburn_find_emulator(&out_o, out_d, 0); if(ret<0 || out_o==NULL) {ret= -1; goto ex;} /* early end will be registered as failure */ in_o->wrote_well= out_o->wrote_well= 0; if(new_img && early_indev_release) { isoburn_msgs_submit(in_o, 0x00060000, "Programming error: Wrong session setup: new_img && early_indev_release", 0, "FATAL", 0); {ret= -4; goto ex;} } out_o->do_tao = opts->do_tao; out_o->do_fsync = opts->do_fsync; state = isoburn_disc_get_status(in_d); if (state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE && state != BURN_DISC_FULL) { isoburn_msgs_submit(in_o, 0x00060000, "Unsuitable source media state", 0, "FAILURE", 0); {ret= -2; goto ex;} } state = isoburn_disc_get_status(out_d); if (state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE) { isoburn_msgs_submit(out_o, 0x00060000, "Unsuitable target media state", 0, "FAILURE", 0); {ret= -2; goto ex;} } if (state != BURN_DISC_BLANK && opts->libjte_handle != NULL) { isoburn_msgs_submit(out_o, 0x00060000, "Jigdo Template Extraction works only on blank target media", 0, "FAILURE", 0); {ret= -2; goto ex;} } fifo_chunks= 32; if(opts->fifo_size >= 64*1024 && opts->fifo_size <= 1024.0 * 1024.0 * 1024.0){ fifo_chunks= opts->fifo_size/2048; if(fifo_chunks*2048 < opts->fifo_size) fifo_chunks++; } ret= iso_write_opts_new(&wopts, 0); if (ret < 0) { isoburn_report_iso_error(ret, "Cannot create iso_write_opts", 0, "FATAL",0); goto ex; } ret= isoburn_make_iso_write_opts(out_o, opts, fifo_chunks, wopts, flag & 1); if(ret < 0) goto ex; ret = iso_image_create_burn_source(in_o->image, wopts, &wsrc); if (ret < 0) { isoburn_report_iso_error(ret, "Cannot create burn source", 0, "FAILURE", 0); {ret= -1; goto ex;} } if (early_indev_release) { for(i= 0; i<300; i++) { /* <<< ??? */ if((i%30) == 0) { sprintf(msg, "Waiting for data in fifo since %d seconds", i/30); isoburn_msgs_submit(in_o, 0x00060000, msg, 0, "DEBUG", 0); } usleep(100000); ret= iso_ring_buffer_get_status(wsrc, &buffer_size, &buffer_free); if(ret >0 && buffer_size != buffer_free) break; } /* <<< ??? */ sprintf(msg, "After %.1f seconds: %d bytes of output available (fifo state=%d)", ((double) i+1) / 10.0, (int) (buffer_size - buffer_free), ret); isoburn_msgs_submit(in_o, 0x00060000, msg, 0, "DEBUG", 0); if(in_o->iso_data_source!=NULL) isoburn_data_source_shutdown(in_o->iso_data_source, 0); } ret= iso_write_opts_get_data_start(wopts, &data_start, 0); opts->data_start_lba= -1; if(ret > 0 && data_start <= 0x7FFFFFFF) opts->data_start_lba= data_start; /* TODO check return values for failure. properly clean-up on error */ out_o->iso_source= wsrc; *disc = burn_disc_create(); session = burn_session_create(); burn_disc_add_session(*disc, session, BURN_POS_END); track = burn_track_create(); burn_track_set_source(track, out_o->iso_source); burn_session_add_track(session, track, BURN_POS_END); /* give up local references */ burn_track_free(track); burn_session_free(session); in_o->wrote_well= out_o->wrote_well= -1; /* neutral */ ret= 1; ex: if(wopts!=NULL) {iso_write_opts_free(wopts); wopts= NULL;} if(msg != NULL) free(msg); return ret; } int isoburn_prepare_disc(struct burn_drive *d, struct burn_disc **disc, struct isoburn_imgen_opts *opts) { return isoburn_prepare_disc_aux(d, d, disc, opts, 0); } int isoburn_prepare_new_image(struct burn_drive *d, struct burn_disc **disc, struct isoburn_imgen_opts *opts, struct burn_drive *out_drive) { int ret; ret= isoburn_prepare_disc_aux(d, out_drive, disc, opts, 1); if (ret<=0) return ret; return 1; } /* API since 0.2.2 */ int isoburn_prepare_blind_grow(struct burn_drive *d, struct burn_disc **disc, struct isoburn_imgen_opts *opts, struct burn_drive *out_drive, int nwa) { int ret; struct isoburn *o= NULL; ret= isoburn_find_emulator(&o, out_drive, 0); if(ret<0 || o==NULL) return(-1); if(nwa >= 0) o->fabricated_msc2= nwa; if(o->nwa == o->zero_nwa) o->nwa= o->zero_nwa= 0; else o->zero_nwa= 0; o->min_start_byte= 0; ret= isoburn_prepare_disc_aux(d, out_drive, disc, opts, 2); if (ret<=0) return ret; return(1); } /* API @since 0.1.0 @param flag bit0= this is a regular end, not an abort give up source reference */ int isoburn_cancel_prepared_write(struct burn_drive *d, struct burn_drive *output_drive, int flag) { int ret; struct isoburn *o= NULL; if(output_drive!=NULL) { ret= isoburn_find_emulator(&o, output_drive, 0); if(ret<0 || o==NULL) o= NULL; else if(o->iso_source==NULL) o= NULL; } if(o==NULL) { ret= isoburn_find_emulator(&o, d, 0); if(ret<0) return(-1); if(o==NULL) return(0); if(o->iso_source==NULL) return(0); } if(o->iso_source->read!=NULL) return(0); if(o->iso_source->version<1) return(0); o->iso_source->cancel(o->iso_source); burn_source_free(o->iso_source); o->iso_source= NULL; return(1); } /* API @since 0.1.0 */ int isoburn_sync_after_write(struct burn_drive *d, struct burn_drive *output_drive, int flag) { return isoburn_cancel_prepared_write(d, output_drive, 1); } void isoburn_version(int *major, int *minor, int *micro) { *major= isoburn_header_version_major; *minor= isoburn_header_version_minor; *micro= isoburn_header_version_micro; /* No more: values from version.h generated from version.h.in and macro values defined in configure.ac *major = ISOBURN_MAJOR_VERSION; *minor = ISOBURN_MINOR_VERSION; *micro = ISOBURN_MICRO_VERSION; */ } int isoburn_is_compatible(int major, int minor, int micro, int flag) { int own_major, own_minor, own_micro; isoburn_version(&own_major, &own_minor, &own_micro); return(own_major > major || (own_major == major && (own_minor > minor || (own_minor == minor && own_micro >= micro)))); } /* ----------------------------------------------------------------------- */ /* Options for image reading. */ /* ----------------------------------------------------------------------- */ int isoburn_ropt_new(struct isoburn_read_opts **new_o, int flag) { struct isoburn_read_opts *o; o= (*new_o)= calloc(1, sizeof(struct isoburn_read_opts)); if(o==NULL) { isoburn_msgs_submit(NULL, 0x00060000, "Cannot allocate memory for read options", 0, "FATAL", 0); return(-1); } o->cache_tiles= Libisoburn_default_cache_tileS; o->cache_tile_blocks= Libisoburn_default_tile_blockS; o->norock= 0; o->nojoliet= 0; o->noiso1999= 1; o->do_ecma119_map= 0; o->map_mode= 1; o->do_joliet_map= 0; o->joliet_map_mode= 1; o->noaaip= 1; o->noacl= 1; o->noea= 1; o->noino= 1; o->nomd5= 1; o->preferjoliet= 0; o->uid= geteuid(); o->gid= getegid(); o->mode= 0444; o->dirmode= 0555; o->input_charset= NULL; o->truncate_mode= 1; o->truncate_length= 255; o->hasRR= 0; o->hasJoliet= 0; o->hasIso1999= 0; o->hasElTorito= 0; o->size= 0; o->pretend_blank= 1; o->displacement= 0; o->displacement_sign= 0; return(1); } int isoburn_ropt_destroy(struct isoburn_read_opts **o, int flag) { if(*o==NULL) return(0); free(*o); *o= NULL; return(1); } int isoburn_ropt_set_data_cache(struct isoburn_read_opts *o, int cache_tiles, int tile_blocks, int flag) { int i; char msg[80]; if(cache_tiles < 1) { isoburn_msgs_submit(NULL, 0x00060000, "Requested number of data cache tiles is too small (< 1)", 0, "SORRY", 0); return(0); } if(((double) cache_tiles) * ((double) tile_blocks) > (double) Libisoburn_cache_max_sizE) { sprintf(msg, "Requested size of data cache exceeds limit of %.f blocks", (double) Libisoburn_cache_max_sizE); isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "SORRY", 0); return(0); } for(i = 1; i <= Libisoburn_cache_max_sizE; i = i << 1) if(i == tile_blocks) break; if(i > Libisoburn_cache_max_sizE) { isoburn_msgs_submit(NULL, 0x00060000, "Requested number of blocks per data cache tiles is not a power of 2", 0, "SORRY", 0); return(0); } if(o != NULL) { o->cache_tiles= cache_tiles; o->cache_tile_blocks= tile_blocks; } return(1); } int isoburn_ropt_get_data_cache(struct isoburn_read_opts *o, int *cache_tiles, int *tile_blocks, int *set_flag, int flag) { if((flag & 1) || o == NULL) { *cache_tiles= Libisoburn_default_cache_tileS; *tile_blocks= Libisoburn_default_tile_blockS; *set_flag= 0; return(1); } *cache_tiles= o->cache_tiles; *tile_blocks= o->cache_tile_blocks; *set_flag= 0; return(1); } int isoburn_ropt_set_extensions(struct isoburn_read_opts *o, int ext) { o->norock= !!(ext&1); o->nojoliet= !!(ext&2); o->noiso1999= !!(ext&4); o->preferjoliet= !!(ext&8); o->pretend_blank= !!(ext&16); o->noaaip= !!(ext & 32); o->noacl= !!(ext & 64); o->noea= !!(ext & 128); o->noino= !!(ext & 256); o->nomd5= (ext >> 9) & 3; o->do_ecma119_map= !!(ext & 2048); o->map_mode= (ext >> 12) & 3; o->do_joliet_map= !!(ext & 16384); o->joliet_map_mode= !!(ext & 32768); return(1); } int isoburn_ropt_get_extensions(struct isoburn_read_opts *o, int *ext) { *ext= (!!o->norock) | ((!!o->nojoliet)<<1) | ((!!o->noiso1999)<<2) | ((!!o->preferjoliet)<<3) | ((!!o->pretend_blank)<<4) | ((!!o->noaaip) << 5) | ((!!o->noacl) << 6) | ((!!o->noea) << 7) | ((!!o->noino) << 8) | ((o->nomd5 & 3) << 9) | ((!!o->do_ecma119_map) << 11) | ((o->map_mode & 3) << 12) | ((!!o->do_joliet_map) << 14) | ((!!o->joliet_map_mode) << 15); return(1); } int isoburn_ropt_set_default_perms(struct isoburn_read_opts *o, uid_t uid, gid_t gid, mode_t mode) { mode_t dirmode; o->uid= uid; o->gid= gid; o->mode= mode; dirmode= mode; if(dirmode & S_IRUSR) dirmode|= S_IXUSR; if(dirmode & S_IRGRP) dirmode|= S_IXGRP; if(dirmode & S_IROTH) dirmode|= S_IXOTH; o->dirmode= dirmode; return(1); } int isoburn_ropt_get_default_perms(struct isoburn_read_opts *o, uid_t *uid, gid_t *gid, mode_t *mode) { *uid= o->uid; *gid= o->gid; *mode= o->mode; return(1); } int isoburn_ropt_set_default_dirperms(struct isoburn_read_opts *o, mode_t mode) { o->dirmode= mode; return(1); } int isoburn_ropt_get_default_dirperms(struct isoburn_read_opts *o, mode_t *mode) { *mode= o->dirmode; return(1); } int isoburn_ropt_set_input_charset(struct isoburn_read_opts *o, char *input_charset) { o->input_charset= input_charset; return(1); } int isoburn_ropt_get_input_charset(struct isoburn_read_opts *o, char **input_charset) { *input_charset= o->input_charset; return(1); } int isoburn_ropt_set_auto_incharset(struct isoburn_read_opts *o, int mode) { o->auto_input_charset= mode & 1; return(1); } int isoburn_ropt_get_auto_incharset(struct isoburn_read_opts *o, int *mode) { *mode= o->auto_input_charset; return(1); } int isoburn_ropt_set_displacement(struct isoburn_read_opts *o, uint32_t displacement, int displacement_sign) { o->displacement= displacement; o->displacement_sign= displacement_sign; return(1); } int isoburn_ropt_get_displacement(struct isoburn_read_opts *o, uint32_t *displacement, int *displacement_sign) { *displacement= o->displacement; *displacement_sign= o->displacement_sign; return(1); } int isoburn_ropt_set_truncate_mode(struct isoburn_read_opts *o, int mode, int length) { if(mode < 0 || mode > 1) mode= 1; if(length < 64) length= 64; if(length > 255) length= 255; o->truncate_mode= mode; o->truncate_length= length; return(1); } int isoburn_ropt_get_truncate_mode(struct isoburn_read_opts *o, int *mode, int *length) { *mode= o->truncate_mode; *length= o->truncate_length; return(1); } int isoburn_ropt_get_size_what(struct isoburn_read_opts *o, uint32_t *size, int *has_what) { *size= o->size; *has_what= (!!o->hasRR) | ((!!o->hasJoliet)<<1) | ((!!o->hasIso1999)<<2) | ((!!o->hasElTorito)<<3); return(1); } int isoburn_ropt_get_tree_loaded(struct isoburn_read_opts *o, int *tree, int *rr) { *tree= o->tree_loaded; *rr= o->rr_loaded; return(1); } /* ----------------------------------------------------------------------- */ /* Options for image generation by libisofs and image transport to libburn. */ /* ----------------------------------------------------------------------- */ int isoburn_igopt_new(struct isoburn_imgen_opts **new_o, int flag) { struct isoburn_imgen_opts *o; int i; o= (*new_o)= calloc(1, sizeof(struct isoburn_imgen_opts)); if(o==NULL) { isoburn_msgs_submit(NULL, 0x00060000, "Cannot allocate memory for image generation options", 0, "FATAL", 0); return(-1); } o->level= 2; o->rockridge= 1; o->joliet= 0; o->iso1999= 0; o->hardlinks= 0; o->aaip = 0; o->session_md5= 0; o->file_md5= 0; o->no_emul_toc= 0; o->old_empty= 0; o->untranslated_name_len = 0; o->allow_dir_id_ext = 0; o->omit_version_numbers= 0; o->allow_deep_paths= 1; o->rr_reloc_dir= NULL; o->rr_reloc_flags= 0; o->allow_longer_paths= 0; o->max_37_char_filenames= 0; o->no_force_dots= 0; o->allow_lowercase= 0; o->allow_full_ascii= 0; o->allow_7bit_ascii= 0; o->joliet_longer_paths= 0; o->joliet_long_names= 0; o->joliet_utf16= 0; o->always_gmt= 0; o->rrip_version_1_10= 0; o->dir_rec_mtime= 0; o->aaip_susp_1_10= 0; o->sort_files= 0; o->replace_dir_mode= 0; o->replace_file_mode= 0; o->replace_uid= 0; o->replace_gid= 0; o->dir_mode= 0555; o->file_mode= 0444; o->uid= 0; o->gid= 0; o->output_charset= NULL; o->fifo_size= 4*1024*1024; o->effective_lba= -1; o->data_start_lba= -1; o->system_area_data= NULL; o->system_area_options= 0; o->partition_offset= 0; o->partition_secs_per_head= 0; o->partition_heads_per_cyl= 0; o->vol_creation_time= 0; o->vol_modification_time= 0; o->vol_expiration_time= 0; o->vol_effective_time= 0; o->libjte_handle= NULL; o->tail_blocks= 0; o->prep_partition= NULL; o->prep_part_flag= 0; o->efi_boot_partition= NULL; o->efi_boot_part_flag= 0; for(i= 0; i < Libisoburn_max_appended_partitionS; i++) { o->appended_partitions[i]= NULL; o->appended_part_types[i]= 0; o->appended_part_flags[i]= 0; memset(o->appended_part_type_guids[i], 0, 16); o->appended_part_gpt_flags[i]= 0; } o->appended_as_gpt= 0; o->appended_as_apm= 0; o->part_like_isohybrid= 0; o->iso_mbr_part_type= -1; memset(o->gpt_guid, 0, 16); o->gpt_guid_mode= 0; memset(o->hfsp_serial_number, 0, 8); o->hfsp_block_size= 0; o->apm_block_size= 0; o->do_tao= 0; o->do_fsync= 0; return(1); } int isoburn_igopt_destroy(struct isoburn_imgen_opts **o, int flag) { int i; if(*o==NULL) return(0); if((*o)->rr_reloc_dir != NULL) free((*o)->rr_reloc_dir); if((*o)->prep_partition != NULL) free((*o)->prep_partition); if((*o)->efi_boot_partition != NULL) free((*o)->efi_boot_partition); for(i= 0; i < Libisoburn_max_appended_partitionS; i++) if((*o)->appended_partitions[i] != NULL) free((*o)->appended_partitions[i]); if ((*o)->system_area_data != NULL) free((*o)->system_area_data); free(*o); *o= NULL; return(1); } int isoburn_igopt_set_level(struct isoburn_imgen_opts *o, int level) { o->level= level; return(1); } int isoburn_igopt_get_level(struct isoburn_imgen_opts *o, int *level) { *level= o->level; return(1); } int isoburn_igopt_set_extensions(struct isoburn_imgen_opts *o, int ext) { o->rockridge= !!(ext&1); o->joliet= !!(ext&2); o->iso1999= !!(ext&4); o->hardlinks= !!(ext & 8); o->aaip= !!(ext & 32); o->session_md5= !!(ext & 64); o->file_md5= (ext & (128 | 256)) >> 7; o->no_emul_toc= !!(ext & 512); o->will_cancel= !!(ext & 1024); o->old_empty= !!(ext & 2048); o->hfsplus= !!(ext & 4096); o->fat= !!(ext & 8192); return(1); } int isoburn_igopt_get_extensions(struct isoburn_imgen_opts *o, int *ext) { *ext= (!!o->rockridge) | ((!!o->joliet)<<1) | ((!!o->iso1999)<<2) | ((!!o->hardlinks) << 3) | ((!!o->aaip) << 5) | ((!!o->session_md5) << 6) | ((o->file_md5 & 3) << 7) | ((!!o->no_emul_toc) << 9) | ((o->will_cancel) << 10) | ((!!o->old_empty) << 11) | ((!!o->hfsplus) << 12) | ((!!o->fat) << 13); return(1); } int isoburn_igopt_set_relaxed(struct isoburn_imgen_opts *o, int relax) { o->omit_version_numbers= (!!(relax&1)) | (2 * !!(relax & isoburn_igopt_only_iso_versions)); o->allow_deep_paths= !!(relax&2); o->allow_longer_paths= !!(relax&4); o->max_37_char_filenames= !!(relax&8); o->no_force_dots= (!!(relax&16)) | (2 * !!(relax & isoburn_igopt_no_j_force_dots)); o->allow_lowercase= !!(relax&32); o->allow_full_ascii= !!(relax&64); o->joliet_longer_paths= !!(relax&128); o->always_gmt= !!(relax & isoburn_igopt_always_gmt); o->rrip_version_1_10= !!(relax & isoburn_igopt_rrip_version_1_10); o->dir_rec_mtime= !!(relax & isoburn_igopt_dir_rec_mtime); o->aaip_susp_1_10= !!(relax & isoburn_igopt_aaip_susp_1_10); o->allow_dir_id_ext= !!(relax & isoburn_igopt_allow_dir_id_ext); o->joliet_long_names= !!(relax & isoburn_igopt_joliet_long_names); o->joliet_rec_mtime= !!(relax & isoburn_igopt_joliet_rec_mtime); o->iso1999_rec_mtime= !!(relax & isoburn_igopt_iso1999_rec_mtime); o->allow_7bit_ascii= !!(relax & isoburn_igopt_allow_7bit_ascii); o->joliet_utf16= !!(relax & isoburn_igopt_joliet_utf16); return(1); } int isoburn_igopt_get_relaxed(struct isoburn_imgen_opts *o, int *relax) { *relax= (!!o->omit_version_numbers) | ((!!o->allow_deep_paths)<<1) | ((!!o->allow_longer_paths)<<2) | ((!!o->max_37_char_filenames)<<3) | ((!!(o->no_force_dots & 1))<<4)| ((!!o->allow_lowercase)<<5) | ((!!o->allow_full_ascii)<<6) | ((!!o->joliet_longer_paths)<<7) | ((!!o->always_gmt)<<8) | ((!!o->rrip_version_1_10)<<9) | ((!!o->dir_rec_mtime)<<10) | ((!!o->aaip_susp_1_10)<<11) | ((!!(o->omit_version_numbers & 2))<<12) | ((!!(o->no_force_dots & 2))<<13) | ((!!o->allow_dir_id_ext) << 14) | ((!!o->joliet_long_names) << 15) | ((!!o->joliet_rec_mtime) << 16) | ((!!o->iso1999_rec_mtime) << 17) | ((!!o->allow_full_ascii) << 18) | ((!!o->joliet_utf16) << 19); return(1); } int isoburn_igopt_set_rr_reloc(struct isoburn_imgen_opts *o, char *name, int flags) { if(o->rr_reloc_dir != name) { if(o->rr_reloc_dir != NULL) free(o->rr_reloc_dir); o->rr_reloc_dir= NULL; if(name != NULL) { o->rr_reloc_dir= strdup(name); if(o->rr_reloc_dir == NULL) { isoburn_msgs_submit(NULL, 0x00060000, "Cannot allocate memory for image generation options", 0, "FATAL", 0); return(-1); } } } o->rr_reloc_flags = flags & 1; return 1; } int isoburn_igopt_get_rr_reloc(struct isoburn_imgen_opts *o, char **name, int *flags) { *name= o->rr_reloc_dir; *flags= o->rr_reloc_flags; return(1); } int isoburn_igopt_set_untranslated_name_len(struct isoburn_imgen_opts *o, int len) { int ret; IsoWriteOpts *opts = NULL; char *msg= NULL; msg= calloc(1, 160); if(msg == NULL) {ret= -1; goto ex;} ret= iso_write_opts_new(&opts, 0); if(ret < 0) { isoburn_msgs_submit(NULL, 0x00060000, "Cannot create libisofs write options object", 0, "FATAL", 0); {ret= 0; goto ex;} } ret= iso_write_opts_set_untranslated_name_len(opts, len); if(ret < 0) { ret= iso_write_opts_set_untranslated_name_len(opts, -1); sprintf(msg, "Improper value for maximum length of untranslated names (%d <-> -1 ... %d)", len, ret); isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "FAILURE", 0); iso_write_opts_free(opts); {ret= 0; goto ex;} } o->untranslated_name_len= ret; /* Normalized len value */ iso_write_opts_free(opts); ret= 1; ex:; if(msg != NULL) free(msg); return(ret); } int isoburn_igopt_get_untranslated_name_len(struct isoburn_imgen_opts *o, int *len) { *len = o->untranslated_name_len; return(1); } int isoburn_igopt_set_sort_files(struct isoburn_imgen_opts *o, int value) { o->sort_files= !!(value&1); return(1); } int isoburn_igopt_get_sort_files(struct isoburn_imgen_opts *o, int *value) { *value= !!o->sort_files; return(1); } int isoburn_igopt_set_over_mode(struct isoburn_imgen_opts *o, int replace_dir_mode, int replace_file_mode, mode_t dir_mode, mode_t file_mode) { o->replace_dir_mode= replace_dir_mode%3; o->replace_file_mode= replace_file_mode%3; o->dir_mode= dir_mode; o->file_mode= file_mode; return(1); } int isoburn_igopt_get_over_mode(struct isoburn_imgen_opts *o, int *replace_dir_mode, int *replace_file_mode, mode_t *dir_mode, mode_t *file_mode) { *replace_dir_mode= o->replace_dir_mode%3; *replace_file_mode= o->replace_file_mode%3; *dir_mode= o->dir_mode; *file_mode= o->file_mode; return(1); } int isoburn_igopt_set_over_ugid(struct isoburn_imgen_opts *o, int replace_uid, int replace_gid, uid_t uid, gid_t gid) { o->replace_uid= replace_uid%3; o->replace_gid= replace_gid%3; o->uid= uid; o->gid= gid; return(1); } int isoburn_igopt_get_over_ugid(struct isoburn_imgen_opts *o, int *replace_uid, int *replace_gid, uid_t *uid, gid_t *gid) { *replace_uid= o->replace_uid%3; *replace_gid= o->replace_gid%3; *uid= o->uid; *gid= o->gid; return(1); } int isoburn_igopt_set_out_charset(struct isoburn_imgen_opts *o, char *output_charset) { o->output_charset= output_charset; return(1); } int isoburn_igopt_get_out_charset(struct isoburn_imgen_opts *o, char **output_charset) { *output_charset= o->output_charset; return(1); } int isoburn_igopt_set_fifo_size(struct isoburn_imgen_opts *o, int fifo_size) { o->fifo_size= fifo_size; return(1); } int isoburn_igopt_get_fifo_size(struct isoburn_imgen_opts *o, int *fifo_size) { *fifo_size= o->fifo_size; return(1); } int isoburn_igopt_get_effective_lba(struct isoburn_imgen_opts *o, int *lba) { *lba= o->effective_lba; return(1); } int isoburn_igopt_get_data_start(struct isoburn_imgen_opts *o, int *lba) { *lba= o->data_start_lba; return(1); } int isoburn_igopt_set_scdbackup_tag(struct isoburn_imgen_opts *o, char *name, char *timestamp, char *tag_written) { strncpy(o->scdbackup_tag_name, name, 80); o->scdbackup_tag_name[80]= 0; strncpy(o->scdbackup_tag_time, timestamp, 18); o->scdbackup_tag_time[18]= 0; o->scdbackup_tag_written = tag_written; if(tag_written != NULL) tag_written[0]= 0; return(1); } int isoburn_igopt_get_scdbackup_tag(struct isoburn_imgen_opts *o, char name[81], char timestamp[19], char **tag_written) { strncpy(name, o->scdbackup_tag_name, 80); name[80]= 0; strncpy(timestamp, o->scdbackup_tag_time, 18); timestamp[18]= 0; *tag_written= o->scdbackup_tag_written; return(1); } int isoburn_igopt_set_system_area(struct isoburn_imgen_opts *opts, char data[32768], int options) { if (data == NULL) { /* Disable */ if (opts->system_area_data != NULL) free(opts->system_area_data); opts->system_area_data = NULL; } else { if (opts->system_area_data == NULL) { opts->system_area_data = calloc(32768, 1); if (opts->system_area_data == NULL) return(-1); } memcpy(opts->system_area_data, data, 32768); } opts->system_area_options = options & 0xffff; return(1); } int isoburn_igopt_get_system_area(struct isoburn_imgen_opts *opts, char data[32768], int *options) { *options= opts->system_area_options; if(opts->system_area_data == NULL) return(0); memcpy(data, opts->system_area_data, 32768); return(1); } int isoburn_igopt_set_pvd_times(struct isoburn_imgen_opts *opts, time_t vol_creation_time, time_t vol_modification_time, time_t vol_expiration_time, time_t vol_effective_time, char *vol_uuid) { opts->vol_creation_time = vol_creation_time; opts->vol_modification_time = vol_modification_time; opts->vol_expiration_time = vol_expiration_time; opts->vol_effective_time = vol_effective_time; strncpy(opts->vol_uuid, vol_uuid, 16); opts->vol_uuid[16] = 0; return(1); } int isoburn_igopt_get_pvd_times(struct isoburn_imgen_opts *opts, time_t *vol_creation_time, time_t *vol_modification_time, time_t *vol_expiration_time, time_t *vol_effective_time, char vol_uuid[17]) { *vol_creation_time = opts->vol_creation_time; *vol_modification_time = opts->vol_modification_time; *vol_expiration_time = opts->vol_expiration_time; *vol_effective_time = opts->vol_effective_time; strcpy(vol_uuid, opts->vol_uuid); return(1); } 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) { if (block_offset_2k > 0 && block_offset_2k < 16) return(0); opts->partition_offset = block_offset_2k; opts->partition_secs_per_head = secs_512_per_head; opts->partition_heads_per_cyl = heads_per_cyl; return(1); } 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) { *block_offset_2k = opts->partition_offset; *secs_512_per_head = opts->partition_secs_per_head; *heads_per_cyl = opts->partition_heads_per_cyl; return 1; } int isoburn_igopt_attach_jte(struct isoburn_imgen_opts *opts, void *libjte_handle) { opts->libjte_handle = libjte_handle; return 1; } int isoburn_igopt_detach_jte(struct isoburn_imgen_opts *opts, void **libjte_handle) { if(libjte_handle != NULL) *libjte_handle = opts->libjte_handle; opts->libjte_handle = NULL; return 1; } int isoburn_igopt_set_tail_blocks(struct isoburn_imgen_opts *opts, uint32_t num_blocks) { opts->tail_blocks = num_blocks; return 1; } int isoburn_igopt_get_tail_blocks(struct isoburn_imgen_opts *opts, uint32_t *num_blocks) { *num_blocks = opts->tail_blocks; return 1; } int isoburn_igopt_set_prep_partition(struct isoburn_imgen_opts *o, char *path, int flag) { if(o->prep_partition != NULL) free(o->prep_partition); o->prep_partition= NULL; o->prep_part_flag= 0; if(path != NULL) { o->prep_partition= strdup(path); if(o->prep_partition == NULL) { isoburn_report_iso_error(ISO_OUT_OF_MEM, "Out of memory", 0, "FATAL", 0); return(-1); } } o->prep_part_flag= flag & 1; return(1); } int isoburn_igopt_get_prep_partition(struct isoburn_imgen_opts *opts, char **path, int flag) { *path= opts->prep_partition; if(flag & 1) return(1 + (opts->prep_part_flag & 0x3fffffff)); return(1); } int isoburn_igopt_set_efi_bootp(struct isoburn_imgen_opts *o, char *path, int flag) { if(o->efi_boot_partition != NULL) free(o->efi_boot_partition); o->efi_boot_partition= NULL; o->efi_boot_part_flag= 0; if(path != NULL) { o->efi_boot_partition= strdup(path); if(o->efi_boot_partition == NULL) { isoburn_report_iso_error(ISO_OUT_OF_MEM, "Out of memory", 0, "FATAL", 0); return(-1); } } o->efi_boot_part_flag = flag & 1; return(1); } int isoburn_igopt_get_efi_bootp(struct isoburn_imgen_opts *opts, char **path, int flag) { *path= opts->efi_boot_partition; if(flag & 1) return(1 + (opts->efi_boot_part_flag & 0x3fffffff)); return(1); } int isoburn_igopt_set_partition_img(struct isoburn_imgen_opts *opts, int partition_number, uint8_t partition_type, char *image_path) { char msg[80]; if (partition_number < 1 || partition_number > Libisoburn_max_appended_partitionS) { sprintf(msg, "Partition number is out of range (1 ... %d)", Libisoburn_max_appended_partitionS); isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "FAILURE", 0); return(0); } if (opts->appended_partitions[partition_number - 1] != NULL) free(opts->appended_partitions[partition_number - 1]); opts->appended_partitions[partition_number - 1] = strdup(image_path); if (opts->appended_partitions[partition_number - 1] == NULL) return(-1); opts->appended_part_types[partition_number - 1] = partition_type; return(1); } int isoburn_igopt_get_partition_img(struct isoburn_imgen_opts *opts, int num_entries, uint8_t partition_types[], char *image_paths[]) { int i, max_entry= 0; for(i= 0; i < num_entries; i++) image_paths[i]= NULL; for(i= 0; i < Libisoburn_max_appended_partitionS; i++) { if(opts->appended_partitions[i] == NULL) continue; if(i < num_entries) { image_paths[i]= opts->appended_partitions[i]; partition_types[i]= opts->appended_part_types[i]; } max_entry= i + 1; } return(max_entry); } int isoburn_igopt_set_part_flag(struct isoburn_imgen_opts *opts, int partition_number, int flag) { char msg[80]; if (partition_number < 1 || partition_number > Libisoburn_max_appended_partitionS) { sprintf(msg, "Partition number is out of range (1 ... %d)", Libisoburn_max_appended_partitionS); isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "FAILURE", 0); return(0); } opts->appended_part_flags[partition_number - 1]= flag; return(1); } int isoburn_igopt_get_part_flags(struct isoburn_imgen_opts *opts, int num_entries, int part_flags[]) { int i, max_entry= 0; for(i= 0; i < num_entries; i++) part_flags[i]= 0; for(i= 0; i < Libisoburn_max_appended_partitionS; i++) { if(i < num_entries) part_flags[i]= opts->appended_part_flags[i]; max_entry= i + 1; } return(max_entry); } int isoburn_igopt_set_appended_as_gpt(struct isoburn_imgen_opts *opts, int gpt) { opts->appended_as_gpt= !!gpt; return(1); } int isoburn_igopt_get_appended_as_gpt(struct isoburn_imgen_opts *opts, int *gpt) { *gpt= opts->appended_as_gpt; return(1); } int isoburn_igopt_set_part_type_guid(struct isoburn_imgen_opts *opts, int partition_number, uint8_t guid[16], int valid) { char msg[80]; if (partition_number < 1 || partition_number > Libisoburn_max_appended_partitionS) { sprintf(msg, "Partition number is out of range (1 ... %d)", Libisoburn_max_appended_partitionS); isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "FAILURE", 0); return(0); } if(valid) memcpy(opts->appended_part_type_guids[partition_number - 1], guid, 16); if(valid) opts->appended_part_gpt_flags[partition_number - 1]|= 1; else opts->appended_part_gpt_flags[partition_number - 1]&= ~1; return(1); } int isoburn_igopt_get_part_type_guid(struct isoburn_imgen_opts *opts, int num_entries, uint8_t guids[][16], int valids[]) { int i, max_entry= 0; for(i= 0; i < num_entries; i++) { memset(guids[i], 0, 16); valids[i]= 0; } for(i= 0; i < Libisoburn_max_appended_partitionS; i++) { if(i < num_entries) { memcpy(guids[i], opts->appended_part_type_guids[i], 16); valids[i]= opts->appended_part_gpt_flags[i] & 1; } max_entry= i + 1; } return(max_entry); } int isoburn_igopt_set_appended_as_apm(struct isoburn_imgen_opts *opts, int apm) { opts->appended_as_apm= !!apm; return(1); } int isoburn_igopt_get_appended_as_apm(struct isoburn_imgen_opts *opts, int *apm) { *apm= opts->appended_as_apm; return(1); } int isoburn_igopt_set_part_like_isohybrid(struct isoburn_imgen_opts *opts, int alike) { opts->part_like_isohybrid= !!alike; return(1); } int isoburn_igopt_get_part_like_isohybrid(struct isoburn_imgen_opts *opts, int *alike) { *alike= opts->part_like_isohybrid; return(1); } int isoburn_igopt_set_iso_mbr_part_type(struct isoburn_imgen_opts *opts, int part_type) { if(part_type < -1 || part_type > 255) part_type = -1; opts->iso_mbr_part_type = part_type; return(1); } int isoburn_igopt_get_iso_mbr_part_type(struct isoburn_imgen_opts *opts, int *part_type) { *part_type= opts->iso_mbr_part_type; return(1); } int isoburn_igopt_set_iso_type_guid(struct isoburn_imgen_opts *opts, uint8_t guid[16], int valid) { if(valid) memcpy(opts->iso_gpt_type_guid, guid, 16); opts->iso_gpt_flag= (opts->iso_gpt_flag & ~1) | !!valid; return(1); } int isoburn_igopt_get_iso_type_guid(struct isoburn_imgen_opts *opts, uint8_t guid[16]) { memcpy(guid, opts->iso_gpt_type_guid, 16); return(opts->iso_gpt_flag & 1); } int isoburn_igopt_set_gpt_guid(struct isoburn_imgen_opts *opts, uint8_t guid[16], int mode) { if(mode < 0 || mode > 2) { isoburn_msgs_submit(NULL, 0x00060000, "Unrecognized GPT disk GUID setup mode. (0 ... 2)", 0, "FAILURE", 0); return(0); } opts->gpt_guid_mode= mode; if(opts->gpt_guid_mode == 1) memcpy(opts->gpt_guid, guid, 16); return 1; } int isoburn_igopt_get_gpt_guid(struct isoburn_imgen_opts *opts, uint8_t guid[16], int *mode) { if(opts->gpt_guid_mode == 1) memcpy(guid, opts->gpt_guid, 16); *mode = opts->gpt_guid_mode; return(1); } int isoburn_igopt_set_disc_label(struct isoburn_imgen_opts *opts, char *label) { strncpy(opts->ascii_disc_label, label, Libisoburn_disc_label_sizE - 1); opts->ascii_disc_label[Libisoburn_disc_label_sizE - 1] = 0; return(1); } int isoburn_igopt_get_disc_label(struct isoburn_imgen_opts *opts, char **label) { *label= opts->ascii_disc_label; return(1); } int isoburn_igopt_set_hfsp_serial_number(struct isoburn_imgen_opts *opts, uint8_t serial_number[8]) { memcpy(opts->hfsp_serial_number, serial_number, 8); return(1); } int isoburn_igopt_get_hfsp_serial_number(struct isoburn_imgen_opts *opts, uint8_t serial_number[8]) { memcpy(serial_number, opts->hfsp_serial_number, 8); return(1); } int isoburn_igopt_set_hfsp_block_size(struct isoburn_imgen_opts *opts, int hfsp_block_size, int apm_block_size) { char msg[80]; msg[0]= 0; if(hfsp_block_size != -1) { if(hfsp_block_size != 0 && hfsp_block_size != 512 && hfsp_block_size != 2048) { sprintf(msg, "Not a supported HFS+ size (%d <-> 0, 512, 2048)", hfsp_block_size); isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "FAILURE", 0); } opts->hfsp_block_size = hfsp_block_size; } if(apm_block_size != -1) { if(apm_block_size != 0 && apm_block_size != 512 && apm_block_size != 2048) { sprintf(msg, "Not a supported APM block size (%d <-> 0, 512, 2048)", apm_block_size); isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "FAILURE", 0); } opts->apm_block_size = apm_block_size; } if(msg[0]) return(0); return(1); } int isoburn_igopt_get_hfsp_block_size(struct isoburn_imgen_opts *opts, int *hfsp_block_size, int *apm_block_size) { *hfsp_block_size= opts->hfsp_block_size; *apm_block_size= opts->apm_block_size; return(1); } int isoburn_igopt_set_write_type(struct isoburn_imgen_opts *opts, int do_tao) { if(do_tao < -1 || do_tao > 1) return(0); opts->do_tao= do_tao; return(1); } int isoburn_igopt_get_write_type(struct isoburn_imgen_opts *opts, int *do_tao) { *do_tao= opts->do_tao; return(1); } int isoburn_igopt_set_stdio_endsync(struct isoburn_imgen_opts *opts, int do_sync) { opts->do_fsync= !!do_sync; return(1); } int isoburn_igopt_get_stdio_endsync(struct isoburn_imgen_opts *opts, int *do_sync) { *do_sync= opts->do_fsync; return(1); } int isoburn_conv_name_chars(struct isoburn_imgen_opts *opts, char *name, size_t name_len, char **result, size_t *result_len, int flag) { int ret; IsoWriteOpts *wopts= NULL; ret = iso_write_opts_new(&wopts, 0); if (ret < 0) { isoburn_report_iso_error(ret, "Cannot create iso_write_opts", 0, "FATAL",0); goto ex; } ret= isoburn_make_iso_write_opts(NULL, opts, 0, wopts, 0); if(ret < 0) goto ex; ret= iso_conv_name_chars(wopts, name, name_len, result, result_len, flag); ex:; if(wopts != NULL) iso_write_opts_free(wopts); return(ret); } libisoburn-1.5.4/libisoburn/libisoburn.h0000644000175700017510000037165114005265305015330 00000000000000 #ifndef LIBISOBURN_LIBISOBURN_H_ #define LIBISOBURN_LIBISOBURN_H_ /* Lower level API definition of libisoburn. Copyright 2007-2009 Vreixo Formoso Lopes Copyright 2007-2021 Thomas Schmitt Provided under GPL version 2 or later. */ #ifdef __cplusplus extern "C" { #endif /** Overview libisoburn is a frontend for libraries libburn and libisofs which enables creation and expansion of ISO-9660 filesystems on all CD/DVD/BD media supported by libburn. This includes media like DVD+RW, which do not support multi-session management on media level and even plain disk files or block devices. The price for that is thorough specialization on data files in ISO-9660 filesystem images. So libisoburn is not suitable for audio (CD-DA) or any other CD layout which does not entirely consist of ISO-9660 sessions. Note that there is a higher level of API: xorriso.h. One should not mix it with the API calls of libisoburn.h, libisofs.h, and libburn.h. Connector functions libisofs and libburn do not depend on each other but share some interfaces by which they can cooperate. libisoburn establishes the connection between both modules by creating the necessary interface objects and attaching them to the right places. Wrapper functions The principle of this frontend is that you may use any call of libisofs or libburn unless it has a isoburn_*() wrapper listed in the following function documentation. E.g. call isoburn_initialize() rather than iso_init(); burn_initialize(); and call isoburn_drive_scan_and_grab() rather than burn_drive_scan_and_grab(). But you may call burn_disc_get_profile() directly if you want to display the media type. The wrappers will transparently provide the necessary emulations which are appropriate for particular target drives and media states. To learn about them you have to read both API descriptions: the one of the wrapper and the one of the underlying libburn or libisofs call. Macros BURN_* and functions burn_*() are documented in Macros ISO_* and functions iso_*() are documented in Usage model There may be an input drive and an output drive. Either of them may be missing with the consequence that no reading or no writing is possible. Both drive roles can be fulfilled by the same drive. Input can be a random access readable libburn drive: optical media, regular files, block devices. Output can be any writeable libburn drive: writeable optical media in burner, writeable file objects (no directories). libburn demands rw-permissions to drive device file or file object. If the input drive provides a suitable ISO RockRidge image, then its tree may be loaded into memory and can then be manipulated by libisofs API calls. The loading is done by isoburn_read_image() under control of struct isoburn_read_opts which the application obtains from libisoburn and manipulates by the family of isoburn_ropt_set_*() functions. Writing of result images is controlled by libisofs related parameters in a struct isoburn_imgen_opts which the application obtains from libisoburn and manipulates by the family of isoburn_igopt_set_*() functions. All multi-session aspects are handled by libisoburn according to these settings. The application does not have to analyze media state and write job parameters. It rather states its desires which libisoburn tries to fulfill, or else will refuse to start the write run. Setup for Growing, Modifying or Blind Growing The connector function family offers alternative API calls for performing the setup for several alternative image generation strategies. Growing: If input and output drive are the same, then isoburn_prepare_disc() is to be used. It will lead to an add-on session on appendable or overwritable media with existing ISO image. With blank media it will produce a first session. Modifying: If the output drive is not the input drive, and if it bears blank media or overwritable without a valid ISO image, then one may produce a consolidated image with old and new data. This will copy file data from an eventual input drive with valid image, add any newly introduced data from the local filesystem, and produce a first session on output media. To prepare for such an image generation run, use isoburn_prepare_new_image(). Blind Growing: This method reads the old image from one drive and writes the add-on session to a different drive. That output drive is nevertheless supposed to finally lead to the same medium from where the session was loaded. Usually it will be stdio:/dev/fd/1 (i.e. stdout) being piped into some burn program like with this classic gesture: mkisofs -M $dev -C $msc1,$nwa | cdrecord -waiti dev=$dev Blind growing is prepared by the call isoburn_prepare_blind_grow(). The input drive should be released immediately after this call in order to allow the consumer of the output stream to access that drive for writing. After either of these setups, some peripheral libburn drive parameter settings like burn_write_opts_set_simulate(), burn_write_opts_set_multi(), burn_drive_set_speed(), burn_write_opts_set_underrun_proof() should be made. Do not set the write mode. It will be chosen by libisoburn so it matches job and media state. Writing the image Then one may start image generation and write threads by isoburn_disc_write(). Progress may be watched at the output drive by burn_drive_get_status() and isoburn_get_fifo_status(). At some time, the output drive will be BURN_DRIVE_IDLE indicating that writing has ended. One should inquire isoburn_drive_wrote_well() to learn about overall success. Finally one must call isoburn_activate_session() which will complete any eventual multi-session emulation. Application Constraints Applications shall include libisofs/libisofs.h , libburn/libburn.h and this file itself: libisoburn/libisoburn.h . They shall link with -lisofs -lburn -lisoburn or with the .o files emerging from building those libraries from their sources. Applications must use 64 bit off_t. E.g. on 32-bit GNU/Linux by defining #define _LARGEFILE_SOURCE #define _FILE_OFFSET_BITS 64 The minimum requirement is to interface with the library by 64 bit signed integers where libisofs.h or libisoburn.h prescribe off_t. Failure to do so may result in surprising malfunction or memory faults. Application files which include libisofs/libisofs.h or libisoburn/libisoburn.h must provide definitions for uint32_t and uint8_t. This can be achieved either: - by using autotools which will define HAVE_STDINT_H or HAVE_INTTYPES_H according to its ./configure tests, - or by defining the macros HAVE_STDINT_H or HAVE_INTTYPES_H according to the local situation, - or by appropriately defining uint32_t and uint8_t by other means, e.g. by including inttypes.h before including libisofs.h and libisoburn.h */ #ifdef HAVE_STDINT_H #include #else #ifdef HAVE_INTTYPES_H #include #endif #endif /* Important: If you add a public API function then add its name to file libisoburn/libisoburn.ver */ /* API functions */ /** Initialize libisoburn, libisofs and libburn. Wrapper for : iso_init() and burn_initialize() @since 0.1.0 @param msg A character array for eventual messages (e.g. with errors) @param flag Bitfield for control purposes (unused yet, submit 0) @return 1 indicates success, 0 is failure */ int isoburn_initialize(char msg[1024], int flag); /** Check whether all features of header file libisoburn.h from the given major.minor.micro revision triple can be delivered by the library version which is performing this call. An application of libisoburn can easily memorize the version of the libisoburn.h header in its own code. Immediately after isoburn_initialize() it should simply do this check: if (! isoburn_is_compatible(isoburn_header_version_major, isoburn_header_version_minor, isoburn_header_version_micro, 0)) ...refuse to start the program with this dynamic library version... @since 0.1.0 @param major obtained at build time @param minor obtained at build time @param micro obtained at build time @param flag Bitfield for control purposes. Unused yet. Submit 0. @return 1= library can work for caller 0= library is not usable in some aspects. Caller must restrict itself to an earlier API version or must not use this library at all. */ int isoburn_is_compatible(int major, int minor, int micro, int flag); /** Obtain the three release version numbers of the library. These are the numbers encountered by the application when linking with libisoburn, i.e. possibly not before run time. Better do not base the fundamental compatibility decision of an application on these numbers. For a reliable check use isoburn_is_compatible(). @since 0.1.0 @param major The maturity version (0 for now, as we are still learning) @param minor The development goal version. @param micro The development step version. This has an additional meaning: Pare numbers indicate a version with frozen API. I.e. you can rely on the same set of features to be present in all published releases with that major.minor.micro combination. Features of a pare release will stay available and ABI compatible as long as the SONAME of libisoburn stays "1". Currently there are no plans to ever change the SONAME. Odd numbers indicate that API upgrades are in progress. I.e. new features might be already present or they might be still missing. Newly introduced features may be changed incompatibly or even be revoked before release of a pare version. So micro revisions {1,3,5,7,9} should never be used for dynamic linking unless the proper library match can be guaranteed by external circumstances. @return 1 success, <=0 might in future become an error indication */ void isoburn_version(int *major, int *minor, int *micro); /** The minimum version of libisofs to be used with this version of libisoburn at compile time. @since 0.1.0 */ #define isoburn_libisofs_req_major 1 #define isoburn_libisofs_req_minor 5 #define isoburn_libisofs_req_micro 4 /** The minimum version of libburn to be used with this version of libisoburn at compile time. @since 0.1.0 */ #define isoburn_libburn_req_major 1 #define isoburn_libburn_req_minor 5 #define isoburn_libburn_req_micro 4 /** The minimum compile time requirements of libisoburn towards libjte are the same as of a suitable libisofs towards libjte. So use these macros from libisofs.h : iso_libjte_req_major iso_libjte_req_minor iso_libjte_req_micro @since 0.6.4 */ /** The minimum version of libisofs to be used with this version of libisoburn at runtime. This is checked already in isoburn_initialize() which will refuse on outdated version. So this call is for information purposes after successful startup only. @since 0.1.0 @param major isoburn_libisofs_req_major as seen at build time @param minor as seen at build time @param micro as seen at build time @return 1 success, <=0 might in future become an error indication */ int isoburn_libisofs_req(int *major, int *minor, int *micro); /** The minimum version of libjte to be used with this version of libisoburn at runtime. The use of libjte is optional and depends on configure tests. It can be prevented by ./configure option --disable-libjte . This is checked already in isoburn_initialize() which will refuse on outdated version. So this call is for information purposes after successful startup only. @since 0.6.4 */ int isoburn_libjte_req(int *major, int *minor, int *micro); /** The minimum version of libburn to be used with this version of libisoburn at runtime. This is checked already in isoburn_initialize() which will refuse on outdated version. So this call is for information purposes after successful startup only. @since 0.1.0 @param major isoburn_libburn_req_major as seen at build time @param minor as seen at build time @param micro as seen at build time @return 1 success, <=0 might in future become an error indication */ int isoburn_libburn_req(int *major, int *minor, int *micro); /** These three release version numbers tell the revision of this header file and of the API it describes. They are memorized by applications at build time. @since 0.1.0 */ #define isoburn_header_version_major 1 #define isoburn_header_version_minor 5 #define isoburn_header_version_micro 4 /** Note: Above version numbers are also recorded in configure.ac because libtool wants them as parameters at build time. For the library compatibility check, ISOBURN_*_VERSION in configure.ac are not decisive. Only the three numbers here do matter. */ /** Usage discussion: Some developers of the libburnia project have differing opinions how to ensure the compatibility of libraries and applications. It is about whether to use at compile time and at runtime the version numbers isoburn_header_version_* provided here. Thomas Schmitt advises to use them. Vreixo Formoso advises to use other means. At compile time: Vreixo Formoso advises to leave proper version matching to properly programmed checks in the the application's build system, which will eventually refuse compilation. Thomas Schmitt advises to use the macros defined here for comparison with the application's requirements of library revisions and to eventually break compilation. Both advises are combinable. I.e. be master of your build system and have #if checks in the source code of your application, nevertheless. At runtime (via *_is_compatible()): Vreixo Formoso advises to compare the application's requirements of library revisions with the runtime library. This is to allow runtime libraries which are young enough for the application but too old for the lib*.h files seen at compile time. Thomas Schmitt advises to compare the header revisions defined here with the runtime library. This is to enforce a strictly monotonous chain of revisions from app to header to library, at the cost of excluding some older libraries. These two advises are mutually exclusive. ----------------------------------------------------- For an implementation of the Thomas Schmitt approach, see libisoburn/burn_wrap.c : isoburn_initialize() This connects libisoburn as "application" with libisofs as "library". The compatible part of Vreixo Formoso's approach is implemented in configure.ac LIBBURN_REQUIRED, LIBISOFS_REQUIRED. In isoburn_initialize() it would rather test by iso_lib_is_compatible(isoburn_libisofs_req_major,... than by iso_lib_is_compatible(iso_lib_header_version_major,... and would leave out the ugly compile time traps. */ /** Announce to the library an application provided method for immediate delivery of messages. It is used when no drive is affected directly or if the drive has no own msgs_submit() method attached by isoburn_drive_set_msgs_submit. If no method is preset or if the method is set to NULL then libisoburn delivers its messages through the message queue of libburn. @param msgs_submit The function call which implements the method @param submit_handle Handle to be used as first argument of msgs_submit @param submit_flag Flag to be used as last argument of msgs_submit @param flag Unused yet, submit 0 @since 0.2.0 */ int isoburn_set_msgs_submit(int (*msgs_submit)(void *handle, int error_code, char msg_text[], int os_errno, char severity[], int flag), void *submit_handle, int submit_flag, int flag); /** Acquire a target drive by its filesystem path or libburn persistent address. Wrapper for: burn_drive_scan_and_grab() @since 0.1.0 @param drive_infos On success returns a one element array with the drive (cdrom/burner). Thus use with driveno 0 only. On failure the array has no valid elements at all. The returned array should be freed via burn_drive_info_free() when the drive is no longer needed. But before this is done one has to call isoburn_drive_release(drive_infos[0].drive). @param adr The persistent address of the desired drive or the path to a file object. @param load 1 attempt to load the disc tray. 0 no attempt,rather failure. @return 1 = success , 0 = drive not found , <0 = other error */ int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[], char* adr, int load); /** Acquire a target drive by its filesystem path or libburn persistent address. This is a modern successor of isoburn_drive_scan_and_grab(). Wrapper for: burn_drive_scan_and_grab() @since 0.1.2 @param drive_infos On success returns a one element array with the drive (cdrom/burner). Thus use with driveno 0 only. On failure the array has no valid elements at all. The returned array should be freed via burn_drive_info_free() when the drive is no longer needed. But before this is done one has to call isoburn_drive_release(drive_infos[0].drive). @param adr The persistent address of the desired drive or the path to a file object. @param flag bit0= attempt to load the disc tray. Else: failure if not loaded. bit1= regard overwritable media as blank bit2= if the drive is a regular disk file: truncate it to the write start address when writing begins bit3= if the drive reports a read-only profile try to read table of content by scanning for ISO image headers. (depending on media type and drive this might help or it might make the resulting toc even worse) bit4= do not emulate table of content on overwritable media bit5= ignore ACL from external filesystems bit6= ignore POSIX Extended Attributes from external filesystems (xattr) bit7= pretend read-only profile and scan for table of content bit8= re-assess already acquired (*drive_infos)[0] rather than acquiring adr @since 1.1.8 bit9= when scanning for ISO 9660 sessions by bit3: Do not demand a valid superblock at LBA 0, ignore it in favor of one at LBA 32, and scan until end of medium. @since 1.2.6 bit10= if not bit6: accept all xattr namespaces from external filesystems, not only "user.". @since 1.5.0 @return 1 = success , 0 = drive not found , <0 = other error Please excuse the typo "aquire" in the function name. */ int isoburn_drive_aquire(struct burn_drive_info *drive_infos[], char* adr, int flag); /** Acquire a drive from the burn_drive_info[] array which was obtained by a previous call of burn_drive_scan(). Wrapper for: burn_drive_grab() @since 0.1.0 @param drive The drive to grab. E.g. drive_infos[1].drive . Call isoburn_drive_release(drive) when it it no longer needed. @param load 1 attempt to load the disc tray. 0 no attempt, rather failure. @return 1 success, <=0 failure */ int isoburn_drive_grab(struct burn_drive *drive, int load); /** Attach to a drive an application provided method for immediate delivery of messages. If no method is set or if the method is set to NULL then libisoburn delivers messages of the drive through the global msgs_submit() method set by isoburn_set_msgs_submiti() or by the message queue of libburn. @since 0.2.0 @param d The drive to which this function, handle and flag shall apply @param msgs_submit The function call which implements the method @param submit_handle Handle to be used as first argument of msgs_submit @param submit_flag Flag to be used as last argument of msgs_submit @param flag Unused yet, submit 0 */ int isoburn_drive_set_msgs_submit(struct burn_drive *d, int (*msgs_submit)(void *handle, int error_code, char msg_text[], int os_errno, char severity[], int flag), void *submit_handle, int submit_flag, int flag); /** Inquire the medium status. Expect the whole spectrum of libburn BURN_DISC_* with multi-session media. Emulated states with random access media are BURN_DISC_BLANK and BURN_DISC_APPENDABLE. Wrapper for: burn_disc_get_status() @since 0.1.0 @param drive The drive to inquire. @return The status of the drive, or what kind of disc is in it. Note: BURN_DISC_UNGRABBED indicates wrong API usage */ #ifdef __cplusplus enum burn::burn_disc_status isoburn_disc_get_status(struct burn_drive *drive); #else enum burn_disc_status isoburn_disc_get_status(struct burn_drive *drive); #endif /** Sets the medium status to BURN_DISC_FULL unconditionally. @since 1.3.8 @param drive The drive with the medium to be handled as if it was closed. @ */ int isoburn_disc_pretend_full_uncond(struct burn_drive *drive); /** Tells whether the medium can be treated by isoburn_disc_erase(). Wrapper for: burn_disc_erasable() @since 0.1.0 @param d The drive to inquire. @return 0=not erasable , else erasable */ int isoburn_disc_erasable(struct burn_drive *d); /** Mark the medium as blank. With multi-session media this will call burn_disc_erase(). With random access media, an eventual ISO-9660 filesystem will get invalidated by altering its start blocks on the medium. In case of success, the medium is in status BURN_DISC_BLANK afterwards. Wrapper for: burn_disc_erase() @since 0.1.0 @param drive The drive with the medium to erase. @param fast 1=fast erase, 0=thorough erase With DVD-RW, fast erase yields media incapable of multi-session. */ void isoburn_disc_erase(struct burn_drive *drive, int fast); /** Set up isoburn_disc_get_msc1() to return a fabricated value. This makes only sense between acquiring the drive and reading the image. After isoburn_read_image() it will confuse the coordination of libisoburn and libisofs. Note: Sessions and tracks are counted beginning with 1, not with 0. @since 0.1.6 @param d The drive where msc1 is to be set @param adr_mode Determines how to interpret adr_value and to set msc1. If adr_value shall represent a number then decimal ASCII digits are expected. 0= start lba of last session in TOC, ignore adr_value 1= start lba of session number given by adr_value 2= start lba of track number given by adr_value 3= adr_value itself is the lba to be used 4= start lba of last session with volume id given by adr_value @param adr_value A string describing the value to be eventually used. @param flag Bitfield for control purposes. bit0= @since 0.2.2 with adr_mode 3: adr_value might be 16 blocks too high (e.g. -C stemming from growisofs). Probe for ISO head at adr_value-16 and eventually adjust setting. bit1= insist in seeing a disc object with at least one session bit2= with adr_mode 4: use adr_value as regular expression */ int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value, int flag); /* ----------------------------------------------------------------------- */ /* Wrappers for emulation of TOC on overwritable media Media which match the overwritable usage model lack of a history of sessions and tracks. libburn will not even hand out a burn_disc object for them and always declare them blank. libisoburn checks for a valid ISO filesystem header at LBA 0 and eventually declares them appendable. Nevertheless one can only determine an upper limit of the size of the overall image (by isoburn_get_min_start_byte()) but not a list of stored sessions and their LBAs, as it is possible with true multi-session media. The following wrappers add the capability to obtain a session and track TOC from emulated multi-session images on overwritables if the first session was written by libisoburn-0.1.6 or later (i.e. with a header copy at LBA 32). Be aware that the structs emitted by these isoburn calls are not compatible with the libburn structs. I.e. you may use them only with isoburn_toc_* calls. isoburn_toc_disc needs to be freed after use. isoburn_toc_session and isoburn_toc_track vanish together with their isoburn_toc_disc. */ /* Opaque handles to media, session, track */ struct isoburn_toc_disc; struct isoburn_toc_session; struct isoburn_toc_track; /** Obtain a master handle for the table of content. This handle governs allocated resources which have to be released by isoburn_toc_disc_free() when no longer needed. Wrapper for: burn_drive_get_disc() @since 0.1.6 @param d The drive with the medium to inspect @return NULL in case there is no content info, else it is a valid handle */ struct isoburn_toc_disc *isoburn_toc_drive_get_disc(struct burn_drive *d); /** Tell the number of 2048 byte blocks covered by the table of content. This number includes the eventual gaps between sessions and tracks. So this call is not really a wrapper for burn_disc_get_sectors(). @since 0.1.6 @param disc The master handle of the medium @return Number of blocks, <=0 indicates unknown or unreadable state */ int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc); /** Get the array of session handles and the number of complete sessions from the table of content. The result array contains *num + isoburn_toc_disc_get_incmpl_sess() elements. All above *num are incomplete sessions. Typically there is at most one incomplete session with no track. Wrapper for: burn_disc_get_sessions() @since 0.1.6 @param disc The master handle of the medium @param num returns the number of sessions in the array @return the address of the array of session handles */ struct isoburn_toc_session **isoburn_toc_disc_get_sessions( struct isoburn_toc_disc *disc, int *num); /** Obtain the number of incomplete sessions which are recorded in the result array of isoburn_toc_disc_get_sessions() after the complete sessions. See above. @since 1.2.8 @param disc The master handle of the medium @return the number of incomplete sessions */ int isoburn_toc_disc_get_incmpl_sess(struct isoburn_toc_disc *disc); /** Tell the number of 2048 byte blocks covered by a particular session. Wrapper for: burn_session_get_sectors() @since 0.1.6 @param s The session handle @return number of blocks, <=0 indicates unknown or unreadable state */ int isoburn_toc_session_get_sectors(struct isoburn_toc_session *s); /** Obtain a copy of the entry which describes the end of a particular session. Wrapper for: burn_session_get_leadout_entry() @since 0.1.6 @param s The session handle @param entry A pointer to memory provided by the caller. It will be filled with info according to struct burn_toc_entry as defined in libburn.h */ void isoburn_toc_session_get_leadout_entry(struct isoburn_toc_session *s, struct burn_toc_entry *entry); /** Get the array of track handles from a particular session. Wrapper for: burn_session_get_tracks() @since 0.1.6 @param s The session handle @param num returns the number of tracks in the array @return the address of the array of track handles, NULL if no tracks are registered with session s */ struct isoburn_toc_track **isoburn_toc_session_get_tracks( struct isoburn_toc_session *s, int *num); /** Obtain a copy of the entry which describes a particular track. Wrapper for: burn_track_get_entry() @since 0.1.6 @param t The track handle @param entry A pointer to memory provided by the caller. It will be filled with info according to struct burn_toc_entry as defined in libburn.h */ void isoburn_toc_track_get_entry(struct isoburn_toc_track *t, struct burn_toc_entry *entry); /** Obtain eventual ISO image parameters of an emulated track. This info was gained with much effort and thus gets cached in the track object. If this call returns 1 then one can save a call of isoburn_read_iso_head() with return mode 1 which could cause an expensive read operation. @since 0.4.0 @param t The track handle @param start_lba Returns the start address of the ISO session @param image_blocks Returns the number of 2048 bytes blocks @param volid Caller provided memory for the volume id @param flag unused yet, submit 0 @return 0= not an emulated ISO session , 1= reply is valid */ int isoburn_toc_track_get_emul(struct isoburn_toc_track *t, int *start_lba, int *image_blocks, char volid[33], int flag); /** Release the memory associated with a master handle of a medium. The handle is invalid afterwards and may not be used any more. Wrapper for: burn_disc_free() @since 0.1.6 @param disc The master handle of the medium */ void isoburn_toc_disc_free(struct isoburn_toc_disc *disc); /** Try whether the data at the given address look like a ISO 9660 image header and obtain its alleged size. Depending on the info mode one other string of text information can be retrieved too. @since 0.1.6 @param d The drive with the medium to inspect @param lba The block number from where to read @param image_blocks Returns the number of 2048 bytes blocks in the session @param info Caller provided memory, enough to take possible info reply @param flag bit0-7: info return mode 0= do not return anything in info (do not even touch it) 1= copy volume id to info (info needs 33 bytes) 2= @since 0.2.2 : copy 64 kB header to info (needs 65536 bytes) bit13= @since 0.2.2: Do not read head from medium but use first 64 kB from info. In this case it is permissible to submit d == NULL. bit14= check both half buffers (not only second) return 2 if found in first block bit15= return -1 on read error @return >0 seems to be a valid ISO image, 0 format not recognized, <0 error */ int isoburn_read_iso_head(struct burn_drive *d, int lba, int *image_blocks, char *info, int flag); /** Try to convert the given entity address into various entity addresses which would describe it. Note: Sessions and tracks are counted beginning with 1, not with 0. @since 0.3.2 @param d The drive where msc1 is to be set @param adr_mode Determines how to interpret the input adr_value. If adr_value shall represent a number then decimal ASCII digits are expected. 0= start lba of last session in TOC, ignore adr_value 1= start lba of session number given by adr_value 2= start lba of track given number by adr_value 3= adr_value itself is the lba to be used 4= start lba of last session with volume id given by adr_value @param adr_value A string describing the value to be eventually used. @param lba returns the block address of the entity, -1 means invalid @param track returns the track number of the entity, -1 means invalid @param session returns the session number of the entity, -1 means invalid @param volid returns the volume id of the entity if it is a ISO session @param flag Bitfield for control purposes. bit2= with adr_mode 4: use adr_value as regular expression @return <=0 error , 1 ok, ISO session, 2 ok, not an ISO session */ int isoburn_get_mount_params(struct burn_drive *d, int adr_mode, char *adr_value, int *lba, int *track, int *session, char volid[33], int flag); /* ----------------------------------------------------------------------- */ /* Options for image reading. An application shall create an option set object by isoburn_ropt_new(), program it by isoburn_ropt_set_*(), use it with isoburn_read_image(), and finally delete it by isoburn_ropt_destroy(). */ /* ----------------------------------------------------------------------- */ struct isoburn_read_opts; /** Produces a set of image read options, initialized with default values. @since 0.1.0 @param o the newly created option set object @param flag Bitfield for control purposes. Submit 0 for now. @return 1=ok , <0 = failure */ int isoburn_ropt_new(struct isoburn_read_opts **o, int flag); /** Deletes an option set which was created by isoburn_ropt_new(). @since 0.1.0 @param o The option set to work on @param flag Bitfield for control purposes. Submit 0 for now. @return 1= **o destroyed , 0= *o was already NULL (harmless) */ int isoburn_ropt_destroy(struct isoburn_read_opts **o, int flag); /** Sets the size and granularity of the cache which libisoburn provides to libisofs for reading of ISO image data. This cache consists of several tiles which are buffers of a given size. The ISO image is divided into virtual tiles of that size. A cache tile may hold an in-memory copy of such a virtual image tile. When libisofs requests to read a block, then first the cache is inquired whether it holds that block. If not, then the block is read via libburn together with its neighbors in their virtual image tile into a free cache tile. If no cache tile is free, then the one will be re-used which has the longest time of not being hit by a read attempt. A larger cache might speed up image loading by reducing the number of libburn read calls on the directory tree. It might also help with reading the content of many small files, if for some reason it is not an option to sort access by LBA. Caching will not provide much benefit with libburn "stdio:" drives, because the operating system is supposed to provide the same speed-up in a more flexible way. @since 1.2.2 @param o The option set to work on. It is permissible to submit NULL in order to just have the parameters tested. @param cache_tiles Number of tiles in the cache. Not less than 1. Default is 32. @param tile_blocks Number of blocks per tile. Must be a power of 2. Default is 32. cache_tiles * tile_blocks * 2048 must not exceed 1073741824 (= 1 GiB). @param flag Bitfield for control purposes. Unused yet. Submit 0. @return <=0 error , >0 ok */ int isoburn_ropt_set_data_cache(struct isoburn_read_opts *o, int cache_tiles, int tile_blocks, int flag); /** Inquire the current settings of isoburn_set_data_cache(). @since 1.2.2 @param o The option set to work on. NULL has the same effect as flag bit0. @param cache_tiles Will return the number of tiles in the cache. @param tile_blocks Will return the number of blocks per tile. @param set_flag Will return control bits. None are defined yet. @param flag Bitfield for control purposes bit0= return default values rather than current ones @return <=0 error , >0 reply is valid */ int isoburn_ropt_get_data_cache(struct isoburn_read_opts *o, int *cache_tiles, int *tile_blocks, int *set_flag, int flag); /** Which existing ISO 9660 extensions in the image to read or not to read. Whether to read the content of an existing image at all. The bits can be combined by | and inquired by &. @since 0.1.0 @param ext Bitfield: bit0= norock Do not read Rock Ridge extensions bit1= nojoliet Do not read Joliet extensions bit2= noiso1999 Do not read ISO 9660:1999 enhanced tree bit3= preferjoliet When both Joliet and RR extensions are present, the RR tree is used. If you prefer using Joliet, set this to 1. bit4= pretend_blank Always create empty image.Ignore any image on input drive. bit5= noaaip @since 0.3.4 Do not load AAIP information from image. This information eventually contains ACL or XFS-style Extended Attributes. bit6= noacl @since 0.3.4 Do not obtain ACL from external filesystem objects (e.g. local filesystem files). bit7= noea @since 0.3.4 Do not obtain XFS-style Extended Attributes from external filesystem objects (e.g. local filesystem files). bit8= noino @since 0.4.0 Do not load eventual inode numbers from RRIP entry PX, but generate a new unique inode number for each imported IsoNode object. PX inode numbers mark families of hardlinks by giving all family members the same inode number. libisofs keeps the PX inode numbers unaltered when IsoNode objects get written into an ISO image. bit9= nomd5 @since 0.4.2 Do not load the possibly present MD5 checksum array. Do not check possibly present session_md5 tags. bit10= nomd5tag @since 1.0.4 Do not check session_md5 tags although bit9 is not set. bit11= do_ecma119_map @since 1.4.2 Set iso_read_opts_set_ecma119_map() to map_mode rather than relying on the default setting of libisofs. bit12 - bit13= map_mode @since 1.4.2 How to convert file names if neither Rock Ridge nor Joliet names are present and acceptable. 0 = unmapped: Take name as recorded in ECMA-119 directory record (not suitable for writing them to a new ISO filesystem) 1 = stripped: Like unmapped, but strip off trailing ";1" or ".;1" 2 = uppercase: Like stripped, but map {a-z} to {A-Z} 3 = lowercase: Like stripped, but map {A-Z} to {a-z} bit14= do_joliet_map @since 1.5.4 Set iso_read_opts_set_joliet_map() to joliet_map_mode rather than relying on the default setting of libisofs. bit15= joliet_map_mode @since 1.5.4 How to convert Joliet file names. 0 = unmapped: Take name as recorded in Joliet directory record (not suitable for writing them to a new ISO filesystem) 1 = stripped: strip off trailing ";1" or ".;1" @return 1 success, <=0 failure */ #define isoburn_ropt_norock 1 #define isoburn_ropt_nojoliet 2 #define isoburn_ropt_noiso1999 4 #define isoburn_ropt_preferjoliet 8 #define isoburn_ropt_pretend_blank 16 #define isoburn_ropt_noaaip 32 #define isoburn_ropt_noacl 64 #define isoburn_ropt_noea 128 #define isoburn_ropt_noino 256 #define isoburn_ropt_nomd5 512 #define isoburn_ropt_nomd5tag 1024 #define isoburn_ropt_map_unmapped ( 2048 | 0 ) #define isoburn_ropt_map_stripped ( 2048 | 4096 ) #define isoburn_ropt_map_uppercase ( 2048 | 8192 ) #define isoburn_ropt_map_lowercase ( 2048 | 12288 ) #define isoburn_ropt_joliet_unmapped ( 16384 | 0) #define isoburn_ropt_joliet_stripped ( 16384 | 32768) int isoburn_ropt_set_extensions(struct isoburn_read_opts *o, int ext); int isoburn_ropt_get_extensions(struct isoburn_read_opts *o, int *ext); /** Default attributes to use if no RockRidge extension gets loaded. @since 0.1.0 @param o The option set to work on @param uid user id number (see /etc/passwd) @param gid group id number (see /etc/group) @param mode permissions (not file type) as of man 2 stat. With directories, r-permissions will automatically imply x-permissions. See isoburn_ropt_set_default_dirperms() below. @return 1 success, <=0 failure */ int isoburn_ropt_set_default_perms(struct isoburn_read_opts *o, uid_t uid, gid_t gid, mode_t mode); int isoburn_ropt_get_default_perms(struct isoburn_read_opts *o, uid_t *uid, gid_t *gid, mode_t *mode); /** Default attributes to use on directories if no RockRidge extension gets loaded. Above call isoburn_ropt_set_default_perms() automatically adds x-permissions to r-permissions for directories. This call here may be done afterwards to set independent permissions for directories, especially to override the automatically added x-permissions. @since 0.1.0 @param o The option set to work on @param mode permissions (not file type) as of man 2 stat. @return 1 success, <=0 failure */ int isoburn_ropt_set_default_dirperms(struct isoburn_read_opts *o, mode_t mode); int isoburn_ropt_get_default_dirperms(struct isoburn_read_opts *o, mode_t *mode); /** Set the character set for reading RR file names from ISO images. @since 0.1.0 @param o The option set to work on @param input_charset Set this to NULL to use the default locale charset For selecting a particular character set, submit its name, e.g. as listed by program iconv -l. Example: "UTF-8". @return 1 success, <=0 failure */ int isoburn_ropt_set_input_charset(struct isoburn_read_opts *o, char *input_charset); int isoburn_ropt_get_input_charset(struct isoburn_read_opts *o, char **input_charset); /** Enable or disable methods to automatically choose an input charset. This eventually overrides the name set via isoburn_ropt_set_input_charset() @since 0.3.8 @param o The option set to work on @param mode Bitfield for control purposes: bit0= set the input character set automatically from attribute "isofs.cs" of root directory. Submit any other bits with value 0. @return 1 success, <=0 failure */ int isoburn_ropt_set_auto_incharset(struct isoburn_read_opts *o, int mode); int isoburn_ropt_get_auto_incharset(struct isoburn_read_opts *o, int *mode); /** Control an offset to be applied to all block address pointers in the ISO image in order to compensate for an eventual displacement of the image relative to the start block address for which it was produced. E.g. if track number 2 from CD gets copied into a disk file and shall then be loaded as ISO filesystem, then the directory tree and all data file content of the track copy will become readable by setting the track start address as displacement and -1 as displacement_sign. Data file content outside the track will of course not be accessible and eventually produce read errors. @since 0.6.6 @param o The option set to work on @param displacement 0 or a positive number @param displacement_sign Determines whether to add or subtract displacement to block addresses before applying them to the storage object for reading: +1 = add , -1= subtract , else keep unaltered */ int isoburn_ropt_set_displacement(struct isoburn_read_opts *o, uint32_t displacement, int displacement_sign); int isoburn_ropt_get_displacement(struct isoburn_read_opts *o, uint32_t *displacement, int *displacement_sign); /* If you get here because of a compilation error like /usr/include/libisoburn/libisoburn.h:895: error: expected declaration specifiers or '...' before 'uint32_t' then see above paragraph "Application Constraints" about the definition of uint32_t. */ /** Set the name truncation mode and the maximum name length for imported file objects. @since 1.4.2 @param o The option set to work on @param mode 0= Do not truncate but throw error ISO_RR_NAME_TOO_LONG if a file name is longer than parameter length. 1= Truncate to length and overwrite the last 32 bytes of that length by the hex representation of the MD5 of the whole oversized name. Potential incomplete UTF-8 characters will get their leading bytes replaced by '_'. This is the default. @param length Maximum byte count of a file name. Permissible values are 64 to 255. Default is 255. */ int isoburn_ropt_set_truncate_mode(struct isoburn_read_opts *o, int mode, int length); int isoburn_ropt_get_truncate_mode(struct isoburn_read_opts *o, int *mode, int *length); /** After calling function isoburn_read_image() there are information available in the option set about the size and the available extra trees and extensions in the ISO filesystem. This info can be obtained as bits in parameter has_what. Like: joliet_available = (has_what & isoburn_ropt_has_joliet); @since 0.1.0 @param o The option set to work on @param size Number of image data blocks, 2048 bytes each. @param has_what Bitfield: bit0= has_rockridge RockRidge extension info is available in the ISO 9660 tree (POSIX filesystem) bit1= has_joliet Joliet tree is available (suitable for MS-Windows) bit2= has_iso1999 ISO version 2 Enhanced Volume Descriptor aka ISO 9660:1999 and its tree is available. This is rather exotic. bit3= has_el_torito El-Torito boot record is present @return 1 success, <=0 failure */ #define isoburn_ropt_has_rockridge 1 #define isoburn_ropt_has_joliet 2 #define isoburn_ropt_has_iso1999 4 #define isoburn_ropt_has_el_torito 8 int isoburn_ropt_get_size_what(struct isoburn_read_opts *o, uint32_t *size, int *has_what); /* ts A90122 */ /* >>> to be implemented: #define isoburn_ropt_has_acl 64 #define isoburn_ropt_has_ea 128 */ /** After calling function isoburn_read_image() there are information available in the option set about which tree was used for image loading and whether Rock Ridge information was actually used. @since 1.5.4 @param o The option set to work on @param tree The tree which was loaded: 0= ISO 9660 , 1 = Joliet , 2 = ISO 9660:1999 @param rr 1= Rock Ridge information was used, 0 = No Rock Ridge was used @return 1 success, <=0 failure */ int isoburn_ropt_get_tree_loaded(struct isoburn_read_opts *o, int *tree, int *rr); /* ----------------------------------------------------------------------- */ /* End of Options for image reading */ /* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */ /* Options for image generation by libisofs and image transport to libburn. An application shall create an option set by isoburn_igopt_new(), program it by isoburn_igopt_set_*(), use it with either isoburn_prepare_new_image() or isoburn_prepare_disc(), and finally delete it by isoburn_igopt_destroy(). */ /* ----------------------------------------------------------------------- */ struct isoburn_imgen_opts; /** Produces a set of generation and transfer options, initialized with default values. @since 0.1.0 @param o the newly created option set object @param flag Bitfield for control purposes. Submit 0 for now. @return 1=ok , <0 = failure */ int isoburn_igopt_new(struct isoburn_imgen_opts **o, int flag); /** Deletes an option set which was created by isoburn_igopt_new(). @since 0.1.0 @param o The option set to give up @param flag Bitfield for control purposes. Submit 0 for now. @return 1= **o destroyed , 0= *o was already NULL (harmless) */ int isoburn_igopt_destroy(struct isoburn_imgen_opts **o, int flag); /** ISO level to write at. @since 0.1.0 @param o The option set to work on @param level is a term of the ISO 9660 standard. It should be one of: 1= filenames restricted to form 8.3 2= filenames allowed up to 31 characters 3= file content may be larger than 4 GB - 1. @return 1 success, <=0 failure */ int isoburn_igopt_set_level(struct isoburn_imgen_opts *o, int level); int isoburn_igopt_get_level(struct isoburn_imgen_opts *o, int *level); /** Which extensions to support. @since 0.1.0 @param o The option set to work on @param ext Bitfield: bit0= rockridge Rock Ridge extensions add POSIX file attributes like owner, group, access permissions, long filenames. Very advisable if the designed audience has Unix style systems. bit1= joliet Longer filenames for Windows systems. Weaker than RockRidge, but also readable with GNU/Linux. bit2= iso1999 This is rather exotic. Better do not surprise the readers. bit3= hardlinks Enable hardlink consolidation. IsoNodes which refer to the same source object and have the same properties will get the same ISO image inode numbers. If combined with isoburn_igopt_rrip_version_1_10 below, then the PX entry layout of RRIP-1.12 will be used within RRIP-1.10 (mkisofs does this without causing visible trouble). bit5= aaip The libisofs specific SUSP based extension of ECMA-119 which can encode ACL and XFS-style Extended Attributes. bit6= session_md5 @since 0.4.2 Produce and write MD5 checksum tags of superblock, directory tree, and the whole session stream. bit7= file_md5 @since 0.4.2 Produce and write MD5 checksums for each single IsoFile. bit8= file_stability (only together with file_md5) @since 0.4.2 Compute MD5 of each file before copying it into the image and compare this with the MD5 of the actual copying. If they do not match then issue MISHAP event. See also libisofs.h iso_write_opts_set_record_md5() bit9= no_emul_toc @since 0.5.8 On overwritable media or random access files do not write the first session to LBA 32 and do not copy the first 64kB of the first session to LBA 0, but rather write the first session to LBA 0 directly. bit10= will_cancel @since 0.6.6 Announce to libisofs that only the image size is desired and that the write thread will be cancelled by isoburn_cancel_prepared_write() before actual image writing occurs. Without this, cancellation can cause a MISHAP event. bit11= old_empty @since 1.0.2 Let symbolic links and device files point to block 0, and let empty data files point to the address of the Volume Descriptor Set Terminator. This was done by libisofs in the past. By default there is now a single dedicated block of zero bytes after the end of the directory trees, of which the address is used for all files without own content. bit12= hfsplus @since 1.2.4 Produce a HFS+ partition inside the ISO image and announce it by an Apple Partition Map in the System Area. >>> GPT production ? Caution: Interferes with isoburn_igopt_set_system_area() by overwriting the first 8 bytes of the data, and several blocks of 2 KiB after the first one. bit13= fat @since 1.2.4 >>> Not yet implemented. Planned to co-exist with hfsplus. Produce a FAT32 partition inside the ISO image and announce it by an MBR partition entry in the System Area. Caution: Interferes with isoburn_igopt_set_system_area() by >>> what impact ? @return 1 success, <=0 failure */ #define isoburn_igopt_rockridge 1 #define isoburn_igopt_joliet 2 #define isoburn_igopt_iso1999 4 #define isoburn_igopt_hardlinks 8 #define isoburn_igopt_aaip 32 #define isoburn_igopt_session_md5 64 #define isoburn_igopt_file_md5 128 #define isoburn_igopt_file_stability 256 #define isoburn_igopt_no_emul_toc 512 #define isoburn_igopt_will_cancel 1024 #define isoburn_igopt_old_empty 2048 #define isoburn_igopt_hfsplus 4096 #define isoburn_igopt_fat 8192 int isoburn_igopt_set_extensions(struct isoburn_imgen_opts *o, int ext); int isoburn_igopt_get_extensions(struct isoburn_imgen_opts *o, int *ext); /** Relaxed constraints. Setting any of the bits to 1 break the specifications, but it is supposed to work on most moderns systems. Use with caution. @since 0.1.0 @param o The option set to work on @param relax Bitfield: bit0= omit_version_numbers Omit the version number (";1") at the end of the ISO-9660 and Joliet identifiers. Version numbers are usually not used by readers. bit1= allow_deep_paths Allow ISO-9660 directory hierarchy to be deeper than 8 levels. bit2= allow_longer_paths Allow path in the ISO-9660 tree to have more than 255 characters. bit3= max_37_char_filenames Allow a single file or directory hierarchy to have up to 37 characters. This is larger than the 31 characters allowed by ISO level 2, and the extra space is taken from the version number, so this also forces omit_version_numbers. bit4= no_force_dots ISO-9660 forces filenames to have a ".", that separates file name from extension. libisofs adds it if original filename has none. Set this to 1 to prevent this behavior. bit5= allow_lowercase Allow lowercase characters in ISO-9660 filenames. By default, only uppercase characters, numbers and a few other characters are allowed. bit6= allow_full_ascii Allow all ASCII characters to be appear on an ISO-9660 filename. Note that "/" and "\0" characters are never allowed, even in RR names. bit7= joliet_longer_paths Allow paths in the Joliet tree to have more than 240 characters. bit8= always_gmt Write timestamps as GMT although the specs prescribe local time with eventual non-zero timezone offset. Negative timezones (west of GMT) can trigger bugs in some operating systems which typically appear in mounted ISO images as if the timezone shift from GMT was applied twice (e.g. in New York 22:36 becomes 17:36). bit9= rrip_version_1_10 Write Rock Ridge info as of specification RRIP-1.10 rather than RRIP-1.12: signature "RRIP_1991A" rather than "IEEE_1282", field PX without file serial number. bit10= dir_rec_mtime Store as ECMA-119 Directory Record timestamp the mtime of the source rather than the image creation time. bit11= aaip_susp_1_10 Write AAIP fields without announcing AAIP by an ER field and without distinguishing RRIP fields from the AAIP field by prefixed ES fields. This saves 5 to 10 bytes per file and might avoid problems with readers which only accept RRIP. SUSP-1.10 allows it, SUSP-1.12 frowns on it. bit12= only_iso_numbers Same as bit1 omit_version_number but restricted to the names in the eventual Joliet tree. @since 0.5.4 For reasons of backward compatibility it is not possible yet to disable version numbers for ISO 9660 while enabling them for Joliet. bit13= no_j_force_dots Same as no_force_dots but affecting the names in the eventual Joliet tree rather than the ISO 9660 / ECMA-119 names. @since 0.5.4 Previous versions added dots to Joliet names unconditionally. bit14= allow_dir_id_ext 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 obviously do this violation.) @since 1.0.0 bit15= joliet_long_names Allow for Joliet leaf names up to 103 characters rather than up to 64. @since 1.0.6 bit16= joliet_rec_mtime Like dir_rec_mtime, but for the Joliet tree. @since 1.2.0 bit17= iso1999_rec_mtime Like dir_rec_mtime, but for the ISO 9660:1999 tree. @since 1.2.0 bit18= allow_7bit_ascii 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. bit19= joliet_utf16 Encode Joliet names by character set UTF-16BE rather than UCS-2. The difference is with characters which are not present in UCS-2 and get encoded in UTF-16 by 2 words of 16 bit each. Both words then stem from a reserved subset of UCS-2. @since 1.3.6 @return 1 success, <=0 failure */ #define isoburn_igopt_omit_version_numbers 1 #define isoburn_igopt_allow_deep_paths 2 #define isoburn_igopt_allow_longer_paths 4 #define isoburn_igopt_max_37_char_filenames 8 #define isoburn_igopt_no_force_dots 16 #define isoburn_igopt_allow_lowercase 32 #define isoburn_igopt_allow_full_ascii 64 #define isoburn_igopt_joliet_longer_paths 128 #define isoburn_igopt_always_gmt 256 #define isoburn_igopt_rrip_version_1_10 512 #define isoburn_igopt_dir_rec_mtime 1024 #define isoburn_igopt_aaip_susp_1_10 2048 #define isoburn_igopt_only_iso_versions 4096 #define isoburn_igopt_no_j_force_dots 8192 #define isoburn_igopt_allow_dir_id_ext 16384 #define isoburn_igopt_joliet_long_names 32768 #define isoburn_igopt_joliet_rec_mtime 0x10000 #define isoburn_igopt_iso1999_rec_mtime 0x20000 #define isoburn_igopt_allow_7bit_ascii 0x40000 #define isoburn_igopt_joliet_utf16 0x80000 int isoburn_igopt_set_relaxed(struct isoburn_imgen_opts *o, int relax); int isoburn_igopt_get_relaxed(struct isoburn_imgen_opts *o, int *relax); /** If not isoburn_igopt_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. Wrapper for: iso_write_opts_set_rr_reloc() @since 1.2.2 @param o The option set to work on @param name The name of the relocation directory in the root directory. Do not prepend "/". An empty name or NULL will direct relocated directories into the root directory. This is the default. If the given name does not exist in the root directory when isoburn_disc_write() is called, and if there are directories at path level 8, then directory /name will be created automatically. @param flags Bitfield for control purposes. bit0= Mark the relocation directory by a Rock Ridge RE entry, if it gets created during isoburn_disc_write(). This will make it invisible for most Rock Ridge readers. bit1= not settable via API (used internally) @return > 0 success, <= 0 failure */ int isoburn_igopt_set_rr_reloc(struct isoburn_imgen_opts *o, char *name, int flags); /** Obtain the settings of isoburn_igopt_set_rr_reloc(). @since 1.2.2 @param o The option set to work on @param name Will return NULL or a pointer to the name of the relocation directory in the root directory. Do not alter or dispose the memory which holds this name. @param flags Will return the flags bitfield. @return > 0 success, <= 0 failure */ int isoburn_igopt_get_rr_reloc(struct isoburn_imgen_opts *o, char **name, int *flags); /** Caution: This option breaks any assumptions about names that are supported by ECMA-119 specifications. Try to 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_full_ascii. Further it prevents the conversion from local character set to ASCII. The maximum name length is given by this call. If a filename exceeds this length or cannot be recorded untranslated for other reasons, then image production gets aborted. Currently the length limit is 96 characters, because an ECMA-119 directory record may at most have 254 bytes and up to 158 other bytes must fit into the record. Probably 96 more bytes can be made free for the name in future. @since 1.0.0 @param o The option set to work on @param len 0 = disable this feature and perform name translation according to other settings. >0 = Omit any translation. Eventually abort image production if a name is longer than the given value. -1 = Like >0. Allow maximum possible length. isoburn_igopt_get_untranslated_name_len() will tell the effectively resulting value. @return >0 success, <=0 failure */ int isoburn_igopt_set_untranslated_name_len(struct isoburn_imgen_opts *o, int len); int isoburn_igopt_get_untranslated_name_len(struct isoburn_imgen_opts *o, int *len); /** Whether and how files should be sorted. @since 0.1.0 @param o The option set to work on @param value Bitfield: bit0= sort_files_by_weight files should be sorted based on their weight. Weight is attributed to files in the image by libisofs call iso_node_set_sort_weight(). @return 1 success, <=0 failure */ #define isoburn_igopt_sort_files_by_weight 1 int isoburn_igopt_set_sort_files(struct isoburn_imgen_opts *o, int value); int isoburn_igopt_get_sort_files(struct isoburn_imgen_opts *o, int *value); /** Set the override values for files and directory permissions. The parameters replace_* these take one of three values: 0, 1 or 2. If 0, the corresponding attribute will be kept as set in the IsoNode at the time of image generation. If set to 1, the corresponding attrib. will be changed by a default suitable value. With value 2, the attrib. will be changed with the value specified in the corresponding *_mode options. Note that only the permissions are set, the file type remains unchanged. @since 0.1.0 @param o The option set to work on @param replace_dir_mode whether and how to override directories @param replace_file_mode whether and how to override files of other type @param dir_mode Mode to use on dirs with replace_dir_mode == 2. @param file_mode; Mode to use on files with replace_file_mode == 2. @return 1 success, <=0 failure */ int isoburn_igopt_set_over_mode(struct isoburn_imgen_opts *o, int replace_dir_mode, int replace_file_mode, mode_t dir_mode, mode_t file_mode); int isoburn_igopt_get_over_mode(struct isoburn_imgen_opts *o, int *replace_dir_mode, int *replace_file_mode, mode_t *dir_mode, mode_t *file_mode); /** Set the override values values for group id and user id. The rules are like with above overriding of mode values. replace_* controls whether and how. The other two parameters provide values for eventual use. @since 0.1.0 @param o The option set to work on @param replace_uid whether and how to override user ids @param replace_gid whether and how to override group ids @param uid User id to use with replace_uid == 2. @param gid Group id to use on files with replace_gid == 2. @return 1 success, <=0 failure */ int isoburn_igopt_set_over_ugid(struct isoburn_imgen_opts *o, int replace_uid, int replace_gid, uid_t uid, gid_t gid); int isoburn_igopt_get_over_ugid(struct isoburn_imgen_opts *o, int *replace_uid, int *replace_gid, uid_t *uid, gid_t *gid); /** Set the character set to use for representing RR filenames in the image. @since 0.1.0 @param o The option set to work on @param output_charset Set this to NULL to use the default output charset. For selecting a particular character set, submit its name, e.g. as listed by program iconv -l. Example: "UTF-8". @return 1 success, <=0 failure */ int isoburn_igopt_set_out_charset(struct isoburn_imgen_opts *o, char *output_charset); int isoburn_igopt_get_out_charset(struct isoburn_imgen_opts *o, char **output_charset); /** The number of bytes to be used for the fifo which decouples libisofs and libburn for better throughput and for reducing the risk of interrupting signals hitting the libburn thread which operates the MMC drive. The size will be rounded up to the next full 2048. Minimum is 64kiB, maximum is 1 GiB (but that is too much anyway). @since 0.1.0 @param o The option set to work on @param fifo_size Number of bytes to use @return 1 success, <=0 failure */ int isoburn_igopt_set_fifo_size(struct isoburn_imgen_opts *o, int fifo_size); int isoburn_igopt_get_fifo_size(struct isoburn_imgen_opts *o, int *fifo_size); /** Obtain after image preparation the block address where the session will start on the medium. This value cannot be set by the application but only be inquired. @since 0.1.4 @param o The option set to work on @param lba The block number of the session start on the medium. <0 means that no address has been determined yet. @return 1 success, <=0 failure */ int isoburn_igopt_get_effective_lba(struct isoburn_imgen_opts *o, int *lba); /** Obtain after image preparation the lowest block address of file content data. Failure can occur if libisofs is too old to provide this information, if the result exceeds 31 bit, or if the call is made before image preparation. This value cannot be set by the application but only be inquired. @since 0.3.6 @param o The option set to work on @param lba The block number of the session start on the medium. <0 means that no address has been determined yet. @return 1 success, <=0 failure */ int isoburn_igopt_get_data_start(struct isoburn_imgen_opts *o, int *lba); /** Set or get parameters "name" and "timestamp" for a scdbackup checksum tag. It will be appended to the libisofs session tag if the image starts at LBA 0. See isoburn_disc_track_lba_nwa. The scdbackup tag can be used to verify the image by command scdbackup_verify $device -auto_end. See scdbackup/README appendix VERIFY for its inner details. @since 0.4.4 @param o The option set to work on @param name The tag name. 80 characters max. An empty name disables production of an scdbackup tag. @param timestamp A string of up to 13 characters YYMMDD.hhmmss A9 = 2009, B0 = 2010, B1 = 2011, ... C0 = 2020, ... @param tag_written Either NULL or the address of an array with at least 512 characters. In the latter case the eventually produced scdbackup tag will be copied to this array when the image gets written. This call sets scdbackup_tag_written[0] = 0 to mark its preliminary invalidity. @return 1 success, <=0 failure */ int isoburn_igopt_set_scdbackup_tag(struct isoburn_imgen_opts *o, char *name, char *timestamp, char *tag_written); int isoburn_igopt_get_scdbackup_tag(struct isoburn_imgen_opts *o, char name[81], char timestamp[19], char **tag_written); /** Attach 32 kB of binary data which shall get written to the first 32 kB of the ISO image, the System Area. options can cause manipulations of these data before writing happens. If system area data are giveni or options bit0 is set, then bit1 of el_torito_set_isolinux_options() is automatically disabled. @since 0.5.4 @param o The option set to work on @param data Either NULL or 32 kB of data. Do not submit less bytes ! @param options Can cause manipulations of submitted data before they get written: bit0= apply a --protective-msdos-label as of grub-mkisofs. This means to patch bytes 446 to 512 of the system area so that one partition is defined which begins at the second 512-byte block of the image and ends where the image ends. This works with and without system_area_data. bit1= apply isohybrid MBR patching to the system area. This works only with system area data from SYSLINUX plus an ISOLINUX boot image (see iso_image_set_boot_image()) and only if not bit0 is set. bit2-7= System area type 0= with bit0 or bit1: MBR else: unspecified type @since 0.6.4 1= MIPS Big Endian Volume Header Submit up to 15 MIPS Big Endian boot files by iso_image_add_mips_boot_file() of libisofs. This will overwrite the first 512 bytes of the submitted data. 2= DEC Boot Block for MIPS Little Endian The first boot file submitted by iso_image_add_mips_boot_file() will be activated. This will overwrite the first 512 bytes of the submitted data. @since 0.6.6 3= SUN Disk Label for SUN SPARC Submit up to 7 SPARC boot images by isoburn_igopt_set_partition_img() for partition numbers 2 to 8. This will overwrite the first 512 bytes of the submitted data. @since 1.3.8 4= HP-PA PALO boot sector header version 4 Submit all five parameters of iso_image_set_hppa_palo() as non-NULL texts. 5= HP-PA PALO boot sector header version 5 Submit all five parameters of iso_image_set_hppa_palo() as non-NULL texts. bit8-9= Only with System area type 0 = MBR @since 1.0.4 Cylinder alignment mode eventually pads the image to make it end at a cylinder boundary. 0 = auto (align if bit1) 1 = always align to cylinder boundary 2 = never align to cylinder boundary bit10-13= System area sub type @since 1.2.4 With type 0 = MBR: Gets overridden by bit0 and bit1. 0 = no particular sub type 1 = CHRP: A single MBR partition of type 0x96 covers the ISO image. Not compatible with any other feature which needs to have own MBR partition entries. bit14= Only with System area type 0 = MBR GRUB2 boot provisions: @since 1.3.0 Patch system area at byte 0x1b0 to 0x1b7 with (512-block address + 4) of the first boot image file. Little-endian 8-byte. Should be combined with options bit0. Will not be in effect if options bit1 is set. @return 1 success, 0 no data to get, <0 failure */ 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); /** Control production of a second set of volume descriptors (superblock) and directory trees, together with a partition table in the MBR where the first partition has non-zero start address and the others are zeroed. The first partition stretches to the end of the whole ISO image. The additional volume descriptor set and trees can be used to mount the ISO image at the start of the first partition, while it is still possible to mount it via the normal first volume descriptor set and tree at the start of the image or storage device. This makes few sense on optical media. But on USB sticks it creates a conventional partition table which makes it mountable on e.g. Linux via /dev/sdb and /dev/sdb1 alike. @since 0.6.2 @param opts The option set to be manipulated. @param block_offset_2k The offset of the partition start relative to device start. This is counted in 2 kB blocks. The partition table will show the according number of 512 byte sectors. Default is 0 which causes no second set and trees. If it is not 0 then it must not be smaller than 16. @param secs_512_per_head Number of 512 byte sectors per head. 1 to 63. 0=automatic. @param heads_per_cyl Number of heads per cylinder. 1 to 255. 0=automatic. @return 1 success, <=0 failure */ int isoburn_igopt_set_part_offset(struct isoburn_imgen_opts *opts, uint32_t block_offset_2k, int secs_512_per_head, int heads_per_cyl); int isoburn_igopt_get_part_offset(struct isoburn_imgen_opts *opts, uint32_t *block_offset_2k, int *secs_512_per_head, int *heads_per_cyl); /** Explicitly set the four timestamps of the emerging ISO image. Default with all parameters is 0. @since 0.5.4 @param opts The option set to work on @param creation_time ECMA-119 Volume Creation Date and Time When "the information in the volume was created." A value of 0 means that the timepoint of write start is to be used. @param modification_time ECMA-119 Volume Modification Date and Time When "the informationin the volume was last modified." A value of 0 means that the timepoint of write start is to be used. @param expiration_time ECMA-119 Volume Expiration Date and Time When "the information in the volume may be regarded as obsolete." A value of 0 means that the information never shall expire. @param effective_time ECMA-119 Volume Effective Date and Time When "the information in the volume may be used." A value of 0 means that not such retention is intended. @param uuid If this text is not empty, then it overrides vol_modification_time by copying the first 16 decimal digits from uuid, eventually padding up with decimal '1', and writing a NUL-byte as timezone GMT. It should express a reasonable time in form YYYYMMDDhhmmsscc E.g.: 2010040711405800 = 7 Apr 2010 11:40:58 (+0 centiseconds) @return 1 success, <=0 failure */ int isoburn_igopt_set_pvd_times(struct isoburn_imgen_opts *opts, time_t creation_time, time_t modification_time, time_t expiration_time, time_t effective_time, char *uuid); int isoburn_igopt_get_pvd_times(struct isoburn_imgen_opts *opts, time_t *creation_time, time_t *modification_time, time_t *expiration_time, time_t *effective_time, char uuid[17]); /** Associate a libjte environment object to the upcoming write run. libjte implements Jigdo Template Extraction as of Steve McIntyre and Richard Atterer. A non-NULL libjte_handle will cause failure to write if libjte was not enabled in libisofs at compile time. @since 0.6.4 @param opts The option set to work on @param libjte_handle Pointer to a struct libjte_env e.g. created by libjte_new(). It must stay existent from the start of image writing by isoburn_prepare_*() until the write thread has ended. E.g. until libburn indicates the end of its write run. @return 1 success, <=0 failure */ int isoburn_igopt_attach_jte(struct isoburn_imgen_opts *opts, void *libjte_handle); /** Remove eventual association to a libjte environment handle. @since 0.6.4 @param opts The option set to work on @param libjte_handle If not submitted as NULL, this will return the previously set libjte handle. @return 1 success, <=0 failure */ int isoburn_igopt_detach_jte(struct isoburn_imgen_opts *opts, void **libjte_handle); /** Set or get the number of trailing zero byte blocks to be written by libisofs. The image size counter of the emerging ISO image will include them. Eventual checksums will take them into respect. They will be written immediately before the eventual image checksum area which is at the very end of the image. For a motivation see iso_write_opts_set_tail_blocks() in libisofs.h . @since 0.6.4 @param opts The option set to work on @param num_blocks Number of extra 2 kB blocks to be written by libisofs. @return 1 success, <=0 failure */ int isoburn_igopt_set_tail_blocks(struct isoburn_imgen_opts *opts, uint32_t num_blocks); int isoburn_igopt_get_tail_blocks(struct isoburn_imgen_opts *opts, uint32_t *num_blocks); /** Copy a data file from the local filesystem into the emerging ISO image. Mark it by an MBR partition entry as PreP partition and also cause protective MBR partition entries before and after this partition. See libisofs.h iso_write_opts_set_prep_img(). @since 1.2.4 @param opts The option set to be manipulated. @param path File address in the local file system. @param flag With isoburn_igopt_set_prep_partition(): Control bits as of iso_write_opts_set_efi_bootp() bit0= The path contains instructions for the interval libisofs reader. See libisofs.h. @since 1.4.0 With isoburn_igopt_get_prep_partition(): bit0= add the current flag setting & 0x3fffffff to return value 1. @return 1 success, <=0 failure */ int isoburn_igopt_set_prep_partition(struct isoburn_imgen_opts *opts, char *path, int flag); int isoburn_igopt_get_prep_partition(struct isoburn_imgen_opts *opts, char **path, int flag); /** Copy a data file from the local filesystem into the emerging ISO image and mark it by a GPT entry as EFI system partition. @since 1.2.4 @param opts The option set to be manipulated. @param path File address in the local file system. Instead of a disk path, the word --efi-boot-image may be given. It exposes in GPT the content of the first El Torito EFI boot image as EFI system partition. @param flag With isoburn_igopt_get_efi_bootp(): Control bits as of iso_write_opts_set_efi_bootp() bit0= The path contains instructions for the interval libisofs reader. See libisofs.h. @since 1.4.0 With isoburn_igopt_set_efi_bootp(): bit0= add the current flag setting & 0x3fffffff to return value 1. @return 1 success, <=0 failure */ int isoburn_igopt_set_efi_bootp(struct isoburn_imgen_opts *opts, char *path, int flag); int isoburn_igopt_get_efi_bootp(struct isoburn_imgen_opts *opts, char **path, int flag); /** Cause an arbitrary data file to be appended to the ISO image and to be described by a partition table entry in an MBR or SUN Disk Label at the start of the ISO image. The partition entry will bear the size of the image file rounded up to the next multiple of 2048 bytes. MBR or SUN Disk Label are selected by isoburn_igopt_set_system_area() system area type: 0 selects MBR partition table. 3 selects a SUN partition table with 320 kB start alignment. @since 0.6.4 @param opts The option set to be manipulated. @param partition_number Depicts the partition table entry which shall describe the appended image. Range with MBR: 1 to 4. 1 will cause the whole ISO image to be unclaimable space before partition 1. @since 0.6.6 Range with SUN Disk Label: 2 to 8. @param image_path File address in the local file system. With SUN Disk Label: an empty name causes the partition to become a copy of the next lower partition. @param partition_type The MBR partition type. E.g. FAT12 = 0x01 , FAT16 = 0x06, Linux Native Partition = 0x83. See fdisk command L. This parameter is ignored with SUN Disk Label. @return <=0 = error, 1 = success */ int isoburn_igopt_set_partition_img(struct isoburn_imgen_opts *opts, int partition_number, uint8_t partition_type, char *image_path); /** Inquire the current settings made by isoburn_igopt_set_partition_img(). @since 0.6.4 @param opts The option set to be inquired. @param num_entries Number of array elements in partition_types[] and image_paths[]. @param partition_types The partition type associated with the partition. Valid only if image_paths[] of the same index is not NULL. @param image_paths Its elements get filled with either NULL or a pointer to a string with a file address or an empty text. @return <0 = error 0 = no partition image set >0 highest used partition number */ int isoburn_igopt_get_partition_img(struct isoburn_imgen_opts *opts, int num_entries, uint8_t partition_types[], char *image_paths[]); /** Set flag bits for a partition defined by isoburn_igopt_set_partition_img(). The bits will be forwarded to libisofs iso_write_opts_set_partition_img(). @since 1.4.0 @param opts The option set to be manipulated. @param partition_number Depicts the partition table entry to which shall the flags bits shall apply. @param flag Control bits as of iso_write_opts_set_partition_img() bit0= The path contains instructions for the interval libisofs reader. See libisofs.h. @since 1.4.0 @return <=0 = error, 1 = success */ int isoburn_igopt_set_part_flag(struct isoburn_imgen_opts *opts, int partition_number, int flag); /** Inquire the current settings made by isoburn_igopt_set_part_flags(). @since 1.4.0 @param opts The option set to be inquired. @param num_entries Number of array elements in part_flags[]. @param part_flags The array elements 0 to num_entries - 1 will get filled by the flag bits of the images of the corresponding partition. @return <0 = error 0 = no partition image set >0 highest used partition number */ int isoburn_igopt_get_part_flags(struct isoburn_imgen_opts *opts, int num_entries, int part_flags[]); /** Control whether partitions created by iso_write_opts_set_partition_img() are to be represented in MBR or as GPT partitions. @since 1.4.0 @param opts The option set to be manipulated. @param gpt 0= represent as MBR partition; as GPT only if other GPT partitions are present 1= represent as GPT partition and cause protective MBR with a single partition which covers the whole output data. This may fail if other settings demand MBR partitions. Do not use other values for now. @return <=0 = error, 1 = success */ int isoburn_igopt_set_appended_as_gpt(struct isoburn_imgen_opts *opts, int gpt); /** Inquire the current setting made by isoburn_igopt_set_appended_as_gpt(). @since 1.4.0 @param opts The option set to be inquired. @param gpt Returns the current value. @return <=0 = error, 1 = success */ int isoburn_igopt_get_appended_as_gpt(struct isoburn_imgen_opts *opts, int *gpt); /** Set the GPT Type GUID for a partition defined by isoburn_igopt_set_partition_img(). @since 1.5.2 @param opts The option set to be manipulated. @param partition_number Depicts the partition table entry which shall get the Type GUID. @param guid 16 bytes of user supplied GUID. Readily byte-swapped from the text form as prescribed by UEFI specs: 4 byte, 2 byte, 2 byte as little-endian. 2 byte, 6 byte as big-endian. @param valid Set to 1 to make this Type GUID valid. Set to 0 in order to invalidate a previously made setting. In this case MBR type 0xEF will become the EFI Type GUID. All others will become the Basic Data Partition Type GUID. @return <=0 = error, 1 = success */ int isoburn_igopt_set_part_type_guid(struct isoburn_imgen_opts *opts, int partition_number, uint8_t guid[16], int valid); /** Inquire the current settings made by isoburn_igopt_set_part_type_guid(). @since 1.5.2 @param opts The option set to be inquired. @param num_entries Number of array elements in part_flags[]. @param type_guids The array elements 0 to num_entries - 1 will get filled by the 16 flag bits of the images of the corresponding partition. @param valids The array elements 0 to num_entries - 1 will get filled by 1 or 0 to indicate whether the corresponding type_guids element is valid. @return <0 = error 0 = no partition image set >0 highest used partition number */ int isoburn_igopt_get_part_type_guid(struct isoburn_imgen_opts *opts, int num_entries, uint8_t guids[][16], int valids[]); /** Control whether partitions created by iso_write_opts_set_partition_img() are to be represented in Apple Partition Map. @since 1.4.4 @param opts The option set to be manipulated. @param apm 0= do not represent appended partitions in APM 1= represent in APM, even if not iso_write_opts_set_part_like_isohybrid() enables it and no other APM partitions emerge. Do not use other values for now. @return <=0 = error, 1 = success */ int isoburn_igopt_set_appended_as_apm(struct isoburn_imgen_opts *opts, int apm); /** Inquire the current setting made by isoburn_igopt_set_appended_as_apm(). @since 1.4.4 @param opts The option set to be inquired. @param apm Returns the current value. @return <=0 = error, 1 = success */ int isoburn_igopt_get_appended_as_apm(struct isoburn_imgen_opts *opts, int *apm); /** Control whether bits 2 to 8 of el_torito_set_isolinux_options() shall apply even if not isohybrid MBR patching is enabled (bit1 of parameter options of isoburn_igopt_set_system_area()). For details see iso_write_opts_set_part_like_isohybrid() in libisofs.h. @since 1.4.4 @param opts The option set to be manipulated. @param alike 0= Apply isohybrid behavior only with ISOLINUX isohybrid. Do not mention appended partitions in APM unless isoburn_igopt_set_appended_as_apm() is enabled. 1= Apply isohybrid behavior even without ISOLINUX isohybrid. @return <=0 = error, 1 = success */ int isoburn_igopt_set_part_like_isohybrid(struct isoburn_imgen_opts *opts, int alike); /** Inquire the current setting of isoburn_igopt_set_part_like_isohybrid(). @since 1.4.4 @param opts The option set to be inquired. @param alike Returns the current value. @return <=0 = error, 1 = success */ int isoburn_igopt_get_part_like_isohybrid(struct isoburn_imgen_opts *opts, int *alike); /** Set the partition type of the MBR partition which represents the ISO filesystem or at least protects it. This is without effect if no such partition emerges by other settings or if the partition type is prescribed mandatorily like 0xee for GPT protective MBR or 0x96 for CHRP. @since 1.4.8 @param opts The option set to be manipulated. @param part_type 0x00 to 0xff as desired partition type. Any other value (e.g. -1) enables the default types of the various occasions. */ int isoburn_igopt_set_iso_mbr_part_type(struct isoburn_imgen_opts *opts, int part_type); /** Inquire the current setting of isoburn_igopt_set_iso_mbr_part_type(). @since 1.4.8 @param opts The option set to be inquired. @param part_type Returns the current value: -1, 0x00 to 0xff. @return <=0 = error, 1 = success */ int isoburn_igopt_get_iso_mbr_part_type(struct isoburn_imgen_opts *opts, int *part_type); /** Set the GPT Type GUID for the partition which represents the ISO 9660 filesystem, if such a partition emerges in GPT. @since 1.5.2 @param opts The option set to be manipulated. @param guid 16 bytes of user supplied GUID. Readily byte-swapped from the text form as prescribed by UEFI specs: 4 byte, 2 byte, 2 byte as little-endian. 2 byte, 6 byte as big-endian. @param valid Set to 1 to make this Type GUID valid. Set to 0 in order to invalidate a previously made setting. In this case the setting of isoburn_igopt_set_iso_mbr_part_type() or its default gets into effect. @return <=0 = error, 1 = success */ int isoburn_igopt_set_iso_type_guid(struct isoburn_imgen_opts *opts, uint8_t guid[16], int valid); /** Inquire the current setting of isoburn_igopt_set_iso_type_guid(). @since 1.5.2 @param opts The option set to be inquired. @param guid Gets filled with the 16 bytes of GUID. @return <= error, 0= guid is invalid, 1 = guid is valid */ int isoburn_igopt_get_iso_type_guid(struct isoburn_imgen_opts *opts, uint8_t guid[16]); /** Control whether the emerging GPT gets a pseudo-randomly generated disk GUID or whether it gets a user supplied GUID. The partition GUIDs will be generated in a reproducible way by exoring a little-endian 32 bit counter with the disk GUID beginning at byte offset 9. @since 1.4.6 @param opts The option set to be manipulated. @param guid 16 bytes of user supplied GUID. Readily byte-swapped from the text form as prescribed by UEFI specs: 4 byte, 2 byte, 2 byte as little-endian. 2 byte, 6 byte as big-endian. The upper 4 bit of guid[6] and guid[7] should bear the value 4 to express the version 4 in both endiannesses. Bit 7 of byte[8] should be set to 1 and bit 6 be set to 0, in order to express the RFC 4122 variant of GUID, where version 4 means "random". @param mode 0 = ignore parameter guid and produce the GPT disk GUID by a pseudo-random algorithm. This is the default setting. 1 = use parameter guid as GPT disk GUID 2 = ignore parameter guid and derive the GPT disk GUID from parameter uuid of isoburn_igopt_set_pvd_times(). The 16 bytes of uuid get copied and bytes 6, 7, 8 get their upper bits changed to comply to RFC 4122. If no such uuid is given when ISO production starts, then mode 2 defaults to mode 0. */ int isoburn_igopt_set_gpt_guid(struct isoburn_imgen_opts *opts, uint8_t guid[16], int mode); /** Inquire the current setting of isoburn_igopt_set_gpt_guid(). @since 1.4.6 @param opts The option set to be inquired. @param guid Returns the current guid if current mode is 1. @param mode Returns the current value. @return <=0 = error, 1 = success */ int isoburn_igopt_get_gpt_guid(struct isoburn_imgen_opts *opts, uint8_t guid[16], int *mode); /** Set a name for the system area. This setting is ignored unless system area type 3 "SUN Disk Label" is in effect by iso_write_opts_set_system_area(). In this case it will replace the default text at the start of the image: "CD-ROM Disc with Sun sparc boot created by libisofs" @since 0.6.6 @param opts The option set to be manipulated. @param label A text of up to 128 characters. @return <=0 = error, 1 = success */ int isoburn_igopt_set_disc_label(struct isoburn_imgen_opts *opts, char *label); /** Inquire the current setting made by isoburn_igopt_set_disc_label(). @since 0.6.6 @param opts The option set to be inquired. @param label Returns a pointer to the currently set label string. Do not alter this string. Use only as long as the opts object exists. @return <=0 = error, 1 = success */ int isoburn_igopt_get_disc_label(struct isoburn_imgen_opts *opts, char **label); /** Set a serial number for the HFS+ extension of the emerging ISO image. @since 1.2.4 @param opts The option set to be manipulated. @param serial_number 8 bytes which should be unique to the image. If all bytes are 0, then the serial number will be generated as random number by libisofs. This is the default setting. @return <=0 = error, 1 = success */ int isoburn_igopt_set_hfsp_serial_number(struct isoburn_imgen_opts *opts, uint8_t serial_number[8]); /** Inquire the current setting made by isoburn_igopt_set_disc_label() @since 1.2.4 @param opts The option set to be inquired. @param serial_number Will get filled with the current setting. @return <=0 = error, 1 = success */ int isoburn_igopt_get_hfsp_serial_number(struct isoburn_imgen_opts *opts, uint8_t serial_number[8]); /** Set the allocation block size for HFS+ production and the block size for layout and address unit of Apple Partition map. @since 1.2.4 @param opts The option set to be manipulated. @param hfsp_block_size -1 means that this setting shall be left unchanged 0 allows the automatic default setting 512 and 2048 enforce a size. @param apm_block_size -1 means that this setting shall be left unchanged 0 allows the automatic default setting 512 and 2048 enforce a size. Size 512 cannot be combined with GPT production. Size 2048 cannot be mounted -t hfsplus by Linux kernels at least up to 2.6.32. @return <=0 = error, 1 = success */ int isoburn_igopt_set_hfsp_block_size(struct isoburn_imgen_opts *opts, int hfsp_block_size, int apm_block_size); /** Inquire the current setting made by isoburn_igopt_set_hfsp_block_size @since 1.2.4 @param opts The option set to be inquired. @param hfsp_block_size Will be set to a value as described above. Except -1. @param apm_block_size Will be set to a value as described above. Except -1. @return <=0 = error, 1 = success */ int isoburn_igopt_get_hfsp_block_size(struct isoburn_imgen_opts *opts, int *hfsp_block_size, int *apm_block_size); /** Set or inquire the write type for the next write run on optical media. @since 1.2.4 @param opts The option set to be manipulated or inquired. @param do_tao The value to be set or the variable where to return the current setting: 0 = Let libburn choose according to other write parameters. This is advisable unless there are particular reasons not to use one of the two write types. Be aware that 1 and -1 can lead to failure if the write type is not appropriate for the given media situation. 1 = Use BURN_WRITE_TAO which does TAO on CD, Incremental on DVD-R, no track reservation on DVD+R and BD-R -1 = Use BURN_WRITE_SAO which does SAO on CD, DAO on DVD-R, track reservation on DVD+R and BD-R @return <=0 = error, 1 = success */ int isoburn_igopt_set_write_type(struct isoburn_imgen_opts *opts, int do_tao); int isoburn_igopt_get_write_type(struct isoburn_imgen_opts *opts, int *do_tao); /** Set or inquire whether a final fsync(2) is performed when updating the multi-session information of libburn stdio pseudo-drives by isoburn_activate_session(). Note: fsync(2) calls during and at the end of isoburn_disc_write() are controlled by libburn call burn_write_opts_set_stdio_fsync(). @since 1.2.4 @param opts The option set to be manipulated or inquired. @param do_sync 1= call fsync(2) with stdio drives in isoburn_activate_session() 0= do not @return <=0 = error, 1 = success */ int isoburn_igopt_set_stdio_endsync(struct isoburn_imgen_opts *opts, int do_sync); int isoburn_igopt_get_stdio_endsync(struct isoburn_imgen_opts *opts, int *do_sync); /* ----------------------------------------------------------------------- */ /* End of Options for image generation */ /* ----------------------------------------------------------------------- */ /** Frontend of libisofs call iso_conv_name_chars() controlled by struct isoburn_imgen_opts rather than IsoWriteOpts. See libisofs.h for a more detailed description. @since 1.3.6 @param opts Defines options like output charset, UCS-2 versus UTF-16 for Joliet, and naming restrictions. @param name The input text which shall be converted. @param name_len The number of bytes in input text. @param result Will return the conversion result in case of success. Terminated by a trailing zero byte. Use free() to dispose it when no longer needed. @param result_len Will return the number of bytes in result (excluding trailing zero) @param flag Bitfield for control purposes. bit0-bit7= Name space 0= generic (to_charset is valid, no reserved characters, no length limits) 1= Rock Ridge (to_charset is valid) 2= Joliet (to_charset gets overridden by UCS-2 or UTF-16) 3= ECMA-119 (to_charset gets overridden by the dull ISO 9660 subset of ASCII) 4= HFS+ (to_charset gets overridden by UTF-16BE) bit8= Treat input text as directory name (matters for Joliet and ECMA-119) bit9= Do not issue error messages bit15= Reverse operation (best to be done only with results of previous conversions) @return 1 means success, <=0 means error */ int isoburn_conv_name_chars(struct isoburn_imgen_opts *opts, char *name, size_t name_len, char **result, size_t *result_len, int flag); /** Get the image attached to a drive, if any. @since 0.1.0 @param d The drive to inquire @return A reference to attached image, or NULL if the drive has no image attached. This reference needs to be released via iso_image_unref() when it is not longer needed. */ IsoImage *isoburn_get_attached_image(struct burn_drive *d); /** Get the start address of the image that is attached to the drive, if any. @since 1.2.2 @param d The drive to inquire @return The logical block address where the System Area of the image starts. <0 means that the address is invalid. */ int isoburn_get_attached_start_lba(struct burn_drive *d); /** Load the ISO filesystem directory tree from the medium in the given drive. This will give libisoburn the base on which it can let libisofs perform image growing or image modification. The loaded volset gets attached to the drive object and handed out to the application. Not a wrapper, but peculiar to libisoburn. @since 0.1.0 @param d The drive which holds an existing ISO filesystem or blank media. d is allowed to be NULL which produces an empty ISO image. In this case one has to call before writing isoburn_attach_volset() with the volset from this call and with the intended output drive. @param read_opts The read options which can be chosen by the application @param image the image read, if the disc is blank it will have no files. This reference needs to be released via iso_image_unref() when it is not longer needed. The drive, if not NULL, will hold an own reference which it will release when it gets a new volset or when it gets released via isoburn_drive_release(). You can pass NULL if you already have a reference or you plan to obtain it later with isoburn_get_attached_image(). Of course, if you haven't specified a valid drive (i.e., if d == NULL), this parameter can't be NULL. @return <=0 error , 1 = success */ int isoburn_read_image(struct burn_drive *d, struct isoburn_read_opts *read_opts, IsoImage **image); /** Set a callback function for producing pacifier messages during the lengthy process of image reading. The callback function and the application handle are stored until they are needed for the underlying call to libisofs. Other than with libisofs the handle is managed entirely by the application. An idle .free() function is exposed to libisofs. The handle has to stay valid until isoburn_read_image() is done. It has to be detached by isoburn_set_read_pacifier(drive, NULL, NULL); before it may be removed from memory. @since 0.1.0 @param drive The drive which will be used with isoburn_read_image() It has to be acquired by an isoburn_* wrapper call. @param read_pacifier The callback function @param app_handle The app handle which the callback function can obtain via iso_image_get_attached_data() from its IsoImage* @return 1 success, <=0 failure */ int isoburn_set_read_pacifier(struct burn_drive *drive, int (*read_pacifier)(IsoImage*, IsoFileSource*), void *app_handle); /** Inquire the partition offset of the loaded image. The first 512 bytes of the image get examined whether they bear an MBR signature and a first partition table entry which matches the size of the image. In this case the start address is recorded as partition offset and internal buffers get adjusted. See also isoburn_igopt_set_part_offset(). @since 0.6.2 @param drive The drive with the loaded image @param block_offset_2k returns the recognized partition offset @return <0 = error 0 = no partition offset recognized 1 = acceptable non-zero offset, buffers are adjusted 2 = offset is credible but not acceptable for buffer size */ int isoburn_get_img_partition_offset(struct burn_drive *drive, uint32_t *block_offset_2k); /** Set the IsoImage to be used with a drive. This eventually releases the reference to the old IsoImage attached to the drive. Caution: Use with care. It hardly makes sense to replace an image that reflects a valid ISO image on the medium. This call is rather intended for writing a newly created and populated image to blank media. The use case in xorriso is to let an image survive the change or demise of the outdev target drive. @since 0.1.0 @param d The drive which shall be write target of the volset. @param image The image that represents the image to be written. This image pointer MUST already be a valid reference suitable for iso_image_unref(). It may have been obtained by appropriate libisofs calls or by isoburn_read_image() with d==NULL. @return <=0 error , 1 = success */ int isoburn_attach_image(struct burn_drive *d, IsoImage *image); /** Set the start address of the image that is attached to the drive, if any. @since 1.2.2 @param d The drive to inquire @param lba The logical block address where the System Area of the image starts. <0 means that the address is invalid. @param flag Bitfield, submit 0 for now. @return <=0 error (e.g. because no image is attached), 1 = success */ int isoburn_attach_start_lba(struct burn_drive *d, int lba, int flag); /** Return the best possible estimation of the currently available capacity of the medium. This might depend on particular write option settings and on drive state. An eventual start address for emulated multi-session will be subtracted from the capacity estimation given by burn_disc_available_space(). Negative results get defaulted to 0. Wrapper for: burn_disc_available_space() @since 0.1.0 @param d The drive to query. @param o If not NULL: write parameters to be set on drive before query @return number of most probably available free bytes */ off_t isoburn_disc_available_space(struct burn_drive *d, struct burn_write_opts *o); /** Obtain the start block number of the most recent session on the medium. In case of random access media this will normally be 0. Successful return is not a guarantee that there is a ISO-9660 image at all. The call will fail, nevertheless,if isoburn_disc_get_status() returns not BURN_DISC_APPENDABLE or BURN_DISC_FULL. Note: The result of this call may be fabricated by a previous call of isoburn_set_msc1() which can override the rule to load the most recent session. Wrapper for: burn_disc_get_msc1() @since 0.1.0 @param d The drive to inquire @param start_lba Contains on success the start address in 2048 byte blocks @return <=0 error , 1 = success */ int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba); /** Use this with trackno==0 to obtain the predicted start block number of the new session. The interesting number is returned in parameter nwa. Wrapper for: burn_disc_track_lba_nwa() @since 0.1.0 @param d The drive to inquire @param o If not NULL: write parameters to be set on drive before query @param trackno Submit 0. @param lba return value: start lba @param nwa return value: Next Writeable Address @return 1=nwa is valid , 0=nwa is not valid , -1=error */ int isoburn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o, int trackno, int *lba, int *nwa); /** Obtain the size which was attributed to an emulated appendable on actually overwritable media. This value is supposed to be <= 2048 * nwa as of isoburn_disc_track_lba_nwa(). @since 0.1.0 @param d The drive holding the medium. @param start_byte The reply value counted in bytes, not in sectors. @param flag Unused yet. Submit 0. @return 1=stat_byte is valid, 0=not an emulated appendable, -1=error */ int isoburn_get_min_start_byte(struct burn_drive *d, off_t *start_byte, int flag); /** Start production of an ISO 9660 image using the method of Growing: Create a disc object for writing the new session from the created or loaded iso_volset which has been manipulated via libisofs, to the same medium from where the image was eventually loaded. This call starts a libisofs thread which begins to produce the image. It has to be revoked by isoburn_cancel_prepared_write() if for some reason this image data stream shall not be consumed. The returned struct burn_disc is ready for use by a subsequent call to isoburn_disc_write(). After this asynchronous writing has ended and the drive is BURN_DRIVE_IDLE again, the burn_disc object has to be disposed by burn_disc_free(). @since 0.1.0 @param drive The combined source and target drive, grabbed with isoburn_drive_scan_and_grab(). . @param disc Returns the newly created burn_disc object. @param opts Image generation options, see isoburn_igopt_*() @return <=0 error , 1 = success */ int isoburn_prepare_disc(struct burn_drive *drive, struct burn_disc **disc, struct isoburn_imgen_opts *opts); /** Start production of an ISO 9660 image using the method of Modifying: Create a disc object for producing a new image from a previous image plus the changes made by user. The generated burn_disc is suitable to be written to a grabbed drive with blank writeable medium. But you must not use the same drive for input and output, because data will be read from the source drive while at the same time the target drive is already writing. This call starts a libisofs thread which begins to produce the image. It has to be revoked by isoburn_cancel_prepared_write() if for some reason this image data stream shall not be consumed. The resulting burn_disc object has to be disposed when all its writing is done and the drive is BURN_DRIVE_IDLE again after asynchronous burn_disc_write(). @since 0.1.0 @param in_drive The input drive, grabbed with isoburn_drive_aquire() or one of its alternatives. @param disc Returns the newly created burn_disc object. @param opts Options for image generation and data transport to the medium. @param out_drive The output drive, from isoburn_drive_aquire() et.al.. @return <=0 error , 1 = success */ int isoburn_prepare_new_image(struct burn_drive *in_drive, struct burn_disc **disc, struct isoburn_imgen_opts *opts, struct burn_drive *out_drive); /** Start production of an ISO 9660 image using the method of Blind Growing: Create a disc object for writing an add-on session from the created or loaded IsoImage which has been manipulated via libisofs, to a different drive than the one from where it was loaded. Usually output will be stdio:/dev/fd/1 (i.e. stdout) being piped into some burn program like with this classic gesture: mkisofs -M $dev -C $msc1,$nwa | cdrecord -waiti dev=$dev Parameter translation into libisoburn: $dev is the address by which parameter in_drive of this call was acquired $msc1 was set by isoburn_set_msc1() before image reading or was detected from the in_drive medium $nwa is a parameter of this call or can be used as detected from the in_drive medium This call starts a libisofs thread which begins to produce the image. It has to be revoked by isoburn_cancel_prepared_write() if for some reason this image data stream shall not be consumed. This call waits for libisofs output to become available and then detaches the input drive object from the data source object by which libisofs was reading from the input drive. So, as far as libisofs is concerned, that drive may be released immediately after this call in order to allow the consumer to access the drive for writing. The consumer should wait for input to become available and only then open its burn drive. With cdrecord this is caused by option -waiti. The resulting burn_disc object has to be disposed when all its writing is done and the drive is BURN_DRIVE_IDLE again after asynchronous burn_disc_write(). @since 0.2.2 @param in_drive The input drive,grabbed with isoburn_drive_scan_and_grab(). @param disc Returns the newly created burn_disc object. @param opts Options for image generation and data transport to media. @param out_drive The output drive, from isoburn_drive_aquire() et.al.. typically stdio:/dev/fd/1 . @param nwa The address (2048 byte block count) where the add-on session will be finally stored on a mountable medium or in a mountable file. If nwa is -1 then the address is used as determined from the in_drive medium. @return <=0 error , 1 = success */ int isoburn_prepare_blind_grow(struct burn_drive *in_drive, struct burn_disc **disc, struct isoburn_imgen_opts *opts, struct burn_drive *out_drive, int nwa); /** Revoke isoburn_prepare_*() instead of running isoburn_disc_write(). libisofs reserves resources and maybe already starts generating the image stream when one of above three calls is performed. It is mandatory to either run isoburn_disc_write() or to revoke the preparations by the call described here. If this call returns 0 or 1 then the write thread of libisofs has ended. @since 0.1.0 @param input_drive The drive or in_drive which was used with the preparation call. @param output_drive The out_drive used with isoburn_prepare_new_image(), NULL if none. @param flag Bitfield, submit 0 for now. bit0= -reserved for internal use- @return <0 error, 0= no pending preparations detectable, 1 = canceled */ int isoburn_cancel_prepared_write(struct burn_drive *input_drive, struct burn_drive *output_drive, int flag); /** Override the truncation setting that was made with flag bit2 during the call of isoburn_drive_aquire. This applies only to stdio pseudo drives. @since 0.1.6 @param drive The drive which was acquired and shall be used for writing. @param flag Bitfield controlling the setting: bit0= truncate (else do not truncate) bit1= do not warn if call is inappropriate to drive bit2= only set if truncation is currently enabled do not warn if call is inappropriate to drive @return 1 success, 0 inappropriate drive, <0 severe error */ int isoburn_set_truncate(struct burn_drive *drive, int flag); /** Start writing of the new session. This call is asynchronous. I.e. it returns quite soon and the progress has to be watched by a loop with call burn_drive_get_status() until BURN_DRIVE_IDLE is returned. Wrapper for: burn_disc_write() @since 0.1.0 @param o Options which control the burn process. See burnwrite_opts_*() in libburn.h. @param disc Disc object created either by isoburn_prepare_disc() or by isoburn_prepare_new_image(). */ void isoburn_disc_write(struct burn_write_opts *o, struct burn_disc *disc); /** Inquire state and fill parameters of the fifo which is attached to the emerging track. This should be done in the pacifier loop while isoburn_disc_write() or burn_disc_write() are active. This works only with drives obtained by isoburn_drive_scan_and_grab() or isoburn_drive_grab(). If isoburn_prepare_new_image() was used, then parameter out_drive must have announced the track output drive. Hint: If only burn_write_opts and not burn_drive is known, then the drive can be obtained by burn_write_opts_get_drive(). @since 0.1.0 @param d The drive to which the track with the fifo gets burned. @param size The total size of the fifo @param free_bytes The current free capacity of the fifo @param status_text Returns a pointer to a constant text, see below @return <0 reply invalid, >=0 fifo status code: bit0+1=input status, bit2=consumption status, i.e: 0="standby" : data processing not started yet 1="active" : input and consumption are active 2="ending" : input has ended without error 3="failing" : input had error and ended, 4="unused" : ( consumption has ended before processing start ) 5="abandoned" : consumption has ended prematurely 6="ended" : consumption has ended without input error 7="aborted" : consumption has ended after input error */ int isoburn_get_fifo_status(struct burn_drive *d, int *size, int *free_bytes, char **status_text); /** Inquire whether the most recent write run was successful. Wrapper for: burn_drive_wrote_well() @since 0.1.0 @param d The drive to inquire @return 1=burn seems to have went well, 0=burn failed */ int isoburn_drive_wrote_well(struct burn_drive *d); /** Call this after isoburn_disc_write has finished and burn_drive_wrote_well() indicates success. It will eventually complete the emulation of multi-session functionality, if needed at all. Let libisoburn decide. Not a wrapper, but peculiar to libisoburn. @since 0.1.0 @param d The output drive to which the session was written @return 1 success , <=0 failure */ int isoburn_activate_session(struct burn_drive *d); /** Wait after normal end of operations until libisofs ended all write threads and freed resource reservations. This call is not mandatory. But without it, messages from the ending threads might appear after the application ended its write procedure. @since 0.1.0 @param input_drive The drive or in_drive which was used with the preparation call. @param output_drive The out_drive used with isoburn_prepare_new_image(), NULL if none. @param flag Bitfield, submit 0 for now. @return <=0 error , 1 = success */ int isoburn_sync_after_write(struct burn_drive *input_drive, struct burn_drive *output_drive, int flag); /** Release an acquired drive. Wrapper for: burn_drive_release() @since 0.1.0 @param drive The drive to be released @param eject 1= eject medium from drive , 0= do not eject */ void isoburn_drive_release(struct burn_drive *drive, int eject); /** Shutdown all three libraries. Wrapper for : iso_finish() and burn_finish(). @since 0.1.0 */ void isoburn_finish(void); /* The following calls are for expert applications only. An application should have a special reason to use them. */ /** Inquire whether the medium needs emulation or would be suitable for generic multi-session via libburn. @since 0.1.0 @param d The drive to inquire @return 0 is generic multi-session 1 is emulated multi-session -1 is not suitable for isoburn */ int isoburn_needs_emulation(struct burn_drive *d); /* ---------------------------- Test area ----------------------------- */ /* no tests active, currently */ #ifdef __cplusplus } /* extern "C" */ #endif #endif /* LIBISOBURN_LIBISOBURN_H_ */ libisoburn-1.5.4/libisoburn/isofs_wrap.c0000644000175700017510000005066613763473103015336 00000000000000 /* cc -g -c isofs_wrap.c */ /* libisofs related functions of libisoburn. Copyright 2007 - 2009 Vreixo Formoso Lopes Copyright 2007 - 2020 Thomas Schmitt Provided under GPL version 2 or later. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #ifndef Xorriso_standalonE #include #include #else /* ! Xorriso_standalonE */ #include "../libisofs/libisofs.h" #include "../libburn/libburn.h" #endif /* Xorriso_standalonE */ #include "libisoburn.h" #include "isoburn.h" #define BP(a,b) [(b) - (a) + 1] struct ecma119_pri_vol_desc { uint8_t vol_desc_type BP(1, 1); uint8_t std_identifier BP(2, 6); uint8_t vol_desc_version BP(7, 7); uint8_t unused1 BP(8, 8); uint8_t system_id BP(9, 40); uint8_t volume_id BP(41, 72); uint8_t unused2 BP(73, 80); uint8_t vol_space_size BP(81, 88); uint8_t unused3 BP(89, 120); uint8_t vol_set_size BP(121, 124); uint8_t vol_seq_number BP(125, 128); uint8_t block_size BP(129, 132); uint8_t path_table_size BP(133, 140); uint8_t l_path_table_pos BP(141, 144); uint8_t opt_l_path_table_pos BP(145, 148); uint8_t m_path_table_pos BP(149, 152); uint8_t opt_m_path_table_pos BP(153, 156); uint8_t root_dir_record BP(157, 190); uint8_t vol_set_id BP(191, 318); uint8_t publisher_id BP(319, 446); uint8_t data_prep_id BP(447, 574); uint8_t application_id BP(575, 702); uint8_t copyright_file_id BP(703, 739); uint8_t abstract_file_id BP(740, 776); uint8_t bibliographic_file_id BP(777, 813); uint8_t vol_creation_time BP(814, 830); uint8_t vol_modification_time BP(831, 847); uint8_t vol_expiration_time BP(848, 864); uint8_t vol_effective_time BP(865, 881); uint8_t file_structure_version BP(882, 882); uint8_t reserved1 BP(883, 883); uint8_t app_use BP(884, 1395); uint8_t reserved2 BP(1396, 2048); }; static uint32_t iso_read_lsb(const uint8_t *buf, int bytes) { int i; uint32_t ret = 0; for (i=0; iimage); return o->image; } /* API */ int isoburn_get_attached_start_lba(struct burn_drive *d) { int ret; struct isoburn *o= NULL; ret = isoburn_find_emulator(&o, d, 0); if (ret < 0 || o == NULL) return -1; if(o->image == NULL) return -1; return o->image_start_lba; } static void isoburn_idle_free_function(void *ignored) { return; } int isoburn_root_defaults(IsoImage *image, int flag) { IsoNode *root_node; mode_t root_mode= 0755; root_node= (IsoNode *) iso_image_get_root(image); iso_node_set_permissions(root_node, root_mode); return(1); } /* API function. See libisoburn.h */ int isoburn_read_image(struct burn_drive *d, struct isoburn_read_opts *read_opts, IsoImage **image) { int ret, int_num, dummy, ignore_aclea= 0; IsoReadOpts *ropts= NULL; IsoReadImageFeatures *features= NULL; uint32_t ms_block; char *msg= NULL; enum burn_disc_status status= BURN_DISC_BLANK; IsoDataSource *ds= NULL; struct isoburn *o= NULL; IsoImage *new_image= NULL; msg= calloc(1, 160); if(d != NULL) { ret = isoburn_find_emulator(&o, d, 0); if (ret < 0 || o == NULL) {ret= 0; goto ex;} status = isoburn_disc_get_status(d); o->image_start_lba= -1; } if(read_opts==NULL) { isoburn_msgs_submit(o, 0x00060000, "Program error: isoburn_read_image: read_opts==NULL", 0, "FATAL", 0); {ret= -1; goto ex;} } if (d == NULL || status == BURN_DISC_BLANK || read_opts->pretend_blank) { create_blank_image:; /* * Blank disc, we create a new image without files. */ if (d == NULL) { /* New empty image without relation to a drive */ if (image==NULL) { isoburn_msgs_submit(o, 0x00060000, "Program error: isoburn_read_image: image==NULL", 0, "FATAL", 0); {ret= -1; goto ex;} } /* create a new image */ ret = iso_image_new("ISOIMAGE", image); if (ret < 0) { isoburn_report_iso_error(ret, "Cannot create image", 0, "FATAL", 0); goto ex; } 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; } if (image != NULL) { *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;} } if (status != BURN_DISC_APPENDABLE && status != BURN_DISC_FULL) { isoburn_msgs_submit(o, 0x00060000, "Program error: isoburn_read_image: incorrect disc status", 0, "FATAL", 0); {ret= -4; goto ex;} } ret = isoburn_disc_get_msc1(d, &int_num); if (ret <= 0) {ret= -2; goto ex;} ms_block= int_num; if (o != NULL) o->image_start_lba= ms_block; ret = isoburn_read_iso_head(d, int_num, &dummy, NULL, 0); if (ret <= 0) { sprintf(msg, "No ISO 9660 image at LBA %d. Creating blank image.", int_num); isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0); goto create_blank_image; } if(read_opts->displacement != 0 && abs(read_opts->displacement_sign) == 1) { /* Apply reverse displacement to session start */ if(read_opts->displacement_sign == -1) { if(ms_block+ read_opts->displacement < ms_block) { displacement_rollover:; sprintf(msg, "Displacement offset leads outside 32 bit range."); isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0); {ret= 0; goto ex;} } ms_block+= read_opts->displacement; } else { if(ms_block < read_opts->displacement) goto displacement_rollover; ms_block-= read_opts->displacement; } } /* create the data source */ ret = iso_read_opts_new(&ropts, 0); if (ret < 0) { isoburn_report_iso_error(ret, "Cannot create write opts", 0, "FATAL", 0); goto ex; } /* Important: do not return until iso_read_opts_free() */ iso_read_opts_set_start_block(ropts, ms_block); iso_read_opts_set_no_rockridge(ropts, read_opts->norock); iso_read_opts_set_no_aaip(ropts, read_opts->noaaip); if(read_opts->nomd5 == 2) int_num= 2; else if(read_opts->nomd5 == 1) int_num= 1; else int_num= 0; iso_read_opts_set_no_md5(ropts, int_num); if(read_opts->do_ecma119_map) iso_read_opts_set_ecma119_map(ropts, read_opts->map_mode); 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= iso_image_set_truncate_mode(o->image, read_opts->truncate_mode, read_opts->truncate_length); if(ret < 0) goto ex; ds = isoburn_data_source_new(d, read_opts->displacement, read_opts->displacement_sign, read_opts->cache_tiles, read_opts->cache_tile_blocks); if (ds == NULL) { isoburn_report_iso_error(ret, "Cannot create IsoDataSource object", 0, "FATAL", 0); ret= -1; goto ex; } if(o->iso_data_source!=NULL) iso_data_source_unref(o->iso_data_source); o->iso_data_source= ds; iso_image_attach_data(o->image, o->read_pacifier_handle, isoburn_idle_free_function); if(o->read_pacifier_handle==NULL) iso_tree_set_report_callback(o->image, NULL); else iso_tree_set_report_callback(o->image, o->read_pacifier); ret = iso_image_import(o->image, ds, ropts, &features); iso_tree_set_report_callback(o->image, NULL); iso_read_opts_free(ropts); ropts= NULL; if (ret < 0) { isoburn_report_iso_error(ret, "Cannot import image", 0, "FAILURE", 0); goto ex; } /* Important: do not return until free(features) */ if (image!=NULL) { *image = o->image; iso_image_ref(*image); /*protects object from premature free*/ } read_opts->hasRR = iso_read_image_features_has_rockridge(features); read_opts->hasJoliet = iso_read_image_features_has_joliet(features); read_opts->hasIso1999 = iso_read_image_features_has_iso1999(features); read_opts->hasElTorito = iso_read_image_features_has_eltorito(features); read_opts->size = iso_read_image_features_get_size(features); 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_attach_image(struct burn_drive *d, IsoImage *image) { int ret; struct isoburn *o; ret = isoburn_find_emulator(&o, d, 0); if (ret < 0 || o == NULL) return 0; if (image == NULL) { isoburn_msgs_submit(o, 0x00060000, "Program error: isoburn_attach_image: image==NULL", 0, "FATAL", 0); return -1; } if(o->image != NULL) iso_image_unref(o->image); o->image = image; o->image_start_lba = -1; return(1); } /* API */ int isoburn_attach_start_lba(struct burn_drive *d, int lba, int flag) { int ret; struct isoburn *o; ret = isoburn_find_emulator(&o, d, 0); if(ret < 0) return ret; if(o == NULL) return 0; if(o->image == NULL) return 0; o->image_start_lba = lba; return 1; } /* API function. See libisoburn.h */ int isoburn_activate_session(struct burn_drive *drive) { int ret, do_sync = 1; struct isoburn *o; ret = isoburn_find_emulator(&o, drive, 0); if (ret < 0) return -1; if (o->emulation_mode != 1) return 1; /* don't need to activate session */ if (o->fabricated_msc2 >= 0) return 1; /* blind growing: do not alter anything outside the session */ if (!(o->fabricated_disc_status == BURN_DISC_APPENDABLE || (o->fabricated_disc_status == BURN_DISC_BLANK && o->zero_nwa > 0))) return 1; ret = burn_drive_get_drive_role(drive); if (ret != 1) do_sync = !! o->do_fsync; ret = burn_random_access_write(drive, (off_t) 0, (char*)o->target_iso_head, o->target_iso_head_size, do_sync); return ret; } /** API @since 0.6.2 */ int isoburn_get_img_partition_offset(struct burn_drive *drive, uint32_t *block_offset_2k) { int ret; struct isoburn *o; ret = isoburn_find_emulator(&o, drive, 0); if(ret < 0 || o == NULL) return -1; *block_offset_2k= o->loaded_partition_offset; if(o->loaded_partition_offset == 0) return(0); if(o->target_iso_head_size == (off_t) Libisoburn_target_head_sizE + (off_t) 2048 * (off_t) o->loaded_partition_offset) return(1); return(2); } /* Check for MBR signature and a first partition that starts at a 2k block and ends where the image ends. If not too large or too small, accept its start as partition offset. */ static int isoburn_inspect_partition(struct isoburn *o, uint32_t img_size, int flag) { uint8_t *mbr, *part, *buf= NULL; uint32_t offst, numsec; struct ecma119_pri_vol_desc *pvm; off_t data_count; int ret; char *msg= NULL; static int max_offst= 512 - 32; buf= (uint8_t *) calloc(1, 2048); msg= calloc(1, 160); if(buf == NULL || msg == NULL) {ret= -1; goto ex;} mbr= o->target_iso_head; part= mbr + 446; if(mbr[510] != 0x55 || mbr[511] != 0xAA) {ret= 2; goto ex;} /* not an MBR */ /* Does the first partition entry look credible ? */ if(part[0] != 0x80 && part[0] != 0x00) {ret= 2; goto ex;} /* Invalid partition status */ if(part[1] == 0 && part[2] == 0 && part[3] == 0) {ret= 2; goto ex;} /* Zero C/H/S start address */ /* Does it match the normal ISO image ? */ offst= iso_read_lsb(part + 8, 4); numsec= iso_read_lsb(part + 12, 4); if(offst < 64) {ret= 2; goto ex;} /* Zero or unusably small partition start */ if((offst % 4) || (numsec % 4)) {ret= 2; goto ex;} /* Not aligned to 2k */ if(numsec < 72) {ret= 2; goto ex;} /* No room for volume descriptors */ offst/= 4; numsec/= 4; if(offst + numsec > img_size) {ret= 2; goto ex;} /* Partition end exceeds image end */ /* Is there a PVD at the partition start ? */ ret = burn_read_data(o->drive, (off_t) (offst + 16) * (off_t) 2048, (char*) buf, 2048, &data_count, 32); if(ret <= 0) {ret= 2; goto ex;} pvm = (struct ecma119_pri_vol_desc *) buf; if (strncmp((char*) pvm->std_identifier, "CD001", 5) != 0) {ret= 2; goto ex;} /* not a PVD */ if (pvm->vol_desc_type[0] != 1 || pvm->vol_desc_version[0] != 1 || pvm->file_structure_version[0] != 1 ) {ret= 2; goto ex;} /* failed sanity check */ if(iso_read_lsb(pvm->vol_space_size, 4) + offst > img_size) {ret= 2; goto ex;} /* Image ends do not match plausibly */ /* Now it is credible. Not yet clear is whether it is acceptable. */ o->loaded_partition_offset= offst; /* If the partition start is too large: Report but do not accept. */ if(offst > (uint32_t) max_offst) {/* Not more than 1 MB of .target_iso_head */ sprintf(msg, "Detected partition offset of %.f blocks. Maximum for load buffer is %d", (double) offst, max_offst); isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "WARNING", 0); {ret= 3; goto ex;} } /* Accept partition start and adjust buffer size */ ret= isoburn_adjust_target_iso_head(o, offst, 0); if(ret <= 0) goto ex; ret= 1; ex:; if(buf != NULL) free(buf); if(msg != NULL) free(msg); return(ret); } /** Initialize the emulation of multi-session on random access media. The need for emulation is confirmed already. @param o A freshly created isoburn object. isoburn_create_data_source() was already called, nevertheless. @param flag bit0= read-only @return <=0 error , 1 = success */ int isoburn_start_emulation(struct isoburn *o, int flag) { int ret, i, capacity = -1, role, dummy; off_t data_count, to_read; struct burn_drive *drive; struct ecma119_pri_vol_desc *pvm; enum burn_disc_status s; char *path= NULL, *msg= NULL; path= calloc(1, BURN_DRIVE_ADR_LEN); msg= calloc(1, 2 * BURN_DRIVE_ADR_LEN); if(path == NULL || msg == NULL) {ret= -1; goto ex;} if(o==NULL) { isoburn_msgs_submit(NULL, 0x00060000, "Program error: isoburn_start_emulation: o==NULL", 0, "FATAL", 0); {ret= -1; goto ex;} } drive= o->drive; if(flag & 1) o->fabricated_disc_status= BURN_DISC_FULL; /* We can assume 0 as start block for image. The data there point to the most recent session. */ role = burn_drive_get_drive_role(drive); ret = burn_get_read_capacity(drive, &capacity, 0); if (ret <= 0) capacity = -1; if (role == 5) { /* random access write-only medium */ s = burn_disc_get_status(drive); o->fabricated_disc_status= s; burn_disc_track_lba_nwa(drive, NULL, 0, &dummy, &(o->nwa)); if(o->nwa < o->zero_nwa) o->zero_nwa= 0; {ret= 1; goto ex;} } else if (capacity > 0 || role == 2 || role == 4) { /* Might be a block device on a system where libburn cannot determine its size. Try to read anyway. */ to_read = o->target_iso_head_size; memset(o->target_iso_head, 0, to_read); if(capacity > 0 && (off_t) capacity * (off_t) 2048 < to_read) to_read = (off_t) capacity * (off_t) 2048; ret = burn_read_data(drive, (off_t) 0, (char*)o->target_iso_head, to_read, &data_count, 32 | 8); if (ret <= 0) { /* an error means a disc with no ISO image */ o->media_read_error= 1; if (ret == -2) { path[0]= 0; burn_drive_d_get_adr(drive, path); sprintf(msg, "Pseudo drive '%s' does not allow reading", path); isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "NOTE", 0); o->fabricated_disc_status= BURN_DISC_BLANK; } else if (capacity > 0) o->fabricated_disc_status= BURN_DISC_FULL; else if(!(flag & 1)) o->fabricated_disc_status= BURN_DISC_BLANK; {ret= 1; goto ex;} } } else { /* No read capacity means blank medium */ if(!(flag & 1)) o->fabricated_disc_status= BURN_DISC_BLANK; {ret= 1; goto ex;} } /* check first 64K. If 0's, the disc is treated as a blank disc, and thus overwritten without extra check. */ i = Libisoburn_target_head_sizE; while (i && !o->target_iso_head[i-1]) --i; if (!i) { if(!(flag & 1)) o->fabricated_disc_status= BURN_DISC_BLANK; {ret= 1; goto ex;} } pvm = (struct ecma119_pri_vol_desc *)(o->target_iso_head + 16 * 2048); if (strncmp((char*)pvm->std_identifier, "CD001", 5) == 0) { off_t size; /* sanity check */ if (pvm->vol_desc_type[0] != 1 || pvm->vol_desc_version[0] != 1 || pvm->file_structure_version[0] != 1 ) { /* TODO for now I treat this as a full disc */ o->fabricated_disc_status= BURN_DISC_FULL; {ret= 1; goto ex;} } /* ok, PVM found, set size */ size = (off_t) iso_read_lsb(pvm->vol_space_size, 4); ret= isoburn_inspect_partition(o, (uint32_t) size, 0); if (ret <= 0) goto ex; size *= (off_t) 2048; /* block size in bytes */ isoburn_set_start_byte(o, size, 0); if(!(flag & 1)) o->fabricated_disc_status= BURN_DISC_APPENDABLE; } else if (strncmp((char*)pvm->std_identifier, "CDXX1", 5) == 0 || (strncmp((char*)pvm->std_identifier, "CDxx1", 5) == 0 && pvm->vol_desc_type[0] == 'x')) { /* empty image */ isoburn_set_start_byte(o, o->zero_nwa * 2048, 0); if(!(flag & 1)) o->fabricated_disc_status= BURN_DISC_BLANK; } else { /* treat any disc in an unknown format as full */ o->fabricated_disc_status= BURN_DISC_FULL; } ret= 1; ex:; if(path != NULL) free(path); if(msg != NULL) free(msg); return(ret); } /** Alters and writes the first 64 kB of a "medium" to invalidate an ISO image. (It shall stay restorable by skilled humans, though). The result shall especially keep libisoburn from accepting the medium image as ISO filesystem. @param o A fully activated isoburn object. isoburn_start_emulation() was already called. @return <=0 error , 1 = success */ int isoburn_invalidate_iso(struct isoburn *o, int flag) { int end_ed_found= 0, i; char *head; head= (char *) o->target_iso_head; /* * replace CD001 with CDXX1 in PVM. */ 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); } } return isoburn_activate_session(o->drive); } /* API @since 0.1.0 */ int isoburn_set_read_pacifier(struct burn_drive *drive, int (*read_pacifier)(IsoImage*, IsoFileSource*), void *read_handle) { int ret; struct isoburn *o; ret = isoburn_find_emulator(&o, drive, 0); if(ret < 0 || o == NULL) return -1; o->read_pacifier_handle= read_handle; o->read_pacifier= read_pacifier; return(1); } libisoburn-1.5.4/COPYING0000644000175700017510000003542713701321754011673 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS libisoburn-1.5.4/TODO0000644000175700017510000000107213701321754011315 00000000000000[Task] Figure out how to use "Requires" in pc.in (libisoburn and libisofs would benefit) [Task] Figure out the usage of Libs.private (used in libburn) [Task] Improve build system [Task] Investigate build system, so other libburnia components can benefit [Task] Write Doxygen files [Task] Explain to Thomas & Vreixo about NEWS importance (all libburnia components will benefit [Task] Write a document about ABI & API [Task] Create following targets for make: Src, Indent, Docs, Test, All [Any other suggestions?) All those tasks are currently assigned to Mario. libisoburn-1.5.4/test/0000755000175700017510000000000014005267033011661 500000000000000libisoburn-1.5.4/test/compare_file.c0000644000175700017510000002046513701321754014404 00000000000000/* Compare two copies of a file object in as many aspects as i can imagine to make sense. (E.g.: comparing atime makes no sense.) To compare tree /media/dvd and /original/dir : find /media/dvd -exec compare_file '{}' /media/dvd /original/dir ';' Copyright 2008 - 2015 Thomas Schmitt, Provided under GPL version 2 or later. cc -g -o compare_file compare_file.c */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include /* 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) { if(flag&1) goto single_letters; if(S_ISDIR(st_mode)) return("directory"); else if(S_ISREG(st_mode)) return("regular_file"); else if(S_ISLNK(st_mode)) return("symbolic_link"); else if(S_ISBLK(st_mode)) return("block_device"); else if(S_ISCHR(st_mode)) return("char_device"); else if(S_ISFIFO(st_mode)) return("name_pipe"); else if(S_ISSOCK(st_mode)) return("unix_socket"); return("unknown"); single_letters:; if(S_ISDIR(st_mode)) return("d"); else if(S_ISREG(st_mode)) return("-"); else if(S_ISLNK(st_mode)) return("l"); else if(S_ISBLK(st_mode)) return("b"); else if(S_ISCHR(st_mode)) return("c"); else if(S_ISFIFO(st_mode)) return("p"); else if(S_ISSOCK(st_mode)) return("s"); return("?"); } char *Ftimetxt(time_t t, char timetext[40], int flag) { char *rpt; struct tm tms, *tmpt; static char months[12][4]= { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; tmpt= localtime_r(&t, &tms); rpt= timetext; rpt[0]= 0; if(tmpt==0) sprintf(rpt+strlen(rpt), "%12.f", (double) t); else if(time(NULL)-t < 180*86400 && time(NULL)-t >= 0) sprintf(rpt+strlen(rpt), "%3s %2d %2.2d:%2.2d", months[tms.tm_mon], tms.tm_mday, tms.tm_hour, tms.tm_min); else sprintf(rpt+strlen(rpt), "%3s %2d %4.4d", months[tms.tm_mon], tms.tm_mday, 1900+tms.tm_year); return(timetext); } /* @param flag bit0= compare atime bit1= compare ctime */ int Compare_2_files(char *adr1, char *adr2, char *adrc, int flag) { struct stat s1, s2; 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) { printf("? %s : cannot lstat() : %s\n", adr1, strerror(errno)); return(0); } strcpy(a, Ftypetxt(s1.st_mode, 1)); strcat(a, " "); if(adrc[0]) { if(strlen(a) + strlen(adrc) < 4096) strcat(a, adrc); } else { strcat(a, "."); } ret= lstat(adr2, &s2); if(ret==-1) { printf("? %s : cannot lstat() : %s\n", adr2, strerror(errno)); return(0); } /* Attributes */ if(s1.st_mode != s2.st_mode) { if((s1.st_mode&~S_IFMT)!=(s2.st_mode&~S_IFMT)) printf("%s : st_mode : %7.7o <> %7.7o\n", a, (unsigned int) (s1.st_mode & ~S_IFMT), (unsigned int) (s2.st_mode & ~S_IFMT)); if((s1.st_mode&S_IFMT)!=(s2.st_mode&S_IFMT)) printf("%s : type : %s <> %s\n", a, Ftypetxt(s1.st_mode, 0), Ftypetxt(s2.st_mode, 0)); differs= 1; } if(s1.st_uid != s2.st_uid) { printf("%s : st_uid : %lu <> %lu\n", a, (unsigned long) s1.st_uid, (unsigned long) s2.st_uid); differs= 1; } if(s1.st_gid != s2.st_gid) { printf("%s : st_gid : %lu <> %lu\n", a, (unsigned long) s1.st_gid, (unsigned long) s2.st_gid); differs= 1; } if((S_ISCHR(s1.st_mode) && S_ISCHR(s2.st_mode)) || (S_ISBLK(s1.st_mode) && S_ISBLK(s2.st_mode))) { if(s1.st_rdev != s2.st_rdev) { printf("%s : %s st_rdev : %lu <> %lu\n", a, (S_ISCHR(s1.st_mode) ? "S_IFCHR" : "S_IFBLK"), (unsigned long) s1.st_rdev, (unsigned long) s1.st_rdev); differs= 1; } } if(S_ISREG(s2.st_mode) && s1.st_size != s2.st_size) { printf("%s : st_size : %.f <> %.f diff= %.f\n", a, (double) s1.st_size, (double) s2.st_size, ((double) s1.st_size) - (double) s2.st_size); differs= 1; } if(s1.st_mtime != s2.st_mtime) { printf("%s : st_mtime : %s <> %s diff= %.f s\n", a, Ftimetxt(s1.st_mtime, ttx1, 0), Ftimetxt(s2.st_mtime, ttx2, 0), ((double) s1.st_mtime) - (double) s2.st_mtime); differs= 1; } if(flag&1) { if(s1.st_atime != s2.st_atime) { printf("%s : st_atime : %s <> %s diff= %.f s\n", a, Ftimetxt(s1.st_atime, ttx1, 0), Ftimetxt(s2.st_atime, ttx2, 0), ((double) s1.st_atime) - (double) s2.st_atime); differs= 1; } } if(flag&2) { if(s1.st_ctime != s2.st_ctime) { printf("%s : st_ctime : %s <> %s diff= %.f s\n", a, Ftimetxt(s1.st_ctime, ttx1, 0), Ftimetxt(s2.st_ctime, ttx2, 0), ((double) s1.st_ctime) - (double) s2.st_ctime); differs= 1; } } if(S_ISREG(s1.st_mode) && S_ISREG(s2.st_mode)) { fd1= open(adr1, O_RDONLY | O_BINARY); if(fd1==-1) { printf("- %s : cannot open() : %s\n", adr1, strerror(errno)); return(0); } fd2= open(adr2, O_RDONLY | O_BINARY); if(fd2==-1) { printf("- %s : cannot open() : %s\n", adr2, strerror(errno)); close(fd1); return(0); } /* Content */ done= 0; while(!done) { r1= read(fd1, buf1, sizeof(buf1)); r2= read(fd2, buf2, sizeof(buf2)); if((r1==EOF && r2==EOF) || (r1==0 && r2==0)) break; if(r1==EOF || r1==0) { if(r1==EOF) r1= 0; if(s1.st_size > r1count + r1) printf("- %s : early EOF after %.f bytes\n", adr1, (double) r1count); differs= 1; } r1count+= r1; if(r2==EOF || r2 r2count + r2) printf("- %s : early EOF after %.f bytes\n", adr2, (double) r2count); differs= 1; done= 1; } if(r2>r1) { if(s1.st_size > r1count + r1) printf("- %s : early EOF after %.f bytes\n", adr1, (double) r1count); differs= 1; done= 1; } r2count+= r2; if(r1>r2) r1= r2; for(i= 0; i0 || 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); differs= 1; } } if(fd1!=-1) close(fd1); if(fd2!=-1) close(fd2); return(!differs); } int main(int argc, char **argv) { int ret, i, with_ctime= 1; char adr1[4096], adr2[4096], adrc[4096]; if(sizeof(off_t) < 8) { fprintf(stderr, "%s : FATAL : Compile time misconfiguration. sizeof(off_t) too small.\n\n", argv[0]); exit(4); } if(argc<4) { fprintf(stderr, "usage: %s path prefix1 prefix2\n", argv[0]); exit(2); } for(i= 4; i= 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); ret= Compare_2_files(adr1, adr2, adrc, (with_ctime<<1)); exit(ret<=0); } libisoburn-1.5.4/Makefile.in0000644000175700017510000024151014005267031012670 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2006 - 2008 Vreixo Formoso # Copyright (C) 2008 - 2019 Thomas Schmitt # Provided under GPL version 2 or later. VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = xorriso/xorriso$(EXEEXT) noinst_PROGRAMS = test/compare_file$(EXEEXT) \ xorriso/make_xorriso_1$(EXEEXT) subdir = . DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(top_srcdir)/doc/doxygen.conf.in $(srcdir)/version.h.in \ $(srcdir)/libisoburn-1.pc.in depcomp texinfo.tex \ $(libinclude_HEADERS) AUTHORS COPYING ChangeLog INSTALL NEWS \ README TODO compile config.guess config.sub install-sh missing \ ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = doc/doxygen.conf version.h libisoburn-1.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" \ "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(libincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libisoburn_libisoburn_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__dirstamp = $(am__leading_dot)dirstamp am_libisoburn_libisoburn_la_OBJECTS = libisoburn/burn_wrap.lo \ libisoburn/data_source.lo libisoburn/isoburn.lo \ libisoburn/isofs_wrap.lo xorriso/sfile.lo \ xorriso/aux_objects.lo xorriso/findjob.lo \ xorriso/check_media.lo xorriso/misc_funct.lo \ xorriso/text_io.lo xorriso/match.lo xorriso/emulators.lo \ xorriso/disk_ops.lo xorriso/cmp_update.lo \ xorriso/parse_exec.lo xorriso/opts_a_c.lo xorriso/opts_d_h.lo \ xorriso/opts_i_o.lo xorriso/opts_p_z.lo xorriso/base_obj.lo \ xorriso/lib_mgt.lo xorriso/sort_cmp.lo xorriso/drive_mgt.lo \ xorriso/iso_img.lo xorriso/iso_tree.lo xorriso/iso_manip.lo \ xorriso/write_run.lo xorriso/read_run.lo xorriso/filters.lo libisoburn_libisoburn_la_OBJECTS = \ $(am_libisoburn_libisoburn_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libisoburn_libisoburn_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libisoburn_libisoburn_la_LDFLAGS) \ $(LDFLAGS) -o $@ PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_test_compare_file_OBJECTS = \ test/test_compare_file-compare_file.$(OBJEXT) test_compare_file_OBJECTS = $(am_test_compare_file_OBJECTS) test_compare_file_DEPENDENCIES = test_compare_file_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_compare_file_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_xorriso_make_xorriso_1_OBJECTS = \ xorriso/xorriso_make_xorriso_1-make_xorriso_1.$(OBJEXT) xorriso_make_xorriso_1_OBJECTS = $(am_xorriso_make_xorriso_1_OBJECTS) xorriso_make_xorriso_1_DEPENDENCIES = xorriso_make_xorriso_1_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(xorriso_make_xorriso_1_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_xorriso_xorriso_OBJECTS = \ xorriso/xorriso_xorriso-xorriso_main.$(OBJEXT) xorriso_xorriso_OBJECTS = $(am_xorriso_xorriso_OBJECTS) xorriso_xorriso_DEPENDENCIES = libisoburn/libisoburn.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) SCRIPTS = $(bin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libisoburn_libisoburn_la_SOURCES) \ $(test_compare_file_SOURCES) $(xorriso_make_xorriso_1_SOURCES) \ $(xorriso_xorriso_SOURCES) DIST_SOURCES = $(libisoburn_libisoburn_la_SOURCES) \ $(test_compare_file_SOURCES) $(xorriso_make_xorriso_1_SOURCES) \ $(xorriso_xorriso_SOURCES) AM_V_DVIPS = $(am__v_DVIPS_@AM_V@) am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@) am__v_DVIPS_0 = @echo " DVIPS " $@; am__v_DVIPS_1 = AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@) am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@) am__v_MAKEINFO_0 = @echo " MAKEINFO" $@; am__v_MAKEINFO_1 = AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@) am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@) am__v_INFOHTML_0 = @echo " INFOHTML" $@; am__v_INFOHTML_1 = AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@) am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@) am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@; am__v_TEXI2DVI_1 = AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@) am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@) am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@; am__v_TEXI2PDF_1 = AM_V_texinfo = $(am__v_texinfo_@AM_V@) am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@) am__v_texinfo_0 = -q am__v_texinfo_1 = AM_V_texidevnull = $(am__v_texidevnull_@AM_V@) am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@) am__v_texidevnull_0 = > /dev/null am__v_texidevnull_1 = INFO_DEPS = $(srcdir)/xorriso/xorriso.info \ $(srcdir)/xorriso/xorrisofs.info \ $(srcdir)/xorriso/xorrecord.info \ $(srcdir)/xorriso/xorriso-tcltk.info \ $(srcdir)/xorriso-dd-target/xorriso-dd-target.info am__TEXINFO_TEX_DIR = $(srcdir) DVIS = xorriso/xorriso.dvi xorriso/xorrisofs.dvi xorriso/xorrecord.dvi \ xorriso/xorriso-tcltk.dvi \ xorriso-dd-target/xorriso-dd-target.dvi PDFS = xorriso/xorriso.pdf xorriso/xorrisofs.pdf xorriso/xorrecord.pdf \ xorriso/xorriso-tcltk.pdf \ xorriso-dd-target/xorriso-dd-target.pdf PSS = xorriso/xorriso.ps xorriso/xorrisofs.ps xorriso/xorrecord.ps \ xorriso/xorriso-tcltk.ps \ xorriso-dd-target/xorriso-dd-target.ps HTMLS = xorriso/xorriso.html xorriso/xorrisofs.html \ xorriso/xorrecord.html xorriso/xorriso-tcltk.html \ xorriso-dd-target/xorriso-dd-target.html TEXINFOS = xorriso/xorriso.texi xorriso/xorrisofs.texi \ xorriso/xorrecord.texi xorriso/xorriso-tcltk.texi \ xorriso-dd-target/xorriso-dd-target.texi TEXI2DVI = texi2dvi TEXI2PDF = $(TEXI2DVI) --pdf --batch MAKEINFOHTML = $(MAKEINFO) --html AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) DVIPS = dvips am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) DATA = $(nodist_pkgconfig_DATA) HEADERS = $(libinclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope AM_RECURSIVE_TARGETS = cscope DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARCH = @ARCH@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTF_DEF = @EXTF_DEF@ EXTF_SUID_DEF = @EXTF_SUID_DEF@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ISOBURN_MAJOR_VERSION = @ISOBURN_MAJOR_VERSION@ ISOBURN_MICRO_VERSION = @ISOBURN_MICRO_VERSION@ ISOBURN_MINOR_VERSION = @ISOBURN_MINOR_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LFRONT_DEF = @LFRONT_DEF@ LFRONT_SUID_DEF = @LFRONT_SUID_DEF@ LIBACL_DEF = @LIBACL_DEF@ LIBBURNIA_LDCONFIG_CMD = @LIBBURNIA_LDCONFIG_CMD@ LIBBURNIA_PKGCONFDIR = @LIBBURNIA_PKGCONFDIR@ LIBBURN_ARCH_LIBS = @LIBBURN_ARCH_LIBS@ LIBBURN_CFLAGS = @LIBBURN_CFLAGS@ LIBBURN_LIBS = @LIBBURN_LIBS@ LIBCDIO_CFLAGS = @LIBCDIO_CFLAGS@ LIBCDIO_DEF = @LIBCDIO_DEF@ LIBCDIO_LIBS = @LIBCDIO_LIBS@ LIBISOFS_CFLAGS = @LIBISOFS_CFLAGS@ LIBISOFS_LIBS = @LIBISOFS_LIBS@ LIBJTE_DEF = @LIBJTE_DEF@ LIBLDFLAGS = @LIBLDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ READLINE_DEF = @READLINE_DEF@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ VERSION = @VERSION@ XATTR_DEF = @XATTR_DEF@ XORRISO_DD_TARGET = @XORRISO_DD_TARGET@ XORRISO_DD_TARGET_MAN = @XORRISO_DD_TARGET_MAN@ XORRISO_DD_TARGET_TEXI = @XORRISO_DD_TARGET_TEXI@ XORRISO_DVD_OBS_64K = @XORRISO_DVD_OBS_64K@ ZLIB_DEF = @ZLIB_DEF@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = $(DESTDIR)$(prefix)/share/doc/$(PACKAGE)-$(VERSION) dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # ts A90315 : LIBBURNIA_PKGCONFDIR is defined OS specific in acinclude.m4 # was: pkgconfigdir=$(libdir)/pkgconfig pkgconfigdir = $(LIBBURNIA_PKGCONFDIR) libincludedir = $(includedir)/libisoburn lib_LTLIBRARIES = libisoburn/libisoburn.la ACLOCAL_AMFLAGS = -I ./ # Build libraries libisoburn_libisoburn_la_LDFLAGS = \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) $(LIBLDFLAGS) libisoburn_libisoburn_la_SOURCES = \ libisoburn/isoburn.h \ libisoburn/libisoburn.h \ libisoburn/burn_wrap.c \ libisoburn/data_source.c \ libisoburn/isoburn.c \ libisoburn/isofs_wrap.c \ \ xorriso/xorriso.h \ xorriso/xorriso_private.h \ xorriso/sfile.h \ xorriso/sfile.c \ xorriso/aux_objects.h \ xorriso/aux_objects.c \ xorriso/findjob.h \ xorriso/findjob.c \ xorriso/check_media.h \ xorriso/check_media.c \ xorriso/misc_funct.h \ xorriso/misc_funct.c \ xorriso/text_io.h \ xorriso/text_io.c \ xorriso/match.h \ xorriso/match.c \ xorriso/emulators.h \ xorriso/emulators.c \ xorriso/disk_ops.h \ xorriso/disk_ops.c \ xorriso/cmp_update.h \ xorriso/cmp_update.c \ xorriso/parse_exec.h \ xorriso/parse_exec.c \ xorriso/opts_a_c.c \ xorriso/opts_d_h.c \ xorriso/opts_i_o.c \ xorriso/opts_p_z.c \ \ xorriso/xorrisoburn.h \ xorriso/base_obj.h \ xorriso/base_obj.c \ xorriso/lib_mgt.h \ xorriso/lib_mgt.c \ xorriso/sort_cmp.h \ xorriso/sort_cmp.c \ xorriso/drive_mgt.h \ xorriso/drive_mgt.c \ xorriso/iso_img.h \ xorriso/iso_img.c \ xorriso/iso_tree.h \ xorriso/iso_tree.c \ xorriso/iso_manip.h \ xorriso/iso_manip.c \ xorriso/write_run.h \ xorriso/write_run.c \ xorriso/read_run.h \ xorriso/read_run.c \ xorriso/filters.h \ xorriso/filters.c \ xorriso/xorriso_timestamp.h \ xorriso/xorriso_buildstamp.h libisoburn_libisoburn_la_LIBADD = \ $(THREAD_LIBS) \ -lisofs \ -lburn libinclude_HEADERS = \ libisoburn/libisoburn.h \ xorriso/xorriso.h # This looks quite ugly with make install: xorriso.c is compiled twice again # # Trying to create a build timestamp file # # BUILT_SOURCES = xorriso/xorriso_buildstamp.h # # phony targets get rebuilt every time # # .PHONY: xorriso/xorriso_buildstamp.h # xorriso/xorriso_buildstamp.h: # date -u '+#define Xorriso_build_timestamP "%Y.%m.%d.%H%M%S"' >xorriso/xorriso_buildstamp.h # cat xorriso/xorriso_buildstamp.h xorriso_xorriso_CPPFLAGS = -Ilibisoburn # xorriso_xorriso_CFLAGS = $(READLINE_DEF) $(LIBACL_DEF) $(XATTR_DEF) \ # $(EXTF_DEF) $(EXTF_SUID_DEF) $(ZLIB_DEF) \ # $(XORRISO_DVD_OBS_64K) xorriso_xorriso_LDADD = libisoburn/libisoburn.la -lisofs -lburn \ $(THREAD_LIBS) $(LIBBURN_ARCH_LIBS) xorriso_xorriso_SOURCES = \ xorriso/xorriso.h \ xorriso/xorriso_main.c # A program to compare two files in mirrored trees in mounted filesystems # To compare tree /media/dvd and /original/dir : # find /media/dvd -exec test/compare_file '{}' /media/dvd /original/dir ';' # test_compare_file_CPPFLAGS = test_compare_file_CFLAGS = test_compare_file_LDADD = test_compare_file_SOURCES = test/compare_file.c # Specialized converter from xorriso/xorriso.texi to xorriso/xorriso.1 # xorriso_make_xorriso_1_CPPFLAGS = xorriso_make_xorriso_1_CFLAGS = xorriso_make_xorriso_1_LDADD = xorriso_make_xorriso_1_SOURCES = xorriso/make_xorriso_1.c # A Proof-of-concept for frontends, and xorriso-dd-target if on Linux kernel bin_SCRIPTS = \ frontend/xorriso-tcltk \ $(XORRISO_DD_TARGET) EXTRA_SCRIPTS = xorriso-dd-target/xorriso-dd-target webhost = http://libburn-api.pykix.org webpath = / # Indent source files indent_files = \ $(libisoburn_libisoburn_la_SOURCES) # Extra things 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) 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 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 \ COPYRIGHT \ COPYING \ INSTALL \ ChangeLog \ libisoburn/libisoburn.ver \ xorriso/changelog.txt \ xorriso/xorriso_buildstamp_none.h \ xorriso/README_gnu_xorriso \ xorriso/make_docs.sh \ releng/README \ releng/auto_cxx \ releng/auto_isocontent \ releng/auto_printsize \ releng/change_shell_to_use \ releng/codesamples/api_3lib.cpp \ releng/codesamples/api_xorriso.cpp \ releng/inc/releng_getopts.inc \ releng/jigdo-gen-md5-list \ releng/jigdo-gen-md5-list.1 \ releng/manual_burn \ releng/manual_devices \ releng/manual_isojigdo \ releng/releng_generated_data/placeholder \ releng/run_all_auto \ releng/template_new \ $(man_MANS) all: all-am .SUFFIXES: .SUFFIXES: .c .dvi .lo .o .obj .ps am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): doc/doxygen.conf: $(top_builddir)/config.status $(top_srcdir)/doc/doxygen.conf.in cd $(top_builddir) && $(SHELL) ./config.status $@ version.h: $(top_builddir)/config.status $(srcdir)/version.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ libisoburn-1.pc: $(top_builddir)/config.status $(srcdir)/libisoburn-1.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libisoburn/$(am__dirstamp): @$(MKDIR_P) libisoburn @: > libisoburn/$(am__dirstamp) libisoburn/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) libisoburn/$(DEPDIR) @: > libisoburn/$(DEPDIR)/$(am__dirstamp) libisoburn/burn_wrap.lo: libisoburn/$(am__dirstamp) \ libisoburn/$(DEPDIR)/$(am__dirstamp) libisoburn/data_source.lo: libisoburn/$(am__dirstamp) \ libisoburn/$(DEPDIR)/$(am__dirstamp) libisoburn/isoburn.lo: libisoburn/$(am__dirstamp) \ libisoburn/$(DEPDIR)/$(am__dirstamp) libisoburn/isofs_wrap.lo: libisoburn/$(am__dirstamp) \ libisoburn/$(DEPDIR)/$(am__dirstamp) xorriso/$(am__dirstamp): @$(MKDIR_P) xorriso @: > xorriso/$(am__dirstamp) xorriso/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xorriso/$(DEPDIR) @: > xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/sfile.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/aux_objects.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/findjob.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/check_media.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/misc_funct.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/text_io.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/match.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/emulators.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/disk_ops.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/cmp_update.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/parse_exec.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/opts_a_c.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/opts_d_h.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/opts_i_o.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/opts_p_z.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/base_obj.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/lib_mgt.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/sort_cmp.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/drive_mgt.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/iso_img.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/iso_tree.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/iso_manip.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/write_run.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/read_run.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/filters.lo: xorriso/$(am__dirstamp) \ xorriso/$(DEPDIR)/$(am__dirstamp) libisoburn/libisoburn.la: $(libisoburn_libisoburn_la_OBJECTS) $(libisoburn_libisoburn_la_DEPENDENCIES) $(EXTRA_libisoburn_libisoburn_la_DEPENDENCIES) libisoburn/$(am__dirstamp) $(AM_V_CCLD)$(libisoburn_libisoburn_la_LINK) -rpath $(libdir) $(libisoburn_libisoburn_la_OBJECTS) $(libisoburn_libisoburn_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list test/$(am__dirstamp): @$(MKDIR_P) test @: > test/$(am__dirstamp) test/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) test/$(DEPDIR) @: > test/$(DEPDIR)/$(am__dirstamp) test/test_compare_file-compare_file.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) test/compare_file$(EXEEXT): $(test_compare_file_OBJECTS) $(test_compare_file_DEPENDENCIES) $(EXTRA_test_compare_file_DEPENDENCIES) test/$(am__dirstamp) @rm -f test/compare_file$(EXEEXT) $(AM_V_CCLD)$(test_compare_file_LINK) $(test_compare_file_OBJECTS) $(test_compare_file_LDADD) $(LIBS) xorriso/xorriso_make_xorriso_1-make_xorriso_1.$(OBJEXT): \ xorriso/$(am__dirstamp) xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/make_xorriso_1$(EXEEXT): $(xorriso_make_xorriso_1_OBJECTS) $(xorriso_make_xorriso_1_DEPENDENCIES) $(EXTRA_xorriso_make_xorriso_1_DEPENDENCIES) xorriso/$(am__dirstamp) @rm -f xorriso/make_xorriso_1$(EXEEXT) $(AM_V_CCLD)$(xorriso_make_xorriso_1_LINK) $(xorriso_make_xorriso_1_OBJECTS) $(xorriso_make_xorriso_1_LDADD) $(LIBS) xorriso/xorriso_xorriso-xorriso_main.$(OBJEXT): \ xorriso/$(am__dirstamp) xorriso/$(DEPDIR)/$(am__dirstamp) xorriso/xorriso$(EXEEXT): $(xorriso_xorriso_OBJECTS) $(xorriso_xorriso_DEPENDENCIES) $(EXTRA_xorriso_xorriso_DEPENDENCIES) xorriso/$(am__dirstamp) @rm -f xorriso/xorriso$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xorriso_xorriso_OBJECTS) $(xorriso_xorriso_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f libisoburn/*.$(OBJEXT) -rm -f libisoburn/*.lo -rm -f test/*.$(OBJEXT) -rm -f xorriso/*.$(OBJEXT) -rm -f xorriso/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@libisoburn/$(DEPDIR)/burn_wrap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libisoburn/$(DEPDIR)/data_source.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libisoburn/$(DEPDIR)/isoburn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libisoburn/$(DEPDIR)/isofs_wrap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_compare_file-compare_file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/aux_objects.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/base_obj.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/check_media.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/cmp_update.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/disk_ops.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/drive_mgt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/emulators.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/filters.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/findjob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/iso_img.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/iso_manip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/iso_tree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/lib_mgt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/match.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/misc_funct.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/opts_a_c.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/opts_d_h.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/opts_i_o.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/opts_p_z.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/parse_exec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/read_run.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/sfile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/sort_cmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/text_io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/write_run.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/xorriso_make_xorriso_1-make_xorriso_1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xorriso/$(DEPDIR)/xorriso_xorriso-xorriso_main.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< test/test_compare_file-compare_file.o: test/compare_file.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_compare_file_CPPFLAGS) $(CPPFLAGS) $(test_compare_file_CFLAGS) $(CFLAGS) -MT test/test_compare_file-compare_file.o -MD -MP -MF test/$(DEPDIR)/test_compare_file-compare_file.Tpo -c -o test/test_compare_file-compare_file.o `test -f 'test/compare_file.c' || echo '$(srcdir)/'`test/compare_file.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_compare_file-compare_file.Tpo test/$(DEPDIR)/test_compare_file-compare_file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/compare_file.c' object='test/test_compare_file-compare_file.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_compare_file_CPPFLAGS) $(CPPFLAGS) $(test_compare_file_CFLAGS) $(CFLAGS) -c -o test/test_compare_file-compare_file.o `test -f 'test/compare_file.c' || echo '$(srcdir)/'`test/compare_file.c test/test_compare_file-compare_file.obj: test/compare_file.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_compare_file_CPPFLAGS) $(CPPFLAGS) $(test_compare_file_CFLAGS) $(CFLAGS) -MT test/test_compare_file-compare_file.obj -MD -MP -MF test/$(DEPDIR)/test_compare_file-compare_file.Tpo -c -o test/test_compare_file-compare_file.obj `if test -f 'test/compare_file.c'; then $(CYGPATH_W) 'test/compare_file.c'; else $(CYGPATH_W) '$(srcdir)/test/compare_file.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_compare_file-compare_file.Tpo test/$(DEPDIR)/test_compare_file-compare_file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/compare_file.c' object='test/test_compare_file-compare_file.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_compare_file_CPPFLAGS) $(CPPFLAGS) $(test_compare_file_CFLAGS) $(CFLAGS) -c -o test/test_compare_file-compare_file.obj `if test -f 'test/compare_file.c'; then $(CYGPATH_W) 'test/compare_file.c'; else $(CYGPATH_W) '$(srcdir)/test/compare_file.c'; fi` xorriso/xorriso_make_xorriso_1-make_xorriso_1.o: xorriso/make_xorriso_1.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xorriso_make_xorriso_1_CPPFLAGS) $(CPPFLAGS) $(xorriso_make_xorriso_1_CFLAGS) $(CFLAGS) -MT xorriso/xorriso_make_xorriso_1-make_xorriso_1.o -MD -MP -MF xorriso/$(DEPDIR)/xorriso_make_xorriso_1-make_xorriso_1.Tpo -c -o xorriso/xorriso_make_xorriso_1-make_xorriso_1.o `test -f 'xorriso/make_xorriso_1.c' || echo '$(srcdir)/'`xorriso/make_xorriso_1.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xorriso/$(DEPDIR)/xorriso_make_xorriso_1-make_xorriso_1.Tpo xorriso/$(DEPDIR)/xorriso_make_xorriso_1-make_xorriso_1.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xorriso/make_xorriso_1.c' object='xorriso/xorriso_make_xorriso_1-make_xorriso_1.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xorriso_make_xorriso_1_CPPFLAGS) $(CPPFLAGS) $(xorriso_make_xorriso_1_CFLAGS) $(CFLAGS) -c -o xorriso/xorriso_make_xorriso_1-make_xorriso_1.o `test -f 'xorriso/make_xorriso_1.c' || echo '$(srcdir)/'`xorriso/make_xorriso_1.c xorriso/xorriso_make_xorriso_1-make_xorriso_1.obj: xorriso/make_xorriso_1.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xorriso_make_xorriso_1_CPPFLAGS) $(CPPFLAGS) $(xorriso_make_xorriso_1_CFLAGS) $(CFLAGS) -MT xorriso/xorriso_make_xorriso_1-make_xorriso_1.obj -MD -MP -MF xorriso/$(DEPDIR)/xorriso_make_xorriso_1-make_xorriso_1.Tpo -c -o xorriso/xorriso_make_xorriso_1-make_xorriso_1.obj `if test -f 'xorriso/make_xorriso_1.c'; then $(CYGPATH_W) 'xorriso/make_xorriso_1.c'; else $(CYGPATH_W) '$(srcdir)/xorriso/make_xorriso_1.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xorriso/$(DEPDIR)/xorriso_make_xorriso_1-make_xorriso_1.Tpo xorriso/$(DEPDIR)/xorriso_make_xorriso_1-make_xorriso_1.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xorriso/make_xorriso_1.c' object='xorriso/xorriso_make_xorriso_1-make_xorriso_1.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xorriso_make_xorriso_1_CPPFLAGS) $(CPPFLAGS) $(xorriso_make_xorriso_1_CFLAGS) $(CFLAGS) -c -o xorriso/xorriso_make_xorriso_1-make_xorriso_1.obj `if test -f 'xorriso/make_xorriso_1.c'; then $(CYGPATH_W) 'xorriso/make_xorriso_1.c'; else $(CYGPATH_W) '$(srcdir)/xorriso/make_xorriso_1.c'; fi` xorriso/xorriso_xorriso-xorriso_main.o: xorriso/xorriso_main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xorriso_xorriso_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xorriso/xorriso_xorriso-xorriso_main.o -MD -MP -MF xorriso/$(DEPDIR)/xorriso_xorriso-xorriso_main.Tpo -c -o xorriso/xorriso_xorriso-xorriso_main.o `test -f 'xorriso/xorriso_main.c' || echo '$(srcdir)/'`xorriso/xorriso_main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xorriso/$(DEPDIR)/xorriso_xorriso-xorriso_main.Tpo xorriso/$(DEPDIR)/xorriso_xorriso-xorriso_main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xorriso/xorriso_main.c' object='xorriso/xorriso_xorriso-xorriso_main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xorriso_xorriso_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xorriso/xorriso_xorriso-xorriso_main.o `test -f 'xorriso/xorriso_main.c' || echo '$(srcdir)/'`xorriso/xorriso_main.c xorriso/xorriso_xorriso-xorriso_main.obj: xorriso/xorriso_main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xorriso_xorriso_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xorriso/xorriso_xorriso-xorriso_main.obj -MD -MP -MF xorriso/$(DEPDIR)/xorriso_xorriso-xorriso_main.Tpo -c -o xorriso/xorriso_xorriso-xorriso_main.obj `if test -f 'xorriso/xorriso_main.c'; then $(CYGPATH_W) 'xorriso/xorriso_main.c'; else $(CYGPATH_W) '$(srcdir)/xorriso/xorriso_main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xorriso/$(DEPDIR)/xorriso_xorriso-xorriso_main.Tpo xorriso/$(DEPDIR)/xorriso_xorriso-xorriso_main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xorriso/xorriso_main.c' object='xorriso/xorriso_xorriso-xorriso_main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xorriso_xorriso_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xorriso/xorriso_xorriso-xorriso_main.obj `if test -f 'xorriso/xorriso_main.c'; then $(CYGPATH_W) 'xorriso/xorriso_main.c'; else $(CYGPATH_W) '$(srcdir)/xorriso/xorriso_main.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf libisoburn/.libs libisoburn/_libs -rm -rf test/.libs test/_libs -rm -rf xorriso/.libs xorriso/_libs distclean-libtool: -rm -f libtool config.lt $(srcdir)/xorriso/xorriso.info: xorriso/xorriso.texi $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I xorriso -I $(srcdir)/xorriso \ -o $@ $(srcdir)/xorriso/xorriso.texi; \ then \ rc=0; \ $(am__cd) $(srcdir); \ else \ rc=$$?; \ $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc xorriso/xorriso.dvi: xorriso/xorriso.texi xorriso/$(am__dirstamp) $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I xorriso -I $(srcdir)/xorriso' \ $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ `test -f 'xorriso/xorriso.texi' || echo '$(srcdir)/'`xorriso/xorriso.texi xorriso/xorriso.pdf: xorriso/xorriso.texi xorriso/$(am__dirstamp) $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I xorriso -I $(srcdir)/xorriso' \ $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ `test -f 'xorriso/xorriso.texi' || echo '$(srcdir)/'`xorriso/xorriso.texi xorriso/xorriso.html: xorriso/xorriso.texi xorriso/$(am__dirstamp) $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I xorriso -I $(srcdir)/xorriso \ -o $(@:.html=.htp) `test -f 'xorriso/xorriso.texi' || echo '$(srcdir)/'`xorriso/xorriso.texi; \ then \ rm -rf $@ && mv $(@:.html=.htp) $@; \ else \ rm -rf $(@:.html=.htp); exit 1; \ fi $(srcdir)/xorriso/xorrisofs.info: xorriso/xorrisofs.texi $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I xorriso -I $(srcdir)/xorriso \ -o $@ $(srcdir)/xorriso/xorrisofs.texi; \ then \ rc=0; \ $(am__cd) $(srcdir); \ else \ rc=$$?; \ $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc xorriso/xorrisofs.dvi: xorriso/xorrisofs.texi xorriso/$(am__dirstamp) $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I xorriso -I $(srcdir)/xorriso' \ $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ `test -f 'xorriso/xorrisofs.texi' || echo '$(srcdir)/'`xorriso/xorrisofs.texi xorriso/xorrisofs.pdf: xorriso/xorrisofs.texi xorriso/$(am__dirstamp) $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I xorriso -I $(srcdir)/xorriso' \ $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ `test -f 'xorriso/xorrisofs.texi' || echo '$(srcdir)/'`xorriso/xorrisofs.texi xorriso/xorrisofs.html: xorriso/xorrisofs.texi xorriso/$(am__dirstamp) $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I xorriso -I $(srcdir)/xorriso \ -o $(@:.html=.htp) `test -f 'xorriso/xorrisofs.texi' || echo '$(srcdir)/'`xorriso/xorrisofs.texi; \ then \ rm -rf $@ && mv $(@:.html=.htp) $@; \ else \ rm -rf $(@:.html=.htp); exit 1; \ fi $(srcdir)/xorriso/xorrecord.info: xorriso/xorrecord.texi $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I xorriso -I $(srcdir)/xorriso \ -o $@ $(srcdir)/xorriso/xorrecord.texi; \ then \ rc=0; \ $(am__cd) $(srcdir); \ else \ rc=$$?; \ $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc xorriso/xorrecord.dvi: xorriso/xorrecord.texi xorriso/$(am__dirstamp) $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I xorriso -I $(srcdir)/xorriso' \ $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ `test -f 'xorriso/xorrecord.texi' || echo '$(srcdir)/'`xorriso/xorrecord.texi xorriso/xorrecord.pdf: xorriso/xorrecord.texi xorriso/$(am__dirstamp) $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I xorriso -I $(srcdir)/xorriso' \ $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ `test -f 'xorriso/xorrecord.texi' || echo '$(srcdir)/'`xorriso/xorrecord.texi xorriso/xorrecord.html: xorriso/xorrecord.texi xorriso/$(am__dirstamp) $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I xorriso -I $(srcdir)/xorriso \ -o $(@:.html=.htp) `test -f 'xorriso/xorrecord.texi' || echo '$(srcdir)/'`xorriso/xorrecord.texi; \ then \ rm -rf $@ && mv $(@:.html=.htp) $@; \ else \ rm -rf $(@:.html=.htp); exit 1; \ fi $(srcdir)/xorriso/xorriso-tcltk.info: xorriso/xorriso-tcltk.texi $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I xorriso -I $(srcdir)/xorriso \ -o $@ $(srcdir)/xorriso/xorriso-tcltk.texi; \ then \ rc=0; \ $(am__cd) $(srcdir); \ else \ rc=$$?; \ $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc xorriso/xorriso-tcltk.dvi: xorriso/xorriso-tcltk.texi xorriso/$(am__dirstamp) $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I xorriso -I $(srcdir)/xorriso' \ $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ `test -f 'xorriso/xorriso-tcltk.texi' || echo '$(srcdir)/'`xorriso/xorriso-tcltk.texi xorriso/xorriso-tcltk.pdf: xorriso/xorriso-tcltk.texi xorriso/$(am__dirstamp) $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I xorriso -I $(srcdir)/xorriso' \ $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ `test -f 'xorriso/xorriso-tcltk.texi' || echo '$(srcdir)/'`xorriso/xorriso-tcltk.texi xorriso/xorriso-tcltk.html: xorriso/xorriso-tcltk.texi xorriso/$(am__dirstamp) $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I xorriso -I $(srcdir)/xorriso \ -o $(@:.html=.htp) `test -f 'xorriso/xorriso-tcltk.texi' || echo '$(srcdir)/'`xorriso/xorriso-tcltk.texi; \ then \ rm -rf $@ && mv $(@:.html=.htp) $@; \ else \ rm -rf $(@:.html=.htp); exit 1; \ fi xorriso-dd-target/$(am__dirstamp): @$(MKDIR_P) xorriso-dd-target @: > xorriso-dd-target/$(am__dirstamp) $(srcdir)/xorriso-dd-target/xorriso-dd-target.info: xorriso-dd-target/xorriso-dd-target.texi $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I xorriso-dd-target -I $(srcdir)/xorriso-dd-target \ -o $@ $(srcdir)/xorriso-dd-target/xorriso-dd-target.texi; \ then \ rc=0; \ $(am__cd) $(srcdir); \ else \ rc=$$?; \ $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc xorriso-dd-target/xorriso-dd-target.dvi: xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/$(am__dirstamp) $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I xorriso-dd-target -I $(srcdir)/xorriso-dd-target' \ $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ `test -f 'xorriso-dd-target/xorriso-dd-target.texi' || echo '$(srcdir)/'`xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/xorriso-dd-target.pdf: xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/$(am__dirstamp) $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I xorriso-dd-target -I $(srcdir)/xorriso-dd-target' \ $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ `test -f 'xorriso-dd-target/xorriso-dd-target.texi' || echo '$(srcdir)/'`xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/xorriso-dd-target.html: xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/$(am__dirstamp) $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I xorriso-dd-target -I $(srcdir)/xorriso-dd-target \ -o $(@:.html=.htp) `test -f 'xorriso-dd-target/xorriso-dd-target.texi' || echo '$(srcdir)/'`xorriso-dd-target/xorriso-dd-target.texi; \ then \ rm -rf $@ && mv $(@:.html=.htp) $@; \ else \ rm -rf $(@:.html=.htp); exit 1; \ fi .dvi.ps: $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) $(AM_V_texinfo) -o $@ $< uninstall-dvi-am: @$(NORMAL_UNINSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ rm -f "$(DESTDIR)$(dvidir)/$$f"; \ done uninstall-html-am: @$(NORMAL_UNINSTALL) @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ done uninstall-info-am: @$(PRE_UNINSTALL) @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done uninstall-pdf-am: @$(NORMAL_UNINSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ done uninstall-ps-am: @$(NORMAL_UNINSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ rm -f "$(DESTDIR)$(psdir)/$$f"; \ done dist-info: $(INFO_DEPS) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ case $$base in \ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ if test -f $$file; then \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f "$(distdir)/$$relfile" || \ cp -p $$file "$(distdir)/$$relfile"; \ else :; fi; \ done; \ done mostlyclean-aminfo: -rm -rf xorriso/xorriso.t2d xorriso/xorriso.t2p xorriso/xorrisofs.t2d \ xorriso/xorrisofs.t2p xorriso/xorrecord.t2d \ xorriso/xorrecord.t2p xorriso/xorriso-tcltk.t2d \ xorriso/xorriso-tcltk.t2p \ xorriso-dd-target/xorriso-dd-target.t2d \ xorriso-dd-target/xorriso-dd-target.t2p clean-aminfo: -test -z "xorriso/xorriso.dvi xorriso/xorriso.pdf xorriso/xorriso.ps \ xorriso/xorriso.html xorriso/xorrisofs.dvi \ xorriso/xorrisofs.pdf xorriso/xorrisofs.ps \ xorriso/xorrisofs.html xorriso/xorrecord.dvi \ xorriso/xorrecord.pdf xorriso/xorrecord.ps \ xorriso/xorrecord.html xorriso/xorriso-tcltk.dvi \ xorriso/xorriso-tcltk.pdf xorriso/xorriso-tcltk.ps \ xorriso/xorriso-tcltk.html \ xorriso-dd-target/xorriso-dd-target.dvi \ xorriso-dd-target/xorriso-dd-target.pdf \ xorriso-dd-target/xorriso-dd-target.ps \ xorriso-dd-target/xorriso-dd-target.html" \ || rm -rf xorriso/xorriso.dvi xorriso/xorriso.pdf xorriso/xorriso.ps \ xorriso/xorriso.html xorriso/xorrisofs.dvi \ xorriso/xorrisofs.pdf xorriso/xorrisofs.ps \ xorriso/xorrisofs.html xorriso/xorrecord.dvi \ xorriso/xorrecord.pdf xorriso/xorrecord.ps \ xorriso/xorrecord.html xorriso/xorriso-tcltk.dvi \ xorriso/xorriso-tcltk.pdf xorriso/xorriso-tcltk.ps \ xorriso/xorriso-tcltk.html \ xorriso-dd-target/xorriso-dd-target.dvi \ xorriso-dd-target/xorriso-dd-target.pdf \ xorriso-dd-target/xorriso-dd-target.ps \ xorriso-dd-target/xorriso-dd-target.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-nodist_pkgconfigDATA: $(nodist_pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(nodist_pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-nodist_pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(nodist_pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-libincludeHEADERS: $(libinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(libinclude_HEADERS)'; test -n "$(libincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libincludedir)" || exit $$?; \ done uninstall-libincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(libinclude_HEADERS)'; test -n "$(libincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am all-am: Makefile $(INFO_DEPS) $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) \ $(MANS) $(DATA) $(HEADERS) install-binPROGRAMS: install-libLTLIBRARIES installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(libincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f libisoburn/$(DEPDIR)/$(am__dirstamp) -rm -f libisoburn/$(am__dirstamp) -rm -f test/$(DEPDIR)/$(am__dirstamp) -rm -f test/$(am__dirstamp) -rm -f xorriso-dd-target/$(am__dirstamp) -rm -f xorriso/$(DEPDIR)/$(am__dirstamp) -rm -f xorriso/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-aminfo clean-binPROGRAMS clean-generic \ clean-libLTLIBRARIES clean-libtool clean-local \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf libisoburn/$(DEPDIR) test/$(DEPDIR) xorriso/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: $(DVIS) html: html-am html-am: $(HTMLS) info: info-am info-am: $(INFO_DEPS) install-data-am: install-data-local install-info-am \ install-libincludeHEADERS install-man \ install-nodist_pkgconfigDATA install-dvi: install-dvi-am install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ done install-exec-am: install-binPROGRAMS install-binSCRIPTS \ install-libLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: $(HTMLS) @$(NORMAL_INSTALL) @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ d2=$$d$$p; \ if test -d "$$d2"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \ $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ else \ list2="$$list2 $$d2"; \ fi; \ done; \ test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ done; } install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \ $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \ fi; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ echo "$$ifile"; \ else : ; fi; \ done; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done @$(POST_INSTALL) @if $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ done; \ else : ; fi install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done install-ps: install-ps-am install-ps-am: $(PSS) @$(NORMAL_INSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf libisoburn/$(DEPDIR) test/$(DEPDIR) xorriso/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-aminfo mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: $(PDFS) ps: ps-am ps-am: $(PSS) uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-dvi-am uninstall-html-am uninstall-info-am \ uninstall-libLTLIBRARIES uninstall-libincludeHEADERS \ uninstall-local uninstall-man uninstall-nodist_pkgconfigDATA \ uninstall-pdf-am uninstall-ps-am uninstall-man: uninstall-man1 .MAKE: check-am install-am install-exec-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am \ check-local clean clean-aminfo clean-binPROGRAMS clean-cscope \ clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ clean-noinstPROGRAMS cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-info dist-lzip dist-shar \ dist-tarZ dist-xz dist-zip distcheck distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-binSCRIPTS install-data \ install-data-am install-data-local install-dvi install-dvi-am \ install-exec install-exec-am install-exec-hook install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-libincludeHEADERS install-man \ install-man1 install-nodist_pkgconfigDATA install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-aminfo maintainer-clean-generic mostlyclean \ mostlyclean-aminfo mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-dvi-am uninstall-html-am uninstall-info-am \ uninstall-libLTLIBRARIES uninstall-libincludeHEADERS \ uninstall-local uninstall-man uninstall-man1 \ uninstall-nodist_pkgconfigDATA uninstall-pdf-am \ uninstall-ps-am # Install symbolic links to the xorriso binary # install-exec-hook: if test -e "$(DESTDIR)$(bindir)"/xorrisofs ; then rm "$(DESTDIR)$(bindir)"/xorrisofs ; else echo ; fi ln -s xorriso "$(DESTDIR)$(bindir)"/xorrisofs if test -e "$(DESTDIR)$(bindir)"/osirrox ; then rm "$(DESTDIR)$(bindir)"/osirrox ; else echo ; fi ln -s xorriso "$(DESTDIR)$(bindir)"/osirrox if test -e "$(DESTDIR)$(bindir)"/xorrecord ; then rm "$(DESTDIR)$(bindir)"/xorrecord ; else echo ; fi ln -s xorriso "$(DESTDIR)$(bindir)"/xorrecord $(LIBBURNIA_LDCONFIG_CMD) "$(DESTDIR)$(libdir)" || echo 'NOTE: Explicit dynamic library configuration failed. If needed, configure manually for:' "$(DESTDIR)$(libdir)" # Alternative to the disabled .PHONY above. # Trying to create a build timestamp file semi-manually: make buildstamped # buildstamp: date -u '+#define Xorriso_build_timestamP "%Y.%m.%d.%H%M%S"' >xorriso/xorriso_buildstamp.h cat xorriso/xorriso_buildstamp.h # For now make buildstamped has to be performed explicitly. buildstamped: buildstamp make # "make clean" shall remove a few stubborn .libs directories # which George Danchev reported Dec 03 2011. # Learned from: http://www.gnu.org/software/automake/manual/automake.html#Clean clean-local: -rm -rf test/.libs # Will be executed by "make check" check-local: xorriso/xorriso -no_rc -version -list_extras all doc: doc/html doc/html: doc/doxygen.conf if [ -f ./doc/doc.lock ]; then \ $(RM) -r doc/html; \ doxygen doc/doxygen.conf; \ fi doc-upload: doc/html scp -r $. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libisoburn-1.5.4/libisoburn-1.pc.in0000644000175700017510000000041013701321754014057 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libisoburn Description: Multi-session filesystem extension to libisofs, libburn. Version: @VERSION@ Requires: Libs: -L${libdir} -lisoburn Cflags: -I${includedir}/libisoburn libisoburn-1.5.4/version.h.in0000644000175700017510000000031213701321754013064 00000000000000 /* <<< this file is on its way out #define ISOBURN_MAJOR_VERSION @ISOBURN_MAJOR_VERSION@ #define ISOBURN_MINOR_VERSION @ISOBURN_MINOR_VERSION@ #define ISOBURN_MICRO_VERSION @ISOBURN_MICRO_VERSION@ */ libisoburn-1.5.4/AUTHORS0000644000175700017510000000007713701321754011701 00000000000000Thomas Schmitt Vreixo Formoso Lopes Nio Wiklund alias sudodus libisoburn-1.5.4/xorriso/0000755000175700017510000000000014005267033012407 500000000000000libisoburn-1.5.4/xorriso/drive_mgt.h0000644000175700017510000000264113701321754014466 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2010 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of functions which operate on drives and media. */ #ifndef Xorriso_pvt_drive_mgt_includeD #define Xorriso_pvt_drive_mgt_includeD yes int Xorriso_may_burn(struct XorrisO *xorriso, int flag); int Xorriso_toc_line(struct XorrisO *xorriso, int flag); int Xorriso_media_product(struct XorrisO *xorriso, int flag); int Xorriso_check_md5_range(struct XorrisO *xorriso, off_t start_lba, off_t end_lba, char md5[16], int flag); int Xorriso_check_interval(struct XorrisO *xorriso, struct SpotlisT *spotlist, struct CheckmediajoB *job, int from_lba, int block_count, int read_chunk, int md5_start, int flag); int Xorriso_get_drive_handles(struct XorrisO *xorriso, struct burn_drive_info **dinfo, struct burn_drive **drive, char *attempt, int flag); int Xorriso_check_for_abort(struct XorrisO *xorriso, char *abort_file_path, double post_read_time, double *last_abort_file_time, int flag); #endif /* ! Xorriso_pvt_drive_mgt_includeD */ libisoburn-1.5.4/xorriso/opts_d_h.c0000644000175700017510000031503613762644673014324 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of commands as mentioned in man page or info file derived from xorriso.texi. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" #ifdef Xorriso_with_readlinE #define Xorriso_with_line_editoR #endif #ifdef Xorriso_with_editlinE #define Xorriso_with_line_editoR #endif /* Command -data_cache_size */ int Xorriso_option_data_cache_size(struct XorrisO *xorriso, char *num_tiles, char *tile_blocks, int flag) { int ret, blocks= -1, tiles= -1, to_default= 0; sscanf(num_tiles, "%d", &tiles); sscanf(tile_blocks, "%d", &blocks); if(strcmp(num_tiles, "default") == 0 || num_tiles[0] == 0) to_default|= 1; if(strcmp(tile_blocks, "default") == 0 || tile_blocks[0] == 0) to_default|= 2; ret= Xorriso_set_data_cache(xorriso, NULL, tiles, blocks, to_default); if(ret > 0) { xorriso->cache_num_tiles= tiles; xorriso->cache_tile_blocks= blocks; xorriso->cache_default= to_default; } return(ret); } /* Options -dev , -indev, -outdev */ /** @param flag bit0= use as indev bit1= use as outdev bit2= do not -reassure bit3= regard overwritable media as blank bit4= if the drive is a regular disk file: truncate it to the write start address bit5= do not print toc of acquired drive bit6= do not calm down drive after acquiring it @return <=0 error , 1 success, 2 revoked by -reassure */ int Xorriso_option_dev(struct XorrisO *xorriso, char *in_adr, int flag) { int ret; char *adr; adr= in_adr; if(strcmp(in_adr, "-")==0) adr= "stdio:/dev/fd/1"; if(strncmp(adr, "stdio:", 6)==0) { if(strlen(adr)==6 || strcmp(adr, "stdio:/")==0 || strcmp(adr, "stdio:.")==0 || strcmp(adr, "stdio:..")==0 || strcmp(adr, "stdio:-")==0) { sprintf(xorriso->info_text, "No suitable path given by device address '%s'", adr); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } if(Xorriso_change_is_pending(xorriso, 0) && (flag&1)) { sprintf(xorriso->info_text, "%s: Image changes pending. -commit or -rollback first", (flag&2) ? "-dev" : "-indev"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if((flag&1) && (xorriso->in_drive_handle != NULL || adr[0]) && !(flag&4)) { ret= Xorriso_reassure(xorriso, (flag&2) ? "-dev" : "-indev", "eventually discard the current image", 0); if(ret<=0) return(2); } if(adr[0]==0) { if((flag&1) && xorriso->in_drive_handle != NULL) { if(xorriso->in_drive_handle == xorriso->out_drive_handle) sprintf(xorriso->info_text,"Giving up -dev "); else sprintf(xorriso->info_text,"Giving up -indev "); Text_shellsafe(xorriso->indev, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } if((flag&2) && xorriso->out_drive_handle != NULL && xorriso->in_drive_handle != xorriso->out_drive_handle) { sprintf(xorriso->info_text,"Giving up -outdev "); Text_shellsafe(xorriso->outdev, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } ret= Xorriso_give_up_drive(xorriso, (flag&3)|((flag&32)>>2)); } else ret= Xorriso_aquire_drive(xorriso, adr, NULL, (flag & (3 | 32 | 64)) | (((flag & (8 | 16)) >> 1))); if(ret<=0) return(ret); if(xorriso->in_drive_handle == NULL) xorriso->image_start_mode= 0; /* session setting is invalid by now */ return(1); } /* Option -devices , -device_links */ /* @param flag bit0= perform -device_links rather than -devices @return <=0 error , 1 success, 2 revoked by -reassure */ int Xorriso_option_devices(struct XorrisO *xorriso, int flag) { int ret; if(Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text, "-devices: Image changes pending. -commit or -rollback first"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_reassure(xorriso, "-devices", "eventually discard the current image", 0); if(ret<=0) return(2); xorriso->info_text[0]= 0; if(xorriso->in_drive_handle!=NULL || xorriso->out_drive_handle!=NULL) { if(xorriso->in_drive_handle == xorriso->out_drive_handle) { sprintf(xorriso->info_text, "Gave up -dev "); Text_shellsafe(xorriso->indev, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); }else { if(xorriso->in_drive_handle!=NULL) { sprintf(xorriso->info_text, "Gave up -indev "); Text_shellsafe(xorriso->indev, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } if(xorriso->out_drive_handle!=NULL) { sprintf(xorriso->info_text, "Gave up -outdev "); Text_shellsafe(xorriso->outdev, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } } Xorriso_give_up_drive(xorriso, 3); } ret= Xorriso_show_devices(xorriso, flag & 1); return(ret); } /* Option -dialog "on"|"single_line"|"off" */ int Xorriso_option_dialog(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "on") == 0 || strcmp(mode, "multi_line") == 0) xorriso->dialog= 2; else if(strcmp(mode, "single_line") == 0) xorriso->dialog= 1; else if(strcmp(mode, "off") == 0) xorriso->dialog= 0; else { sprintf(xorriso->info_text, "-dialog: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } return(1); } /* Option -disk_dev_ino "on"|"ino_only"|"off" */ int Xorriso_option_disk_dev_ino(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "on") == 0) xorriso->do_aaip= (xorriso->do_aaip & ~128) | 16 | 32 | 64; else if(strcmp(mode, "ino_only") == 0) xorriso->do_aaip|= 16 | 32 | 64 | 128; else if(strcmp(mode, "off") == 0) xorriso->do_aaip &= ~(16 | 32 | 64 | 128); else { sprintf(xorriso->info_text, "-disk_dev_ino: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } return(1); } /* Option -disk_pattern "on"|"ls"|"off" */ int Xorriso_option_disk_pattern(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off")==0) xorriso->do_disk_pattern= 0; else if(strcmp(mode, "on")==0) xorriso->do_disk_pattern= 1; else if(strcmp(mode, "ls")==0) xorriso->do_disk_pattern= 2; else { sprintf(xorriso->info_text, "-disk_pattern: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -displacement [-]offset */ int Xorriso_option_displacement(struct XorrisO *xorriso, char *value, int flag) { double num; int displacement_sign= 1, l; char *cpt; cpt= value; if(value[0] == '-') { displacement_sign= -1; cpt++; } else if(value[0] == '+') cpt++; num= Scanf_io_size(cpt, 0); l= strlen(cpt); if(cpt[l - 1] < '0' || cpt[l - 1] > '9') num/= 2048.0; if(num < 0.0 || num > 4294967295.0) { sprintf(xorriso->info_text, "-displacement: too large or too small: '%s'", value); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(num == 0) displacement_sign= 0; xorriso->displacement= num; xorriso->displacement_sign= displacement_sign; return(1); } /* Command -drive_access "exclusive"|"shared":"readonly"|"unrestricted" */ int Xorriso_option_drive_access(struct XorrisO *xorriso, char *mode, int flag) { int l; char *npt, *cpt; npt= cpt= mode; for(cpt= mode; npt != NULL; cpt= npt+1) { npt= strchr(cpt, ':'); if(npt==NULL) l= strlen(cpt); else l= npt - cpt; if(l == 0 && mode[0] != 0) goto unknown_mode; if(strncmp(cpt, "shared", l) == 0 && l == 6) { xorriso->drives_exclusive= 0; } else if(strncmp(cpt, "exclusive", l) == 0 && l == 9) { xorriso->drives_exclusive= 1; } else if(strncmp(cpt, "readonly", l) == 0 && l == 8) { xorriso->drives_access= 0; } else if(strncmp(cpt, "unrestricted", l) == 0 && l == 12) { xorriso->drives_access= 1; } else { unknown_mode:; sprintf(xorriso->info_text, "-drive_access: unknown mode '"); if(l > 0 && l < SfileadrL) strncat(xorriso->info_text, cpt, l); strcat(xorriso->info_text, "'"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } return(1); } /* Option -drive_class */ int Xorriso_option_drive_class(struct XorrisO *xorriso, char *d_class, char *pattern, int flag) { int ret= 1; if(strcmp(d_class, "banned") == 0) { ret= Xorriso_lst_new(&(xorriso->drive_blacklist), pattern, xorriso->drive_blacklist, 1); } else if(strcmp(d_class, "caution") == 0) { ret= Xorriso_lst_new(&(xorriso->drive_greylist), pattern, xorriso->drive_greylist, 1); } else if (strcmp(d_class, "harmless") == 0) { ret= Xorriso_lst_new(&(xorriso->drive_whitelist), pattern, xorriso->drive_whitelist, 1); } else if (strcmp(d_class, "clear_list") == 0) { if(strcmp(pattern, "banned") == 0) Xorriso_lst_destroy_all(&(xorriso->drive_blacklist), 0); else if(strcmp(pattern, "caution") == 0) Xorriso_lst_destroy_all(&(xorriso->drive_greylist), 0); else if(strcmp(pattern, "harmless") == 0) Xorriso_lst_destroy_all(&(xorriso->drive_whitelist), 0); else if(strcmp(pattern, "all") == 0) { Xorriso_lst_destroy_all(&(xorriso->drive_blacklist), 0); Xorriso_lst_destroy_all(&(xorriso->drive_greylist), 0); Xorriso_lst_destroy_all(&(xorriso->drive_whitelist), 0); } else { sprintf(xorriso->info_text, "-drive_class clear : unknown class '%s'", pattern); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= 1; } else { sprintf(xorriso->info_text, "-drive_class: unknown class '%s'", d_class); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(ret); } /* Option -dummy "on"|"off" */ int Xorriso_option_dummy(struct XorrisO *xorriso, char *mode, int flag) { xorriso->do_dummy= !!strcmp(mode, "off"); return(1); } /* Option -dvd_obs "default"|"32k"|"64k" */ int Xorriso_option_dvd_obs(struct XorrisO *xorriso, char *obs, int flag) { double num; if(strcmp(obs, "default") == 0) num= 0; else num = Scanf_io_size(obs,0); if(num != 0 && num != 32768 && num != 65536) { sprintf(xorriso->info_text, "-dvd_obs : Bad size. Acceptable are 0, 32k, 64k"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } else xorriso->dvd_obs= num; return(1); } /* Option -early_stdio_test */ int Xorriso_option_early_stdio_test(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "on") == 0) xorriso->early_stdio_test= 2 | 4; else if(strcmp(mode, "off") == 0) xorriso->early_stdio_test= 0; else if(strcmp(mode, "appendable_wo") == 0) xorriso->early_stdio_test= 2 | 4 | 8; else { sprintf(xorriso->info_text, "-early_stdio_test: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } return(1); } /* Command -ecma119_map */ int Xorriso_option_ecma119_map(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "unmapped") == 0) xorriso->ecma119_map= 0; else if(strcmp(mode, "stripped") == 0) xorriso->ecma119_map= 1; else if(strcmp(mode, "uppercase") == 0) xorriso->ecma119_map= 2; else if(strcmp(mode, "lowercase") == 0) xorriso->ecma119_map= 3; else { sprintf(xorriso->info_text, "-ecma119_map: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } return(1); } /* Option -eject */ /* @param flag bit0=do not report toc of eventually remaining drives */ int Xorriso_option_eject(struct XorrisO *xorriso, char *which, int flag) { int gu_flag= 4, ret; if(strncmp(which,"in",2)==0) gu_flag|= 1; else if(strncmp(which,"out",3)==0) gu_flag|= 2; else gu_flag|= 3; if((gu_flag&1) && Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text, "-eject: Image changes pending. -commit or -rollback first"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(flag&1) gu_flag|= 8; ret= Xorriso_give_up_drive(xorriso, gu_flag); return(ret); } /* Options -end , and -rollback_end */ /* @param flag bit0= discard pending changes bit1= do not -reassure @return <=0 error , 1 success, 2 revoked by -reassure */ int Xorriso_option_end(struct XorrisO *xorriso, int flag) { int ret; char *cmd, *which_will; if(flag&1) cmd= "-rollback_end"; else cmd= "-end"; if(Xorriso_change_is_pending(xorriso, 0)) { if((flag & 1) || !Xorriso_change_is_pending(xorriso, 1)) which_will= "end the program discarding image changes"; else which_will= "commit image changes and then end the program"; } else { which_will= "end the program"; } if(!(flag&2)) { ret= Xorriso_reassure(xorriso, cmd, which_will, 0); if(ret<=0) return(2); } if(Xorriso_change_is_pending(xorriso, 0)) { if((flag & 1) || !Xorriso_change_is_pending(xorriso, 1)) { xorriso->volset_change_pending= 0; } else { ret= Xorriso_option_commit(xorriso, 1); xorriso->volset_change_pending= 0; /* no further tries to commit */ if(ret<=0) return(ret); } } ret= Xorriso_give_up_drive(xorriso, 3); if(ret<=0) return(ret); return(1); } /* Option -errfile_log marked|plain path|-|"" */ int Xorriso_option_errfile_log(struct XorrisO *xorriso, char *mode, char *path, int flag) { int ret, mode_word; FILE *fp= NULL; if(path[0]==0 || path[0]=='-') { /* ok */; } else { fp= fopen(path, "a"); if(fp==0) { sprintf(xorriso->info_text, "-errfile_log: Cannot open file "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } mode_word= xorriso->errfile_mode; if(strcmp(mode, "marked")==0) mode_word|= 1; else if(strcmp(mode, "plain")==0) mode_word&= ~1; else { sprintf(xorriso->info_text, "-errfile_log: Unknown mode "); Text_shellsafe(mode, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); if(fp != NULL) fclose(fp); return(0); } Xorriso_process_errfile(xorriso, 0, "log end", 0, 1); if(xorriso->errfile_fp!=NULL) fclose(xorriso->errfile_fp); xorriso->errfile_fp= fp; xorriso->errfile_mode= mode_word; ret= Sfile_str(xorriso->errfile_log, path, 0); if(ret>0) ret= Xorriso_process_errfile(xorriso, 0, "log start", 0, 1); if(ret<=0) return(ret); return(1); } /* Option -error_behavior */ int Xorriso_option_error_behavior(struct XorrisO *xorriso, char *occasion, char *behavior, int flag) { if(strcmp(occasion, "image_loading")==0) { if(strcmp(behavior, "best_effort")==0) xorriso->img_read_error_mode= 0; else if(strcmp(behavior, "failure")==0 || strcmp(behavior, "FAILURE")==0) xorriso->img_read_error_mode= 1; else if(strcmp(behavior, "fatal")==0 || strcmp(behavior, "FATAL")==0) xorriso->img_read_error_mode= 2; else { unknown_behavior:; sprintf(xorriso->info_text, "-error_behavior: with '%s': unknown behavior '%s'", occasion, behavior); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } else if(strcmp(occasion, "file_extraction")==0) { if(strcmp(behavior, "best_effort")==0) xorriso->extract_error_mode= 0; else if(strcmp(behavior, "keep")==0) xorriso->extract_error_mode= 1; else if(strcmp(behavior, "delete")==0) xorriso->extract_error_mode= 2; else goto unknown_behavior; } else { sprintf(xorriso->info_text, "-error_behavior: unknown occasion '%s'", occasion); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -external_filter */ int Xorriso_option_external_filter(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, start_idx, end_idx; start_idx= *idx; end_idx= Xorriso_end_idx(xorriso, argc, argv, start_idx, 1); (*idx)= end_idx; if(end_idx - start_idx < 3) { sprintf(xorriso->info_text, "-external_filter : Not enough parameters given. Needed: name options path %s", xorriso->list_delimiter); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_external_filter(xorriso, argv[start_idx], argv[start_idx + 1], argv[start_idx + 2], end_idx - start_idx - 3, argv + start_idx + 3, 0); return(ret); } /* Options -extract , -extract_single */ /* @param flag bit0=do not report the restored item bit1=do not reset pacifier, no final pacifier message bit2= do not make lba-sorted node array for hardlink detection bit5= -extract_single: eventually do not insert directory tree */ int Xorriso_option_extract(struct XorrisO *xorriso, char *iso_path, char *disk_path, int flag) { int ret, problem_count; char *eff_origin= NULL, *eff_dest= NULL, *ipth, *eopt[1], *edpt[1]; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); if(xorriso->allow_restore <= 0) { sprintf(xorriso->info_text, "-extract: image-to-disk copies are not enabled by option -osirrox"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(!(flag&2)) Xorriso_pacifier_reset(xorriso, 0); ipth= iso_path; if(ipth[0]==0) ipth= disk_path; if(disk_path[0]==0) { sprintf(xorriso->info_text, "-extract: Empty disk_path given"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 1); ret= 0; goto ex; } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, disk_path, eff_dest, 2|4); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, ipth, eff_origin, 2|8); if(ret<=0) goto ex; eopt[0]= eff_origin; edpt[0]= eff_dest; ret= Xorriso_restore_sorted(xorriso, 1, eopt, edpt, &problem_count, (flag & 32 ? 33 : 0)); if(!(flag&2)) Xorriso_pacifier_callback(xorriso, "files restored",xorriso->pacifier_count, xorriso->pacifier_total, "", 1 | 4 | 8 | 32); if(ret <= 0 || problem_count > 0) goto ex; if(!(flag&1)) { sprintf(xorriso->info_text, "Extracted from ISO image: %s '%s'='%s'\n", (ret>1 ? "directory" : "file"), eff_origin, eff_dest); Xorriso_info(xorriso,0); } ret= 1; ex:; if(!(flag & (4 | 32))) Xorriso_destroy_node_array(xorriso, 0); Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); return(ret); } /* Command -extract_boot_images */ int Xorriso_option_extract_boot_images(struct XorrisO *xorriso, char *disk_dir_path, int flag) { int ret; if(xorriso->allow_restore <= 0) { sprintf(xorriso->info_text, "-extract_boot_images: image-to-disk copies are not enabled by option -osirrox" ); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_extract_boot_images(xorriso, disk_dir_path, 0); return(ret); } /* Option -extract_cut */ int Xorriso_option_extract_cut(struct XorrisO *xorriso, char *iso_rr_path, char *start, char *count, char *disk_path, int flag) { int ret; double num; off_t startbyte, bytecount; num= Scanf_io_size(start, 0); if(num<0 || num > 1.0e18) { /* 10^18 = 10^3 ^ 6 < 2^10 ^ 6 = 2^60 */ sprintf(xorriso->info_text, "-extract_cut: startbyte address negative or much too large (%s)", start); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } startbyte= num; num= Scanf_io_size(count, 0); if(num<=0 || num > 1.0e18) { sprintf(xorriso->info_text, "-extract_cut: bytecount zero, negative or much too large (%s)", count); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } bytecount= num; sprintf(xorriso->info_text, "-extract_cut from %s , byte %.f to %.f, and store as %s", iso_rr_path, (double) startbyte, (double) (startbyte+bytecount), disk_path); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); ret= Xorriso_extract_cut(xorriso, iso_rr_path, disk_path, startbyte, bytecount, 0); return(ret); } /* Command -file_name_limit */ int Xorriso_option_file_name_limit(struct XorrisO *xorriso, char *value, int flag) { int ret, sub_flag= 0; double num; if(value[0] == '+') sub_flag|= 1; num= Scanf_io_size(value + (sub_flag & 1), 0); if(num < 64 || num > 255) { sprintf(xorriso->info_text, "-file_name_limit: Value '%s' out of range [64..255]", value); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } if(num == xorriso->file_name_limit) return(1); ret= Xorriso_set_file_name_limit(xorriso, (int) num, sub_flag); return(ret > 0); } /* Option -file_size_limit */ int Xorriso_option_file_size_limit(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, i, end_idx; off_t new_limit= 0; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); if(*idx >= end_idx) {ret= 2; goto ex;} if(*idx + 1 == end_idx && strcmp(argv[*idx], "off") == 0) { xorriso->file_size_limit= 0; ret= 1; goto ex; } for(i= *idx; i < end_idx; i++) new_limit+= Scanf_io_size(argv[i], 0); if(new_limit <= 0) { sprintf(xorriso->info_text, "-file_size_limit: values sum up to %.f", (double) new_limit); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } xorriso->file_size_limit= new_limit; ret= 1; ex:; if((xorriso->file_size_limit >= ((off_t) 4) * (off_t) (1024 * 1024 * 1024) || xorriso->file_size_limit == 0) && xorriso->iso_level < 3 && ret > 0) { xorriso->iso_level= 3; xorriso->iso_level_is_default= 0; Xorriso_msgs_submit(xorriso, 0, "-file_size_limit of at least 4 GiB causes ISO level 3", 0, "NOTE", 0); } (*idx)= end_idx; if(ret > 0) { if(xorriso->file_size_limit > 0) sprintf(xorriso->info_text, "-file_size_limit now at %.f\n", (double) xorriso->file_size_limit); else sprintf(xorriso->info_text, "-file_size_limit now off\n"); Xorriso_info(xorriso,0); } return(ret); } static int Xorriso_determine_name_space(struct XorrisO *xorriso, char *space_name, int flag) { if(strcmp(space_name, "rockridge") == 0) return(1); else if(strcmp(space_name, "joliet") == 0) return(2); else if(strcmp(space_name, "ecma119") == 0 || strcmp(space_name, "iso9660") == 0) return(3); else if(strcmp(space_name, "hfsplus") == 0) return(4); sprintf(xorriso->info_text, "-find: Unknown output namespace identifier"); return(0); } static int Xorriso_truncate_const_find_name(struct XorrisO *xorriso, char *expr, char *buffer, char **namept, int flag) { int ret; *namept= expr; ret= Xorriso_truncate_path_comps(xorriso, expr, buffer, namept, 1); if(ret < 0) { sprintf(xorriso->info_text, "-find[ix]: cannot truncate constant -name to -file_name_limit: "); Text_shellsafe(expr, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -find alias -findi, and -findx */ /* @param flag bit0= -findx rather than -findi bit1= do not reset pacifier, no final pacifier message do not reset find_compare_result bit2= do not count deleted files with rm and rm_r bit3= use Xorriso_findi_sorted() rather than Xorriso_findi() (this can also be ordered by test -sort_lba) bit4= return number of matches plus 1 */ int Xorriso_option_find(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, i, end_idx, type= 0, action, deleter= 0, start_lba, count; int list_extattr_head= 0, bsl_mem, disk_path, name_space; struct FindjoB *job, *first_job= NULL, *new_job; char *start_path, *path= NULL, *cpt, *other_path_start= NULL, *cd_pt; char *access_acl_text= NULL, *default_acl_text= NULL, *list_extattr_mode; char *arg1_pt, *namept; struct stat dir_stbuf; uid_t user= 0; gid_t group= 0; time_t date= 0; mode_t mode_or= 0, mode_and= ~1; double mem_lut= 0.0; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); Xorriso_alloc_meM(path, char, SfileadrL); Xorriso_alloc_meM(other_path_start, char, SfileadrL); start_path= "."; list_extattr_mode= "e"; if(end_idx > *idx && start_path[0]!=0) start_path= argv[*idx]; ret= Findjob_new(&first_job, start_path, 0); if(ret<=0) { Xorriso_no_findjob(xorriso, "-find[ix]", 0); {ret= -1; goto ex;} } job= first_job; if(!(flag&2)) xorriso->find_compare_result= 1; for(i= *idx+1; i=end_idx) { not_enough_arguments:; sprintf(xorriso->info_text, "-find[ix]: not enough parameters with test "); Text_shellsafe(argv[i], xorriso->info_text, 1); goto sorry_ex; } i++; ret= Xorriso_truncate_const_find_name(xorriso, argv[i], path, &namept, 0); if(ret <= 0) goto ex; ret= Findjob_set_name_expr(job, namept, 0); if(ret<=0) { sprintf(xorriso->info_text, "-find[ix]: cannot set -name expression "); Text_shellsafe(argv[i], xorriso->info_text, 1); goto sorry_ex; } } else if(strcmp(argv[i], "-wholename")==0) { if(i+1>=end_idx) goto not_enough_arguments; i++; ret= Xorriso_truncate_const_find_name(xorriso, argv[i], path, &namept, 0); if(ret <= 0) goto ex; ret= Findjob_set_name_expr(job, namept, 1); if(ret<=0) { sprintf(xorriso->info_text, "-find[ix]: cannot set -wholename expression "); Text_shellsafe(argv[i], xorriso->info_text, 1); goto sorry_ex; } } else if(strcmp(argv[i], "-type")==0) { if(i+1>=end_idx) goto not_enough_arguments; i++; ret= Findjob_set_file_type(job, argv[i][0], 0); if(ret<=0) { sprintf(xorriso->info_text, "-find[ix]: unknown -type '%c'",argv[i][0]); goto sorry_ex; } } else if(strcmp(argv[i], "-damaged")==0) { Findjob_set_damage_filter(job, 1, 0); } else if(strcmp(argv[i], "-undamaged")==0) { Findjob_set_damage_filter(job, -1, 0); } else if(strcmp(argv[i], "-lba_range")==0) { if(i+2>=end_idx) goto not_enough_arguments; i+= 2; /* >>> if letter suffix: use Scanf_io_size */ sscanf(argv[i-1], "%d", &start_lba); sscanf(argv[i], "%d", &count); Findjob_set_lba_range(job, start_lba, count, 0); } else if(strcmp(argv[i], "-pending_data")==0) { Findjob_set_commit_filter_2(job, 0); } else if(strcmp(argv[i], "-has_acl")==0) { Findjob_set_acl_filter(job, 1, 0); } else if(strcmp(argv[i], "-has_no_acl")==0) { Findjob_set_acl_filter(job, -1, 0); } else if(strcmp(argv[i], "-has_xattr")==0) { Findjob_set_xattr_filter(job, 1, 0); } else if(strcmp(argv[i], "-has_any_xattr")==0) { Findjob_set_xattr_filter(job, 1, 1); } else if(strcmp(argv[i], "-has_no_xattr")==0) { Findjob_set_xattr_filter(job, -1, 0); } else if(strcmp(argv[i], "-has_aaip")==0) { Findjob_set_aaip_filter(job, 1, 0); } else if(strcmp(argv[i], "-has_no_aaip")==0) { Findjob_set_aaip_filter(job, -1, 0); } else if(strcmp(argv[i], "-has_filter")==0) { Findjob_set_filter_filter(job, 1, 0); } else if(strcmp(argv[i], "-has_no_filter")==0) { Findjob_set_filter_filter(job, -1, 0); } else if(strcmp(argv[i], "-has_md5")==0) { Findjob_set_prop_filter(job, 15, 1, 0); } else if(strcmp(argv[i], "-disk_name")==0 || strcmp(argv[i], "-disk_path")==0) { disk_path= (strcmp(argv[i], "-disk_path") == 0); if(i+1>=end_idx) goto not_enough_arguments; i++; arg1_pt= argv[i]; if(disk_path) { ret= Xorriso_make_abs_adr(xorriso, xorriso->wdx, argv[i], path, 1 | 2 | 4 | 8); if(ret<=0) goto ex; arg1_pt= path; } ret= Findjob_set_name_expr(job, arg1_pt, 2 + disk_path); if(ret<=0) { sprintf(xorriso->info_text, "-find[ix]: cannot set %s ", disk_path ? "-disk_path address" : "-disk_name expression"); Text_shellsafe(argv[i], xorriso->info_text, 1); goto sorry_ex; } } else if(strcmp(argv[i], "-hidden")==0) { if(i + 1 >= end_idx) goto not_enough_arguments; i+= 1; type= Xorriso__hide_mode(argv[i], 0); if(type < 0) { sprintf(xorriso->info_text, "-findi: -hidden : unknown hide state "); Text_shellsafe(argv[i], xorriso->info_text, 1); goto sorry_ex; } else { ret= Findjob_set_test_hidden(job, type, 0); if(ret <= 0) { sprintf(xorriso->info_text, "-findi: cannot setup -hidden test"); goto sorry_ex; } } } else if(strcmp(argv[i], "-has_hfs_crtp")==0) { if(i + 2 >= end_idx) goto not_enough_arguments; i+= 2; ret= Xorriso_hfsplus_file_creator_type(xorriso, "", NULL, argv[i - 1], argv[i], 3); if(ret <= 0) {ret= 0; goto ex;} ret= Findjob_set_crtp_filter(job, argv[i - 1], argv[i], 0); if(ret <= 0) { sprintf(xorriso->info_text, "-findi: cannot setup -has_hfs_crtp test"); goto sorry_ex; } } else if(strcmp(argv[i], "-has_hfs_bless")==0) { if(i + 1 >= end_idx) goto not_enough_arguments; i+= 1; ret= Findjob_set_bless_filter(xorriso, job, argv[i], 0); if(ret <= 0) { sprintf(xorriso->info_text, "-findi: cannot setup -has_hfs_bless test"); goto sorry_ex; } } else if(strcmp(argv[i], "-bad_outname")==0) { if(i + 1 >= end_idx) goto not_enough_arguments; i+= 1; name_space= Xorriso_determine_name_space(xorriso, argv[i], 0); if(name_space < 0) { ret= 0; goto sorry_ex; } ret= Findjob_set_num_filter(job, 21, name_space, 0, 0); if(ret <= 0) { sprintf(xorriso->info_text, "-findi: cannot setup -bad_outname test"); goto sorry_ex; } } else if(strcmp(argv[i], "-true") == 0) { ret= Findjob_set_false(job, -1, 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-false") == 0) { ret= Findjob_set_false(job, 1, 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-decision") == 0) { if(i+1>=end_idx) goto not_enough_arguments; i++; ret= Findjob_set_arg1(job, 11, argv[i], 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-prune") == 0) { ret= Findjob_set_prune(job, 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-sub") == 0 || strcmp(argv[i], "(") == 0) { ret= Findjob_open_bracket(job, 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-subend") == 0 || strcmp(argv[i], ")") == 0) { ret= Findjob_close_bracket(job, 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-not") == 0 || strcmp(argv[i], "!") == 0) { ret= Findjob_not(job, 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-and") == 0 || strcmp(argv[i], "-a") == 0) { ret= Findjob_and(job, 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-or") == 0 || strcmp(argv[i], "-o") == 0) { ret= Findjob_or(job, 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-if") == 0) { ret= Findjob_if(job, 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-then") == 0) { ret= Findjob_then(job, 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-else") == 0) { ret= Findjob_else(job, 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-elseif") == 0) { ret= Findjob_elseif(job, 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-endif") == 0) { ret= Findjob_endif(job, 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-sort_lba") == 0) { flag|= 8; /* If an operator is open: insert a -true test, else do nothing */ ret= Findjob_set_false(job, -1, 1); if(ret == 2) ret= 1; } else if(strcmp(argv[i], "-use_pattern") == 0 || strcmp(argv[i], "-or_use_pattern") == 0) { if(i + 1 >= end_idx) goto not_enough_arguments; i++; ret= Findjob_set_arg1(job, 22 + (strcmp(argv[i - 1], "-or_use_pattern") == 0), argv[i], 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-name_limit_blocker") == 0) { if(i + 1 >= end_idx) goto not_enough_arguments; i++; sscanf(argv[i], "%d", &count); if(count < 64 || count > 255) { sprintf(xorriso->info_text, "-findi: wrong length with -name_limit_blocker [64...255]"); goto sorry_ex; } ret= Findjob_set_num_filter(job, 24, count, 0, 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-maxdepth") == 0 || strcmp(argv[i], "-mindepth") == 0) { if(i + 1 >= end_idx) goto not_enough_arguments; i++; count= -1; sscanf(argv[i], "%d", &count); if(count < 0) { sprintf(xorriso->info_text, "-findi: wrong length with %s [>= 0]", argv[i - 1]); goto sorry_ex; } ret= Findjob_set_num_filter(job, 25 + (strcmp(argv[i - 1], "-mindepth") == 0), count, 0, 0); if(ret <= 0) goto ex; } else if(strcmp(argv[i], "-exec")==0) { if(i+1>=end_idx) { not_enough_exec_arguments:; sprintf(xorriso->info_text, "-find[ix]: not enough parameters with -exec "); Text_shellsafe(argv[i], xorriso->info_text, 1); goto sorry_ex; } i++; cpt= argv[i]; if(*cpt=='-') cpt++; if(strcmp(cpt, "echo")==0) { Findjob_set_action_target(job, 0, NULL, 0); } else if(strcmp(cpt, "rm")==0) { Findjob_set_action_target(job, 1, NULL, 0); deleter= 1; } else if(strcmp(cpt, "rm_r")==0) { Findjob_set_action_target(job, 2, NULL, 0); deleter= 1; #ifdef NIX /* >>> not implemented yet */; } else if(strcmp(cpt, "mv")==0) { if(i+1>=end_idx) goto not_enough_exec_arguments; i++; Findjob_set_action_target(job, 3, argv[i], 0); #endif } else if(strcmp(cpt, "chown")==0 || strcmp(cpt, "chown_r")==0) { if(i+1>=end_idx) goto not_enough_exec_arguments; i++; ret= Xorriso_convert_uidstring(xorriso, argv[i], &user, 0); if(ret<=0) goto ex; ret= Findjob_set_action_chown(job, user, strlen(cpt)>5); if(ret<=0) { Xorriso_no_findjob(xorriso, "-find -exec chown_r", 0); goto ex; } } else if(strcmp(cpt, "chgrp")==0 || strcmp(cpt, "chgrp_r")==0) { if(i+1>=end_idx) goto not_enough_exec_arguments; i++; ret= Xorriso_convert_gidstring(xorriso, argv[i], &group, 0); if(ret<=0) goto ex; ret= Findjob_set_action_chgrp(job, group, strlen(cpt)>5); if(ret<=0) { Xorriso_no_findjob(xorriso, "-find -exec chgrp_r", 0); goto ex; } } else if(strcmp(cpt, "chmod")==0 || strcmp(cpt, "chmod_r")==0) { if(i+1>=end_idx) goto not_enough_exec_arguments; i++; ret= Xorriso_convert_modstring(xorriso, "-find -exec chmod", argv[i], &mode_and, &mode_or, 0); if(ret<=0) goto ex; ret= Findjob_set_action_chmod(job, mode_and, mode_or, strlen(cpt)>5); if(ret<=0) { Xorriso_no_findjob(xorriso, "-find -exec chmod_r", 0); goto ex; } } else if(strcmp(cpt, "alter_date")==0 || strcmp(cpt, "alter_date_r")==0){ if(i+2>=end_idx) goto not_enough_exec_arguments; i+= 2; ret= Xorriso_convert_datestring(xorriso, "-find -exec alter_date", argv[i-1], argv[i], &type, &date, 0); if(ret<=0) goto ex; ret= Findjob_set_action_ad(job, type, date, strlen(cpt)>10); if(ret<=0) { Xorriso_no_findjob(xorriso, "-find -exec alter_date_r", 0); goto ex; } } else if(strcmp(cpt, "set_to_mtime") == 0) { Findjob_set_action_target(job, 59, NULL, 0); } else if(strcmp(cpt, "lsdl")==0) { Findjob_set_action_target(job, 8, NULL, 0); } else if(strcmp(cpt, "find")==0) { ret= Findjob_new(&new_job, "", 0); if(ret<=0) { Xorriso_no_findjob(xorriso, "-find[ix]", 0); {ret= -1; goto ex;} } Findjob_set_action_subjob(job, 13, new_job, 0); job= new_job; } else if(strcmp(cpt, "compare")==0 || strcmp(cpt, "update")==0 || strcmp(cpt, "widen_hardlinks")==0 || strcmp(cpt, "update_merge")==0) { if(i+1>=end_idx) goto not_enough_exec_arguments; i++; action= 14; if(strcmp(cpt, "update")==0) action= 17; else if(strcmp(cpt, "widen_hardlinks")==0) action= 32; else if(strcmp(cpt, "update_merge") == 0) { action= 41; /* Enter update_merge mode for node adding */ xorriso->update_flags|= 1; } ret= Xorriso_make_abs_adr(xorriso, xorriso->wdx, argv[i], other_path_start, 1|2|4|8); if(ret<=0) goto ex; Findjob_set_action_target(job, action, other_path_start, 0); ret= Xorriso_make_abs_adr(xorriso, xorriso->wdi, start_path, path, 1|2|4); if(ret<=0) goto ex; Findjob_set_start_path(job, path, 0); if(!(flag&2)) { Xorriso_pacifier_reset(xorriso, 0); mem_lut= xorriso->last_update_time; } } else if(strcmp(cpt, "in_iso")==0 || strcmp(cpt, "not_in_iso")==0 || strcmp(cpt, "add_missing")==0 || strcmp(cpt, "empty_iso_dir")==0 || strcmp(cpt, "is_full_in_iso")==0) { if(i+1>=end_idx) goto not_enough_exec_arguments; i++; ret= Xorriso_make_abs_adr(xorriso, xorriso->wdi, argv[i], other_path_start, 1|2|4); if(ret<=0) goto ex; if(strcmp(cpt, "in_iso")==0) action= 15; else if(strcmp(cpt, "add_missing")==0) action= 18; else if(strcmp(cpt, "empty_iso_dir")==0) action= 19; else if(strcmp(cpt, "is_full_in_iso")==0) action= 20; else action= 16; Findjob_set_action_target(job, action, other_path_start, 0); ret= Xorriso_make_abs_adr(xorriso, xorriso->wdx, start_path, path, 1|2|4|8); if(ret<=0) goto ex; Findjob_set_start_path(job, path, 0); } else if(strcmp(cpt, "report_damage")==0) { Findjob_set_action_target(job, 21, NULL, 0); } else if(strcmp(cpt, "report_lba")==0) { Findjob_set_action_target(job, 22, NULL, 0); } else if(strcmp(cpt, "getfacl")==0) { Findjob_set_action_target(job, 24, NULL, 0); } else if(strcmp(cpt, "setfacl")==0) { if(i+1>=end_idx) goto not_enough_exec_arguments; i++; ret= Xorriso_normalize_acl_text(xorriso, argv[i], &access_acl_text, &default_acl_text, 0); if(ret <= 0) goto ex; Findjob_set_action_text_2(job, 25, access_acl_text, default_acl_text, 0); } else if(strcmp(cpt, "getfattr")==0) { Findjob_set_action_target(job, 26, NULL, 0); } else if(strcmp(cpt, "setfattr")==0) { if(i + 2 >= end_idx) goto not_enough_exec_arguments; i+= 2; /* check input */ ret= Xorriso_path_setfattr(xorriso, NULL, "", argv[i - 1], strlen(argv[i]), argv[i], 1); if(ret <= 0) goto ex; Findjob_set_action_text_2(job, 27, argv[i - 1], argv[i], 0); } else if(strcmp(cpt, "set_filter")==0) { if(i + 1 >= end_idx) goto not_enough_exec_arguments; i+= 1; Findjob_set_action_target(job, 28, argv[i], 0); if(!(flag&2)) { Xorriso_pacifier_reset(xorriso, 0); mem_lut= xorriso->last_update_time; } } else if(strcmp(cpt, "show_stream")==0) { Findjob_set_action_target(job, 29, NULL, 0); } else if(strcmp(cpt, "get_any_xattr")==0) { Findjob_set_action_target(job, 33, NULL, 0); } else if(strcmp(cpt, "get_md5")==0) { Findjob_set_action_target(job, 34, NULL, 0); } else if(strcmp(cpt, "check_md5")==0) { if(i + 1 >= end_idx) goto not_enough_exec_arguments; i+= 1; Findjob_set_action_target(job, 35, argv[i], 0); flag|= 8; if(!(flag&2)) { Xorriso_pacifier_reset(xorriso, 0); mem_lut= xorriso->last_update_time; } if(!(flag & 1)) xorriso->find_check_md5_result= 0; } else if(strcmp(cpt, "make_md5")==0) { Findjob_set_action_target(job, 36, NULL, 0); flag|= 8; if(!(flag&2)) { Xorriso_pacifier_reset(xorriso, 0); mem_lut= xorriso->last_update_time; } } else if(strcmp(cpt, "mkisofs_r")==0) { Findjob_set_action_target(job, 37, NULL, 0); } else if(strcmp(cpt, "sort_weight")==0) { if(i + 1 >= end_idx) goto not_enough_exec_arguments; i+= 1; sscanf(argv[i], "%d", &type); Findjob_set_action_type(job, 38, type, 0); } else if(strcmp(cpt, "hide")==0) { if(i+1>=end_idx) goto not_enough_exec_arguments; i++; type= Xorriso__hide_mode(argv[i], 0); if(type < 0) { sprintf(xorriso->info_text, "-find -exec hide: unknown hide state "); Text_shellsafe(argv[i], xorriso->info_text, 1); goto sorry_ex; } Findjob_set_action_type(job, 39, type, 0); } else if(strcmp(cpt, "estimate_size")==0) { Findjob_set_action_target(job, 40, NULL, 0); } else if(strcmp(cpt, "rm_merge")==0) { Findjob_set_action_target(job, 42, NULL, 0); xorriso->update_flags&= ~1; /* End update_merge mode for node adding */ } else if(strcmp(cpt, "clear_merge")==0) { Findjob_set_action_target(job, 43, NULL, 0); xorriso->update_flags&= ~1; /* End update_merge mode for node adding */ } else if(strcmp(cpt, "list_extattr")==0) { if(i+1>=end_idx) goto not_enough_exec_arguments; i++; Findjob_set_action_target(job, 44, argv[i], 0); list_extattr_head= 1; list_extattr_mode= argv[i]; } else if(strcmp(cpt, "set_hfs_crtp")==0) { if(i + 2 >= end_idx) goto not_enough_exec_arguments; i+= 2; /* Check creator and type for compliance */ ret= Xorriso_hfsplus_file_creator_type(xorriso, "", NULL, argv[i - 1], argv[i], 1); if(ret <= 0) goto ex; Findjob_set_action_text_2(job, 45, argv[i - 1], argv[i], 0); } else if(strcmp(cpt, "get_hfs_crtp")==0) { Findjob_set_action_target(job, 46, NULL, 0); } else if(strcmp(cpt, "set_hfs_bless")==0) { if(i+1>=end_idx) goto not_enough_exec_arguments; i++; /* Check type of blessing for compliance */ ret= Xorriso_hfsplus_bless(xorriso, "", NULL, argv[i], 4); if(ret <= 0) goto ex; Findjob_set_action_target(job, 47, argv[i], 0); } else if(strcmp(cpt, "get_hfs_bless")==0) { Findjob_set_action_target(job, 48, NULL, 0); } else if(strcmp(cpt, "print_outname")==0) { if(i+1>=end_idx) goto not_enough_exec_arguments; i++; name_space= Xorriso_determine_name_space(xorriso, argv[i], 0); if(name_space < 0) { ret= 0; goto sorry_ex; } Findjob_set_action_type(job, 50, name_space, 0); } else if(strcmp(cpt, "report_sections")==0) { Findjob_set_action_target(job, 51, NULL, 0); } else if(strcmp(cpt, "show_stream_id") == 0) { Findjob_set_action_target(job, 52, NULL, 0); } else { sprintf(xorriso->info_text, "-find -exec: unknown action "); Text_shellsafe(argv[i], xorriso->info_text, 1); goto sorry_ex; } } else { sprintf(xorriso->info_text, "-find[ix]: unknown option "); Text_shellsafe(argv[i], xorriso->info_text, 1); sorry_ex:; Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } if(list_extattr_head) { sprintf(xorriso->result_line, "# Output of xorriso %s action list_extattr\n", (flag & 1) ? "-findx" : "-find"); Xorriso_result(xorriso, 0); strcpy(xorriso->result_line, "cd "); if(start_path[0] == '/') strcat(xorriso->result_line, "/"); else { cd_pt= (flag & 1) ? xorriso->wdx : xorriso->wdi; if(cd_pt[0] == 0) cd_pt= "/"; ret= Xorriso_append_extattr_comp(xorriso, cd_pt, strlen(cd_pt), list_extattr_mode, 0); if(ret <= 0) goto ex; } strcat(xorriso->result_line, "\n"); /* temporarily disable -backslash_codes with result output */ bsl_mem= xorriso->bsl_interpretation; xorriso->bsl_interpretation= 0; Xorriso_result(xorriso, 0); xorriso->bsl_interpretation= bsl_mem; sprintf(xorriso->result_line, "c=\"setextattr\"\n\n"); Xorriso_result(xorriso, 0); } if(flag&1) ret= Xorriso_findx(xorriso, first_job, "", start_path, &dir_stbuf, 0, NULL, 0); else if(flag & 8) { cpt= start_path; ret= Xorriso_findi_sorted(xorriso, first_job, (off_t) 0, 1, &cpt, 0); } else ret= Xorriso_findi(xorriso, first_job, NULL, (off_t) 0, NULL, start_path, &dir_stbuf, 0, (flag&4)>>1); ex:; if(deleter && !(flag&2)) Xorriso_pacifier_callback(xorriso, "iso_rr_paths deleted", xorriso->pacifier_count, 0, "", 1|2); else if(first_job != NULL && first_job->action == 28 && !(flag&2)) Xorriso_pacifier_callback(xorriso, "file filters processed", xorriso->pacifier_count, 0, "", 1 | 2); else if(mem_lut!=xorriso->last_update_time && mem_lut!=0.0 && !(flag&2)) Xorriso_pacifier_callback(xorriso, "content bytes read", xorriso->pacifier_count, 0, "", 1 | 8 | 32); if(first_job != NULL && first_job->action == 35 && !(flag & 1)) Xorriso_report_md5_outcome(xorriso, first_job->target, 0); if(first_job != NULL && first_job->action == 40) { sprintf(xorriso->result_line,"Size lower : %lus\n", (unsigned long) (first_job->estim_lower_size / (off_t) 2048)); Xorriso_result(xorriso,0); sprintf(xorriso->result_line,"Size upper : %lus\n", (unsigned long) ((first_job->estim_upper_size / (off_t) 2048) + !!(first_job->estim_upper_size % 2048))); Xorriso_result(xorriso,0); } if(access_acl_text != NULL) free(access_acl_text); if(default_acl_text != NULL) free(default_acl_text); if(ret > 0 && (flag & 16) && first_job != NULL) ret= first_job->match_count + 1; Findjob_destroy(&first_job, 0); Xorriso_free_meM(path); Xorriso_free_meM(other_path_start); (*idx)= end_idx; return(ret); } /* Option -follow */ int Xorriso_option_follow(struct XorrisO *xorriso, char *mode, int flag) { int was_fl, was_fm, was_fpr, was_fpt, was_fc, l; double num; char *cpt, *npt; was_fpt= xorriso->do_follow_pattern; was_fpr= xorriso->do_follow_param; was_fl= xorriso->do_follow_links; was_fc= xorriso->do_follow_concat; was_fm= xorriso->do_follow_mount; xorriso->do_follow_pattern= 0; xorriso->do_follow_param= 0; xorriso->do_follow_links= 0; xorriso->do_follow_concat= 0; xorriso->do_follow_mount= 0; npt= cpt= mode; for(cpt= mode; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0) goto unknown_mode; if(strncmp(cpt, "off", l)==0) { xorriso->do_follow_pattern= 0; xorriso->do_follow_param= 0; xorriso->do_follow_links= 0; xorriso->do_follow_concat= 0; xorriso->do_follow_mount= 0; } else if(strncmp(cpt, "on", l)==0) { xorriso->do_follow_pattern= 1; xorriso->do_follow_param= 1; xorriso->do_follow_links= 1; xorriso->do_follow_concat= 1; xorriso->do_follow_mount= 1; } else if(strncmp(cpt, "default", l)==0) { xorriso->do_follow_pattern= 1; xorriso->do_follow_param= 0; xorriso->do_follow_links= 0; xorriso->do_follow_concat= 0; xorriso->do_follow_mount= 1; xorriso->follow_link_limit= 100; } else if(strncmp(cpt, "link", l)==0 || strncmp(cpt,"links", l)==0) { xorriso->do_follow_links= 1; } else if(strncmp(cpt, "mount", l)==0) { xorriso->do_follow_mount= 1; } else if(strncmp(cpt,"param", l)==0) { xorriso->do_follow_param= 1; } else if(strncmp(cpt, "pattern", l)==0) { xorriso->do_follow_pattern= 1; } else if(strncmp(cpt, "concat", l)==0) { xorriso->do_follow_concat= 1; } else if(strncmp(cpt, "limit=", 6)==0) { sscanf(cpt+6, "%lf", &num); if(num<=0 || num>1.0e6) { sprintf(xorriso->info_text, "-follow: Value too %s with '%s'", num<=0 ? "small" : "large", cpt+6); goto sorry_ex; } xorriso->follow_link_limit= num; } else { unknown_mode:; if(linfo_text, "-follow: unknown mode '%s'", cpt); else sprintf(xorriso->info_text, "-follow: oversized mode parameter (%d)",l); sorry_ex: Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); xorriso->do_follow_pattern= was_fpt; xorriso->do_follow_param= was_fpr; xorriso->do_follow_links= was_fl; xorriso->do_follow_concat= was_fc; xorriso->do_follow_mount= was_fm; return(0); } } return(1); } /* Option -fs */ int Xorriso_option_fs(struct XorrisO *xorriso, char *size, int flag) { double num; num= Scanf_io_size(size, 0); if(num < 64*1024 || num > 1024.0 * 1024.0 * 1024.0) { sprintf(xorriso->info_text, "-fs: wrong size %.f (allowed: %.f - %.f)", num, 64.0 * 1024.0, 1024.0 * 1024.0 * 1024.0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } xorriso->fs= num / 2048.0; if(xorriso->fs * 2048 < num) xorriso->fs++; return(1); } /* Commands -getfacl alias -getfacli, -getfacl_r alias -getfacl_ri -getfattr alias getfattri */ /* @param flag bit0= recursive -getfacl_r bit1= getfattr rather than getfacl bit3= with bit1: do not ignore eventual non-user attributes */ int Xorriso_option_getfacli(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int i, ret, was_failure= 0, end_idx, fret; int optc= 0; char **optv= NULL; struct FindjoB *job= NULL; struct stat dir_stbuf; ret= Xorriso_opt_args(xorriso, "-getfacl", argc, argv, *idx, &end_idx, &optc, &optv, 0); if(ret<=0) goto ex; for(i= 0; i0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; ret= 0; goto ex; } ret= 1; ex:; (*idx)= end_idx; Xorriso_opt_args(xorriso, "-getfacl", argc, argv, *idx, &end_idx, &optc, &optv, 256); Findjob_destroy(&job, 0); if(ret<=0) return(ret); return(!was_failure); } /* Option -gid */ int Xorriso_option_gid(struct XorrisO *xorriso, char *gid, int flag) { int ret; xorriso->do_global_gid= 0; if(gid[0]==0 || strcmp(gid,"-")==0) return(1); ret= Xorriso_convert_gidstring(xorriso, gid, &(xorriso->global_gid), 0); if(ret>0) xorriso->do_global_gid= 1; return(ret); } /* Option -grow_blindly */ int Xorriso_option_grow_blindly(struct XorrisO *xorriso, char *msc2, int flag) { double num; int l; if(msc2[0]==0 || msc2[0]=='-' || strcmp(msc2, "off")==0) { xorriso->grow_blindly_msc2= -1; return(1); } num= Scanf_io_size(msc2, 0); l= strlen(msc2); if(msc2[l-1]<'0' || msc2[l-1]>'9') num/= 2048.0; xorriso->grow_blindly_msc2= num; return(1); } /* Option -hardlinks "on"|"off" */ int Xorriso_option_hardlinks(struct XorrisO *xorriso, char *mode, int flag) { int ret; char *what_data= NULL, *what, *what_next; Xorriso_alloc_meM(what_data, char, SfileadrL); if(Sfile_str(what_data, mode, 0)<=0) { sprintf(xorriso->info_text, "-hardlinks: mode string is much too long (%d)", (int) strlen(mode)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } for(what= what_data; what != NULL; what= what_next) { what_next= strchr(what, ':'); if(what_next != NULL) { *what_next= 0; what_next++; } if(strcmp(what, "off") == 0) { Xorriso_finish_hl_update(xorriso, 0); xorriso->ino_behavior|= 1 | 2 | 4; xorriso->ino_behavior&= ~8; } else if(strcmp(what, "on") == 0) { xorriso->ino_behavior&= ~(1 | 2 | 4 | 8); } else if(strcmp(what, "without_update") == 0) { Xorriso_finish_hl_update(xorriso, 0); xorriso->ino_behavior&= ~(1 | 2 | 4); xorriso->ino_behavior|= 8; } else if(strcmp(what, "start_update") == 0) { xorriso->ino_behavior&= ~(1 | 2 | 4 | 8); ret= Xorriso_make_di_array(xorriso, 1); if(ret <= 0) goto ex; } else if(strcmp(what, "end_update") == 0) { Xorriso_finish_hl_update(xorriso, 0); } else if(strcmp(what, "perform_update") == 0) { Xorriso_finish_hl_update(xorriso, 0); } else if(strcmp(what, "start_extract") == 0) { xorriso->ino_behavior&= ~(1 | 2 | 4); ret= Xorriso_make_hln_array(xorriso, 1); if(ret <= 0) goto ex; } else if(strcmp(what, "end_extract") == 0) { Xorriso_destroy_hln_array(xorriso, 0); } else if(strcmp(what, "discard_extract") == 0) { Xorriso_destroy_hln_array(xorriso, 0); } else if(strcmp(what, "normal_extract") == 0) { xorriso->ino_behavior&= ~16; } else if(strcmp(what, "cheap_sorted_extract") == 0) { xorriso->ino_behavior|= 16; } else if(strcmp(what, "lsl_count") == 0) { xorriso->ino_behavior&= ~32; } else if(strcmp(what, "no_lsl_count") == 0) { xorriso->ino_behavior|= 32; } else { sprintf(xorriso->info_text, "-hardlinks: unknown mode '%s' in '%s'", what, mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } /* <<< ts B00613 : This is wrong: it enables new_rr if -hardlinks is off. Documented is that new_rr gets enabled if hardlinks are on. But it never worked that way. A compromise seems to be to disable this totally and to change man xorriso. new_rr still is not recognized by mount on Solaris. if(xorriso->ino_behavior & 2) Xorriso_option_compliance(xorriso, "new_rr", 0); */ ret= 1; ex:; Xorriso_free_meM(what_data); return(ret); } /* Option -help and part of -prog_help */ int Xorriso_option_help(struct XorrisO *xorriso, int flag) { static char text[][80]={ #ifdef Xorriso_no_helP "This binary program does not contain a help text.", "If available, read: man 1 xorriso", #else "This program creates, loads, manipulates and writes ISO 9660 filesystem", "images with Rock Ridge extensions. Write targets can be drives with optical", "media or local filesystem objects.", "The program operations are controlled by a sequence of commands, of which", "the initial ones are given as program arguments or as lines in startup", "files. Further commands may get read from files in batch mode or from", "standard input in dialog mode.", "", " -x Only in effect if given as program argument:", " Execute commands given as program arguments in a sequence", " that most likely makes some sense. Default is to execute", " program arguments exactly in the sequence as given.", "", "Preparation commands:", "Drive addresses are either /dev/... as listed with command -devices or", "disk files, eventually with prefix \"stdio:\" if non-CD-drive in /dev tree.", "E.g. /dev/sr0 , /tmp/pseudo_drive , stdio:/dev/sdc", " -dev address Set input and output drive and load eventual ISO image.", " Set the image expansion method to growing.", " -indev address Set input drive and load eventual ISO image. Use expansion", " methods modifying or blind growing.", " -outdev address", " Set output drive and use modifying or blind growing.", " -drive_class \"harmless\"|\"banned\"|\"risky\"|\"clear_list\" disk_pattern", " Add a drive path pattern to one of the safety lists or make", " those lists empty. Defaulty entry in \"risky\" is \"/dev\".", " -drive_access \"exclusive\"|\"shared\":\"unrestricted\"|\"readonly\"", " Enable or disable device file locking mechanisms.", " Enable or disable status and content changes of drive.", " -scsi_dev_family \"default\"|\"sr\"|\"scd\"|\"sg\"", " Linux specific: Choose device file type.", " -read_speed number[\"k/s\"|\"[x]CD\"|\"[x]DVD\"|\"[x]BD\"]|keyword", " Set the read speed. Default is \"none\" = do not set speed", " before reading. Prefix \"soft_force:\" enables slowdown by", " software.", " -grow_blindly \"off\"|predicted_nwa", " Switch between modifying and blind growing.", " -load \"session\"|\"track\"|\"lba\"|\"sbsector\"|\"volid\"|\"auto\" id", " Load a particular (outdated) ISO session from a -dev or", " -indev which hosts more than one session.", " -displacement [-]block_address", " When loading ISO tree or reading data files compensate a", " displacement versus the start address for which the image", " was prepared.", " -read_fs \"any\"|\"norock\"|\"nojoliet\"|\"ecma119\"", " Specify which kind of filesystem tree to load if present.", " -rom_toc_scan \"on\"|\"force\"|\"off\"[:\"emul_on\"|\"emul_off\"]", " [:\"emul_wide\"|\"emul_narrow\"]", " Enable scanning for ISO sessions on read-only drives/media", " and on overwritable media with emulated TOC.", " -calm_drive \"in\"|\"out\"|\"all\"|\"on\"|\"off\"", " Reduce drive noise until it gets actually used again.", " -assert_volid pattern severity", " Accept input image only if its volume id matches pattern.", " -charset name Set the character set name to be used for file name", " conversion from and to media.", " -in_charset name", " Like -charset but only for conversion from media.", " -auto_charset \"on\"|\"off\"", " Enable writing and reading of character set name in image.", " -out_charset name", " Like -charset but only for conversion to media.", " -local_charset name", " Override system assumption of the local character set name.", " -hardlinks mode[:mode ...]", " Enable or disable recording and restoring of hard links.", " Modes are \"on\", \"off\", \"perform_update\",", " \"without_update\", \"discard_extract\",", " \"cheap_sorted_extract\", \"normal_extract\"", " -acl \"on\"|\"off\"", " Enable or disable reading and writing of ACLs.", " -xattr \"on\"|\"user\"|\"any\"|\"off\"", " Enable or disable reading and writing of xattr.", " -md5 \"on\"|\"all\"|\"off\"", " Enable or disable processing of MD5 checksums.", " -for_backup", " Shortcut for: -hardlinks on -acl on -xattr any -md5 on", " -ecma119_map \"unmapped\"|\"stripped\"|\"uppercase\"|\"lowercase\"", " Choose conversion of file names if neither Rock Ridge", " nor Joliet is present in the loaded ISO session.", " -joliet_map \"unmapped\"|\"stripped\"", " Choose conversion of file names if the Joliet tree is read", " when loading the ISO session.", " -iso_nowtime \"dynamic\"|timestring", " Choose use of current time or a fixed point in time for", " timestamps where libisofs would normally use the current", " (i.e. dynamic) time.", " -disk_dev_ino \"on\"|\"ino_only\"|\"off\"", " Enable or disable recording of disk file dev_t and ino_t", " and their use in file comparison.", " -scdbackup_tag list_path record_name", " Enable production of scdbackup tag with -md5 on", " -ban_stdio_write", " Allow for writing only the usage of optical drives.", " -early_stdio_test \"on\"|\"appendable_wo\"|\"off\"", " Classify stdio drives by effective access permissions.", " -data_cache_size number_of_tiles blocks_per_tile", " Adjust size and granularity of the data read cache.", " -blank [\"force:\"]\"fast\"|\"all\"|\"deformat\"|\"deformat_quickest\"", " Blank medium or invalidate ISO image on medium.", " Prefix \"force:\" overrides medium evaluation.", " -truncate_overwritable entity id adjust", " Activate an older session on overwritable medium. Adjust", " its size to some value not smaller than original old size.", " -close_damaged \"as_needed\"|\"force\"", " Close track and session of damaged medium.", " -format \"as_needed\"|\"full\"|\"fast\"|\"by_index_#\"|\"by_size_#\"", " Format BD-RE, BD-R, DVD-RAM, DVD-RW, DVD+RW.", " -volid volume_id", " Specifies the volume ID text. (32 chars out of [A-Z0-9_])", " -volset_id name", " Specifies the volume set id. (128 chars)", " -publisher name", " Specifies the publisher name. (128 chars)", " -application_id name", " Specifies the application id. (128 chars)", " -system_id name", " Specifies the system id for the System Area. (32 chars)", " -volume_date type timestring", " Specifies volume timestamps. [\"c\",\"m\",\"x\",\"f\",\"uuid\"]", " -copyright_file name", " Specifies the name of the Copyright File. (37 chars)", " -biblio_file name", " Specifies the name of the Bibliographic File. (37 chars)", " -abstract_file name", " Specifies the name of the Abstract File. (37 chars)", " -application_use character|0xXY|disk_path", " Specifies the content of Application Use field. (512 bytes)", " A single character or a hex code gets repeated 512 times.", " Other text gets opened as data file and 512 bytes are read.", " -joliet \"on\"|\"off\"", " Generate Joliet info additional to Rock Ridge info.", " -hfsplus \"on\"|\"off\"", " Generate a HFS+ partition and filesystem within ISO image.", " -rockridge \"on\"|\"off\"", " Opportunity to omit Rock Ridge info. (Do not do it !)", " -jigdo \"clear\"|\"template_path\"|\"jigdo_path\"|\"md5_path\"", " |\"min_size\"|\"checksum_iso\"|\"checksum_template\"", " |\"checksum_path\"|\"demand_checksum\"|\"checksum_algorithm\"", " |\"compression\"|\"exclude\"|\"demand_md5\"|\"mapping\"", " |\"checksum_iso\"|\"checksum_template\"", " value", " Clear Jigdo Template Extraction parameter list or add a", " parameter with its value to that list.", " -compliance rule[:rule...]", " Allow more or less harmless deviations from strict standards", " compliance.", " -rr_reloc_dir name", " Specifies name of relocation directory in root directory,", " to which deep subtrees will get relocated if -compliance", " is set to \"deep_paths_off\".", " -boot_image \"any\"|\"isolinux\"|\"grub\"", " |\"discard\"|\"keep\"|\"patch\"|\"replay\"", " |\"dir=\"|\"bin_path=\"", " |\"cat_path=\"|\"cat_hidden=on|iso_rr|joliet|off\"", " |\"load_size=\"|\"boot_info_table=\"", " |\"grub2_boot_info=\"|\"grub2_mbr=\"|\"partition_offset=\"", " |\"partition_hd_cyl=\"|\"partition_sec_hd=\"", " |\"partition_cyl_align=\"|\"mbr_force_bootable=\"", " |\"system_area=\"|\"partition_table=on|off\"", " |\"partition_entry=\"|\"appended_part_as=\"", " |\"part_like_isohybrid=\"|\"iso_mbr_part_type=\"", " |\"gpt_disk_guid=\"", " |\"chrp_boot_part=on|off=\"|\"prep_boot_part=\"", " |\"efi_boot_part=\"|\"efi_boot_part=--efi-boot-image\"", " |\"mips_path=\"|\"mipsel_path=\"|\"mips_discard\"", " |\"sparc_label=\"|\"grub2_sparc_core=\"|\"sparc_discard\"", " |\"hppa_cmdline=\"|\"hppa_bootloader=\"|\"hppa_kernel_32=\"", " |\"hppa_kernel_64=\"|\"hppa_ramdisk=\"|\"hppa_hdrversion=\"", " |\"hppa_discard\"|\"alpha_boot=\"|\"alpha_discard\"", " |\"hfsplus_serial=\"|\"hfsplus_block_size=\"", " |\"apm_block_size=\"|\"show_status\"", " Whether to discard or keep an exiting El Torito boot image,", " or to freshly set up boot equipment. \"replay\" performs", " the commands proposed by -report_system_area \"cmd\".", " ISOLINUX can be made bootable by dir=/ or dir=/isolinux", " or dir=/boot/isolinux. Others, like GRUB, by bin_path=...", " and cat_path=...", " The boot image and its helper files need to be added to the", " ISO image by the usual commands like -map or -add.", " system_area= and partition_table= are for MBR based booting", " from USB stick. The system_area= file needs not to be added.", " chrp_boot_part= and prep_boot_part= are for PowerPC.", " efi_boot_part= is for booting EFI systems from USB stick.", " mips_path= adds Big Endian MIPS boot files. mipsel_path=", " sets one Little Endian MIPS boot file. sparc_label=", " activates SUN Disk Label. hppa_* is for HP PA-RISC via PALO.", " alpha_boot= is for DEC Alpha SRM. MIPS, SUN, HP, and Alpha", " are mutually exclusive and exclusive to production", " of MBR and to booting via EFI from USB stick.", " -append_partition partition_number type_code disk_path", " Append a prepared filesystem image after the end of the", " ISO image. Caution: Will be overwritten by multi-session.", "", " -uid uid User id to be used for the whole multi-session ISO image.", " -gid gid Group id for the same purpose.", "", " -devices Show list of available optical drives and their addresses.", " -device_links Like devices, but showing link paths which are hopefully", " persistent over reboot on modern Linux systems.", "", " -toc Show media specific tables of content (sessions).", " -toc_of \"in\"|\"out\"|\"all\"[\":short\"]", " Show -toc of either input drive or output drive or both.", "", " -mount_cmd drive entity id path", " Print to result channel a command suitable to mount the", " depicted entity (see -load) at the given directory path.", " -mount_opts \"exclusive\"|\"shared\"", " Set options for -mount and -mount_cmd.", " -session_string drive entity id \"linux:\"path|\"freebsd:\"path|form", " Print foreign OS command or custom line.", "", " -list_formats Show media specific list of format descriptors.", "", " -list_speeds Show media specific list of write speed descriptors.", "", " -list_profiles \"in\"|\"out\"|\"all\"", " Show list of media types supported by indev and/or outdev.", " -print_size Print the foreseeable consumption by next -commit.", "", " -tell_media_space", " Print foreseeable available space on output medium", " -pvd_info Print various id strings of the loaded ISO image.", "", " -report_el_torito \"plain\"|\"help\"|\"cmd\"|\"as_mkisofs\"", " \"plain\" prints information about the El Torito boot catalog", " and boot images of the loaded ISO image.", " \"help\" prints an explanation of the output format.", " \"cmd\" and \"as_mkisofs\" propose commands to reproduce", " the boot equipment reported by -report_el_torito \"plain\"", " and -report_system_area \"plain\"", " -report_system_area \"plain\"|\"help\"|\"gpt_crc_of:\"disk_path", " |\"cmd\"|\"as_mkisofs\"", " \"plain\" prints information about recognized data", " \"help\" prints an explanation of the output format.", " in the System Area of the loaded ISO image: MBR, GPT, ...", " \"gpt_crc_of:\" prints GPT CRC of file disk_path.", " For \"cmd\" and \"as_mkisofs\" see -report_el_torito.", "", "Commands with variable length path list [...] need the list delimiter text", "as end mark if they are followed by another command. By default this", "delimiter is \"--\". In dialog and with commands read from files, the line", "end serves as such a mark. With program arguments this mark can be omitted", "only with the last command in the list of program arguments.", "For brevity the list delimiter is referred as \"--\" throughout this text.", "", " -list_delimiter text Set the list delimiter to be used instead of \"--\"", " It has to be a single word, must not be empty, not longer", " than 80 characters, may not contain quotation marks.", "", "Manipulation commands:", "disk_path is a path to an object in the local filesystem tree.", "iso_rr_path is the Rock Ridge name of a file object in the ISO image.", "pathspec is either a disk_path or (if allowed) a pair: iso_rr_path=disk_path", "Commands marked by [***] have variable length parameter lists and perform", "pattern expansion if enabled by -iso_rr_pattern or -disk_pattern.", "", " -pathspecs \"on\"|\"off\"|\"as_mkisofs\"", " Allow or disallow pathspecs of form iso_rr_path=disk_path", " Only \"off\" allows -disk_pattern expansion.", " -file_name_limit number", " Set truncation size for file names [64 ... 255].", " -file_size_limit value [...]", " Set limit for file content size. One or more numbers to add.", " -add pathspec [...] | disk_path [***]", " Insert the given files or directory trees from", " filesystem into the ISO image. Much like mkisofs.", " -add_plainly \"none\"|\"unknown\"|\"dashed\"|\"any\"", " Whether to add lonely arguments as pathspec or disk_path.", " -path_list disk_path", " Like -add but read the pathspecs from file disk_path.", " -quoted_path_list disk_path", " Like -path_list but with line rules as -dialog \"on\".", "", " -map disk_path iso_rr_path", " Insert disk file object at the given iso_rr_path.", " -map_single disk_path iso_rr_path", " Like -map but with directory do not insert its sub tree.", " -map_l disk_prefix iso_rr_prefix disk_path [***]", " Performs -map with each disk_path.", " -update disk_path iso_rr_path", " Compare both file objects and do what is necessary to make", " iso_rr_path a matching copy of disk_path.", " -update_r disk_path iso_rr_path", " Like -update but affecting all files below directories.", " -update_l disk_prefix iso_rr_prefix disk_path [***]", " Performs -update_r with each disk_path.", " -update_li iso_rr_prefix disk_prefix iso_rr_path [***]", " Performs -update_r with each iso_rr_path.", " -update_lxi disk_prefix iso_rr_prefix disk_or_iso_rr_path [***]", " Performs -update_r with each disk_path or corresponding", " iso_rr_path after exchange of disk_prefix by iso_rr_prefix.", " -cut_out disk_path byte_offset byte_count iso_rr_path", " Map a byte interval of a regular disk file into a regular", " file in the ISO image.", "", " -cpr disk_path [***] iso_rr_path", " Insert the given files or directory trees from filesystem", " into the ISO image, according to the rules of cp -r.", "", " -rm iso_rr_path [***]", " Delete the given files from the ISO image.", " -rm_r iso_rr_path [***]", " Delete the given directory trees from ISO image.", " -move iso_rr_path iso_rr_path", " Rename the single file given by the first iso_rr_path to", " the second iso_rr_path.", " -mv iso_rr_path [***] iso_rr_path", " Like shell command mv rename the given file objects in the", " ISO tree to the last of the iso_rr_path parameters.", " -chown uid iso_rr_path [***]", " Equivalent to chown in the ISO image.", " -chown_r uid iso_rr_path [***]", " Like -chown but affecting all files below directories.", " -chgrp gid iso_rr_path [***]", " Equivalent to chgrp in the ISO image.", " -chgrp_r gid iso_rr_path [***]", " Like -chgrp but affecting all files below directories.", " -chmod mode iso_rr_path [***]", " Equivalent to chmod in the ISO image.", " -chmod_r mode iso_rr_path [***]", " Like -chmod but affecting all files below directories.", " -setfacl acl_text iso_rr_path [***]", " Replace the permissions and eventual ACL of the given files", " in the ISO image by the ACL which is defined by acl_text.", " -setfacl_r acl_text iso_rr_path [***]", " Like -setfacl but affecting all files below directories.", " -setfacl_list disk_path", " Read output of getfacl from file disk_path. Set owner,", " group and ACL of the iso_rr_path given by line \"# file:\".", " -setfattr [-]name value iso_rr_path [***]", " Set xattr pair with the given name to the given value, or", " delete pair if name is prefixed with \"-\" and value is", " an empty text.", " -setfattr_r [-]name value iso_rr_path [***]", " Like -setfattr but affecting all files below directories.", " -setfattr_list disk_path", " Read output of getfattr from file disk_path. Replace the", " xattr of the iso_rr_path given by line \"# file:\".", " -alter_date type timestring iso_rr_path [***]", " Alter the date entries of a file in the ISO image. type is", " one of \"a\", \"m\", \"b\" for:", " access time, modification time, both times.", " -alter_date_r type timestring iso_rr_path [***]", " Like -alter_date but affecting all files below directories.", " -hide on|iso_rr:joliet:hfsplus|off iso_rr_path [***]", " Keep names of files out of directory trees, but store their", " data content in the image.", " -find iso_rr_path [test [op] [test ...]] [-exec action [params]]", " performs an action on files below the given directory in", " the ISO image. Tests:", " -name pattern, -wholename pattern, -disk_name pattern,", " -type b|c|d|p|f|l|s|e, -pending_data, -hidden,", " -lba_range start count, -damaged, -has_acl, -has_xattr,", " -has_aaip, -has_filter, -has_md5, -has_any_xattr,", " -has_hfs_crtp, -has_hfs_bless, -bad_outname,", " -name_limit_blocker, -maxdepth, -mindepth,", " -prune, -decision yes|no, -true, -false", " Operators: -not, -or, -and, -sub, (, -subend, ),", " -if, -then, -elseif, -else, -endif", " Action may be one of: echo, chown, chown_r, chgrp, chgrp_r,", " chmod, chmod_r, alter_date, alter_date_r, set_to_mtime,", " lsdl, compare, rm, rm_r, compare, update, report_damage,", " report_lba, report_sections,", " getfacl, setfacl, getfattr, setfattr, get_any_xattr,", " list_extattr, get_md5, check_md5, make_md5,", " set_hfs_crtp, get_hfs_crtp, set_hfs_bless, get_hfs_bless,", " set_filter, show_stream, show_stream_id, mkisofs_r,", " hide, print_outname, estimate_size, find", " params are their parameters except iso_rr_path.", " -mkdir iso_rr_path [...]", " Create empty directories if they do not exist yet.", " -lns target_text iso_rr_path", " Create a symbolic link pointing to target_text", " -rmdir iso_rr_path [***]", " Delete empty directories.", " -clone iso_rr_path_original iso_rr_path_copy", " Create an ISO copy of an ISO file or ISO directory tree.", " -cp_clone iso_rr_path_original [***] iso_rr_path_dest", " Create ISO to ISO copies according to the rules of cp -r.", "", " -- Default list delimiter marking the end of command parameter", " lists. It may be changed by command -list_delimiter.", "", " -not_paths disk_path [***]", " Add the given paths to the list of excluded absolute paths.", " -not_leaf pattern", " Add the given pattern to the list of leafname exclusions.", " -not_list disk_path", " Read lines from disk_path and use as -not_paths (with \"/\")", " or as -not_leaf (without \"/\").", " -quoted_not_list disk_path", " Like -not_list but with line rules as -dialog \"on\".", " -not_mgt \"reset\"|\"on\"|\"off\"|\"param_on\"|\"subtree_on\"|\"ignore_on\"", " Control effect of exclusion lists.", " -follow \"on\"|\"pattern:param:link:concat:mount:limit=#\"|\"default\"|\"off\"", " Follow symbolic links and mount points within disk_path.", " -overwrite \"on\"|\"nondir\"|\"off\"", " Allow or disallow to overwrite existing files in ISO image.", " -split_size number[\"k\"|\"m\"]", " Set the threshold for automatic splitting of regular files.", " -reassure \"on\"|\"tree\"|\"off\"", " If \"on\" then ask the user for \"y\" or \"n\" with any", " file before deleting or overwriting it in the ISO image.", "", "Filter commands:", "External filter processes may produce synthetic file content by reading the", "original content from stdin and writing to stdout whatever they want.", #ifdef Xorriso_allow_external_filterS " -external_filter name option[:option] program_path [arguments] --", " Define an external filter. Options are: suffix=...: ", " remove_suffix:if_nonempty:if_reduction:if_block_reduction.", " -unregister_filter name", " Undefine an external filter.", " -close_filter_list", " Irrevocably ban -external_filter and -unregister_filter.", #else "Sorry: The use of external filters was not enabled at compile time.", " E.g. by ./configure option --enable-external-filters", #endif /* ! Xorriso_allow_external_filterS */ " -set_filter name iso_rr_path [***]", " Apply a defined filter to the given data files.", " Special name \"--remove-all-filters\" revokes filtering.", " Builtin filters are --gzip , --gunzip, --zisofs .", " -set_filter_r name iso_rr_path [***]", " Like -set_filter but affecting all files below directories.", "", "zisofs is a compression format which is recognized by some Linux kernels.", "xorriso supports it by builtin filter \"--zisofs\" which is to be applied by", "the user, and by \"--zisofs-decode\" which is applied automatically when", "compressed content is detected with a file in the ISO image.", " -zisofs option[:options]", " Set global zisofs parameters:", " level=0|...|9 , block_size=32k|64k|128k , by_magic=on|off", " version_2=off|as_needed|on , block_size_v2=32k|...|1024k", " max_bpt=1k...128g , max_bpt_f=1k...128g , bpt_target=num", " bpt_free_ratio=-1|[0.0...1.0] , susp_z2=off|on" "", "Write-to-media commands:", " -rollback Discard the manipulated ISO image and reload it.", "", " -changes_pending \"no\"|\"yes\"|\"mkisofs_printed\"|\"show_status\"", " Override the automatically determined change status of the", " loaded image, or show the current status.", " -commit Perform the write operation if changes are pending.", " Then perform -dev outdrive.", " Hint: To perform a final write operation with no new -dev", " and no new loading of image, execute command -end.", " -commit_eject \"in\"|\"out\"|\"all\"|\"none\"", " Like -commit but rather eject than load image from outdrive.", " Give up any unejected drive afterwards.", " -write_type \"auto\"|\"tao\"|\"sao/dao\"", " Set write type for CD-R[W], DVD-R[W], DVD+R, BD-R.", " -close \"on\"|\"off\"|\"as_needed\"", " If \"on\" then mark the written medium as not appendable.", " -padding number[\"k\"|\"m\"]|\"included\"|\"appended\"", " Append extra bytes to image stream. (Default is 300k)", " -dummy \"on\"|\"off\"", " If \"on\" simulate burning. Refuse if medium cannot simulate.", " -speed number[\"k/s\"|\"m/s\"|\"[x]CD\"|\"[x]DVD\"|\"[x]BD\"]", " Set the burn speed. Default is \"max\" = maximum speed.", " -stream_recording \"on\"|\"off\"", " Try to circumvent slow checkread on DVD-RAM, BD-RE, BD-R.", " -modesty_on_drive [\"on\"|\"off\"|min_percent_number]", " [:\"min_percent=\"number][:\"max_percent=\"number]", " [:\"min_usec=\"number][:\"max_usec\"=number]", " [:\"timeout_sec=\"number]", " Keep drive buffer hungry to ease concurrent burn run.", " -dvd_obs \"default\"|\"32k\"|\"64k\"", " Set number of bytes per DVD/BD write operation.", " -use_immed_bit \"on\"|\"off\"|\"default\"", " Control whether long running SCSI commands shall run", " asynchronously with progress messages.", " -stdio_sync \"on\"|\"off\"|\"end\"|number", " Set number of bytes after which to force output to stdio", " pseudo drives. \"on\" is the same as 16m.", " -fs number[\"k\"|\"m\"]", " Set the size of the fifo buffer. (Default is 4m)", " -eject \"in\"|\"out\"|\"all\"", " Immediately eject the medium in -indev, -outdev, or both.", "", "Navigation commands:", "", " -cd iso_rr_path Change working directory in the ISO image. iso_rr_paths", " which do not begin with '/' will be inserted beginning at", " the path given with -cd. -ls patterns will eventually", " looked up at this path.", " -cdi disk_path Same as -cd disk_path", " -cdx disk_path Change the current working directory in the local", " filesystem. disk_paths which do not begin with '/'", " will be looked up beginning at the path given with -cdx.", " -lsx patterns will eventually be looked up at this path.", " -pwd tells the current working directory in the ISO image.", " -pwdi same as -pwd.", " -pwdx tells the current working directory in the local filesystem.", "", " -iso_rr_pattern \"on\"|\"ls\"|\"off\"", " Enable or disable pattern expansions for ISO image commands", " marked by [***]. \"ls\" restricts it to -ls and -du.", " -disk_pattern \"on\"|\"ls\"|\"off\"", " Enable or disable pattern expansions for local filesystem", " commands marked by [***]. \"ls\" restricts to -ls*x and -du*x.", "", " -ls pattern [***] lists files of the ISO image which match one of the", " given shell parser patterns. (I.e. wildcards '*' '?').", " Directories are listed by their content.", " -lsd pattern [***] like -ls but listing directories as single items.", " -lsl pattern [***] like -ls but also telling some file attributes.", " -lsdl pattern [***] like -lsd but also telling some file attributes.", "", " -lsx pattern [***] lists files of the local filesystem which match one", " of the patterns. Directories are listed by their content.", " -lsdx pattern [***] like -lsx but listing directories as single items.", " -lslx pattern [***] like -lsx but also telling some file attributes.", " -lsdlx pattern [***] like -lsdx but also telling some file attributes.", " -getfacl pattern [***] list eventual ACLs of the given files.", " -getfacl_r pattern [***] like -getfacl but listing whole file trees.", " -getfattr pattern [***] list eventual xattr of the given files.", " -getfxattr_r pattern [***] like -getfxattr but listing whole file trees.", "", " -du pattern [***] recursively lists sizes of files or directories in the", " ISO image which match one of the shell parser patterns.", " -dux pattern [***] recursively lists sizes of files or directories in the", " local filesystem which match one of the shell parser", " patterns.", " -dus pattern [***] like -du but summing up subdirectories without", " listing them explicitly.", " -dusx pattern [***] like -dux but summing up subdirectories without", " listing them explicitly.", "", " -findx disk_path [-name pattern] [-type t] [-exec action [params]]", " Like -find but operating on local filesystem. Most -exec", " actions are defaulted to action echo. Supported actions are:", " in_iso, not_in_iso, is_full_in_iso, add_missing,", " empty_iso_dir", "", " -compare disk_path iso_rr_path", " compare attributes and in case of regular data files the", " content of filesystem object and ISO object.", " -compare_r disk_path iso_rr_path", " Like -compare but affecting all files below directories.", " -compare_l disk_prefix iso_rr_prefix disk_path [***]", " Performs -compare_r with each disk_path.", "", " -show_stream iso_rr_path [***]", " Show content stream chain of data files in the ISO image.", " -show_stream_r iso_rr_path [***]", " Like -show_stream but affecting all files below directories.", "", "Restore commands which copy file objects from ISO image to disk filesystem:", " -osirrox \"on\"|\"device_files\"|\"off\"|\"blocked\"|\"unblock\"|\"banned\"", " [:\"concat_split_on\"|\"concat_split_off\"]", " [:\"auto_chmod_on\"|\"auto_chmod_off\"]", " [:\"sort_lba_on\"|\"sort_lba_off\"]", " [:\"strict_acl_on\"|\"strict_acl_off\"]", " [:\"check_md5_on\"|\"check_md5_off\"|\"check_md5_force\"]", " [:\"sparse=off\"|\"sparse=\"number]", " By default \"off\" the inverse operation of xorriso from ISO", " image to disk filesystem is disabled. \"on\" allows xorriso", " to create, overwrite, delete files in the disk filesystem.", " \"banned\" is irrevocably \"off\". \"blocked\" can only be", " revoked by \"unblock\". (\"device_files\" is dangerous.)", " -extract iso_rr_path disk_path", " Copy tree under iso_rr_path onto disk address disk_path.", " This avoids the pitfalls of cp -r addressing rules.", " -extract_l iso_rr_prefix disk_prefix iso_rr_path [***]", " Perform -extract with each iso_rr_path.", " -extract_single iso_rr_path disk_path", " Like -extract but with directory do not restore sub tree.", " -extract_cut iso_rr_path byte_offset byte_count disk_path", " Copy a byte interval from iso_rr_path to disk_path.", " This is governed in part by -check_media_defaults.", " -extract_boot_images disk_path", " Copy boot images into files in directory disk_path with", " names which tell the role inside the ISO.", " -cpx iso_rr_path [***] disk_path", " Copy leaf file objects from ISO image to disk filesystem.", " -cpax iso_rr_path [***] disk_path", " Like -cpx but trying to restore timestamps and ownership.", " -cp_rx iso_rr_path [***] disk_path", " Copy directory trees from ISO image to disk filesystem.", " -cp_rax iso_rr_path [***] disk_path", " Like -cp_rx but trying to restore timestamps and ownership.", " -paste_in iso_rr_path disk_path byte_offset byte_count", " Copy ISO file content into a byte interval of a disk file.", " -concat \"append\"|\"overwrite\" target iso_rr_path [***]", " Write content of iso_rr_paths into disk file target. Target", " may be a disk_path or \"-\" for writing to standard output.", " -concat \"pipe\" lim prog [args [...]] lim iso_rr_path [***]", " Start prog with given args and write content of iso_rr_paths", " into its standard input. prog must at least contain one '/'.", " lim may be any word that is not among prog and args.", " -mount drive entity id path", " Like -mount_cmd but actually performing that command if", " not setuid or setgid is active.", "", "Evaluation of readability:", " -check_media [options] --", " Try to read data blocks from the medium and report about the", " outcome. Several options modify the behavior:", " use=indev|outdev , what=track|session ,", " min_lba=blockadr , max_lba=blockadr ,", " abort_file=path , time_limit=seconds , item_limit=number ,", " retry=on|off|default , data_to=filepath ,", " sector_map=filepath , map_with_volid=on|off ,", " patch_lba0=on|off|force|blockadr[:force] ,", " report=blocks|files|blocks_files event=severity ,", " bad_limit=quality , slow_limit=seconds , chunk_size=bytes", " -check_media_defaults [options] --", " Preset options for runs of -check_media and -extract_cut.", "", "Compatibility emulation (option list may be ended by list delimiter --):", " -as mkisofs [-help|-version|-o|-R|-r|-J|-V|-P|-f|-m|-exclude-list|", " -no-pad|-M|-C|-graft-points|-path-list|pathspecs|-z|", " -no-emul-boot|-b|-c|-boot-info-table|-boot-load-size|-G|...]", " Perform some mkisofs gestures, understand pathspecs as mkisofs", " does. Commit happens outside emulation at usual occasions.", " For a list of options see -as mkisofs -help.", " -read_mkisofsrc", " Read and interpret the .mkisofsrc configuration file.", " -as cdrecord [-help|-v|dev=|speed=|blank=|fs=|-eject|-atip|padsize=|-multi]", " path|-", " Perform some cdrecord gestures, eventually write at most one", " data track to blank, appendable or overwritable media.", " -pacifier \"xorriso\"|\"cdrecord\"|\"mkisofs\"", " Choose format of UPDATE pacifier during write operations.", "", "General commands:", " -help Print this text", " -abort_on severity Set the threshold for events to abort the program.", " Useful severities: NEVER, ABORT, FATAL, FAILURE, SORRY, WARNING", " -return_with severity exit_value Set the threshold for events to return", " at program end the given exit_value even if not aborted.", " exit_value may be 0 or 32 to 63.", " -report_about severity Set the threshold for events to be reported.", " Use -abort_on severities or: HINT, NOTE, UPDATE, DEBUG, ALL", " -signal_handling \"on\"|\"off\"|\"sig_dfl\"|\"sig_ign\"", " Handling of signals. Default \"on\" uses libburn handler.", " -error_behavior \"image_loading\"|\"file_extraction\" behavior", " Behavior \"best_effort\" is most endurant but may produce", " results which are correct only on the first glimpse.", " -dialog \"on\"|\"off\"|\"single_line\"", " After all program arguments are processed, enter dialog mode.", " \"single_line\" does not support newline characters within", " open quotation marks and no line continuation by trailing \\.", " -page len width Prompt user after len output lines (0=no prompt).", " width (default 80) can adjust line number computation", " to the output terminal's line width.", #ifdef Xorriso_with_line_editoR " -use_readline \"on\"|\"off\"", " Whether to use libreadline for dialog if available.", " -history text Copy text into libreadline history. This command", " itself is not copied to the history list.", #endif /* Xorriso_with_line_editoR */ " -sh_style_result \"on\"|\"off\"", " If \"on\" do not wrap file addresses in quotation marks with", " -pwd -pwdx -ls -lsd -lsl -lsdl -lsx -lsdx -lslx -lsdlx", " -du -dus -dux -dusx -findx -find", " -backslash_codes \"on\"|\"off\"|", " \"in_double_quotes\"|\"in_quotes\"|\"with_quoted_input\"", " [:\"with_program_arguments\"][:\"encode_output\"]", " Disable or enable interpretation of \\a \\b \\e \\f \\n \\r \\t \\v", " \\\\ \\NNN \\xNN \\cC in input or program arguments.", " -pkt_output \"on\"|\"off\" Direct output to stdout and prefix each line", " by a short header which tells channel id and a mode number.", " Each such output packet is finalized by a newline.", " Channel ids are 'R:' for result lines, 'I:' for notes", " and error messages, 'M:' for -mark texts. Bit 0 of the", " mode number tells whether the newline is also part of the", " packet payload. Example of a info message with newline:", " I:1: enter option text :", " -pkt_output:on is intended for use by frontend programs.", " -msg_op \"start_sieve\"|\"read_sieve\"|\"clear_sieve\"|\"end_sieve\"|", " \"parse\"|\"parse_silently\"|\"parse_bulk\"|\"parse_bulk_silently\"|", " \"compare_sev\"|\"list_sev\" param_text", " Enable, use, or disable message sieve. Or parse lines into", " words. Or compare or list severity names.", " -named_pipes_loop mode[:mode]", " disk_path_stdin disk_path_stdout disk_path_stderr", " Enter an EOF resistant dialog loop at a named pipe as input", " and zero, one or two named pipes as output. \"-\" = no pipe.", " Mode \"cleanup\" removes pipes at loop end. \"keep\" does not.", " Mode \"buffered\" reads all lines from input pipe before it", " opens the output pipes. \"direct\" opens after first input.", " -launch_frontend program [args ...] --", " Start a program, connect its stdin to xorriso stdout and", " stderr, connect its stdout to xorriso stdin.", " Use any given parameters as arguments for the started program.", " -logfile channel fileaddress Copy output of a channel to the given file.", " channel may be 'R','I','M' as with -pkt_output or '.'", " for the consolidated -pkt_output stream.", " -mark text If text is not empty it will get put out each time a command", " is completed.", " -temp_mem_limit number[\"k\"|\"m\"]", " Set the maximum size for pattern expansion. (Default is 16m)", " -prog text Use text as this program's name in subsequent messages", " -prog_help text Use text as this program's name and perform -help", " -status mode|filter Report the current settings of persistent commands.", " Modes:", " short... print only important or altered settings", " long ... print settings even if they have default values", " long_history like long plus -history: lines", " Filters begin with '-' and are compared literally against the", " output lines of -status long_history. A line is put out only", " if its start matches the filter.", " -status_history_max number Maximum number of history lines to be reported", " with -status:long_history", " -options_from_file fileaddress", " Reads lines from the given file and executes them as commands.", " -no_rc Only if used as first program argument, this command", " prevents reading and interpretation of these startup files:", " /etc/default/xorriso , /etc/opt/xorriso/rc", " /etc/xorriso/xorriso.conf , $HOME/.xorrisorc", " -print text", " Print a text to result channel.", " -print_info text", " Print a text to info channel.", " -print_mark text", " Print a text to mark channel.", " -prompt text", " Wait for Enter key or for a line of input at stdin.", " -sleep number", " Do nothing during the given number of seconds.", " -errfile_log mode path|channel", " Log disk paths of files involved in problem events.", " -session_log path", " Set path of a file where a log record gets appended after", " each session. Form: timestamp start_lba size volume-id", " -scsi_log \"on\"|\"off\"", " Enable or disable logging of SCSI commands to stderr.", " # any text Is ignored. In dialog mode the input line will be stored in", " the eventual readline history, nevertheless.", " -list_extras code", " Tell whether certain extra features were enabled at compile", " time. Code \"all\" lists all features and a headline. Other", " codes pick a single feature. \"codes\" lists the known codes.", " -list_arg_sorting", " Print the sorting order of xorriso commands with option -x.", " -version Tell program and version number", " -end End program. Commit eventual pending changes.", " -rollback_end", " End program. Discard pending changes.", "", "", "Command -page causes a user prompt after the given number of result lines.", "Empty input resumes output until the next prompt. Other input may be:", " @ suppresses paging until the current action is done", " @@ suppresses further result output but continues the action", " @@@ aborts the current action", " other aborts the current action and executes input as new command", "", #ifdef Xorriso_GNU_xorrisO "Report bugs to: bug-xorriso@gnu.org , or in private to: scdbackup@gmx.net .", "xorriso home page: ", "General help using GNU software: ", #else "Report any bugs to bug-xorriso@gnu.org or in private to scdbackup@gmx.net .", #endif "", #endif /* ! Xorriso_no_helP */ "@ENDE_OF_HELPTEXT_(HOPEFULLY_UNIQUELY_SILLY_TEXT)@" }; char *tpt= NULL; int i; Xorriso_restxt(xorriso,"\n"); sprintf(xorriso->result_line,"usage: %s [settings|actions]\n", xorriso->progname); Xorriso_result(xorriso,0); Xorriso_restxt(xorriso,"\n"); for(i=0;1;i++) { tpt= text[i]; if(strcmp(tpt,"@ENDE_OF_HELPTEXT_(HOPEFULLY_UNIQUELY_SILLY_TEXT)@")==0) break; sprintf(xorriso->result_line,"%s\n",tpt); Xorriso_result(xorriso,0); if(xorriso->request_to_abort) return(1); } Xorriso_restxt(xorriso,"\n"); return(1); } /* Option -hfsplus "on"|"off" */ int Xorriso_option_hfsplus(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off")==0) xorriso->do_hfsplus= 0; else if(strcmp(mode, "on")==0) xorriso->do_hfsplus= 1; else { sprintf(xorriso->info_text, "-hfsplus: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -hide */ int Xorriso_option_hide(struct XorrisO *xorriso, char *hide_state, int argc, char **argv, int *idx, int flag) { int i, ret, end_idx, optc= 0, was_failure= 0, fret, hide_mode; char **optv= NULL; ret= Xorriso_opt_args(xorriso, "-hide", argc, argv, *idx, &end_idx, &optc, &optv, 0); if(ret<=0) goto ex; hide_mode= Xorriso__hide_mode(hide_state, 0); if(hide_mode < 0) { sprintf(xorriso->info_text, "-hide : unknown hide state "); Text_shellsafe(hide_state, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } for(i= 0; i0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; ret= 0; goto ex; } ret= 1; ex:; (*idx)= end_idx; Xorriso_opt_args(xorriso, "-hide", argc, argv, *idx, &end_idx, &optc, &optv, 256); if(ret<=0) return(ret); return(!was_failure); } /* Option -history */ int Xorriso_option_history(struct XorrisO *xorriso, char *line, int flag) { Xorriso_dialog_input(xorriso, line, strlen(line) + 1, 2 | 32); return(1); } libisoburn-1.5.4/xorriso/xorriso.10000644000175700017510000102211314005265761014124 00000000000000.\" Hey, EMACS: -*- nroff -*- .\" .\" IMPORTANT NOTE: .\" .\" The original of this file is kept in xorriso/xorriso.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 XORRISO 1 "Version 1.5.4, Jan 30, 2021" .\" 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 insert n+1 empty lines .\" for manpage-specific macros, see man(7) .nh .SH NAME xorriso \- creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. .SH SYNOPSIS .B xorriso .RI [ settings | actions ] .br .SH DESCRIPTION .PP \fBxorriso\fR is a program which copies file objects from POSIX compliant filesystems into Rock Ridge enhanced ISO 9660 filesystems and performs session\-wise manipulation of such filesystems. It can load the management information of existing ISO images and it writes the session results to optical media or to filesystem objects. .br Vice versa \fBxorriso\fR is able to copy file objects out of ISO 9660 filesystems. .PP A special property of \fBxorriso\fR is that it needs neither an external ISO 9660 formatter program nor an external burn program for CD, DVD or BD but rather incorporates the libraries of libburnia\-project.org . .SS .B Overview of features: .br Operates on an existing ISO image or creates a new one. .br Copies files from disk filesystem into the ISO image. .br Copies files from ISO image to disk filesystem (see osirrox). .br Renames or deletes file objects in the ISO image. .br Changes file properties in the ISO image. .br Updates ISO subtrees incrementally to match given disk subtrees. .br Writes result either as completely new image or as add\-on session to optical media or filesystem objects. .br Can activate ISOLINUX and GRUB boot images via El Torito and MBR. .br Can perform multi\-session tasks as emulation of mkisofs and cdrecord. .br Can record and restore hard links and ACL. .br Content may get zisofs compressed or filtered by external processes. .br Can issue commands to mount older sessions on GNU/Linux or FreeBSD. .br Can check media for damages and copy readable blocks to disk. .br Can attach MD5 checksums to each data file and the whole session. .br Scans for optical drives, blanks re\-usable optical media. .br Reads its instructions from command line arguments, dialog, and files. .br Provides navigation commands for interactive ISO image manipulation. .br Adjustable thresholds for abort, exit value, and problem reporting. .br .sp 1 Note that \fBxorriso\fR does not write audio CDs and that it does not produce UDF filesystems which are specified for official video DVD or BD. .SS .B General information paragraphs: .br Session model .br Media types and states .br Creating, Growing, Modifying, Blind Growing .br Libburn drives .br Rock Ridge, POSIX, X/Open, El Torito, ACL, xattr .br Command processing .br Dialog, Readline, Result pager .sp 1 Maybe you first want to have a look at section EXAMPLES near the end of this text before reading the next few hundred lines of background information. .SS \fBSession model:\fR .br Unlike other filesystems, \fBISO 9660\fR (aka \fBECMA\-119\fR) is not intended for read\-write operation but rather for being generated in a single sweep and being written to media as a \fBsession\fR. .br The data content of the session is called filesystem \fBimage\fR. .PP The written image in its session can then be mounted by the operating system for being used read\-only. GNU/Linux is able to mount ISO images from block devices, which may represent optical media, other media or via a loop device even from regular disk files. FreeBSD mounts ISO images from devices that represent arbitrary media or from regular disk files. .PP This session usage model has been extended on CD media by the concept of \fBmulti\-session\fR , which adds information to the CD and gives the mount programs of the operating systems the addresses of the entry points of each session. The mount programs recognize block devices which represent CD media and will by default mount the image in the last session. .br This session usually contains an updated directory tree for the whole medium which governs the data contents in all recorded sessions. So in the view of the mount program all sessions of a particular medium together form a single filesystem image. .br Adding a session to an existing ISO image is in this text referred as \fBgrowing\fR. .br The multi\-session model of the MMC standard does not apply to all media types. But program growisofs by Andy Polyakov showed how to extend this functionality to overwritable media or disk files which carry valid ISO 9660 filesystems. .PP \fBxorriso\fR provides growing as well as an own method named \fBmodifying\fR which produces a completely new ISO image from the old one and the modifications. See paragraph Creating, Growing, Modifying, Blind Growing below. .PP \fBxorriso\fR adopts the concept of multi\-session by loading an image directory tree if present, by offering to manipulate it by several actions, and by writing the new image to the target medium. .br The first session of a \fBxorriso\fR run begins by the definition of the input drive with the ISO image or by the definition of an output drive. The session ends by command \-commit which triggers writing. A \-commit is done automatically when the program ends regularly. .PP After \-commit a new session begins with the freshly written one as input. A new input drive can only be chosen as long as the loaded ISO image was not altered. Pending alteration can be revoked by command \-rollback. .PP Writing a session to the target is supposed to be very expensive in terms of time and of consumed space on appendable or write\-once media. Therefore all intended manipulations of a particular ISO image should be done in a single session. But in principle it is possible to store intermediate states and to continue with image manipulations. .SS .B Media types and states: There are two families of media in the MMC standard: .br \fBMulti\-session media\fR are CD\-R, CD\-RW, DVD\-R, DVD+R, DVD+R/DL, BD\-R, and unformatted DVD\-RW. These media provide a table of content which describes their existing sessions. See command \fB\-toc\fR. .br Similar to multi\-session media are DVD\-R DL and minimally blanked DVD\-RW. They record only a single session of which the size must be known in advance. \fBxorriso\fR will write onto them only if command \-close is set to "on". .br \fBOverwritable media\fR are DVD\-RAM, DVD+RW, BD\-RE, and formatted DVD\-RW. They offer random write access but do not provide information about their session history. If they contain one or more ISO 9660 sessions and if the first session was written by \fBxorriso\fR, then a table of content can be emulated. Else only a single overall session will be visible. .br DVD\-RW media can be formatted by \-format "full". They can be made unformatted by \-blank "deformat". .br Regular files and block devices are handled as overwritable media. Pipes and other writeable file types are handled as blank multi\-session media. .PP These media can assume several states in which they offer different capabilities. .br \fBBlank\fR media can be written from scratch. They contain no ISO image suitable for \fBxorriso\fR. .br Blank is the state of newly purchased optical media. With used CD\-RW and DVD\-RW it can be achieved by action \-blank "as_needed". Overwritable media are considered blank if they are new or if they have been marked as blank by \fBxorriso\fR. Action \-blank "as_needed" can be used to do this marking on overwritable media, or to apply mandatory formatting to new media if necessary. .br \fBAppendable\fR media accept further sessions. Either they are MMC multi\-session media in appendable state, or they are overwritable media which contain an ISO image suitable for \fBxorriso\fR. .br Appendable is the state after writing a session with command \-close off. .br \fBClosed\fR media cannot be written. They may contain an ISO image suitable for \fBxorriso\fR. .br Closed is the state of DVD\-ROM media and of multi\-session media which were written with command \-close on. If the drive is read\-only hardware then it will probably show any media as closed CD\-ROM or DVD\-ROM. .br Overwritable media assume this state in such read\-only drives or if they contain unrecognizable data in the first 32 data blocks. .br Read\-only drives may or may not show session histories of multi\-session media. Often only the first and the last session are visible. Sometimes not even that. Command \-rom_toc_scan might or might not help in such cases. .SS .B Creating, Growing, Modifying, Blind Growing: .br A new empty ISO image gets \fBcreated\fR if there is no input drive with a valid ISO 9660 image when the first time an output drive is defined. This is achieved by command \-dev on blank media or by command \-outdev on media in any state. .br The new empty image can be populated with directories and files. Before it can be written, the medium in the output drive must get into blank state if it was not blank already. .PP If there is a input drive with a valid ISO image, then this image gets loaded as foundation for manipulations and extension. The constellation of input and output drive determines which write method will be used. They have quite different capabilities and constraints. .PP The method of \fBgrowing\fR adds new data to the existing data on the medium. These data comprise of new file content and they override the existing ISO 9660 + Rock Ridge directory tree. It is possible to hide files from previous sessions but they still exist on the medium and with many types of optical media it is quite easy to recover them by mounting older sessions. .br Growing is achieved by command \-dev. .PP The write method of \fBmodifying\fR produces compact filesystem images with no outdated files or directory trees. Modifying can write its images to target media which are completely unsuitable for multi\-session operations. E.g. DVD\-RW which were treated with \-blank deformat_quickest, DVD\-R DL, named pipes, character devices, sockets. On the other hand modified sessions cannot be written to appendable media but to blank media only. .br So for this method one needs either two optical drives or has to work with filesystem objects as source and/or target medium. .br Modifying takes place if input drive and output drive are not the same and if command \-grow_blindly is set to its default "off". This is achieved by commands \-indev and \-outdev. .PP If command \-grow_blindly is set to a non\-negative number and if \-indev and \-outdev are both set to different drives, then \fBblind growing\fR is performed. It produces an add\-on session which is ready for being written to the given block address. This is the usage model of .br mkisofs \-M $indev \-C $msc1,$msc2 \-o $outdev .br which gives much room for wrong parameter combinations and should thus only be employed if a strict distinction between ISO formatter \fBxorriso\fR and the burn program is desired. \-C $msc1,$msc2 is equivalent to: .br \-load sbsector $msc1 \-grow_blindly $msc2 .SS .B Libburn drives: .br Input drive, i.e. source of an existing or empty ISO image, can be any random access readable libburn drive: optical media with readable data, blank optical media, regular files, block devices. .br Output drive, i.e. target for writing, can be any libburn drive. Some drive types do not support the method of growing but only the methods of modifying and blind growing. They all are suitable for newly created images. .PP All drive file objects have to offer rw\-permission to the user of \fBxorriso\fR. Even those which will not be usable for reading an ISO image. .br With any type of drive object, the data are considered to be organized in blocks of 2 KiB. Access happens in terms of Logical Block Address (\fBLBA\fR) which gives the number of a particular data block. .PP MMC compliant (i.e. optical) drives on GNU/Linux usually get addressed by the path of their block device or of their generic character device. E.g. .br \-dev /dev/sr0 .br \-dev /dev/hdc .br \-dev /dev/sg2 .br By default xorriso will try to map the given address to /dev/hd* and /dev/sr*. The command \-scsi_dev_family can redirect the mapping from sr to scd or sg. The latter does not suffer from the concurrency problems which plague /dev/sr of Linux kernels since version 3. But it does not yield the same addresses which are used by mount(8) or by open(2) for read(2). .br On FreeBSD the device files have names like .br \-dev /dev/cd0 .br On NetBSD: .br \-dev /dev/rcd0d .br On OpenSolaris: .br \-dev /dev/rdsk/c4t0d0s2 .br Get a list of accessible drives by command .br \-device_links .br It might be necessary to do this as \fBsuperuser\fR in order to see all drives and to then allow rw\-access for the intended users. Consider to bundle the authorized users in a group like old "floppy". .PP Filesystem objects of nearly any type can be addressed by prefix "stdio:" and their path in the filesystem. E.g.: .br \-dev stdio:/dev/sdc .br The default setting of \-drive_class allows the user to address files outside the /dev tree without that prefix. E.g.: .br \-dev /tmp/pseudo_drive .br If path leads to a regular file or to a block device then the emulated drive is random access readable and can be used for the method of growing if it already contains a valid ISO 9660 image. Any other file type is not readable via "stdio:" and can only be used as target for the method of modifying or blind growing. Non\-existing paths in existing directories are handled as empty regular files. .PP A very special kind of pseudo drive are open file descriptors. They are depicted by "stdio:/dev/fd/" and descriptor number (see man 2 open). .br Addresses "\-" or "stdio:/dev/fd/1" depict standard output, which normally is the output channel for result texts. To prevent a fatal intermingling of ISO image and text messages, all result texts get redirected to stderr if \-*dev "\-" or "stdio:/dev/fd/1" is among the start arguments of the program. .br Standard output is currently suitable for creating one session per program run without dialog. Use in other situations is discouraged and several restrictions apply: .br It is not allowed to use standard output as pseudo drive if it was not among the start arguments. Do not try to fool this ban via backdoor addresses to stdout. .br If stdout is used as drive, then \-use_readline is permanently disabled. Use of backdoors can cause severe memory and/or tty corruption. .PP Be aware that especially the superuser can write into any accessible file or device by using its path with the "stdio:" prefix. By default any address in the /dev tree without prefix "stdio:" will work only if it leads to a MMC drive. .br One may use command \fB\-ban_stdio_write\fR to surely prevent this risk and to restrict drive usage to MMC drives. .br One may prepend "mmc:" to a path to surely disallow any automatic "stdio:". .br By command \-drive_class one may ban certain paths or allow access without prefix "stdio:" to other paths. .SS .B Rock Ridge, POSIX, X/Open, El Torito, ACL, xattr: .br \fBRock Ridge\fR is the name of a set of additional information which enhance an ISO 9660 filesystem so that it can represent a POSIX compliant filesystem with ownership, access permissions, symbolic links, and other attributes. .br This is what \fBxorriso\fR uses for a decent representation of the disk files within the ISO image. \fBxorriso\fR produces Rock Ridge information by default. It is strongly discouraged to disable this feature. .PP \fBxorriso\fR is not named "porriso" because POSIX only guarantees 14 characters of filename length. It is the X/Open System Interface standard XSI which demands a file name length of up to 255 characters and paths of up to 1024 characters. Rock Ridge fulfills this demand. .PP An \fBEl Torito\fR boot record points the BIOS bootstrapping facility to one or more boot images, which are binary program files stored in the ISO image. The content of the boot image files is not in the scope of El Torito. .br Most bootable GNU/Linux CDs are equipped with ISOLINUX or GRUB boot images. \fBxorriso\fR is able to create or maintain an El Torito object which makes such an image bootable. For details see command \-boot_image. .br It is possible to make ISO images bootable from USB stick or other hard\-disk\-like media. Several options install a \fBMBR\fR (Master Boot Record), It may get adjusted according to the needs of the intended boot firmware and the involved boot loaders, e.g. GRUB2 or ISOLINUX. A MBR contains boot code and a partition table. The new MBR of a follow\-up session can get in effect only on overwritable media. .br MBR is read by PC\-BIOS when booting from USB stick or hard disk, and by PowerPC CHRP or PReP when booting. An MBR partition with type 0xee indicates the presence of GPT. .br Emulation \-as mkisofs supports the example options out of the ISOLINUX wiki, the options used in GRUB script grub\-mkrescue, and the example in the FreeBSD AvgLiveCD wiki. .br A \fBGPT\fR (GUID Partition Table) marks partitions in a more modern way. It is read by EFI when booting from USB stick or hard disk, and may be used for finding and mounting a HFS+ partition inside the ISO image. .br An \fBAPM\fR (Apple Partition Map) marks the HFS+ partition. It is read by Macs for booting and for mounting. .br MBR, GPT and APM are combinable. APM occupies the first 8 bytes of MBR boot code. All three do not hamper El Torito booting from CDROM. .br There is support for further facilities: MIPS Big Endian (SGI), MIPS Little Endian (DEC), SUN SPARC, HP\-PA. Those are mutually not combinable and also not combinable with MBR, GPT, or APM. .br .PP \fBACL\fR are an advanced way of controlling access permissions to file objects. Neither ISO 9660 nor Rock Ridge specify a way to record ACLs. So libisofs has introduced a standard conformant extension named AAIP for that purpose. It uses this extension if enabled by command \fB\-acl\fR. .br AAIP enhanced images are supposed to be mountable normally, but one cannot expect that the mounted filesystem will show and respect the ACLs. For now, only \fBxorriso\fR is able to retrieve those ACLs. It can bring them into effect when files get restored to an ACL enabled file system or it can print them in a format suitable for tool setfacl. .br Files with ACL show as group permissions the setting of entry "mask::" if that entry exists. Nevertheless the non\-listed group members get handled according to entry "group::". When removing ACL from a file, \fBxorriso\fR brings "group::" into effect. .br Recording and restoring of ACLs from and to local files works currently only on GNU/Linux and FreeBSD. .PP \fBxattr\fR (aka EA, or extattr) are pairs of name and value which can be attached to file objects. AAIP is able to represent them and \fBxorriso\fR can record and restore them. .br But be aware that pairs with names of non\-user namespaces are not necessarily portable between operating systems and not even between filesystems. Only those which begin with "user.", like "user.x" or "user.whatever", can unconditionally be expected to be appropriate on other machines and disks. Processing of other xattr may need administrator privileges. .br Name has to be a 0 terminated string. Value may be any array of bytes which does not exceed the size of 4095 bytes. xattr processing happens only if it is enabled by command \fB\-xattr\fR. .br As with ACL, currently only \fBxorriso\fR is able to retrieve xattr from AAIP enhanced images, to restore them to xattr capable file systems, or to print them. .br Recording and restoring of xattr from and to local files works currently only on GNU/Linux and FreeBSD, where they are known as extattr. .SS .B Command processing: .br Commands are either actions which happen immediately or settings which influence following actions. So their sequence does matter, unless they are given as program arguments and command \fB\-x\fR is among them. .br Commands consist of a command word, followed by zero or more parameter words. If the list of parameter words is of variable length (indicated by "[...]" or "[***]") then it must be terminated by either the \fBlist delimiter\fR, occur at the end of the argument list, or occur at the end of an input line. .PP At program start the list delimiter is the string "\-\-". This may be changed with the \-list_delimiter command in order to allow "\-\-" as parameter in a variable length list. However, it is advised to reset the delimiter to "\-\-" immediately afterwards. .br For brevity the list delimiter is referred as "\-\-" throughout this text. .br The list delimiter is silently ignored if it appears after the parameters of a command with a fixed list length. It is handled as normal text if it appears among the parameters of such a command. .PP \fBPattern expansion\fR converts a list of pattern words into a list of existing file addresses. Unmatched pattern words will appear unaltered in that result list. .br Pattern matching supports the usual shell parser wildcards '*' '?' '[xyz]' and respects '/' as the path separator, which may only be matched literally. .br Pattern expansion is a property of some particular commands and not a general feature. It is controlled by commands \-iso_rr_pattern and \-disk_pattern. Commands which use pattern expansion all have variable parameter lists which are specified in this text by "[***]" rather than "[...]". .br Some other commands perform pattern matching unconditionally. .PP Command and parameter words are either read from the program arguments, where one argument is one word, or from quoted input lines where words are recognized similar to the quotation rules of a shell parser. .br \fBxorriso\fR is not a shell, although it might appear so at first glimpse. Be aware that the interaction of quotation marks and pattern symbols like "*" differs from the usual shell parsers. In \fBxorriso\fR, a quotation mark does not make a pattern symbol literal. .PP \fBQuoted input\fR converts whitespace\-separated text into words. The double quotation mark " and the single quotation mark ' can be used to enclose whitespace and make it part of words (e.g. of file names). Each mark type can enclose the marks of the other type. A trailing backslash \\ outside quotations or an open quotation cause the next input line to be appended. .br Quoted input accepts any 8\-bit character except NUL (0) as the content of the quotes. Nevertheless it can be cumbersome for the user to produce those characters directly. Therefore quoted input and program arguments offer optional \fBBackslash Interpretation\fR which can represent all 8\-bit characters except NUL (0) via backslash codes as in $'...' of bash. .br This is not enabled by default. See command \-backslash_codes. .PP When the program starts then it first looks for argument \-no_rc. If this is not present then it looks for its startup files and reads their content as command input lines. Then it interprets the program arguments as commands and parameters. Finally it enters dialog mode if command \-dialog "on" has been executed by this point. .PP The program ends either by command \-end, or by the end of program arguments if dialog mode has not been enabled at that point, or by a problem event which triggers the threshold of command \-abort_on. .SS .B Dialog, Readline, Result pager: .br Dialog mode prompts for a quoted input line, parses it into words, and performs them as commands with their parameters. It provides assisting services to make dialog more comfortable. .PP Readline is an enhancement for the input line. You may already know it from the bash shell. Whether it is available in \fBxorriso\fR depends on the availability of package readline\-dev at the time when \fBxorriso\fR was built from its sourcecode. .br Readline lets the user move the cursor over the text in the line by help of the Left and the Right arrow keys. Text may be inserted at the cursor position. The Delete key removes the character under the cursor. Up and Down arrow keys navigate through the history of previous input lines. .br See man readline for more info about libreadline. .PP Command \-page activates a built\-in result text pager which may be convenient in dialog mode. After an action has output the given number of terminal lines, the pager prompts the user for a line of input. .br An empty line lets \fBxorriso\fR resume work until the next page is output. .br The single character "@" disables paging for the current action. .br "@@@", "x", "q", "X", or "Q" request that the current action aborts and suppress further result output. .br Any other line input will be interpreted as new dialog line. The current action is requested to abort. Afterwards, the input line is executed. .PP Some actions apply paging to their info output, too. .br The request to abort may or may not be obeyed by the current action. All actions try to abort as soon as possible. .br .SH OPTIONS .br All command words are shown with a leading dash although this dash is not mandatory for the command to be recognized. Nevertheless within command \-as the dashes of the emulated commands are mandatory. .br Normally any number of leading dashes is ignored with command words and inner dashes are interpreted as underscores. .TP .B Execution order of program arguments: .PP By default the program arguments of a xorriso run are interpreted as a sequence of commands which get performed exactly in the given order. This requires the user to write commands for desired settings before the commands which shall be influenced by those settings. .br Many other programs support program arguments in an arbitrary ordering and perform settings and actions in a sequence at their own discretion. xorriso provides an option to enable such a behavior at the cost of loss of expressivity. .TP \fB\-x\fR Enable automatic sorting of program arguments into a sequence that (most likely) is sensible. This command may be given at any position among the commands which are handed over as program arguments. .br Note: It works only if it is given as program argument and with a single dash (i.e. "\-x"). It will not work in startup files, nor with \-options_from_file, nor in dialog mode, nor as "x" and finally not as "\-\-x". It affects only the commands given as program arguments. .TP \fB\-list_arg_sorting\fR List all xorriso commands in the order which applies if command \-x is in effect. .br This list may also be helpful without \-x for a user who ponders over the sequence in which to put commands. Deviations from the listed sorting order may well make sense, though. .PP .TP .B Acquiring source and target drive: .PP The effect of acquiring a drive may depend on several commands in the next paragraph "Influencing the behavior of image loading". If desired, their enabling commands have to be performed before the commands which acquire the drive. .TP \fB\-dev\fR address Set input and output drive to the same address and load an ISO image if it is present. If there is no ISO image then create a blank one. Set the image expansion method to growing. .br This is only allowed as long as no changes are pending in the currently loaded ISO image. If changes are pending, then one has to perform \-commit or \-rollback first. .br Special address string "\-" means standard output, to which several restrictions apply. See above paragraph "Libburn drives". .br An empty address string "" gives up the current device without acquiring a new one. .TP \fB\-indev\fR address Set input drive and load an ISO image if present. If the new input drive differs from \-outdev then switch from growing to modifying or to blind growing. It depends on the setting of \-grow_blindly which of both gets activated. The same rules and restrictions apply as with \-dev. .TP \fB\-outdev\fR address Set output drive and if it differs from the input drive then switch from growing to modifying or to blind growing. Unlike \-dev and \-indev this action does not load a new ISO image. So it can be performed even if there are pending changes. .br \-outdev can be performed without previous \-dev or \-indev. In that case an empty ISO image with no changes pending is created. It can either be populated by help of \-map, \-add et.al. or it can be discarded silently if \-dev or \-indev are performed afterwards. .br Special address string "\-" means standard output, to which several restrictions apply. See above paragraph "Libburn drives". .br An empty address string "" gives up the current output drive without acquiring a new one. No writing is possible without an output drive. .TP \fB\-drive_class\fR "harmless"|"banned"|"caution"|"clear_list" disk_pattern Add a drive path pattern to one of the safety lists or make those lists empty. There are three lists defined which get tested in the following sequence: .br If a drive address path matches the "harmless" list then the drive will be accepted. If it is not a MMC device then the prefix "stdio:" will be prepended automatically. This list is empty by default. .br Else if the path matches the "banned" list then the drive will not be accepted by \fBxorriso\fR but rather lead to a FAILURE event. This list is empty by default. .br Else if the path matches the "caution" list and if it is not a MMC device, then its address must have the prefix "stdio:" or it will be rejected. This list has by default one entry: "/dev". .br If a drive path matches no list then it is considered "harmless". By default these are all paths which do not begin with directory "/dev". .br A path matches a list if one of its parent paths or itself matches a list entry. Address prefix "stdio:" or "mmc:" will be ignored when testing for matches. .br By pseudo\-class "clear_list" and pseudo\-patterns "banned", "caution", "harmless", or "all", the lists may be made empty. .br E.g.: \-drive_class clear_list banned .br One will normally define the \-drive_class lists in one of the \fBxorriso\fR Startup Files. .br Note: This is not a security feature but rather a bumper for the superuser to prevent inadverted mishaps. For reliably blocking access to a device file you have to deny its rw\-permissions in the filesystem. .TP \fB\-drive_access\fR "exclusive"|"shared":"unrestricted"|"readonly" Control whether device file locking mechanisms shall be used when acquiring a drive, and whether status or content of the medium in the drive may be altered. Useful and most harmless are the setting "shared:readonly" and the default setting "exclusive:unrestricted". .br "exclusive" enables tests and locks when acquiring the drive. It depends on the operating system which locking mechanisms get applied, if any. On GNU/Linux it is open(O_EXCL). On FreeBSD it is flock(LOCK_EX). .br "shared" disables the use of these mechanisms to become able to acquire drives which are mounted, or opened by some process, or guarded by /dev/pktcdvd*. .br "unrestricted" enables all technically appropriate operations on an acquired drive. "shared:unrestricted" risks to get own burn runs spoiled by other processes or to vice versa spoil activities of such processes. So use "exclusive:unrestricted" unless you know for sure that "shared" is safe. .br "readonly" disables operations which might surprise a co\-user of the drive. For \-outdev these are formatting, blanking, writing, ejecting. For \-indev this is ejecting. Be aware that even reading and drive status inquiries can disturb an ongoing burn run on CD\-R[W] and DVD\-R[W]. .TP \fB\-scsi_dev_family\fR "default"|"sr"|"scd"|"sg" GNU/Linux specific: .br By default, xorriso tries to map Linux drive addresses to /dev/sr* before they get opened for operating the drive. This coordinates well with other use cases of optical drives, like mount(8). But since year 2010 all /dev/sr* share a global lock which allows only one drive to process an SCSI command while all others have to wait for its completion. This yields awful throughput if more than one drive is writing or reading simultaneously. The global lock is not applied to device files /dev/sg* and also not if the xorriso drive address is prepended by "stdio:". .br So for simultaneous burn runs on modern GNU/Linux it is advisable to perform \-scsi_dev_family "sg" before any \-dev, \-indev, or \-outdev. The drive addresses may then well be given as /dev/sr* but will nevertheless get used as the matching /dev/sg*. .br If you decide so, consider to put the command into a global startup file like /etc/opt/xorriso/rc. .TP \fB\-grow_blindly\fR "off"|predicted_nwa If predicted_nwa is a non\-negative number then perform blind growing rather than modifying if \-indev and \-outdev are set to different drives. "off" or "\-1" switch to modifying, which is the default. .br predicted_nwa is the block address where the add\-on session of blind growing will finally end up. It is the responsibility of the user to ensure this final position and the presence of the older sessions. Else the overall ISO image will not be mountable or will produce read errors when accessing file content. \fBxorriso\fR will write the session to the address as obtained from examining \-outdev and not necessarily to predicted_nwa. .br During a run of blind growing, the input drive is given up before output begins. The output drive is given up when writing is done. .TP .B Influencing the behavior of image loading: .PP The following commands should normally be performed before loading an image by acquiring an input drive. In rare cases it is desirable to activate them only after image loading. .TP \fB\-read_speed\fR code|number[k|m|c|d|b] Set the speed for reading. Default is "none", which avoids to send a speed setting command to the drive before reading begins. .br Further special speed codes are: .br "max" (or "0") selects maximum speed as announced by the drive. .br "min" (or "\-1") selects minimum speed as announced by the drive. .br Speed can be given in media dependent numbers or as a desired throughput per second in MMC compliant kB (= 1000) or MB (= 1000 kB). Media x\-speed factor can be set explicitly by "c" for CD, "d" for DVD, "b" for BD, "x" is optional. .br Example speeds: .br 706k = 706kB/s = 4c = 4xCD .br 5540k = 5540kB/s = 4d = 4xDVD .br If there is no hint about the speed unit attached, then the medium in the \-indev will decide. Default unit is CD = 176.4k. .br Depending on the drive, the reported read speeds can be deceivingly low or high. Therefore "min" cannot become higher than 1x speed of the involved medium type. Read speed "max" cannot become lower than 52xCD, 24xDVD, or 20xBD, depending on the medium type. .br MMC drives usually activate their own idea of speed and take the speed value given by the burn program only as hint for their own decision. Friendly drives adjust their constant angular velocity so that the desired speed is reached at the outer rim of the medium. But often there is only the choice between very slow and very loud. .br Sometimes no speed setting is obeyed at all, but speed is adjusted to the demand frequency of the reading program. So xorriso offers to set an additional software enforced limit by prefix "soft_force:". The program will take care not to read faster than the soft_force speed. This may be combined with setting the drive speed to a higher value. Setting "soft_force:0" disables this feature. .br "soft_force:" tries to correct in subsequent waiting periods lost or surplus time of up to 0.25 seconds. This smoothens the overall data stream but also enables short times of higher speed to compensate short times of low speed. Prefix "soft_corr:" sets this hindsight span by giving a number of microseconds. Not more than 1 billion = 1000 seconds. Very short times can cause speed deviations, because systematic inaccuracies of the waiting function cannot be compensated. .br Examples (combinable): .br \-read_speed 6xBD .br \-read_speed soft_force:4xBD \-read_speed soft_corr:100000 .TP \fB\-load\fR entity id Load a particular (possibly outdated) ISO session from \-dev or \-indev. Usually all available sessions are shown with command \-toc. .br entity depicts the kind of addressing. id depicts the particular address. The following entities are defined: .br "auto" with any id addresses the last session in \-toc. This is the default. .br "session" with id being a number as of a line "ISO session", column "Idx". .br "track" with id being a number as of a line "ISO track", column "Idx". .br "lba" or "sbsector" with a number as of a line "ISO ...", column "sbsector". .br "volid" with a search pattern for a text as of a line "ISO ...", column "Volume Id". .br Addressing a non\-existing entity or one which does not represent an ISO image will either abandon \-indev or at least lead to a blank image. .br If an input drive is set at the moment when \-load is executed, then the addressed ISO image is loaded immediately. Else, the setting will be pending until the next \-dev or \-indev. After the image has been loaded once, the setting is valid for \-rollback until next \-dev or \-indev, where it will be reset to "auto". .TP \fB\-displacement\fR [-]lba Compensate a displacement of the image versus the start address for which the image was prepared. This affects only loading of ISO images and reading of their files. The multi\-session method of growing is not allowed as long as \-displacement is non\-zero. I.e. \-indev and \-outdev must be different. The displacement gets reset to 0 before the drive gets re\-acquired after writing. .br Examples: .br If a track of a CD starts at block 123456 and gets copied to a disk file where it begins at block 0, then this copy can be loaded with \-displacement \-123456 .br If an ISO image was written onto a partition with offset of 640000 blocks of 512 bytes, then it can be loaded from the base device by \-load sbsector 160000 \-displacement 160000 .br (If the partition start address is not divisible by 4, then you will have to employ a loop device instead.) .br In both cases, the ISO sessions should be self contained, i.e. not add\-on sessions to an ISO image outside their track or partition. .TP \fB\-read_fs\fR "any"|"norock"|"nojoliet"|"ecma119" Specify which kind of filesystem tree to load if present. If the wish cannot be fulfilled, then ECMA\-119 names are loaded and converted according to \-ecma119_map. .br "any" first tries to read Rock Ridge. If not present, Joliet is tried. .br "norock" does not try Rock Ridge. .br "nojoliet" does not try Joliet. .br "ecma119" tries neither Rock Ridge nor Joliet. .TP \fB\-assert_volid\fR pattern severity Refuse to load ISO images with volume IDs which do not match the given search pattern. When refusing an image, give up the input drive and issue an event of the given severity (like FAILURE, see \-abort_on). An empty search pattern accepts any image. .br This command does not hamper the creation of an empty image from blank input media and does not discard an already loaded image. .TP \fB\-in_charset\fR character_set_name Set the character set from which to convert file names when loading an image. See paragraph "Character sets" for more explanations. When loading the written image after \-commit the setting of \-out_charset will be copied to \-in_charset. .TP \fB\-auto_charset\fR "on"|"off" Enable or disable recording and interpretation of the output character set name in an xattr attribute of the image root directory. If enabled and if a recorded character set name is found, then this name will be used as name of the input character set when reading an image. .br Note that the default output charset is the local character set of the terminal where \fBxorriso\fR runs. Before attributing this local character set to the produced ISO image, check whether the terminal properly displays all intended filenames, especially exotic national characters. .TP \fB\-hardlinks\fR mode[:mode...] Enable or disable loading and recording of hardlink relations. .br In default mode "off", iso_rr files lose their inode numbers at image load time. Each iso_rr file object which has no inode number at image generation time will get a new unique inode number if \-compliance is set to new_rr. .br Mode "on" preserves inode numbers from the loaded image if such numbers were recorded. When committing a session it searches for families of iso_rr files which stem from the same disk file, have identical content filtering and have identical properties. The family members all get the same inode number. Whether these numbers are respected at mount time depends on the operating system. .br Command \-lsl displays hardlink counts if "lsl_count" is enabled. This can slow down the command substantially after changes to the ISO image have been made. Therefore the default is "no_lsl_count". .br Commands \-update and \-update_r track splits and fusions of hard links in filesystems which have stable device and inode numbers. This can cause automatic last minute changes before the session gets written. Command \-hardlinks "perform_update" may be used to do these changes earlier, e.g. if you need to apply filters to all updated files. .br Mode "without_update" avoids hardlink processing during update commands. Use this if your filesystem situation does not allow \-disk_dev_ino "on". .br \fBxorriso\fR commands which extract files from an ISO image try to hardlink files with identical inode number. The normal scope of this operation is from image load to image load. One may give up the accumulated hard link addresses by \-hardlinks "discard_extract". .br A large number of hardlink families may exhaust \-temp_mem_limit if not \-osirrox "sort_lba_on" and \-hardlinks "cheap_sorted_extract" are both in effect. This restricts hard linking to other files restored by the same single extract command. \-hardlinks "normal_extract" re\-enables wide and expensive hardlink accumulation. .br .TP \fB\-acl\fR "on"|"off" Enable or disable processing of ACLs. If enabled, then \fBxorriso\fR will obtain ACLs from disk file objects, store ACLs in the ISO image using the libisofs specific AAIP format, load AAIP data from ISO images, test ACL during file comparison, and restore ACLs to disk files when extracting them from ISO images. See also commands \-getfacl, \-setfacl. .TP \fB\-xattr\fR "on"|"user"|"any"|"off" Enable or disable processing of xattr attributes. If enabled, then \fBxorriso\fR will handle xattr similar to ACL. See also commands \-getfattr, \-setfattr and above paragraph about xattr. .br Modes "on" and "user" read and write only attributes from namespace "user". .br Mode "any" processes attributes of all namespaces. This might need administrator privileges, even if the owner of the disk file tries to read or write the attributes. .br Note that xattr from namespace "isofs." are never read from disk or restored to disk. Further it is not possible to set them via xorriso xattr manipulation commands. .TP \fB\-md5\fR "on"|"all"|"off"|"load_check_off" Enable or disable processing of MD5 checksums for the overall session and for each single data file. If enabled then images with checksum tags get loaded only if the tags of superblock and directory tree match properly. The MD5 checksums of data files and whole session get loaded from the image if there are any. .br With commands \-compare and \-update the recorded MD5 of a file will be used to avoid content reading from the image. Only the disk file content will be read and compared with that MD5. This can save much time if \-disk_dev_ino "on" is not suitable. .br Commands which copy whole data files from ISO to hard disk will verify the copied data stream by the recorded MD5, if \-osirrox "check_md5_on" is set. .br At image generation time they are computed for each file which gets its data written into the new session. The checksums of files which have their data in older sessions get copied into the new session. Superblock, tree and whole session get a checksum tag each. .br Mode "all" will additionally check during image generation whether the checksum of a data file changed between the time when its reading began and the time when it ended. This implies reading every file twice. .br Mode "load_check_off" together with "on" or "all" will load recorded MD5 sums but not test the recorded checksum tags of superblock and directory tree. This is necessary if growisofs was used as burn program, because it does not overwrite the superblock checksum tag of the first session. Therefore load_check_off is in effect when \fBxorriso\fR \-as mkisofs option \-M is performed. .br The test can be re\-enabled by mode "load_check_on". .br Checksums can be exploited via commands \-check_md5, \-check_md5_r, via find actions get_md5, check_md5, and via \-check_media. .TP \fB\-for_backup\fR Enable all extra features which help to produce or to restore backups with highest fidelity of file properties. Currently this is a shortcut for: .br \-hardlinks on \-acl on \-xattr any \-md5 on .br If you restore a backup with xattr from non\-user namespaces, then make sure that the target operating system and filesystem know what these attributes mean. Possibly you will need administrator privileges to record or restore such attributes. At recording time, xorriso will try to tolerate missing privileges and just record what is readable. But at restore time, missing privileges will cause failure events. .br Command \-xattr "user" after command \-for_backup excludes non\-user attributes from being recorded or restored. .TP \fB\-ecma119_map\fR "stripped"|"unmapped"|"lowercase"|"uppercase" Choose the conversion of file names when a session gets loaded, if they stem neither from a Rock Ridge name nor from a Joliet name. .br Mode "stripped" is the default. It shows the names as found in the ISO but removes trailing ";1" or ".;1" if present. .br Mode "unmapped" shows names as found without removing characters. Warning: Multi\-session converts "xyz;1" to "xyz_1" and maybe adds new ";1". .br Mode "lowercase" is like "stripped" but also maps uppercase letters to lowercase letters. This is compatible to default GNU/Linux mount behavior. .br Mode "uppercase" is like "stripped" but maps lowercase letters to uppercase, if any occur despite the prescriptions of ECMA\-119. .TP \fB\-joliet_map\fR "stripped"|"unmapped" Choose the conversion of file names when a session gets loaded from a Joliet tree. .br Mode "stripped" is the default. It removes trailing ";1" or ".;1" if present. .br Mode "unmapped" shows names as found without removing characters. Warning: Multi\-session converts "xyz;1" to "xyz_1" and maybe adds new ";1". .TP \fB\-iso_nowtime\fR "dynamic"|timestring Choose whether to use the current time ("dynamic") or a fixed time point for timestamps of ISO 9660 nodes without a disk source file and as default for superblock timestamps. .br If a timestring is given, then it is used for such timestamps. For the formats of timestrings see command \fB\-alter_date\fR. .TP \fB\-disk_dev_ino\fR "on"|"ino_only"|"off" Enable or disable processing of recorded file identification numbers (dev_t and ino_t). If enabled they are stored as xattr and can substantially accelerate file comparison. The root node gets a global start timestamp. If during comparison a file with younger timestamps is found in the ISO image, then it is suspected to have inconsistent content. .br If device numbers and inode numbers of the disk filesystems are persistent and if no irregular alterations of timestamps or system clock happen, then potential content changes can be detected without reading that content. File content change is assumed if any of mtime, ctime, device number or inode number have changed. .br Mode "ino_only" replaces the precondition that device numbers are stable by the precondition that mount points in the compared tree always lead to the same filesystems. Use this if mode "on" always sees all files changed. .br The speed advantage appears only if the loaded session was produced with \-disk_dev_ino "on" too. .br Note that \-disk_dev_ino "off" is totally in effect only if \-hardlinks is "off", too. .TP \fB\-file_name_limit\fR [+]number Set the maximum permissible length for file names in the range of 64 to 255. Path components which are longer than the given number will get truncated and have their last 33 bytes overwritten by a colon ':' and the hex representation of the MD5 of the first 4095 bytes of the whole oversized name. Potential incomplete UTF\-8 characters will get their leading bytes replaced by '_'. .br iso_rr_paths with the long components will still be able to access the file paths with truncated components. .br If \-file_name_limit is executed while an ISO tree is present, the file names in the ISO tree get checked for existing truncated file names of the current limit and for name collisions between newly truncated files and existing files. In both cases, the setting will be refused with a SORRY event. .br One may lift this ban by prepending the character "+" to the argument of \-file_name_limit. Truncated filenames may then get truncated again, invalidating their MD5 part. Colliding truncated names are made unique, consuming at least 9 more bytes of the remaining name part. .br If writing of xattr is enabled, then the length will be stored in "isofs.nt" of the root directory. If reading of xattr is enabled and "isofs.nt" is found, then the found length will get into effect if it is smaller than the current setting of \-file_name_limit. .br File name patterns will only work if they match the truncated name. This might change in future. .br Files with truncated names get deleted and re\-added unconditionally during \-update and \-update_r. This might change in future. .br Linux kernels up to at least 4.1 misrepresent names of length 254 and 255. If you expect such names in or under disk_paths and plan to mount the ISO by such Linux kernels, consider to set \-file_name_limit 253. Else just avoid names longer than 253 characters. .TP \fB\-rom_toc_scan\fR "on"|"force"|"off"[:"emul_off"][:"emul_wide"] Read\-only drives do not tell the actual media type but show any media as ROM (e.g. as DVD\-ROM). The session history of MMC multi\-session media might be truncated to first and last session or even be completely false. (The emulated history of overwritable media is not affected by this.) .br To have in case of failure a chance of getting the session history and especially the address of the last session, there is a scan for ISO 9660 filesystem headers which might help but also might yield worse results than the drive's table of content. At its end it can cause read attempts to invalid addresses and thus ugly drive behavior. Setting "on" enables that scan for alleged read\-only media. .br Some operating systems are not able to mount the most recent session of multi\-session DVD or BD. If on such a system \fBxorriso\fR has no own MMC capabilities then it may still find that session from a scanned table of content. Setting "force" handles any media like a ROM medium with setting "on". .br On the other hand the emulation of session history on overwritable media can hamper reading of partly damaged media. Setting "off:emul_off" disables the elsewise trustworthy table\-of\-content scan for those media. .br The table\-of\-content scan on overwritable media normally searches only up to the end of the session that is pointed to by the superblock at block 0. Setting "on:emul_wide" lets the scan continue up to the end of the medium. This may be useful after copying a medium with \-check_media patch_lba0=on when not the last session was loaded. .TP \fB\-calm_drive\fR "in"|"out"|"all"|"revoke"|"on"|"off" Reduce drive noise until it is actually used again. Some drives stay alert for substantial time after they have been used for reading. This reduces the startup time for the next drive operation but can be loud and waste energy if no i/o with the drive is expected to happen soon. .br Modes "in", "out", "all" immediately calm down \-indev, \-outdev, or both, respectively. Mode "revoke" immediately alerts both. Mode "on" causes \-calm_drive to be performed automatically after each \-dev, \-indev, and \-outdev. Mode "off" disables this. .TP \fB\-ban_stdio_write\fR Allow for writing only the usage of MMC optical drives. Disallow to write the result into files of nearly arbitrary type. Once set, this command cannot be revoked. .TP \fB\-early_stdio_test\fR "on"|"appendable_wo"|"off" If enabled by "on" then regular files and block devices get tested for effective access permissions. This implies to try opening those files for writing, which otherwise will happen only later and only if actual writing is desired. .br The test result is used for classifying the pseudo drives as overwritable, read\-only, write\-only, or uselessly empty. This may lead to earlier detection of severe problems, and may avoid some less severe error events. .br Mode "appendable_wo" is like "on" with the additional property that non\-empty write\-only files are regarded as appendable rather than blank. .TP \fB\-data_cache_size\fR number_of_tiles blocks_per_tile Set the size and granularity of the data cache which is used when ISO images are loaded and when file content is read from ISO images. The cache consists of several tiles, which each consists of several blocks. A larger cache reduces the need for tiles being read multiple times. Larger tiles might additionally improve the data throughput from the drive, but can be wasteful if the data are scattered over the medium. .br Larger cache sizes help best with image loading from MMC drives. They are an inferior alternative to \-osirrox option "sort_lba_on". .br blocks_per_tile must be a power of 2. E.g. 16, 32, or 64. The overall cache size must not exceed 1 GiB. The default values can be restored by parameter "default" instead of one or both of the numbers. Currently the default is 32 tiles of 32 blocks = 2 MiB. .TP .B Inserting files into ISO image: .PP The following commands expect file addresses of two kinds: .br \fBdisk_path\fR is a path to an object in the local filesystem tree. .br \fBiso_rr_path\fR is the Rock Ridge name of a file object in the ISO image. If no Rock Ridge information is recorded in the loaded ISO image, then you will see ISO 9660 names which are of limited length and character set. If no Rock Ridge information shall be stored in an emerging ISO image, then their names will get mapped to such restricted ISO 9660 (aka ECMA\-119) names. .PP Note that in the ISO image you are as powerful as the superuser. Access permissions of the existing files in the image do not apply to your write operations. They are intended to be in effect with the read\-only mounted image. .PP If the iso_rr_path of a newly inserted file leads to an existing file object in the ISO image, then the following collision handling happens: .br If both objects are directories then they get merged by recursively inserting the subobjects from filesystem into ISO image. If other file types collide then the setting of command \fB\-overwrite\fR decides. .br Renaming of files has similar collision handling, but directories can only be replaced, not merged. Note that if the target directory exists, then \-mv inserts the source objects into this directory rather than attempting to replace it. Command \-move, on the other hand, would attempt to replace it. .PP The commands in this section alter the ISO image and not the local filesystem. .TP \fB\-disk_pattern\fR "on"|"ls"|"off" Set the pattern expansion mode for the disk_path parameters of several commands which support this feature. .br Setting "off" disables this feature for all commands which are marked in this man page by "disk_path [***]" or "disk_pattern [***]". .br Setting "on" enables it for all those commands. .br Setting "ls" enables it only for those which are marked by "disk_pattern [***]". .br Default is "ls". .TP \fB\-add\fR pathspec [...] | disk_path [***] Insert the given files or directory trees from filesystem into the ISO image. .br If \-pathspecs is set to "on" or "as_mkisofs" then pattern expansion is always disabled and character '=' has a special meaning. It separates the ISO image path from the disk path: .br iso_rr_path=disk_path .br Character '=' in the iso_rr_path must be escaped by '\\' (i.e. as "\\="). .br With \-pathspecs "on", the character '\\' must not be escaped. The character '=' in the disk_path must not be escaped. .br With \-pathspecs "as_mkisofs", all characters '\\' must be escaped in both, iso_rr_path and disk_path. The character '=' may or may not be escaped in the disk_path. .br If iso_rr_path does not begin with '/' then \-cd is prepended. If disk_path does not begin with '/' then \-cdx is prepended. .br If no '=' is given then the word is used as both, iso_rr_path and disk path. If in this case the word does not begin with '/' then \-cdx is prepended to the disk_path and \-cd is prepended to the iso_rr_path. .br If \-pathspecs is set to "off" then \-disk_pattern expansion applies, if enabled. The resulting words are used as both, iso_rr_path and disk path. Relative path words get prepended the setting of \-cdx to disk_path and the setting of \-cd to iso_rr_path. .TP \fB\-add_plainly\fR mode If set to mode "unknown" then any command word that does not begin with "\-" and is not recognized as known command will be subject to a virtual \-add command. I.e. it will be used as pathspec or as disk_path and added to the image. If enabled, \-disk_pattern expansion applies to disk_paths. .br Mode "dashed" is similar to "unknown" but also adds unrecognized command words even if they begin with "\-". .br Mode "any" announces that all further words are to be added as pathspecs or disk_paths. This does not work in dialog mode. .br Mode "none" is the default. It prevents any words from being understood as files to add, if they are not parameters to appropriate commands. .TP \fB\-path_list\fR disk_path Like \-add but read the parameter words from file disk_path or standard input if disk_path is "\-". The list must contain exactly one pathspec or disk_path pattern per line. .TP \fB\-quoted_path_list\fR disk_path Like \-path_list but with quoted input reading rules. Lines get split into parameter words for \-add. Whitespace outside quotes is discarded. .TP \fB\-map\fR disk_path iso_rr_path Insert file object disk_path into the ISO image as iso_rr_path. If disk_path is a directory then its whole sub tree is inserted into the ISO image. .TP \fB\-map_single\fR disk_path iso_rr_path Like \-map, but if disk_path is a directory then its sub tree is not inserted. .TP \fB\-map_l\fR disk_prefix iso_rr_prefix disk_path [***] Perform \-map with each of the disk_path parameters. iso_rr_path will be composed from disk_path by replacing disk_prefix by iso_rr_prefix. .TP \fB\-update\fR disk_path iso_rr_path Compare file object disk_path with file object iso_rr_path. If they do not match, then perform the necessary image manipulations to make iso_rr_path a matching copy of disk_path. By default this comparison will imply lengthy content reading before a decision is made. Commands \-disk_dev_ino or \-md5 may accelerate comparison if they were already in effect when the loaded session was recorded. .br If disk_path is a directory and iso_rr_path does not exist yet, then the whole subtree will be inserted. Else only directory attributes will be updated. .TP \fB\-update_r\fR disk_path iso_rr_path Like \-update but working recursively. I.e. all file objects below both addresses get compared whether they have counterparts below the other address and whether both counterparts match. If there is a mismatch then the necessary update manipulation is done. .br Note that the comparison result may depend on command \-follow. Its setting should always be the same as with the first adding of disk_path as iso_rr_path. .br If iso_rr_path does not exist yet, then it gets added. If disk_path does not exist, then iso_rr_path gets deleted. .TP \fB\-update_l\fR disk_prefix iso_rr_prefix disk_path [***] Perform \-update_r with each of the disk_path parameters. iso_rr_path will be composed from disk_path by replacing disk_prefix by iso_rr_prefix. .TP \fB\-update_li\fR iso_rr_prefix disk_prefix iso_rr_path [***] Perform \-update_r with each of the iso_rr_path parameters. disk_path will be composed from iso_rr_path by replacing iso_rr_prefix by disk_prefix. .TP \fB\-update_lxi\fR disk_prefix iso_rr_prefix disk_path [***] Perform \-update_r with each of the disk_path parameters and with iso_rr_paths in the ISO filesystem which are derived from the disk_path parameters after exchanging disk_prefix by iso_rr_prefix. So, other than \-update_l, this detects missing matches of disk_path and deletes the corresponding iso_rr_path. .br Note that relative disk_paths and disk_path patterns are interpreted as sub paths of the current disk working directory \-cdx. The corresponding iso_rr_paths are derived by exchanging disk_prefix by iso_rr_prefix before pattern expansion happens. The current \-cdi directory has no influence. .TP \fB\-cut_out\fR disk_path byte_offset byte_count iso_rr_path Map a byte interval of a regular disk file into a regular file in the ISO image. This may be necessary if the disk file is larger than a single medium, or if it exceeds the traditional limit of 2 GiB \- 1 for old operating systems, or the limit of 4 GiB \- 1 for newer ones. Only the newest Linux kernels seem to read properly files >= 4 GiB \- 1. .br A clumsy remedy for this limit is to backup file pieces and to concatenate them at restore time. A well tested chopping size is 2047m. It is permissible to request a higher byte_count than available. The resulting file will be truncated to the correct size of a final piece. To request a byte_offset higher than available yields no file in the ISO image but a SORRY event. E.g: .br \-cut_out /my/disk/file 0 2047m \\ .br /file/part_1_of_3_at_0_with_2047m_of_5753194821 \\ .br \-cut_out /my/disk/file 2047m 2047m \\ .br /file/part_2_of_3_at_2047m_with_2047m_of_5753194821 \\ .br \-cut_out /my/disk/file 4094m 2047m \\ .br /file/part_3_of_3_at_4094m_with_2047m_of_5753194821 .br While command \-split_size is set larger than 0, and if all pieces of a file reside in the same ISO directory with no other files, and if the names look like above, then their ISO directory will be recognized and handled like a regular file. This affects commands \-compare*, \-update*, and overwrite situations. See command \-split_size for details. .TP \fB\-cpr\fR disk_path [***] iso_rr_path Insert the given files or directory trees from filesystem into the ISO image. .br The rules for generating the ISO addresses are similar as with shell command cp \-r. Nevertheless, directories of the iso_rr_path are created if necessary. Especially a not yet existing iso_rr_path will be handled as directory if multiple disk_paths are present. The leafnames of the multiple disk_paths will be grafted under that directory as would be done with an existing directory. .br If a single disk_path is present then a non\-existing iso_rr_path will get the same type as the disk_path. .br If a disk_path does not begin with '/' then \-cdx is prepended. If the iso_rr_path does not begin with '/' then \-cd is prepended. .TP \fB\-mkdir\fR iso_rr_path [...] Create empty directories if they do not exist yet. Existence as directory generates a WARNING event, existence as other file causes a FAILURE event. .TP \fB\-lns\fR target_text iso_rr_path Create a symbolic link with address iso_rr_path which points to target_text. iso_rr_path may not exist yet. .br Hint: Command \-clone produces the ISO equivalent of a hard link. .TP \fB\-clone\fR iso_rr_path_original iso_rr_path_copy Create a copy of the ISO file object iso_rr_path_original with the new address iso_rr_path_copy. If the original is a directory then copy all files and directories underneath. If iso_rr_path_original is a boot catalog file, then it gets not copied but is silently ignored. .br The copied ISO file objects have the same attributes. Copied data files refer to the same content source as their originals. The copies may then be manipulated independendly of their originals. .br This command will refuse execution if the address iso_rr_path_copy already exists in the ISO tree. .TP \fB\-cp_clone\fR iso_rr_path_original [***] iso_rr_path_dest Create copies of one or more ISO file objects as with command \-clone. In case of collision merge directories with existing ones, but do not overwrite existing ISO file objects. .br The rules for generating the copy addresses are the same as with command \-cpr (see above) or shell command cp \-r. Other than with \-cpr, relative iso_rr_path_original will get prepended the \-cd path and not the \-cdx path. Consider to \-mkdir iso_rr_path_dest before \-cp_clone so the copy address does not depend on the number of iso_rr_path_original parameters. .TP .B Settings for file insertion: .TP \fB\-file_size_limit\fR value [value [...]] -- Set the maximum permissible size for a single data file. The values get summed up for the actual limit. If the only value is "off" then the file size is not limited by \fBxorriso\fR. Default is a limit of 100 extents, 4g \-2k each: .br \-file_size_limit 400g \-200k \-\- .br When mounting ISO 9660 filesystems, old operating systems can handle only files up to 2g \-1 \-\-. Newer ones are good up to 4g \-1 \-\-. You need quite a new Linux kernel to read correctly the final bytes of a file >= 4g if its size is not aligned to 2048 byte blocks. .br \fBxorriso\fR's own data read capabilities are not affected by operating system size limits. Such limits apply to mounting only. Nevertheless, the target filesystem of an \-extract must be able to take the file size. .TP \fB\-not_mgt\fR code[:code[...]] Control the behavior of the exclusion lists. .br Exclusion processing happens before disk_paths get mapped to the ISO image and before disk files get compared with image files. The absolute disk path of the source is matched against the \-not_paths list. The leafname of the disk path is matched against the patterns in the \-not_leaf list. If a match is detected then the disk path will not be regarded as an existing file and not be added to the ISO image. .br Several codes are defined. The _on/_off settings persist until they are revoked by their_off/_on counterparts. .br "erase" empties the lists which were accumulated by \-not_paths and \-not_leaf. .br "reset" is like "erase" but also re\-installs default behavior. .br "off" disables exclusion processing temporarily without invalidating the lists and settings. .br "on" re\-enables exclusion processing. .br "param_off" applies exclusion processing only to paths below disk_path parameter of commands. I.e. explicitly given disk_paths are exempted from exclusion processing. .br "param_on" applies exclusion processing to command parameters as well as to files below such parameters. .br "subtree_off" with "param_on" excludes parameter paths only if they match a \-not_paths item exactly. .br "subtree_on" additionally excludes parameter paths which lead to a file address below any \-not_paths item. .br "ignore_off" treats excluded disk files as if they were missing. I.e. they get reported with \-compare and deleted from the image with \-update. .br "ignore_on" keeps excluded files out of \-compare or \-update activities. .TP \fB\-not_paths\fR disk_path [***] Add the given paths to the list of excluded absolute disk paths. If a given path is relative, then the current \-cdx is prepended to form an absolute path. Pattern matching, if enabled, happens at definition time and not when exclusion checks are made. .br (Do not forget to end the list of disk_paths by "\-\-") .TP \fB\-not_leaf\fR pattern Add a single shell parser style pattern to the list of exclusions for disk leafnames. These patterns are evaluated when the exclusion checks are made. .TP \fB\-not_list\fR disk_path Read lines from disk_path and use each of them either as \-not_paths parameter, if they contain a / character, or as \-not_leaf pattern. .TP \fB\-quoted_not_list\fR disk_path Like \-not_list but with quoted input reading rules. Each word is handled as one parameter for \-not_paths or \-not_leaf. .TP \fB\-follow\fR occasion[:occasion[...]] Enable or disable resolution of symbolic links and mountpoints under disk_paths. This applies to actions \-add, \-du*x, \-ls*x, \-findx, \-concat, and to \-disk_pattern expansion. .br There are three kinds of follow decisison to be made: .br \fBlink\fR is the hop from a symbolic link to its target file object for the purpose of reading. I.e. not for command \-concat. If enabled then symbolic links are handled as their target file objects, else symbolic links are handled as themselves. .br \fBmount\fR is the hop from one filesystem to another subordinate filesystem. If enabled then mountpoint directories are handled as any other directory, else mountpoints are handled as empty directories if they are encountered in directory tree traversals. .br \fBconcat\fR is the hop from a symbolic link to its target file object for the purpose of writing. I.e. for command \-concat. This is a security risk ! .br Less general than above occasions: .br \fBpattern\fR is mount and link hopping, but only during \-disk_pattern expansion. .br \fBparam\fR is link hopping for parameter words (after eventual pattern expansion). If enabled then \-ls*x will show the link targets rather than the links themselves. \-du*x, \-findx, and \-add will process the link targets but not follow links in an eventual directory tree below the targets (unless "link" is enabled). .br Occasions can be combined in a colon separated list. All occasions mentioned in the list will then lead to a positive follow decision. .br \fBoff\fR prevents any positive follow decision. Use it if no other occasion applies. .br Shortcuts: .br \fBdefault\fR is equivalent to "pattern:mount:limit=100". .br \fBon\fR always decides positive. Equivalent to "link:mount:concat". .br Not an occasion but an optional setting is: .br \fBlimit=\fR which sets the maximum number of link hops. A link hop consists of a sequence of symbolic links and a final target of different type. Nevertheless those hops can loop. Example: .br $ ln \-s .. uploop .br Link hopping has a built\-in loop detection which stops hopping at the first repetition of a link target. Then the repeated link is handled as itself and not as its target. Regrettably one can construct link networks which cause exponential workload before their loops get detected. The number given with "limit=" can curb this workload at the risk of truncating an intentional sequence of link hops. .TP \fB\-pathspecs\fR "on"|"off"|"as_mkisofs" Control parameter interpretation with \fBxorriso\fR actions \-add and \-path_list. .br Mode "as_mkisofs" enables pathspecs of the form .br \fBiso_rr_path=disk_path\fR .br like with program mkisofs \-graft\-points. .br All characters '\\' must be escaped in both, iso_rr_path and disk_path. The character '=' must be escaped in the iso_rr_path and may or may not be escaped in the disk_path. This mode temporarily disables \-disk_pattern expansion for command \-add. .br Mode "on" does nearly the same. But '=' must only be escaped in the iso_rr_path and '\\' must not be escaped at all. This has the disadvantage that one cannot express an iso_rr_path which ends by '\\'. .br Mode "off" disables pathspecs of the form target=source and re\-enables \-disk_pattern expansion. .TP \fB\-overwrite\fR "on"|"nondir"|"off" Allow or disallow overwriting of existing files in the ISO image by files with the same name. .br With setting "off", name collisions with at least one non\-directory file cause FAILURE events. Collisions of two directories lead to merging of their file lists. .br With setting "nondir", only directories are protected by such events, other existing file types get treated with \-rm before the new file gets added. Setting "on" enables automatic \-rm_r. I.e. a non\-directory can replace an existing directory and all its subordinates. .br If restoring of files is enabled, then the overwrite rule applies to the target file objects on disk as well, but "on" is downgraded to "nondir". .TP \fB\-split_size\fR number["k"|"m"] Set the threshold for automatic splitting of regular files. Such splitting maps a large disk file onto a ISO directory with several part files in it. This is necessary if the size of the disk file exceeds \-file_size_limit. Older operating systems can handle files in mounted ISO 9660 filesystems only if they are smaller than 2 GiB or in other cases 4 GiB. .br Default is 0 which will exclude files larger than \-file_size_limit by a FAILURE event. A well tested \-split_size is 2047m. Sizes above \-file_size_limit are not permissible. .br While command \-split_size is set larger than 0 such a directory with split file pieces will be recognized and handled like a regular file by commands \-compare* , \-update*, and in overwrite situations. There are \-osirrox parameters "concat_split_on" and "concat_split_off" which control the handling when files get restored to disk. .br In order to be recognizable, the names of the part files have to describe the splitting by 5 numbers: .br part_number,total_parts,byte_offset,byte_count,disk_file_size .br which are embedded in the following text form: .br part_#_of_#_at_#_with_#_of_# .br Scaling characters like "m" or "k" are taken into respect. All digits are interpreted as decimal, even if leading zeros are present. .br E.g: /file/part_1_of_3_at_0_with_2047m_of_5753194821 .br No other files are allowed in the directory. All parts have to be present and their numbers have to be plausible. E.g. byte_count must be valid as \-cut_out parameter and their contents may not overlap. .TP .B File manipulations: .PP The following commands manipulate files in the ISO image, regardless whether they stem from the loaded image or were newly inserted. .PP .TP \fB\-iso_rr_pattern\fR "on"|"ls"|"off" Set the pattern expansion mode for the iso_rr_path parameters of several commands which support this feature. .br Setting "off" disables pattern expansion for all commands which are marked in this man page by "iso_rr_path [***]" or "iso_rr_pattern [***]". .br Setting "on" enables it for all those commands. .br Setting "ls" enables it only for those which are marked by "iso_rr_pattern [***]". .br Default is "on". .TP \fB\-rm\fR iso_rr_path [***] Delete the given files from the ISO image. .br Note: This does not free any space on the \-indev medium, even if the deletion is committed to that same medium. .br The image size will shrink if the image is written to a different medium in modification mode. .TP \fB\-rm_r\fR iso_rr_path [***] Delete the given files or directory trees from the ISO image. See also the note with command \-rm. .TP \fB\-rmdir\fR iso_rr_path [***] Delete empty directories. .TP \fB\-move\fR iso_rr_path iso_rr_path Rename the file given by the first (origin) iso_rr_path to the second (destination) iso_rr_path. Deviate from rules of shell command mv by not moving the origin file underneath an existing destination directory. The origin file will rather replace such a directory, if this is allowed by command \-overwrite. .TP \fB\-mv\fR iso_rr_path [***] iso_rr_path Rename the given file objects in the ISO tree to the last parameter in the list. Use the same rules as with shell command mv. .br If pattern expansion is enabled and if the last parameter contains wildcard characters then it must match exactly one existing file address, or else the command fails with a FAILURE event. .TP \fB\-chown\fR uid iso_rr_path [***] Set ownership of file objects in the ISO image. uid may either be a decimal number or the name of a user known to the operating system. .TP \fB\-chown_r\fR uid iso_rr_path [***] Like \-chown but affecting all files below eventual directories. .TP \fB\-chgrp\fR gid iso_rr_path [***] Set group attribute of file objects in the ISO image. gid may either be a decimal number or the name of a group known to the operating system. .TP \fB\-chgrp_r\fR gid iso_rr_path [***] Like \-chgrp but affecting all files below eventual directories. .TP \fB\-chmod\fR mode iso_rr_path [***] Equivalent to shell command chmod in the ISO image. mode is either an octal number beginning with "0" or a comma separated list of statements of the form [ugoa]*[+\-=][rwxst]* . .br Like: go\-rwx,u+rwx . .br \fBPersonalities\fR: u=user, g=group, o=others, a=all .br \fBOperators\fR: + adds given permissions, \- revokes given permissions, = revokes all old permissions and then adds the given ones. .br \fBPermissions\fR: r=read, w=write, x=execute|inspect, s=setuid|setgid, t=sticky bit .br For octal numbers see man 2 stat. .TP \fB\-chmod_r\fR mode iso_rr_path [***] Like \-chmod but affecting all files below eventual directories. .TP \fB\-setfacl\fR acl_text iso_rr_path [***] Attach the given ACL to the given iso_rr_paths. If the files already have ACLs, then those get deleted before the new ones get into effect. If acl_text is empty, or contains the text "clear" or the text "\-\-remove\-all", then the existing ACLs will be removed and no new ones will be attached. Any other content of acl_text will be interpreted as a list of ACL entries. It may be in the long multi\-line format as put out by \-getfacl but may also be abbreviated as follows: .br ACL entries are separated by comma or newline. If an entry is empty text or begins with "#" then it will be ignored. A valid entry has to begin by a letter out of {ugom} for "user", "group", "other", "mask". It has to contain two colons ":". A non\-empty text between those ":" gives a user id or group id. After the second ":" there may be letters out of {rwx\- #}. The first three give read, write, or execute permission. Letters "\-", " " and TAB are ignored. "#" causes the rest of the entry to be ignored. Letter "X" or any other letters are not supported. Examples: .br g:toolies:rw,u:lisa:rw,u:1001:rw,u::wr,g::r,o::r,m::rw .br group:toolies:rw\-,user::rw\-,group::r\-\-,other::r\-\-,mask::rw\- .br A valid entry may be prefixed by "d", some following characters and ":". This indicates that the entry goes to the "default" ACL rather than to the "access" ACL. Example: .br u::rwx,g::rx,o::,d:u::rwx,d:g::rx,d:o::,d:u:lisa:rwx,d:m::rwx .TP \fB\-setfacl_r\fR acl_text iso_rr_path [***] Like \-setfacl but affecting all files below eventual directories. .TP \fB\-setfacl_list\fR disk_path Read the output of \-getfacl_r or shell command getfacl \-R and apply it to the iso_rr_paths as given in lines beginning with "# file:". This will change ownership, group and ACL of the given files. If disk_path is "\-" then lines are read from standard input. Line "@" ends the list, "@@@" aborts without changing the pending iso_rr_path. .br Since \-getfacl and getfacl \-R strip leading "/" from file paths, the setting of \-cd does always matter. .TP \fB\-setfattr\fR [-]name value iso_rr_path [***] Attach the given xattr pair of name and value to the given iso_rr_paths. If the given name is prefixed by "\-", then the pair with that name gets removed from the xattr list. If name is "\-\-remove\-all" then all user namespace xattr of the given iso_rr_paths get deleted. In case of deletion, value must be an empty text. .br Which names are permissible depends on the setting of command \-xattr. "on" or "user" restricts them to namespace "user". I.e. a name has to look like "user.x" or "user.whatever". .br \-xattr setting "any" enables names from all namespaces except "isofs". .br Values and names undergo the normal input processing of \fBxorriso\fR. See also command \-backslash_codes. Other than with command \-setfattr_list, the byte value 0 cannot be expressed via \-setfattr. .TP \fB\-setfattr_r\fR [-]name value iso_rr_path [***] Like \-setfattr but affecting all files below eventual directories. .TP \fB\-setfattr_list\fR disk_path Read the output format of \-getfattr_r or shell command getfattr \-Rd and apply it to the iso_rr_paths as given in lines beginning with "# file:". All previously existing xattr of the acceptable namespaces will be deleted before the new xattr get attached. The set of acceptable names depends on the setting of command \-xattr. .br If disk_path is "\-" then lines are read from standard input. .br Since \-getfattr and getfattr \-Rd strip leading "/" from file paths, the setting of \-cd does always matter. .br Empty input lines and lines which begin by "#" will be ignored (except "# file:"). Line "@" ends the list, "@@@" aborts without changing the pending iso_rr_path. Other input lines must have the form .br name="value" .br The separator "=" is not allowed in names. Value may contain any kind of bytes. It must be in quotes. Trailing whitespace after the end quote will be ignored. Non\-printables bytes and quotes must be represented as \\XYZ by their octal 8\-bit code XYZ. Use code \\000 for 0\-bytes. .TP \fB\-alter_date\fR type timestring iso_rr_path [***] Alter the date entries of files in the ISO image. type may be one of the following: .br "a" sets access time, updates ctime. .br "m" sets modification time, updates ctime. .br "b" sets access time and modification time, updates ctime. .br "a\-c", "m\-c", and "b\-c" set the times without updating ctime. .br "c" sets the ctime. .br timestring may be in the following formats (see also section EXAMPLES): .br As expected by program date: MMDDhhmm[[CC]YY][.ss]] .br As produced by program date: .br [Day] MMM DD hh:mm:ss [TZON] YYYY .br Relative times counted from current clock time: .br +|\-Number["s"|"h"|"d"|"w"|"m"|"y"] .br where "s" means seconds, "h" hours, "d" days, "w" weeks, "m"=30d, "y"=365.25d plus 1d added to multiplication result. .br Absolute seconds counted from Jan 1 1970: .br =Number .br \fBxorriso\fR's own timestamps: .br YYYY.MM.DD[.hh[mm[ss]]] .br scdbackup timestamps: .br YYMMDD[.hhmm[ss]] .br where "A0" is year 2000, "B0" is 2010, etc. .br ECMA\-119 volume timestamps: .br YYYYMMDDhhmmsscc .br These are normally given as GMT. The suffix "LOC" causes local timezone conversion. E.g. 2013010720574700, 2013010720574700LOC. The last two digits cc (centiseconds) will be ignored, but must be present in order to make the format recognizable. .br Example: .br \-alter_date m\-c 2013.11.27.103951 /file1 /file2 \-\- .br This command does not persistently apply to the boot catalog, which gets fresh timestamps at \-commit time. Command \-volume_date "uuid" can set this time value. .TP \fB\-alter_date_r\fR type timestring iso_rr_path [***] Like \-alter_date but affecting all files below eventual directories. .TP \fB\-hide\fR hide_state iso_rr_path [***] Prevent the names of the given files from showing up in the directory trees of ISO 9660 and/or Joliet and/or HFS+ when the image gets written. The data content of such hidden files will be included in the resulting image, even if they do not show up in any directory. But you will need own means to find nameless data in the image. .br Warning: Data which are hidden from the ISO 9660 tree will not be copied by the write method of modifying. .br Possible values of hide_state are: "iso_rr" for hiding from ISO 9660 tree, "joliet" for Joliet tree, "hfsplus" for HFS+, "on" for them all. "off" means visibility in all directory trees. .br These values may be combined. E.g.: joliet:hfsplus .br This command does not apply to the boot catalog. Rather use: \-boot_image "any" "cat_hidden=on" .TP .B Tree traversal command -find: .PP .TP \fB\-find\fR iso_rr_path [test [op] [test ...]] [-exec action [params]] -- A restricted substitute for shell command find in the ISO image. It performs an action on matching file objects at or below iso_rr_path. .br If not used as last command in the line then the parameter list needs to get terminated by "\-\-". .br Tests are optional. If they are omitted then action is applied to all file objects. If tests are given then they form together an expression. The action is applied only if the expression matches the file object. Default expression operator between tests is \-and, i.e. the expression matches only if all its tests match. .br Available tests are: .br \fB\-name\fR pattern : Matches if pattern matches the file leaf name. If the pattern does not contain any of the characters "*?[", then it will be truncated according to \-file_name_limit and thus match the truncated name in the ISO filesystem. .br \fB\-wholename\fR pattern : Matches if pattern matches the file path as it would be printed by action "echo". Character '/' can be matched by wildcards. If pattern pieces between '/' do not contain any of the characters "*?[", they will be truncated according to \-file_name_limit. .br \fB\-disk_name\fR pattern : Like \-name but testing the leaf name of the file source on disk. Can match only data files which do not stem from the loaded image, or for directories above such data files. With directories the result can change between \-find runs if their content stems from multiple sources. .br \fB\-disk_path\fR disk_path : Matches if the given disk_path is equal to the path of the file source on disk. The same restrictions apply as with \-disk_name. .br \fB\-type\fR type_letter : Matches files of the given type: "block", "char", "dir", "pipe", "file", "link", "socket", "eltorito", and "Xotic" which matches what is not matched by the other types. .br Only the first letter is interpreted. E.g.: \-find / \-type d .br \fB\-maxdepth\fR number : Matches only files which are at most at the given depth level relative to the iso_rr_path where \-find starts. That path itself is at depth 0, its directory children are at 1, their directory children at 2, and so on. .br \fB\-mindepth\fR number : Matches only files which are at least at the given depth level. .br \fB\-damaged\fR : Matches files which use data blocks marked as damaged by a previous run of \-check_media. The damage info vanishes when a new ISO image gets loaded. .br Note that a MD5 session mismatch marks all files of the session as damaged. If finer distinction is desired, perform \-md5 off before \-check_media. .br \fB\-pending_data\fR : Matches files which get their content from outside the loaded ISO image. .br \fB\-lba_range\fR start_lba block_count : Matches files which use data blocks within the range of start_lba and start_lba+block_count\-1. .br \fB\-has_acl\fR : Matches files which have a non\-trivial ACL. .br \fB\-has_xattr\fR : Matches files which have xattr name\-value pairs from user namespace. .br \fB\-has_aaip\fR : Matches files which have ACL or any xattr. .br \fB\-has_any_xattr\fR : Matches files which have any xattr other than ACL. .br \fB\-has_md5\fR : Matches data files which have MD5 checksums. .br \fB\-has_hfs_crtp\fR creator type : Matches files which have the given HFS+ creator and type attached. These are codes of 4 characters which get stored if \-hfsplus is enabled. Use a single dash '\-' as wildcard that matches any such code. E.g:. .br \-has_hfs_crtp YYDN TEXT .br \-has_hfs_crtp \- \- .br \fB\-has_hfs_bless\fR blessing : Matches files which bear the given HFS+ blessing. It may be one of : "ppc_bootdir", "intel_bootfile", "show_folder", "os9_folder", "osx_folder", "any". See also action set_hfs_bless. .br \fB\-has_filter\fR : Matches files which are filtered by \-set_filter. .br \fB\-hidden\fR hide_state : Matches files which are hidden in "iso_rr" tree, in "joliet" tree, in "hfsplus" tree, in all trees ("on"), or not hidden in any tree ("off"). .br Those which are hidden in some tree match \-not \-hidden "off". .br \fB\-bad_outname\fR namespace : Matches files with names which change when converted forth and back between the local character set and one of the namespaces "rockridge", "joliet", "ecma119", "hfsplus". .br All applicable \-compliance rules are taken into respect. Rule "omit_version" is always enabled, because else namespaces "joliet" and "ecma119" would cause changes with every non\-directory name. Consider to also enable rules "no_force_dots" and "no_j_force_dots". .br The namespaces use different character sets and apply further restrictions to name length, permissible characters, and mandatory name components. "rockridge" uses the character set defined by \-out_charset, "joliet" uses UCS\-2BE, "ecma119" uses ASCII, "hfsplus" uses UTF\-16BE. .br \fB\-name_limit_blocker\fR length : Matches file names which would prevent command \-file_name_limit with the given length. The command itself reports only the first problem file. .br \fB\-prune\fR : If this test is reached and the tested file is a directory then \-find will not dive into that directory. This test itself does always match. .br \fB\-use_pattern\fR "on"|"off" : This pseudo test controls the interpretation of wildcards with tests \-name, \-wholename, and \-disk_name. Default is "on". If interpretation is disabled by "off", then the parameters of \-name, \-wholename, and \-disk_name have to match literally rather than as search pattern. This test itself does always match. .br \fB\-or_use_pattern\fR "on"|"off" : Like \-use_pattern, but automatically appending the test by \-or rather than by \-and. Further the test itself does never match. So a subsequent test \-or will cause its other operand to be performed. .br \fB\-decision\fR "yes"|"no" : If this test is reached then the evaluation ends immediately and action is performed if the decision is "yes" or "true". See operator \-if. .br \fB\-true\fR and \fB\-false\fR : Always match or match not, respectively. Evaluation goes on. .br \fB\-sort_lba\fR : Always match. This causes \-find to perform its action in a sequence sorted by the ISO image block addresses of the files. It may improve throughput with actions which read data from optical drives. Action will always get the absolute path as parameter. .br Available operators are: .br \fB\-not\fR : Matches if the next test or sub expression does not match. Several tests do this specifically: .br \-undamaged, \-lba_range with negative start_lba, \-has_no_acl, \-has_no_xattr, \-has_no_aaip, \-has_no_filter . .br \fB\-and\fR : Matches if both neighboring tests or expressions match. .br \fB\-or\fR : Matches if at least one of both neighboring tests or expressions matches. .br \fB\-sub\fR ... \fB\-subend\fR or \fB(\fR ... \fB)\fR : Enclose a sub expression which gets evaluated first before it is processed by neighboring operators. Normal precedence is: \-not, \-or , \-and. .br \fB\-if\fR ... \fB\-then\fR\ ... \fB\-elseif\fR ... \fB\-then\fR ... \fB\-else\fR ... \fB\-endif\fR : Enclose one or more sub expressions. If the \-if expression matches, then the \-then expression is evaluated as the result of the whole expression up to \-endif. Else the next \-elseif expression is evaluated and if it matches, its \-then expression. Finally in case of no match, the \-else expression is evaluated. There may be more than one \-elseif. Neither \-else nor \-elseif are mandatory. If \-else is missing and would be hit, then the result is a non\-match. .br \-if\-expressions are the main use case for above test \-decision. Default action is \fBecho\fR, i.e. to print the address of the found file. Other actions are certain \fBxorriso\fR commands which get performed on the found files. These commands may have specific parameters. See also their particular descriptions. .br \fBchown\fR and \fBchown_r\fR change the ownership and get the user id as parameter. E.g.: \-exec chown thomas \-\- .br \fBchgrp\fR and \fBchgrp_r\fR change the group attribute and get the group id as parameter. E.g.: \-exec chgrp_r staff \-\- .br \fBchmod\fR and \fBchmod_r\fR change access permissions and get a mode string as parameter. E.g.: \-exec chmod a\-w,a+r \-\- .br \fBalter_date\fR and \fBalter_date_r\fR change the timestamps. They get a type character and a timestring as parameters. .br E.g.: \-exec alter_date "m" "Dec 30 19:34:12 2007" \-\- .br \fBset_to_mtime\fR sets the ctime and atime to the value found in mtime. .br \fBlsdl\fR prints file information like shell command ls \-dl. .br \fBcompare\fR performs command \-compare with the found file address as iso_rr_path and the corresponding file address below its parameter disk_path_start. For this the iso_rr_path of the \-find command gets replaced by the disk_path_start. .br E.g.: \-find /thomas \-exec compare /home/thomas \-\- .br \fBupdate\fR performs command \-update with the found file address as iso_rr_path. The corresponding file address is determined like with above action "compare". .br \fBupdate_merge\fR is like update but does not delete the found file if it is missing on disk. It may be run several times and records with all visited files whether their counterpart on disk has already been seen by one of the update_merge runs. Finally, a \-find run with action "rm_merge" may remove all files that saw no counterpart on disk. .br Up to the next "rm_merge" or "clear_merge" all newly inserted files will get marked as having a disk counterpart. .br \fBrm\fR removes the found iso_rr_path from the image if it is not a directory with files in it. I.e. this "rm" includes "rmdir". .br \fBrm_r\fR removes the found iso_rr_path from the image, including whole directory trees. .br \fBrm_merge\fR removes the found iso_rr_path if it was visited by one or more previous actions "update_merge" and saw no counterpart on disk in any of them. The marking from the update actions is removed in any case. .br \fBclear_merge\fR removes an eventual marking from action "update_merge". .br \fBreport_damage\fR classifies files whether they hit a data block that is marked as damaged. The result is printed together with the address of the first damaged byte, the maximum span of damages, file size, and the path of the file. .br \fBreport_lba\fR prints files which are associated to image data blocks. It tells the logical block address, the block number, the byte size, and the path of each file. There may be reported more than one line per file if the file has more than one section. In this case each line has a different extent number in column "xt". .br \fBreport_sections\fR like report_lba but telling the byte sizes of the particular sections rather than the overall byte size of the file. .br \fBgetfacl\fR prints access permissions in ACL text form to the result channel. .br \fBsetfacl\fR attaches ACLs after removing existing ones. The new ACL is given in text form as defined with command \-setfacl. .br E.g.: \-exec setfacl u:lisa:rw,u::rw,g::r,o::\-,m::rw \-\- .br \fBgetfattr\fR prints xattr name\-value pairs to the result channel. The choice of namespaces depends on the setting of command \-xattr: "on" or "user" restricts it to the namespace "user", "any" only omits namespace "isofs". .br \fBget_any_xattr\fR prints xattr name\-value pairs from any namespace except ACL to the result channel. This is mostly for debugging of namespace "isofs". .br \fBlist_extattr\fR mode prints a script to the result channel, which would use FreeBSD command setextattr to set the file's xattr name\-value pairs of user namespace. Parameter mode controls the form of the output of names and values. Default mode "e" prints harmless characters in shell quotation marks, but represents texts with octal 001 to 037 and 0177 to 0377 by an embedded echo \-e command. Mode "q" prints any characters in shell quotation marks. This might not be terminal\-safe but should work in script files. Mode "r" uses no quotation marks. Not safe. Mode "b" prints backslash encoding. Not suitable for shell parsing. .br E.g. \-exec list_extattr e \-\- .br Command \-backslash_codes does not affect the output. .br \fBget_md5\fR prints the MD5 sum, if recorded, together with file path. .br \fBcheck_md5\fR compares the MD5 sum, if recorded, with the file content and reports if mismatch. .br E.g.: \-find / \-not \-pending_data \-exec check_md5 FAILURE \-\- .br \fBmake_md5\fR equips a data file with an MD5 sum of its content. Useful to upgrade the files in the loaded image to full MD5 coverage by the next commit with \-md5 "on". .br E.g.: \-find / \-type f \-not \-has_md5 \-exec make_md5 \-\- .br \fBsetfattr\fR sets or deletes xattr name value pairs. .br E.g.: \-find / \-has_xattr \-exec setfattr \-\-remove\-all '' \-\- .br \fBset_hfs_crtp\fR adds, changes, or removes HFS+ creator and type attributes. .br E.g.: \-exec set_hfs_crtp YYDN TEXT .br E.g.: \-find /my/dir \-prune \-exec set_hfs_crtp \-\-delete \- .br \fBget_hfs_crtp\fR prints the HFS+ creator and type attributes together with the iso_rr_path, if the file has such attributes at all. .br E.g.: \-exec get_hfs_crtp .br \fBset_hfs_bless\fR applies or removes HFS+ blessings. They are roles which can be attributed to up to four directories and a data file: .br "ppc_bootdir", "intel_bootfile", "show_folder", "os9_folder", "osx_folder". .br They may be abbreviated as "p", "i", "s", "9", and "x". .br Each such role can be attributed to at most one file object. "intel_bootfile" is the one that would apply to a data file. All others apply to directories. The \-find run will end as soon as the first blessing is issued. The previous bearer of the blessing will lose it then. No file object can bear more than one blessing. .br E.g.: \-find /my/blessed/directory \-exec set_hfs_bless p .br Further there is blessing "none" or "n" which revokes any blessing from the found files. This \-find run will not stop when the first match is reached. .br E.g.: \-find / \-has_hfs_bless any \-exec set_hfs_bless none .br \fBget_hfs_bless\fR prints the HFS+ blessing role and the iso_rr_path, if the file is blessed at all. .br E.g.: \-exec get_hfs_bless .br \fBset_filter\fR applies or removes filters. .br E.g.: \-exec set_filter \-\-zisofs \-\- .br \fBmkisofs_r\fR applies the rules of mkisofs \-r to the file object: .br user id and group id become 0, all r\-permissions get granted, all w denied. If there is any x\-permission, then all three x get granted. s\- and t\-bits get removed. .br \fBsort_weight\fR attributes a LBA weight number to regular files. .br The number may range from \-2147483648 to 2147483647. The higher it is, the lower will be the block address of the file data in the emerging ISO image. Currently the boot catalog has a hardcoded weight of 1 billion. Normally it should occupy the block with the lowest possible address. .br Data files which are loaded by \-indev or \-dev get a weight between 1 and 2 exp 28 = 268,435,456, depending on their block address. This shall keep them roughly in the same order if the write method of modifying is applied. .br Data files which are added by other commands get an initial weight of 0. Boot image files have a default weight of 2. .br E.g.: \-exec sort_weight 3 \-\- .br \fBshow_stream\fR shows the content stream chain of a data file. .br \fBshow_stream_id\fR is like show_stream, but also prints between stream type and first ":" in square brackets libisofs id numbers: [fs_id,dev_id,ino_id]. .br \fBhide\fR brings the file into one of the hide states "on", "iso_rr", "joliet", "hfsplus", "off". They may be combined. E.g.: joliet:hfsplus .br E.g.: .br \-find / \-disk_name *_secret \-exec hide on .br \fBprint_outname\fR prints in the first line the filename as registered by the program model, and in the second line the filename after conversion forth and back between local character set and one of the namespaces "rockridge", "joliet", "ecma119", or "hfsplus". The third output line is "\-\-" . .br The name conversion does not take into respect the possibility of name collisions in the target namespace. Such collisions are most likely in "joliet" and "ecma119", where they get resolved by automatic file name changes. .br E.g.: .br \-find / \-bad_outname joliet \-exec print_outname joliet .br \fBestimate_size\fR prints a lower and an upper estimation of the number of blocks which the found files together will occupy in the emerging ISO image. This does not account for the superblock, for the directories in the \-find path, or for image padding. .br \fBfind\fR performs another run of \-find on the matching file address. It accepts the same params as \-find, except iso_rr_path. .br E.g.: .br \-find / \-name '???' \-type d \-exec find \-name '[abc]*' \-exec chmod a\-w,a+r \-\- .TP .B Filters for data file content: .PP \fBFilters\fR may be installed between data files in the ISO image and their content source outside the image. They may also be used vice versa between data content in the image and target files on disk. .br Built\-in filters are "\-\-zisofs" and "\-\-zisofs\-decode". The former is to be applied via \-set_filter, the latter is automatically applied if zisofs compressed content is detected with a file when loading the ISO image. .br Another built\-in filter pair is "\-\-gzip" and "\-\-gunzip" with suffix ".gz". They behave about like external gzip and gunzip but avoid forking a process for each single file. So they are much faster if there are many small files. .PP .TP \fB\-external_filter\fR name option[:option] program_path [arguments] -- Register a content filter by associating a name with a program path, program arguments, and some behavioral options. Once registered it can be applied to multiple data files in the ISO image, regardless whether their content resides in the loaded ISO image or in the local filesystem. External filter processes may produce synthetic file content by reading the original content from stdin and writing to stdout whatever they want. They must deliver the same output on the same input in repeated runs. .br Options are: .br "default" means that no other option is intended. .br "suffix=..." sets a file name suffix. If it is not empty then it will be appended to the file name or removed from it. .br "remove_suffix" will remove a file name suffix rather than appending it. .br "if_nonempty" will leave 0\-sized files unfiltered. .br "if_reduction" will try filtering and revoke it if the content size does not shrink. .br "if_block_reduction" will revoke if the number of 2 kB blocks does not shrink. .br "used=..." is ignored. Command \-status shows it with the number of files which currently have the filter applied. .br Examples: .br \-external_filter bzip2 suffix=.bz2:if_block_reduction \\ .br /usr/bin/bzip2 \-\- .br \-external_filter bunzip2 suffix=.bz2:remove_suffix \\ .br /usr/bin/bunzip2 \-\- .TP \fB\-unregister_filter\fR name Remove an \-external_filter registration. This is only possible if the filter is not applied to any file in the ISO image. .TP \fB\-close_filter_list\fR Irrevocably ban commands \-concat "pipe", \-external_filter, and \-unregister_filter, but not \-set_filter. Use this to prevent external filtering in general or when all intended filters are registered and \-concat mode "pipe" shall be disallowed. External filters may also be banned totally at compile time of \fBxorriso\fR. By default they are banned if \fBxorriso\fR runs under setuid permission. .TP \fB\-set_filter\fR name iso_rr_path [***] Apply an \-external_filter or a built\-in filter to the given data files in the ISO image. If the filter suffix is not empty , then it will be applied to the file name. Renaming only happens if the filter really gets attached and is not revoked by its options. By default files which already bear the suffix will not get filtered. The others will get the suffix appended to their names. If the filter has option "remove_suffix", then the filter will only be applied if the suffix is present and can be removed. Name oversize or collision caused by suffix change will prevent filtering. .br With most filter types this command will immediately run the filter once for each file in order to determine the output size. Content reading operations like \-extract , \-compare and image generation will perform further filter runs and deliver filtered content. .br At image generation time the filter output must still be the same as the output from the first run. Filtering for image generation does not happen with files from the loaded ISO image if the write method of growing is in effect (i.e \-indev and \-outdev are identical). .br The reserved filter name "\-\-remove\-all\-filters" revokes filtering. This will revoke suffix renamings as well. Use "\-\-remove\-all\-filters+" to prevent any suffix renaming. .br Attaching or detaching filters will not alter the state of \-changes_pending. If the filter manipulations shall be the only changes in a write run, then explicitly execute \-changes_pending "yes". .TP \fB\-set_filter_r\fR name iso_rr_path [***] Like \-set_filter but affecting all data files below eventual directories. .TP .B Writing the result, drive control: .PP (see also paragraph about settings below) .TP \fB\-rollback\fR Discard the manipulated ISO image and reload it from \-indev. (Use \-rollback_end if immediate program end is desired.) .TP \fB\-changes_pending\fR "no"|"yes"|"mkisofs_printed"|"show_status" Write runs are performed only if a change of the image has been made since the image was loaded or created blank. Vice versa the program will start a write run for pending changes when it ends normally (i.e. not by abort and not by command \-rollback_end). .br The command \-changes_pending can be used to override the automatically determined state. This is mainly useful for setting state "yes" despite no real changes were made. The sequence \-changes_pending "no" \-end is equivalent to the command \-rollback_end. State "mkisofs_printed" is caused by emulation command \-as mkisofs if option \-print\-size is present. .br The pseudo\-state "show_status" can be used to print the current state to result channel. .br Image loading or manipulations which happen after this command will again update automatically the change status of the image. .TP \fB\-commit\fR Perform the write operation. Afterwards, if \-outdev is readable, make it the new \-dev and load the image from there. Switch to growing mode. (A subsequent \-outdev will activate modification mode or blind growing.) \-commit is performed automatically at end of program if there are uncommitted manipulations pending. .br So, to perform a final write operation with no new \-dev and no new loading of image, rather execute command \-end. If you want to go on without image loading, execute \-commit_eject "none". To eject after write without image loading, use \-commit_eject "all". .br To suppress a final write, execute \-rollback_end. .br Writing can last quite a while. It is not unnormal with several types of media that there is no progress visible for the first few minutes or that the drive gnaws on the medium for a few minutes after all data have been transmitted. \fBxorriso\fR and the drives are in a client\-server relationship. The drives have much freedom about what to do with the media. Some combinations of drives and media simply do not work, despite the promises by their vendors. If writing fails then try other media or another drive. The reason for such failure is hardly ever in the code of the various burn programs but you may well try some of those listed below under SEE ALSO. .TP \fB\-eject\fR "in"|"out"|"all" Eject the medium in \-indev, \-outdev, or both drives, respectively. Note: It is not possible yet to effectively eject disk files. .TP \fB\-commit_eject\fR "in"|"out"|"all"|"none" Combined \-commit and \-eject. When writing has finished do not make \-outdev the new \-dev, and load no ISO image. Rather eject \-indev and/or \-outdev. Give up any non\-ejected drive. .TP \fB\-blank\fR mode Make media ready for writing from scratch (if not \-dummy is activated). .br This affects only the \-outdev not the \-indev. If both drives are the same and if the ISO image was altered then this command leads to a FAILURE event. Defined modes are: as_needed, fast, all, deformat, deformat_quickest .br "as_needed" cares for used CD\-RW, DVD\-RW and for used overwritable media by applying \-blank "fast". It applies \-format "full" to yet unformatted DVD\-RAM and BD\-RE. Other media in blank state are gracefully ignored. Media which cannot be made ready for writing from scratch cause a FAILURE event. .br "fast" makes CD\-RW and unformatted DVD\-RW re\-usable, or invalidates overwritable ISO images. "all" might work more thoroughly and need more time. .br "deformat" converts overwritable DVD\-RW into unformatted ones. .br "deformat_quickest" is a faster way to deformat or blank DVD\-RW but produces media which are only suitable for a single session. Some drives announce this state by not offering feature 21h, but some drives offer it anyway. If feature 21h is missing, then \fBxorriso\fR will refuse to write on DVD\-RW if not command \-close is set to "on". .br The progress reports issued by some drives while blanking are quite unrealistic. Do not conclude success or failure from the reported percentages. Blanking was successful if no SORRY event or worse occurred. .br Mode may be prepended by "force:" in order to override the evaluation of the medium state by libburn. E.g. "force:fast". Blanking will nevertheless only succeed if the drive is willing to do it. .br .TP \fB\-format\fR mode Convert unformatted DVD\-RW into overwritable ones, "de\-ice" DVD+RW, format newly purchased BD\-RE or BD\-R, re\-format DVD\-RAM or BD\-RE. .br Defined modes are: .br as_needed, full, fast, by_index_, fast_by_index_, by_size_, fast_by_size_, without_spare .br "as_needed" formats yet unformatted DVD\-RW, DVD\-RAM, BD\-RE, or blank unformatted BD\-R. Other media are left untouched. .br "full" (re\-)formats DVD\-RW, DVD+RW, DVD\-RAM, BD\-RE, or blank unformatted BD\-R. .br "fast" does the same as "full" but tries to be quicker. .br "by_index_" selects a format out of the descriptor list issued by command \-list_formats. The index number from that list is to be appended to the mode word. E.g: "by_index_3". .br "fast_by_index_" does the same as "by_index_" but tries to be quicker. .br "by_size_" selects a format out of the descriptor list which provides at least the given size. That size is to be appended to the mode word. E.g: "by_size_4100m". This applies to media with Defect Management. On BD\-RE it will not choose format 0x31, which offers no Defect Management. .br "fast_by_size_" does the same as "by_size_" but tries to be quicker. .br "without_spare" selects the largest format out of the descriptor list which provides no Spare Area for Defect Management. On BD\-RE this will be format 0x31. .br The formatting action has no effect on media if \-dummy is activated. .br Formatting is normally needed only once during the lifetime of a medium, if ever. But it is a reason for re\-formatting if: .br DVD\-RW was deformatted by \-blank, .br DVD+RW has read failures (re\-format before next write), .br DVD\-RAM or BD\-RE shall change their amount of defect reserve. .br BD\-R may be written unformatted or may be formatted before first use. Formatting activates Defect Management which tries to catch and repair bad spots on media during the write process at the expense of half speed even with flawless media. .br The progress reports issued by some drives while formatting are quite unrealistic. Do not conclude success or failure from the reported percentages. Formatting was successful if no SORRY event or worse occurred. Be patient with apparently frozen progress. .TP \fB\-list_formats\fR Put out a list of format descriptors as reported by the output drive for the current medium. The list gives the index number after "Format idx", a MMC format code, the announced size in blocks (like "2236704s") and the same size in MiB. .br MMC format codes are manifold. Most important are: "00h" general formatting, "01h" increases reserve space for DVD\-RAM, "26h" for DVD+RW, "30h" for BD\-RE with reserve space, "31h" for BD\-RE without reserve space, "32h" for BD\-R. .br Smaller format size with DVD\-RAM, BD\-RE, or BD\-R means more reserve space. .TP \fB\-list_speeds\fR Put out a list of speed values as reported by the drives with the loaded media. The list tells read speeds of the input drive and of the output drive. Further it tells write speeds of the output drive. .br The list of write speeds does not necessarily mean that the medium is writable or that these speeds are actually achievable. Especially the lists reported with empty drive or with ROM media obviously advertise speeds for other media. .br It is not mandatory to use speed values out of the listed range. The drive is supposed to choose a safe speed that is as near to the desired speed as possible. .br At the end of the list, "Write speed L" and "Write speed H" are the best guesses for lower and upper write speed limit. "Write speed l" and "Write speed h" may appear only with CD and eventually override the list of other speed offers. .br Only if the drive reports contradicting speed information there will appear "Write speed 0", which tells the outcome of speed selection by command \-speed 0, if it deviates from "Write speed H". .br "Read speed L" and "Read speed H" tell the minimum and maximum read speeds, as reported by the drive. They would be chosen by \-read_speed "min" or "max" if they undercut or surpass the built\-in limits. These are "1x", "52xCD", "24xDVD", "20xBD". .TP \fB\-list_profiles\fR "in"|"out"|"all" Put out a list of media types supported by \-indev, \-outdev, or both, respectively. The currently recognized type is marked by text "(current)". .TP \fB\-truncate_overwritable\fR entity id adjust On overwritable medium copy the volume descriptors of an existing session to the overall descriptors at LBA 0 ff. This makes all sessions \fBinaccessible\fR which are younger than the activated one. A reason to do this would be read errors in the younger sessions and the wish to re\-write or skip them. .br This operation is only allowed if no changes to the loaded filesystem are pending. If an \-indev is acquired then it is released before the write operation begins and re\-acquired only in case of success. .br The parameters "entity" and "id" have the same meaning as with command \-load. They choose the existing ISO session which shall become the youngest accessible session. Available entity names are "session", "track", "lba", "sbsector", "volid". "auto" makes few sense. id is a number or search text as appropriate for the given entity. .br Parameter "adjust" controls the claimed size of the activated session. Text "new" means the size of the newly activated session as it was before this command. I.e. the space of the then inaccessible younger sessions will be re\-used when appending more sessions. .br "old" means the size up to the end of the previously youngest session. I.e. "old" will not free the space of the then inaccessible younger sessions for re\-use. .br A number preceded by "+" gives the number of bytes to be added to "new". A number without "+" gives the overall number of bytes. In any case the result may not be smaller than "new". Numbers may have a unit suffix: "d"=512, "k"=1024, "s"=2048, "m"=1024k, "g"=1024m. .br Examples: .br Activate session 4 and enable overwriting of the blocks of younger sessions: .br \-truncate_overwritable session 4 new .br Activate session 4 and claim the blocks of younger sessions as useless part of session 4: .br \-truncate_overwritable session 4 old .br Let session 4 claim additional 500 MiB as useless data: .br \-truncate_overwritable session 4 +500m .TP \fB\-close_damaged\fR "as_needed"|"force" Try to close the upcoming track and session if the drive reported the medium as damaged. This may apply to CD\-R, CD\-RW, DVD\-R, DVD\-RW, DVD+R, DVD+R DL, or BD\-R media. It is indicated by warning messages when the drive gets acquired, and by a remark "but next track is damaged" with the line "Media status :" of command \-toc. .br The setting of command \-close determines whether the medium stays appendable. .br Mode "as_needed" gracefully refuses on media which are not reported as damaged. Mode "force" attempts the close operation even with media which appear undamaged. .br No image changes are allowed to be pending before this command is performed. After closing was attempted, both drives are given up. .TP .B Settings for result writing: .PP Rock Ridge info will be generated by default. ACLs will be written according to the setting of command \-acl. .TP \fB\-joliet\fR "on"|"off" If enabled by "on", generate Joliet tree additional to ISO 9660 + Rock Ridge tree. .TP \fB\-hfsplus\fR "on"|"off" If enabled by "on", generate a HFS+ filesystem inside the ISO 9660 image and mark it by Apple Partition Map (APM) entries in the System Area, the first 32 KiB of the image. .br This may collide with data submitted by \-boot_image system_area=. The first 8 bytes of the System Area get overwritten by { 0x45, 0x52, 0x08 0x00, 0xeb, 0x02, 0xff, 0xff } which can be executed as x86 machine code without negative effects. So if an MBR gets combined with this feature, then its first 8 bytes should contain no essential commands. .br The next blocks of 2 KiB in the System Area will be occupied by APM entries. The first one covers the part of the ISO image before the HFS+ filesystem metadata. The second one marks the range from HFS+ metadata to the end of file content data. If more ISO image data follow, then a third partition entry gets produced. Other features of xorriso might cause the need for more APM entries. .br The HFS+ filesystem is not suitable for add\-on sessions produced by the multi\-session method of growing. An existing ISO image may nevertheless be the base for a new image produced by the method of modifying. If \-hfsplus is enabled when \-indev or \-dev gets executed, then AAIP attributes get loaded from the input image and checked for information about HFS creator, filetype, or blessing. If found, then they get enabled as settings for the next image production. Therefore it is advisable to perform \-hfsplus "on" before \-indev or \-dev. .br Information about HFS creator, type, and blessings gets stored by xorriso if \-hfsplus is enabled at \-commit time. It is stored as copy outside the HFS+ partition, but rather along with the Rock Ridge information. xorriso does not read any information from the HFS+ meta data. .br Be aware that HFS+ is case\-insensitive although it can record file names with upper\-case and lower\-case letters. Therefore, file names from the iso_rr name tree may collide in the HFS+ name tree. In this case they get changed by adding underscore characters and counting numbers. In case of very long names, it might be necessary to map them to "MANGLED_...". .br WARNING: .br The HFS+ implementation in libisofs has a limit of 125,829,120 bytes for the size of the overall directory tree. This suffices for about 300,000 files of normal name length. If the limit gets exceeded, a FAILURE event will be issued and the ISO production will not happen. .TP \fB\-rockridge\fR "on"|"off" Mode "off" disables production of Rock Ridge information for the ISO 9660 file objects. The multi\-session capabilities of xorriso depend much on the naming fidelity of Rock Ridge. So it is strongly discouraged to deviate from default setting "on". .TP \fB\-compliance\fR rule[:rule...] Adjust the compliance to specifications of ISO 9660/ECMA\-119 and its contemporary extensions. In some cases it is worth to deviate a bit in order to circumvent bugs of the intended reader system or to get unofficial extra features. .br There are several adjustable rules which have a keyword each. If they are mentioned with this command then their rule gets added to the relaxation list. This list can be erased by rules "strict" or "clear". It can be reset to its start setting by "default". All of the following relaxation rules can be revoked individually by appending "_off". Like "deep_paths_off". .br Rule keywords are: .br "iso_9660_level="number chooses level 1 with ECMA\-119 names of the form 8.3 and \-file_size_limit <= 4g \- 1, or level 2 with ECMA\-119 names up to length 32 and the same \-file_size_limit, or level 3 with ECMA\-119 names up to length 32 and \-file_size_limit >= 400g \-200k. If necessary \-file_size_limit gets adjusted. .br "allow_dir_id_ext" allows ECMA\-119 names of directories to have a name extension as with other file types. It does not force dots and it omits the version number, though. This is a bad tradition of mkisofs which violates ECMA\-119. Especially ISO level 1 only allows 8 characters in a directory name and not 8.3. .br "omit_version" does not add versions (";1") to ECMA\-119 and Joliet file names. .br "only_iso_version" does not add versions (";1") to Joliet file names. .br "deep_paths" allows ECMA\-119 file paths deeper than 8 levels. .br "long_paths" allows ECMA\-119 file paths longer than 255 characters. .br "long_names" allows up to 37 characters with ECMA\-119 file names. .br "no_force_dots" does not add a dot to ECMA\-119 file names which have none. .br "no_j_force_dots" does not add a dot to Joliet file names which have none. .br "lowercase" allows lowercase characters in ECMA\-119 file names. .br "7bit_ascii" allows nearly all 7\-bit characters in ECMA\-119 file names. Not allowed are 0x0 and '/'. If not "lowercase" is enabled, then lowercase letters get converted to uppercase. .br "full_ascii" allows all 8\-bit characters except 0x0 and '/' in ECMA\-119 file names. .br "untranslated_names" might be dangerous for inadverted reader programs which rely on the restriction to at most 37 characters in ECMA\-119 file names. This rule allows ECMA\-119 file names up to 96 characters with no character conversion. If a file name has more characters, then image production will fail deliberately. .br "untranslated_name_len="number enables untranslated_names with a smaller limit for the length of file names. 0 disables this feature, \-1 chooses maximum length limit, numbers larger than 0 give the desired length limit. .br "joliet_long_names" allows Joliet leaf names up to 103 characters rather than 64. .br "joliet_long_paths" allows Joliet paths longer than 240 characters. .br "joliet_utf16" encodes Joliet names in UTF\-16BE rather than UCS\-2. The difference is with characters which are not present in UCS\-2 and get encoded in UTF\-16 by 2 words of 16 bit each. Both words then stem from a reserved subset of UCS\-2. .br "always_gmt" stores timestamps in GMT representation with timezone 0. .br "rec_mtime" records with non\-RockRidge directory entries the disk file's mtime and not the creation time of the image. This applies to the ECMA\-119 tree (plain ISO 9660), to Joliet, and to ISO 9660:1999. "rec_time" is default. If disabled, it gets automatically re\-enabled by \-as mkisofs emulation when a pathspec is encountered. .br "new_rr" uses Rock Ridge version 1.12 (suitable for GNU/Linux but not for older FreeBSD or for Solaris). This implies "aaip_susp_1_10_off" which may be changed by subsequent "aaip_susp_1_10". .br Default is "old_rr" which uses Rock Ridge version 1.10. This implies also "aaip_susp_1_10" which may be changed by subsequent "aaip_susp_1_10_off". .br "aaip_susp_1_10" allows AAIP to be written as unofficial extension of RRIP rather than as official extension under SUSP\-1.12. .br "no_emul_toc" saves 64 kB with the first session on overwritable media but makes the image incapable of displaying its session history. .br "iso_9660_1999" causes the production of an additional directory tree compliant to ISO 9660:1999. It can record long filenames for readers which do not understand Rock Ridge. .br "old_empty" uses the old way of of giving block addresses in the range of [0,31] to files with no own data content. The new way is to have a dedicated block to which all such files will point. .br Default setting is .br "clear:only_iso_version:deep_paths:long_paths:no_j_force_dots: .br always_gmt:old_rr". .br Note: The term "ECMA\-119 name" means the plain ISO 9660 names and attributes which get visible if the reader ignores Rock Ridge. .TP \fB\-rr_reloc_dir\fR name Specify the name of the relocation directory in which deep directory subtrees shall be placed if \-compliance is set to "deep_paths_off" or "long_paths_off". A deep directory is one that has a chain of 8 parent directories (including root) above itself, or one that contains a file with an ECMA\-119 path of more than 255 characters. .br The overall directory tree will appear originally deep when interpreted as Rock Ridge tree. It will appear as re\-arranged if only ECMA\-119 information is considered. .br The default relocation directory is the root directory. By giving a non\-empty name with \-rr_reloc_dir, a directory in the root directory may get this role. If that directory does not already exist at \-commit time, then it will get created and marked for Rock Ridge as relocation artefact. At least on GNU/Linux it will not be displayed in mounted Rock Ridge images. .br The name must not contain a '/' character and must not be longer than 255 bytes. .TP \fB\-volid\fR text Specify the volume ID, which most operating systems will consider to be the volume name of the image or medium. .br \fBxorriso\fR accepts any text up to 32 characters, but according to rarely obeyed specs stricter rules apply: .br ECMA\-119 demands ASCII characters out of [A\-Z0\-9_]. Like: .br "IMAGE_23" .br Joliet allows 16 UCS\-2 characters. Like: .br "Windows name" .br Be aware that the volume id might get used automatically as the name of the mount point when the medium is inserted into a playful computer system. .br If an ISO image gets loaded while the volume ID is set to default "ISOIMAGE" or to "", then the volume ID of the loaded image will become the effective volume id for the next write run. But as soon as command \-volid is performed afterwards, this pending ID is overridden by the new setting. .br Consider this when setting \-volid "ISOIMAGE" before executing \-dev, \-indev, or \-rollback. If you insist in \-volid "ISOIMAGE", set it again after those commands. .TP \fB\-volset_id\fR text Set the volume set ID string to be written with the next \-commit. Permissible are up to 128 characters. This setting gets overridden by image loading. .TP \fB\-publisher\fR text Set the publisher ID string to be written with the next \-commit. This may identify the person or organisation who specified what shall be recorded. Permissible are up to 128 characters. This setting gets overridden by image loading. .TP \fB\-application_id\fR text Set the application ID string to be written with the next \-commit. This may identify the specification of how the data are recorded. Permissible are up to 128 characters. This setting gets overridden by image loading. .br The special text "@xorriso@" gets converted to the ID string of \fBxorriso\fR which is normally written as \-preparer_id. It is a wrong tradition to write the program ID as \-application_id. .TP \fB\-system_id\fR text Set the system ID string to be written with the next \-commit. This may identify the system which can recognize and act upon the content of the System Area in image blocks 0 to 15. Permissible are up to 32 characters. This setting gets overridden by image loading. .TP \fB\-volume_date\fR type timestring Set one of the four overall timestamps for subsequent image writing. Available types are: .br "c" time when the volume was created. .br "m" time when volume was last modified. .br "x" time when the information in the volume expires. .br "f" time since when the volume is effectively valid. .br "all_file_dates" sets mtime, atime, and ctime of all files and directories to the given time. If the timestring is "set_to_mtime", then the atime and ctime of each file and directory get set to the value found in their mtime. .br These actions stay delayed until actual ISO production begins. Up to then they can be revoked by "all_file_dates" with empty timestring or timestring "default". .br The timestamps of the El Torito boot catalog file get refreshed when the ISO is produced. They can be influenced by "uuid". .br "uuid" sets a timestring that overrides "c" and "m" times literally and sets the time of the El Torito boot catalog. It must consist of 16 decimal digits which form YYYYMMDDhhmmsscc, with YYYY between 1970 and 2999. Time zone is GMT. It is supposed to match this GRUB line: .br search \-\-fs\-uuid \-\-set YYYY\-MM\-DD\-hh\-mm\-ss\-cc .br E.g. 2010040711405800 is 7 Apr 2010 11:40:58 (+0 centiseconds). .br Timestrings for the other types may be given as with command \-alter_date. Some of them are prone to timezone computations. The timestrings "default" or "overridden" cause default settings: "c" and "m" will show the current time of image creation. "x" and "f" will be marked as insignificant. "uuid" will be deactivated. .br At \-commit time, some timestamps get set to the maximum value of effectively written volume creation and modification time: El Torito boot catalog, HFS+ superblock, ECMA\-119 file modification time if \-compliance "no_rec_mtime". The isohybrid MBR id is computed from "uuid" if given, else from the effective volume modification date. .TP \fB\-copyright_file\fR text Set the copyright file name to be written with the next \-commit. This should be the ISO 9660 path of a file in the image which contains a copyright statement. Permissible are up to 37 characters. This setting gets overridden by image loading. .TP \fB\-abstract_file\fR text Set the abstract file name to be written with the next \-commit. This should be the ISO 9660 path of a file in the image which contains an abstract statement about the image content. Permissible are up to 37 characters. This setting gets overridden by image loading. .TP \fB\-biblio_file\fR text Set the biblio file name to be written with the next \-commit. This should be the ISO 9660 path of a file in the image which contains bibliographic records. Permissible are up to 37 characters. This setting gets overridden by image loading. .TP \fB\-preparer_id\fR text Set the preparer ID string to be written with the next \-commit. This may identify the person or other entity which controls the preparation of the data which shall be recorded. Normally this should be the ID of \fBxorriso\fR and not of the person or program which operates \fBxorriso\fR. Please avoid to change it. Permissible are up to 128 characters. .br The special text "@xorriso@" gets converted to the ID string of \fBxorriso\fR which is default at program startup. .br Unlike other ID strings, this setting is not influenced by image loading. .TP \fB\-application_use\fR character|0xXY|disk_path Specify the content of the Application Use field which can take at most 512 bytes. .br If the parameter of this command is empty, then the field is filled with 512 0\-bytes. If it is a single character, then it gets repeated 512 times. If it begins by "0x" followed by two hex digits [0\-9a\-fA\-F], then the digits are read as byte value which gets repeated 512 times. .br Any other parameter text is used as disk_path to open a data file and to read up to 512 bytes from it. If the file is smaller than 512 bytes, then the remaining bytes in the field get set to binary 0. .br This setting is not influenced by image loading. .TP \fB\-out_charset\fR character_set_name Set the character set to which file names get converted when writing an image. See paragraph "Character sets" for more explanations. When loading the written image after \-commit the setting of \-out_charset will be copied to \-in_charset. .TP \fB\-uid\fR uid User id to be used for all files when the new ISO tree gets written to media. .TP \fB\-gid\fR gid Group id to be used for all files when the new ISO tree gets written to media. .TP \fB\-zisofs\fR parameter[:parameters] Set global parameters for zisofs compression. This data format is recognized and transparently uncompressed by some Linux kernels. It is to be applied via command \-set_filter with built\-in filter "\-\-zisofs". .br Note: This command is only permitted while no \-\-zisofs filters are applied to any files. .br Parameters are: .br "level="[0\-9] zlib compression: 0=none, 1=fast,..., 9=slow .br "block_size="32k|64k|128k sets the size of version 1 compression blocks. .br "by_magic=on" enables an expensive test at image generation time which checks files from disk whether they already are zisofs compressed, e.g. by program mkzftree. "by_magic=v2" enables processing of already zisofs2 compressed files additionally to those of zisofs version 1. "by_magic=off" disables both. .br "version_2="off|as_needed|on controls compression by experimental version zisofs2 which can encode files of size 4 GiB or larger. The Linux kernel (as of 5.9) does not yet know this format and will complain like .br isofs: Unknown ZF compression algorithm: PZ .br The files will then appear in their compressed form with zisofs2 header, block pointer list, and compressed data. .br zisofs2 is recognized by xorriso in files from loaded images and gets equipped with \-\-zisofs\-decode filters, unless restrictions on the number of block pointers prevent this. .br Mode "off" restricts compression to files smaller than 4 GiB uncompressed size. Mode "as_needed" uses zisofs2 for larger files. Mode "on" uses zisofs2 for all zisofs compressed files. .br "susp_z2="off|on controls production of SUSP entries "Z2" instead of "ZF" with zisofs2 compressed files. Unaware Linux kernels are supposed to silently ignore "Z2" entries. .br "block_size_v2="32k|64k|128k|256k|512k|1m sets the size of compression blocks for zisofs2. .br "bpt_target="\-1|>0 sets a number of block pointers per file, which is considered low enough to justify a reduction of block size. If this number is larger than 0, then block sizes smaller than the settings of block_size= or block_size_v2= are tried whether they yield not more block pointers than the given number. If so, the smallest suitable block size is applied. .br The inavoidable final block pointer counts. E.g. a file of 55 KiB has 3 block pointers if block size is 32k, and 2 block pointers with block size 64k. .br bpt_target=\-1 disables this automatic block size adjustment. .br "max_bpt="1k...128g sets the limit for the overall allocated block pointer memory. Block pointers occupy virtual memory while a file gets uncompressed and while a file, which shall be compressed, waits for ISO filesystem creation. .br One pointer occupies 8 bytes of memory and governs block_size or block_size_v2 uncompressed bytes. I.e. with block size 128k, 1m of block pointer memory suffices for at most 16g of uncompressed file size. Each file consumes one end block pointer, independently of the file size. Partially filled end blocks may further reduce the effective payload. .br In case of overflow of the max_bpt limit while adding compression filters the program tries to go on by discarding all buffered block pointers of previously added \-\-zisofs filters. From then on all newly added filters will discard their block pointers immediately after being added. Discarded block pointers cause an additional read and compression run of the input file during the production of the ISO filesystem. .br "max_bpt_f="1k...128g sets the limit for the memory size of the block pointer list of a single file. max_bpt_f is never larger than max_bpt. If either is set to violate this rule, the other gets set to the same value. If both values are the same before a change by max_bpt= or max_bpt_f=, then both limits stick together unless the limit is decreased by max_bpt_f=. .br "bpt_free_ratio="\-1|0.0...1.0 sets a threshold for switching to block pointer discarding during compression. If less than the given fraction of the max_bpt_f= memory is free, then block pointers of compression filters get discarded immediately after being added. Value \-1 disables this feature. .br "default" is the same as "level=6:block_size=32k:by_magic=off: version_2=off:block_size_v2=128k:susp_z2=off:max_bpt=256m:max_bpt_f=256m: bpt_free_ratio=\-1". .TP \fB\-speed\fR code|number[k|m|c|d|b] Set the burn speed. Default is "max" (or "0") = maximum speed as announced by the drive. Further special speed codes are: .br "min" (or "\-1") selects minimum speed as announced by the drive. .br "none" avoids to send a speed setting command to the drive before burning begins. .br Speed can be given in media dependent numbers or as a desired throughput per second in MMC compliant kB (= 1000) or MB (= 1000 kB). Media x\-speed factor can be set explicitly by "c" for CD, "d" for DVD, "b" for BD, "x" is optional. .br Example speeds: .br 706k = 706kB/s = 4c = 4xCD .br 5540k = 5540kB/s = 4d = 4xDVD .br If there is no hint about the speed unit attached, then the medium in the \-outdev will decide. Default unit is CD = 176.4k. .br MMC drives usually activate their own idea of speed and take the speed value given by the burn program only as upper limit for their own decision. .TP \fB\-stream_recording\fR "on"|"off"|"full"|"data"|number Setting "on" tries to circumvent the management of defects on DVD\-RAM, BD\-RE, or BD\-R. Defect management keeps partly damaged media usable. But it reduces write speed to half nominal speed even if the medium is in perfect shape. For the case of flawless media, one may use \-stream_recording "on" to get full speed. .br "full" tries full speed with all write operations, whereas "on" does this only above byte address 32s. One may give a number of at least 16s in order to set an own address limit. .br "data" causes full speed to start when superblock and directory entries are written and writing of file content blocks begins. .TP \fB\-dvd_obs\fR "default"|"32k"|"64k" GNU/Linux specific: Set the number of bytes to be transmitted with each write operation to DVD or BD media. A number of 64 KB may improve throughput with bus systems which show latency problems. The default depends on media type, on command \-stream_recording , and on compile time options. .TP \fB\-modesty_on_drive\fR parameter[:parameters] Control whether the drive buffer shall be kept from getting completely filled. Parameter "on" (or "1") keeps the program from trying to write to the burner drive while its buffer is in danger to be filled over a given limit. If this limit is exceeded then the program will wait until the filling reaches a given low percentage value. .br This can ease the load on operating system and drive controller and thus help with achieving better input bandwidth if disk and burner are not on independent controllers (like hda and hdb). It may also help with throughput problems of simultaneous burns on different burners with Linux kernels like 3.16, if one has reason not to fix the problem by \-scsi_dev_family "sg". On the other hand it increases the risk of buffer underflow and thus reduced write speed. .br Some burners are not suitable because they report buffer fill with granularity too coarse in size or time, or expect their buffer to be filled to the top before they go to full speed. .br Parameters "off" or "0" disable this feature. .br The threshold for beginning to wait is given by parameter "max_percent=". Parameter "min_percent=" defines the threshold for resuming transmission. Percentages are permissible in the range of 25 to 100. Numbers in this range without a prepended name are interpreted as "on:min_percent=". .br E.g.: \-modesty_on_drive 75 .br The optimal values depend on the buffer behavior of the drive. .br Parameter "timeout_sec=" defines after which time of unsuccessful waiting the modesty shall be disabled because it does not work. .br Parameter "min_usec=" defines the initial sleeping period in microseconds. If the drive buffer appears to be too full for sending more data, the program will wait the given time and inquire the buffer fill state again. If repeated inquiry shows not enough free space, the sleep time will slowly be increased to what parameter "max_usec=" defines. .br Parameters, which are not mentioned with a \-modesty_on_drive command, stay unchanged. Default is: .br \-modesty_on_drive off:min_percent=90:max_percent=95: timeout_sec=120:min_usec=5000:max_usec=25000 .TP \fB\-use_immed_bit\fR "on"|"off"|"default" Control whether several long lasting SCSI commands shall be executed with the Immed bit, which makes the commands end early while the drive operation is still going on. xorriso then inquires progress indication until the drive reports to be ready again. If this feature is turned off, then blanking and formatting will show no progress indication. .br It may depend on the operating system whether \-use_immed_bit is set to "off" by default. Command \-status will tell by appending "/on" or "/off" if a drive has already been acquired and \-use_immed_bit is currently set to "default". Command \-use_immed_bit tolerates and ignores such appended text. .TP \fB\-stdio_sync\fR "on"|"off"|"end"|number Set the number of bytes after which to force output to stdio: pseudo drives. This forcing keeps the memory from being clogged with lots of pending data for slow devices. Default "on" is the same as "16m". Forced output can be disabled by "off", or be delayed by "end" until all data are produced. If a number is chosen, then it must be at least 64k. .TP \fB\-dummy\fR "on"|"off" If "on" then simulate burning or refuse with FAILURE event if no simulation is possible, do neither blank nor format. .TP \fB\-fs\fR number["k"|"m"] Set the size of the fifo buffer which smoothens the data stream from ISO image generation to media burning. Default is 4 MiB, minimum 64 kiB, maximum 1 GiB. The number may be followed by letter "k" or "m" which means unit is kiB (= 1024) or MiB (= 1024 kiB). .TP \fB\-close\fR "on"|"off"|"as_needed" If \-close is set to "on" then mark the written medium as not appendable any more. This will have no effect on overwritable media types. Setting "on" is the contrary of cdrecord option \-multi, and is one aspect of growisofs option \-dvd\-compat. .br If set to "off" then keep the medium writable for an appended session. .br If set to "as_needed" then use "on" only if "off" is predicted to fail with the given medium and its state. .br Not all drives correctly recognize fast\-blanked DVD\-RW which need "on". If there is well founded suspicion that a burn run failed due to \-close "off", then \-close "as_needed" causes a re\-try with "on". .br Note that emulation command \-as "cdrecord" temporarily overrides the current setting of \-close by its own default \-close "on" if its option \-multi is missing. .TP \fB\-write_type\fR "auto"|"tao"|"sao/dao" Set the write type for the next burn run. "auto" will select SAO with blank CD media, DAO with blank DVD\-R[W] if \-close is "on", and elsewise CD TAO or the equivalent write type of the particular DVD/BD media. Choosing TAO or SAO/DAO explicitly might cause the burn run to fail if the desired write type is not possible with the given media state. .TP \fB\-padding\fR number["k"|"m"]|"included"|"appended" Append the given number of extra bytes to the image stream. This is a traditional remedy for a traditional bug in block device read drivers. Needed only for CD recordings in TAO mode. Since one can hardly predict on what media an image might end up, \fBxorriso\fR adds the traditional 300k of padding by default to all images. .br For images which will never get to a CD it is safe to use \-padding 0 . .br Normally padding is not written as part of the ISO image but appended after the image end. This is \-padding mode "appended". .br Emulation command \-as "mkisofs" and command \-jigdo cause padding to be written as part of the image. The same effect is achieved by \-padding mode "included". .TP .B Bootable ISO images: .PP Contrary to published specifications many BIOSes will load an El Torito record from the first session on media and not from the last one, which gets mounted by default. This makes no problems with overwritable media, because they appear to inadverted readers as one single session. .br But with multi\-session media CD\-R[W], DVD\-R[W], DVD+R, it implies that the whole bootable system has to reside already in the first session and that the last session still has to bear all files which the booted system expects after mounting the ISO image. .br If a boot image from ISOLINUX or GRUB is known to be present on media then it is advised to patch it when a follow\-up session gets written. But one should not rely on the capability to influence the bootability of the existing sessions, unless one can assume overwritable media. .br Normally the boot images are data files inside the ISO filesystem. By special path "\-\-interval:appended_partition_NNN:all::" it is possible to refer to an appended partition. The number NNN gives the partition number as used with the corresponding command \-append_partition. E.g.: .br \-append_partition 2 0xef /tmp/efi.img \-boot_image any efi_path=\-\-interval:appended_partition_2:all:: .br There are booting mechanisms which do not use an El Torito record but rather start at the first bytes of the image: PC\-BIOS MBR or EFI GPT for hard\-disk\-like devices, APM partition entries for Macs which expect HFS+ boot images, MIPS Volume Header for old SGI computers, DEC Boot Block for old MIPS DECstation, SUN Disk Label for SPARC machines, HP\-PA boot sector for HP PA\-RISC machines, DEC Alpha SRM boot sector for old DEC Alpha machines. .PP Several of the following commands expect disk paths as input but also accept description strings for the libisofs interval reader, which is able to cut out data from disk files or \-indev and to zeroize parts of the content: command \-append_partition, boot specs system_area=, grub2_mbr=, prep_boot_part=, efi_boot_part=. .br The description string consists of the following components, separated by colon ':' .br "\-\-interval:"Flags":"Interval":"Zeroizers":"Source .br The component "\-\-interval" states that this is not a plain disk path but rather an interval reader description string. The component Flags modifies the further interpretation: .br "local_fs" demands to read from a file depicted by the path in Source. .br "imported_iso" demands to read from the \-indev. This works only if \-outdev is not the same as \-indev. The Source component is ignored. .br "appended_partition_NNN" with a decimal number NNN works only for \-boot_image bootspecs which announce El Torito boot image paths: bin_path=, efi_path=. The number gives the partition number as used with the corresponding command \-append_partition. .br The component Interval consists of two byte address numbers separated by a "\-" character. E.g. "0\-429" means to read bytes 0 to 429. .br The component Zeroizers consists of zero or more comma separated strings. They define which part of the read data to zeroize. Byte number 0 means the byte read from the Interval start address. Each string may be one of: .br "zero_mbrpt" demands to zeroize the MBR partition table if bytes 510 and 511 bear the MBR signature 0x55 0xaa. .br "zero_gpt" demands to check for a GPT header in bytes 512 to 1023, to zeroize it and its partition table blocks. .br "zero_apm" demands to check for an APM block 0 and to zeroize its partition table blocks. .br Start_byte"\-"End_byte demands to zeroize the read\-in bytes beginning with number Start_byte and ending after End_byte. .br The component Source is the file path with flag "local_fs", and ignored with flag "imported_iso". .br Byte numbers may be scaled by a suffix out of {k,m,g,t,s,d} meaning multiplication by {1024, 1024k, 1024m, 1024g, 2048, 512}. A scaled value end number depicts the last byte of the scaled range. .br E.g. "0d\-0d" is "0\-511". .br Examples: .br "local_fs:0\-32767:zero_mbrpt,zero_gpt,440\-443:/tmp/template.iso" .br "imported_iso:45056d\-47103d::" .br .TP \fB\-boot_image\fR "any"|"isolinux"|"grub" .br "discard"|"keep"|"patch"|"replay"|"show_status"| bootspec|"next" .br Define the equipment of the emerging filesystem with boot entry points. .br With systems which boot via BIOS or EFI this is a set of El Torito boot images, possibly MBR boot code, and possibly partition tables of type MBR, GPT, or APM. Such file sets get produced by boot loader systems like ISOLINUX or GRUB. .br Each \-boot_image command has two parameters: type and setting. More than one \-boot_image command may be used to define the handling of one or more boot images. Sequence matters. .br Types \fBisolinux\fR and \fBgrub\fR care for known peculiarities. Type \fBany\fR makes no assumptions about the origin of the boot images. .br When loading an ISO filesystem, system area and El Torito boot images get loaded, too. The default behavior is not to write loaded El Torito boot images and to write the loaded system area content without alterations. .br \fBdiscard\fR gives up the El Torito boot catalog and its boot images. regardless whether loaded from an ISO filesystem or defined by commands. Any BIOS or EFI related boot options get revoked. Nevertheless, loaded system area data stay valid. If desired, they have to be erased by .br \-boot_image any system_area=/dev/zero .br \fBkeep\fR keeps or copies El Torito boot images unaltered and writes a new catalog. .br \fBpatch\fR applies patching to existing El Torito boot images if they seem to bear a boot info table. .br A boot info table needs to be patched when the boot image gets newly introduced into the ISO image or if an existing image gets relocated. This is automatically done if type "isolinux" or "grub" is given, but not with "any". .br If patching is enabled, then boot images from previous sessions will be checked whether they seem to bear a boot info table. If not, then they stay unpatched. This check is not infallible. So if you do know that the images need no patching, use "any" "keep". "grub" "patch" will not patch EFI images (platform_id=0xef). .br \fBreplay\fR is a more modern version of "patch", which not only cares for existing El Torito boot equipment but also for the recognizable boot provisions in the System Area. It discards any existing \-boot_image setting and executes the commands proposed by command \-report_el_torito "cmd". .br This action will only succeed if the file objects mentioned in the output of command \-report_el_torito "cmd" are still available. Do not remove or rename boot image files after \-indev. .br Drop unknown El Torito: \-boot_image "any" "discard" .br Maintain recognizable stuff: \-boot_image "any" "replay" .br El Torito only for GRUB: \-boot_image "grub" "patch" .br El Torito only for ISOLINUX: \-boot_image "isolinux" "patch" .br \fBshow_status\fR will print what is known about the loaded boot images and their designated fate. .br A \fBbootspec\fR is a word of the form name=value. It is used to describe the parameters of a boot feature. The names "dir", "bin_path", "efi_path" lead to El Torito bootable images. Name "system_area" activates a given file as MBR or other disk header. .br On all media types this is possible within the first session. In further sessions an existing boot image can get replaced by a new one, but depending on the media type this may have few effect at boot time. See above. .br El Torito boot images have to be added to the ISO image by normal means (image loading, \-map, \-add, ...). In case of ISOLINUX the files should reside either in ISO image directory /isolinux or in /boot/isolinux . In that case it suffices to use as bootspec the text "\fBdir=/isolinux\fR" or "dir=/boot/isolinux". E.g.: .br \-boot_image isolinux dir=/boot/isolinux .br which bundles these individual settings: .br \-boot_image isolinux bin_path=/boot/isolinux/isolinux.bin .br \-boot_image isolinux cat_path=/boot/isolinux/boot.cat .br \-boot_image isolinux load_size=2048 .br \-boot_image any boot_info_table=on .br An El Torito boot catalog file gets inserted into the ISO image with address \fBcat_path=\fR with the first \-boot_image "any" "next" or at \-commit time. It is subject to normal \-overwrite and \-reassure processing if there is already a file with the same name. The catalog lists the boot images and is read by the boot facility to choose one of the boot images. But it is not necessary that it appears in the directory tree at all. One may hide it in all trees by \fBcat_hidden=on\fR. Other possible values are "iso_rr", "joliet", "hfsplus", and the default "off". The timestamps of the boot catalog file are refreshed at commit time. Command \-volume_date "uuid" can be used to set their value. .br \fBbin_path=\fR depicts an El Torito boot image file, a binary program which is to be started by the hardware boot facility (e.g. the BIOS) at boot time. .br \fBefi_path=\fR depicts an El Torito boot image file that is ready for EFI booting. This is normally a FAT filesystem image not larger than 65535 blocks of 512 bytes (= 32 MiB \- 512). Its load_size is determined automatically, no boot info table gets written, no boot medium gets emulated, platform_id is 0xef. .br \fBemul_type=\fR can be one of "no_emulation", "hard_disk", "diskette". It controls the boot medium emulation code of a boot image. The default "no_emulation" is suitable for ISOLINUX, GRUB, FreeBSD cdboot. .br \fBload_size=\fR is a value which depends on the boot image. Default is 2048 which matches the expectations of most boot images. The special value "full" means the full size of the boot image file rounded up to a multiple of 2048 bytes. Maximum is 33,552,384 bytes. .br \fBboot_info_table=on\fR causes address patching to bytes 8 to 63 of the boot image which is given by "any" "bin_path=". "boot_info_table=off" disables this patching. .br \fBgrub2_boot_info=on\fR causes address patching to byte 2548 of the boot image which is given by "any" "bin_path=". The address is written as 64 bit little\-endian number. It is the 2KB block address of the boot image content, multiplied by 4, and then incremented by 5. "grub2_boot_info=off" disables this patching. .br \fBplatform_id=\fR defines by a hexadecimal or decimal number the Platform ID of the boot image. "0x00" is 80x86 PC\-BIOS, "0x01" is PowerPC, "0x02" is Mac, "0xef" is EFI (decimal "239"). .br \fBid_string=\fRtext|56_hexdigits defines the ID string of the boot catalog section where the boot image will be listed. If the value consists of 56 characters [0\-9A\-Fa\-f] then it is converted into 28 bytes, else the first 28 characters become the ID string. The ID string of the first boot image becomes the overall catalog ID. It is limited to 24 characters. Other id_strings become section IDs. .br \fBsel_crit=\fRhexdigits defines the Selection Criteria of the boot image. Up to 20 bytes get read from the given characters [0\-9A\-Fa\-f]. They get attributed to the boot image entry in the catalog. .br \fBnext\fR ends the definition of a boot image and starts a new one. Any following \-bootimage bootspecs will affect the new image. The first "next" discards loaded boot images and their catalog. .br \fBsystem_area=\fRdisk_path copies at most 32768 bytes from the given disk file to the very start of the ISO image. This System Area is reserved for system dependent boot software, e.g. an MBR which can be used to boot from USB stick or hard disk. .br Other than an El Torito boot image, the file disk_path needs not to be added to the ISO image. .br \fB\-boot_image isolinux system_area=\fR implies "partition_table=on". In this case, the disk path should lead to one of the SYSLINUX files isohdp[fp]x*.bin or to a file which was derived from one of those files. E.g. to the first 512 bytes from an ISOLINUX isohybrid ISO image. .br In this case, El Torito boot images (dir=, bin_path=, efi_path=) may be augmented by \fBisolinux partition_entry=gpt_basdat\fR or \fBisolinux partition_entry=gpt_hfsplus\fR, and by \fBisolinux partition_entry=apm_hfsplus\fR. The boot image will then be mentioned in an invalid GPT as Basic Data or GPT HFS+ partition, and in a valid APM as HFS+ partition. The first three GPT partitions will also be marked by MBR partitions. The MBR partition of type 0xEF is what actually is used by EFI firmware for booting from USB stick. .br In multi\-session situations the existing System Area is preserved by default. In in this case, the special disk_path "." prevents reading of a disk file but nevertheless causes adjustments in the loaded system area data. Such adjustments may get ordered by \-boot_image commands. .br \fB\-boot_image any gpt_disk_guid=\fRvalue controls whether an emerging GPT shall get a randomly generated disk GUID or whether the GUID is supplied by the user. Value "random" is default. Value "volume_date_uuid" produces a low quality GUID from the value set by \-volume_date "uuid". .br A string of 32 hex digits, or a RFC 4122 compliant GUID string may be used to set the disk GUID directly. UEFI prescribes the first three components of a RFC 4122 GUID string to be byte\-swapped in the binary representation: .br E.g. gpt_disk_guid=2303cd2a\-73c7\-424a\-a298\-25632da7f446 equals gpt_disk_guid=2acd0323c7734a42a29825632da7f446 .br The partition GUIDs get generated by minimally varying the disk GUID. .br \fB\-boot_image any part_like_isohybrid=on\fR enables \-boot_image isolinux partition_entry= even if no \-boot_image isolinux system_area= is given. No MBR partition of type 0xee emerges, even if GPT gets produced. Gaps between GPT and APM partitions will not be filled by more partitions. Appended partitions get mentioned in APM if other APM partitions emerge. .br \fB\-boot_image any iso_mbr_part_type=\fRnumber sets the partition type of the MBR partition which represents the ISO or at least protects it. .br Number may be 0x00 to 0xff. The text "default" re\-enables the default types of the various occasions to create an ISO MBR partition. This is without effect if no such partition emerges by other settings or if the partition type is prescribed mandatorily like 0xee for GPT protective MBR or 0x96 for CHRP. .br If instead a type_guid is given by a 32\-digit hex string like a2a0d0ebe5b9334487c068b6b72699c7 or by a structured text like EBD0A0A2\-B9E5\-4433\-87C0\-68B6B72699C7, then it will be used as partition type if the ISO filesystem appears as partition in GPT. In MBR, C12A7328\-F81F\-11D2\-BA4B\-00A0C93EC93B will be mapped to 0xef. Any other GUID will be mapped to 0x83. .br \fBgrub2_mbr=\fRdisk_path works like "any" system_area= with additional patching for modern GRUB MBRs. The content start address of the first boot image is converted to a count of 512 byte blocks, and an offset of 4 is added. The result is written as 64 bit little\-endian number to byte address 0x1b0. .br This feature can be revoked either by grub2_mbr= with empty disk path, or by submitting a disk_path via system_area=. .br \fBpartition_table=on\fR causes a simple partition table to be written into bytes 446 to 511 of the System Area. .br With type "isolinux" it shows a partition that begins at byte 0 and it causes the LBA of the first boot image to be written into the MBR. For the first session this works only if also "system_area=" and "bin_path=" or "dir=" is given. .br With types "any" and "grub" it shows a single partition which starts at byte 512 and ends where the ISO image ends. This works with or without system_area= or boot image. .br Bootspecs chrp_boot_part=, prep_boot_part=, and efi_boot_part= overwrite this entry in the MBR partition table. .br If types "isolinux" or "grub" are set to "patch", then "partition_table=on" is activated without new boot image. In this case the existing System Area gets checked whether it bears addresses and sizes as if it had been processed by "partition_table=on". If so, then those parameters get updated when the new System Area is written. .br Special "system_area=/dev/zero" causes 32k of NUL\-bytes. Use this to discard an MBR which was loaded with the ISO image. .br \fBappended_part_as=gpt\fR marks partitions from \-append_partition in GPT rather than in MBR. In this case the MBR shows a single partition of type 0xee which covers the whole output data. .br \fBappended_part_as=mbr\fR is the default. Appended partitions get marked in GPT only if GPT is produced because of other settings. If given explicitly, this clears setting "gpt" and "apm". Nevertheless "apm" may be added to "mbr". .br \fBappended_part_as=apm\fR marks partitions from \-append_partition in APM additionally to "mbr" or "gpt". .br By default, appended partitions get marked in APM only if APM is produced because of other options together with part_like_isohybrid="on". .br \fBchrp_boot_part=on\fR causes a single partition in MBR which covers the whole ISO image and has type 0x96. This is not compatible with any other feature that produces MBR partition entries. It makes GPT unrecognizable. .br \fBprep_boot_part=\fRdisk_path inserts the content of a data file into the image and marks it by an MBR partition of type 0x41. The parts of the ISO image before and after this partition will be covered by further MBR partitions. The data file is supposed to contain ELF executable code. .br \fBefi_boot_part=\fRdisk_path inserts the content of a data file into the image and marks it by a GPT partition. If not chrp_boot_part=on, then the first partition in MBR will have type 0xee to announce the presence of GPT. The data file is supposed to contain a FAT filesystem. .br Instead of a disk_path, the word \-\-efi\-boot\-image may be given. It exposes in GPT the content of the first El Torito EFI boot image as EFI system partition. EFI boot images are introduced by bootspec efi_path=. The affected EFI boot image cannot show up in HFS+ because it is stored outside the HFS+ partition. .br \fBpartition_offset=\fR2kb_block_adr causes a partition table with a single partition that begins at the given block address. This is counted in 2048 byte blocks, not in 512 byte blocks. If the block address is non\-zero then it must be at least 16. A non\-zero partition offset causes two superblocks to be generated and two sets of directory trees. The image is then mountable from its absolute start as well as from the partition start. .br The offset value of an ISO image gets preserved when a new session is added. So the value defined here is only in effect if a new ISO image gets written. .br \fBpartition_hd_cyl=\fRnumber gives the number of heads per cylinder for the partition table. 0 chooses a default value. Maximum is 255. .br \fBpartition_sec_hd=\fRnumber gives the number of sectors per head for the partition table. 0 chooses a default value. Maximum is 63. .br The product partition_sec_hd * partition_hd_cyl * 512 is the cylinder size. It should be divisible by 2048 in order to make exact alignment possible. With appended partitions and "appended_part_as=gpt" there is no limit for the number of cylinders. Else there may be at most 1024 of them. If the cylinder size is too small to stay below the limit, then appropriate values of partition_hd_cyl are chosen with partition_sec_hd 32 or 63. If the image is larger than 8,422,686,720 bytes, then the cylinder size constraints cannot be fulfilled for MBR. .br \fBpartition_cyl_align=\fRmode controls image size alignment to an integer number of cylinders. It is prescribed by isohybrid specs and it seems to please program fdisk. Cylinder size must be divisible by 2048. Images larger than 8,323,596,288 bytes cannot be aligned in MBR partition table. .br Mode "auto" is default. Alignment by padding happens only with "isolinux" "partition_table=on". .br Mode "on" causes alignment by padding with "partition_table=on" for any type. Mode "all" is like "on" but also pads up partitions from \-append_partition to an aligned size. .br Mode "off" disables alignment for any type. .br \fBmbr_force_bootable=\fRmode enforces an MBR partition with "bootable/active" flag if options like partition_table= or grub2_mbr= indicate production of a bootable MBR. These options normally cause the flag to be set if there is an MBR partition of type other than 0xee or 0xef. If no such partition exists, then no bootflag is set, unless mbr_force_bootable="on" forces creation of a dummy partition of type 0x00 which covers only the first block of the ISO image. .br If no bootable MBR is indicated and a partition gets created by \-append_partition, then mbr_force_bootable="on" causes a bootflag like it would do with a bootable MBR. .br \fBmips_path=\fRiso_rr_path declares a data file in the image to be a MIPS Big Endian boot file and causes production of a MIPS Big Endian Volume Header. This is mutually exclusive with production of other boot blocks like MBR. It will overwrite the first 512 bytes of any data provided by system_area=. Up to 15 boot files can be declared by mips_path=. .br \fBmipsel_path=\fRiso_rr_path declares a data file in the image to be the MIPS Little Endian boot file. This is mutually exclusive with other boot blocks. It will overwrite the first 512 bytes of any data provided by system_area=. Only a single boot file can be declared by mipsel_path=. .br \fBsparc_label=\fRtext causes the production of a SUN Disk Label with the given text as ASCII label. Partitions 2 to 8 may be occupied by appended images. Partition 1 will always be the ISO image. See command \-append_partition. The first 512 bytes of any data provided by system_area= will be overwritten. .br \fBgrub2_sparc_core=\fRiso_rr_path causes the content address and size of the given file to be written after the SUN Disk Label. Both numbers are counted in bytes. The address is written as 64 bit big\-endian number to byte 0x228. The size is written as 32 bit big\-endian number to byte 0x230. .br \fBhppa_cmdline=\fRtext sets the PALO command line for HP\-PA. Up to 1023 characters are permitted by default. With hppa_hdrversion=4 the limit is 127. .br Note that the first five hppa_ bootspecs are mandatory, if any of the hppa_ bootspecs is used. Only hppa_hdrversion= is allowed to be missing. .br \fBhppa_bootloader=\fRiso_rr_path designates the given path as HP\-PA bootloader file. .br \fBhppa_kernel_32=\fRiso_rr_path designates the given path as HP\-PA 32 bit kernel file. .br \fBhppa_kernel_64=\fRiso_rr_path designates the given path as HP\-PA 64 bit kernel file. .br \fBhppa_ramdisk=\fRiso_rr_path designates the given path as HP\-PA RAM disk file. .br \fBhppa_hdrversion=\fRnumber chooses between PALO header version 5 (default) and version 4. For the appropriate value see in PALO source code: PALOHDRVERSION. .br \fBalpha_boot=\fRiso_rr_path declares a data file in the image to be the DEC Alpha SRM Secondary Bootstrap Loader and causes production of a boot sector which points to it. This is mutually exclusive with production of other boot blocks like MBR. .br \fBmips_discard\fR, \fBsparc_discard\fR, \fBhppa_discard\fR, \fBalpha_discard\fR revoke any boot file declarations made for mips/mipsel, sparc, hppa, or alpha, respectively. This removes the ban on production of other boot blocks. .br \fBhfsplus_serial=\fRhexstring sets a string of 16 digits "0" to "9" and letters "a" to "f", which will be used as unique serial number of an emerging HFS+ filesystem. .br \fBhfsplus_block_size=\fRnumber sets the allocation block size to be used when producing HFS+ filesystems. Permissible are 512, 2048, or 0. The latter lets the program decide. .br \fBapm_block_size=\fRnumber sets the block size to be used when describing partitions by an Apple Partition Map. Permissible are 512, 2048, or 0. The latter lets the program decide. .br Note that size 512 is not compatible with production of GPT, and that size 2048 will not be mountable \-t hfsplus at least by older Linux kernels. .br .TP \fB\-append_partition\fR partition_number type_code disk_path Cause a prepared filesystem image to be appended to the ISO image and to be described by a partition table entry in a boot block at the start of the emerging ISO image. The partition entry will bear the size of the submitted file rounded up to the next multiple of 2048 bytes or to the next multiple of the cylinder size. .br Beware of subsequent multi\-session runs. The appended partition will get overwritten. .br Partitions may be appended with boot block type MBR and with SUN Disk Label. .br With MBR: .br partition_number may be 1 to 4. Number 1 will put the whole ISO image into the unclaimed space before partition 1. So together with most \fBxorriso\fR MBR features, number 2 would be the most natural choice. .br The type_code may be "FAT12", "FAT16", "Linux", or a hexadecimal number between 0x00 and 0xff. Not all those numbers will yield usable results. For a list of MBR partition type codes search the Internet for "Partition Types" or run fdisk command "L". .br type_code may also be a type GUID as plain hex string like a2a0d0ebe5b9334487c068b6b72699c7 or as structured text like EBD0A0A2\-B9E5\-4433\-87C0\-68B6B72699C7. It will be used if the partition is mentioned in GPT. In MBR, C12A7328\-F81F\-11D2\-BA4B\-00A0C93EC93B will be mapped to 0xef. Any other GUID will be mapped to 0x83. In APM, 48465300\-0000\-11AA\-AA11\-00306543ECAC will be mapped to partition type "Apple_HFS", any other to "Data". .br If some other command causes the production of GPT, then the appended partitions will be mentioned there too. .br The disk_path must provide the necessary data bytes at commit time. An empty disk_path disables this feature for the given partition number. .br With SUN Disk Label (selected by \-boot_image any sparc_label=): .br partition_number may be 2 to 8. Number 1 will always be the ISO image. Partition start addresses are aligned to 320 KiB. The type_code does not matter. Submit 0x0. .br Partition image name "." causes the partition to become a copy of the next lower valid one. .TP .B Jigdo Template Extraction: .PP From man genisoimage: "Jigdo is a tool to help in the distribution of large files like CD and DVD images; see http://atterer.net/jigdo/ for more details. Debian CDs and DVD ISO images are published on the web in jigdo format to allow end users to download them more efficiently." .br \fBxorriso\fR can produce a .jigdo and a .template file together with a single\-session ISO image. The .jigdo file contains checksums and symbolic file addresses. The .template file contains the compressed ISO image with reference tags instead of the content bytes of the listed files. .br Input for this process are the normal arguments for a \fBxorriso\fR session on a blank \-outdev, and a checksum file which lists those data files which may be listed in the .jigdo file and externally referenced in the .template file. Each designated file is represented in the checksum file by a single text line: .br Checksum as hex digits, 2 blanks, size as 12 decimal digits or blanks, 2 blanks, symbolic file address .br The kind of checksum is chosen by \-jigdo "checksum_algorithm" with values "md5" (32 hex digits) or "sha256" (64 hex digits). It will also be used for the file address lines in the .jigdo file. The default is "md5". .br The file address in a checksum file line has to bear the same basename as the disk_path of the file which it shall match. The directory path of the file address is decisive for To=From mapping, not for file recognition. After To=From mapping, the file address gets written into the .jigdo file. Jigdo restore tools will convert these addresses into really reachable data source addresses from which they can read. .br If the list of jigdo parameters is not empty, then \fBxorriso\fR will refuse to write to non\-blank targets, it will disable multi\-session emulation, and padding will be counted as part of the ISO image. .br .TP \fB\-jigdo\fR parameter_name value Clear Jigdo Template Extraction parameter list or add a parameter to that list. The alias names are the corresponding genisoimage options. They are accepted as parameter names as well. Especially they are recognized by the \-as mkisofs emulation command. .br Parameter \fBclear\fR with any value empties the whole list. No .jigdo and .template file will be produced. .br \fBchecksum_algorithm\fR chooses the checksum algorithm which shall be used for the data file entries in the .jigdo file and is expected in the checksum file. Permissible are "md5" or "sha256". Default is "md5". .br Alias: \-jigdo\-checksum\-algorithm .br \fBtemplate_path\fR sets the disk_path for the .template file with the holed and compressed ISO image copy. .br Alias: \-jigdo\-template .br \fBjigdo_path\fR sets the disk_path for the .jigdo file with the checksums and download addresses for filling the holes in .template. .br Alias: \-jigdo\-jigdo .br \fBchecksum_path\fR sets the disk_path where to find the checksum file with symbolic file addresses and checksums according to \fBchecksum_algorithm\fR. .br Alias: md5_path .br Alias: \-checksum\-list .br Alias: \-md5\-list .br \fBmin_size\fR sets the minimum size for a data file to be listed in the .jigdo file and being a hole in the .template file. .br Alias: \-jigdo\-min\-file\-size .br \fBexclude\fR adds a regular expression pattern which will get compared with the absolute disk_path of any data file. A match causes the file to stay in .template in any case. .br Alias: \-jigdo\-exclude .br \fBdemand_checksum\fR adds a regular expression pattern which will get compared with the absolute disk_path of any data file that was not found in the checksum list file as of "checksum_path". A match causes a MISHAP event. .br Alias: demand_md5 .br Alias: \-jigdo\-force\-checksum .br Alias: \-jigdo\-force\-md5 .br \fBmapping\fR adds a string pair of the form To=From to the parameter list. If a data file gets listed in the .jigdo file, then it is referred by the file address from its line in the checksum file. This file address gets checked whether it begins with the From string. If so, then this string will be replaced by the To string and a ':' character, before it goes into the .jigdo file. The From string should end by a '/' character. .br Alias: \-jigdo\-map .br \fBcompression\fR chooses one of "bzip2" or "gzip" for the compression of the template file. The jigdo file is put out uncompressed. .br Alias: \-jigdo\-template\-compress .br \fBchecksum_iso\fR chooses one or more of "md5", "sha1", "sha256", "sha512" for the auxiliary "# Image Hex" checksums in the jigdo file. The value may e.g. look like "md5,sha1,sha512". Value "all" chooses all available algorithms. Note that MD5 stays always enabled. .br Alias: \-checksum_algorithm_iso .br \fBchecksum_template\fR is like checksum_iso but for "# Template Hex". .br Alias: \-checksum_algorithm_template .TP .B Character sets: .PP File names are strings of non\-zero bytes with 8 bit each. Unfortunately the same byte string may appear as different peculiar national characters on differently nationalized terminals. The meanings of byte codes are defined in \fBcharacter sets\fR which have names. Shell command iconv \-l lists them. .br The file names on hard disk are assumed to be encoded by the \fBlocal character set\fR which is also used for the communication with the user. Byte codes 32 to 126 of the local character set must match the US\-ASCII characters of the same code. ISO\-8859 and UTF\-8 fulfill this demand. .br By default, \fBxorriso\fR uses the character set as told by shell command "locale" with argument "charmap". This may be influenced by environment variables LC_ALL, LC_CTYPE, or LANG and should match the expectations of the terminal. In some situations it may be necessary to set it by command \-local_charset. .br Local character sets should not matter as long as only english alphanumeric characters are used for file names or as long as all writers and readers of the media use the same local character set. Outside these constraints it may be necessary to let \fBxorriso\fR convert byte codes from and to other character sets. .br The Rock Ridge file names in ISO filesystems are assumed to be encoded by the \fBinput character set\fR. The Rock Ridge file names which get written with ISO filesystems will be encoded by the \fBoutput character set\fR. .br The sets can be defined independently by commands \-in_charset and \-out_charset. Normally one will have both identical, if ever. Other than the local character set, these two character sets may deviate from US\-ASCII. .br The output character sets for Joliet and HFS+ are not influenced by these commands. Joliet uses output character set UCS\-2 or UTF\-16. HFS+ uses UTF\-16. .br The default output charset is the local character set of the terminal where \fBxorriso\fR runs. So by default no conversion happens between local filesystem names and emerging Rock Ridge names in the image. The situation stays ambiguous and the reader has to riddle what character set was used. .br By command \-auto_charset it is possible to attribute the output charset name to the image. This makes the situation unambiguous. But if your terminal character set does not match the character set of the local file names, then this attribute can become plainly wrong and cause problems at read time. To prevent this it is necessary to check whether the terminal properly displays all intended filenames. Check especially the exotic national characters. .br To enforce recording of a particular character set name without any conversion at image generation time, set \-charset and \-local_charset to the desired name, and enable \-backslash_codes to avoid evil character display on your terminal. .TP \fB\-charset\fR character_set_name Set the character set from which to convert file names when loading an image and to which to convert when writing an image. .TP \fB\-local_charset\fR character_set_name Override the system assumption of the local character set name. If this appears necessary, one should consider to set \-backslash_codes to "on" in order to avoid dangerous binary codes being sent to the terminal. .TP .B Exception processing: .PP Since the tasks of \fBxorriso\fR are manifold and prone to external influence, there may arise the need for \fBxorriso\fR to report and handle problem events. .br Those events get classified when they are detected by one of the software modules and forwarded to reporting and evaluation modules which decide about reactions. Event classes are sorted by severity: .br "NEVER" The upper end of the severity spectrum. .br "ABORT" The program is being aborted and on its way to end. .br "FATAL" The main purpose of the run failed or an important resource failed unexpectedly. .br "FAILURE" An important part of the job could not be performed. .br "MISHAP" A FAILURE which can be tolerated during ISO image generation. .br "SORRY" A less important part of the job could not be performed. .br "WARNING" A situation is suspicious of being not intended by the user. .br "HINT" A proposal to the user how to achieve better results. .br "NOTE" A harmless information about noteworthy circumstances. .br "UPDATE" A pacifier message during long running operations. .br "DEBUG" A message which would only interest the program developers. .br "ALL" The lower end of the severity spectrum. .TP \fB\-abort_on\fR severity Set the severity threshold for events to abort the program. .br Useful: "NEVER", "ABORT", "FATAL", "FAILURE" , "MISHAP", "SORRY" .br It may become necessary to abort the program anyway, despite the setting by this command. Expect not many "ABORT" events to be ignorable. .br A special property of this command is that it works preemptive if given as program start argument. I.e. the first \-abort_on setting among the start arguments is in effect already when the first operations of \fBxorriso\fR begin. Only "\-abort_on" with dash "\-" is recognized that way. .TP \fB\-return_with\fR severity exit_value Set the threshold and exit_value to be returned at program end if no abort has happened. This is to allow \fBxorriso\fR to go on after problems but to get a failure indicating exit value from the program, nevertheless. Useful is a value lower than the \-abort_on threshold, down to "WARNING". .br exit_value may be either 0 (indicating success to the starter of the program) or a number between 32 and 63. Some other exit_values are used by \fBxorriso\fR if it decides to abort the program run: .br 1=abort due to external signal .br 2=no program arguments given .br 3=creation of \fBxorriso\fR main object failed .br 4=failure to start libburnia\-project.org libraries .br 5=program abort during argument processing .br 6=program abort during dialog processing .TP \fB\-report_about\fR severity Set the threshold for events to be reported. .br Useful: "SORRY", "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG", "ALL" .br Regardless what is set by \-report_about, messages get always reported if they reach the severity threshold of \-abort_on . .br Event messages are sent to the info channel "I" which is usually stderr but may be influenced by command \-pkt_output. Info messages which belong to no event get attributed severity "NOTE". .br A special property of this command is that the first \-report_about setting among the start arguments is in effect already when the first operations of \fBxorriso\fR begin. Only "\-report_about" with dash "\-" is recognized that way. .TP \fB\-signal_handling\fR mode Control the installation of a signal handler which shall react on external signals (e.g. from program "kill" or from keys Ctrl+C) or on signals caused by severe program errors. .br Mode "on" is the default. It uses the signal handler of libburn which produces ugly messages but puts much effort in releasing optical drives before \fBxorriso\fR ends. .br Mode "off" as first \-signal_handling among the start arguments prevents all own signal precautions of \fBxorriso\fR. Inherited signal handler settings stay as they are. .br It works like "sig_dfl" if given after other signal handling was already established at program start. .br Mode "sig_dfl" uses the system provided default handling of signals, which is normally a sudden abort of the program. To prevent stuck drives, the libburn handler is used during burning, blanking, and formatting on MMC drives. .br Mode "sig_ign" tries to ignore as many signal types as possible. This imposes the risk that \fBxorriso\fR refuses to end until externally kill \-9 if performed. kill \-9 then imposes the risk that the drive is left in unusable state and needs poweroff to be reset. So during burning, blanking, and formatting wait for at least their normal run time before killing externally. .br A special property of this command is that the first \-signal_handling setting among the start arguments is in effect already when the first operations of \fBxorriso\fR begin. Only "\-signal_handling" with dash "\-" is recognized that way. .TP \fB\-error_behavior\fR occasion behavior Control the program behavior at problem event occasions. For now this applies to occasions "image_loading" which is given while an image tree is read from the input device, and to "file_extraction" which is given with osirrox commands like \-extract. .br With "image_loading" there are three behaviors available: .br "best_effort" goes on with reading after events with severity below FAILURE if the threshold of command \-abort_on allows this. .br "failure" aborts image tree reading on first event of at least SORRY. It issues an own FAILURE event. This is the default. .br "fatal" acts like "failure" but issues the own event as FATAL. .br With occasion "file_extraction" there are three behaviors: .br "keep" maintains incompletely extracted files on disk. This is the default. .br "delete" removes files which encountered errors during content extraction. .br "best_effort" starts a revovery attempt by means of \-extract_cut if the file content stems from the loaded ISO image and is not filtered. .TP .B Dialog mode control: .TP \fB\-dialog\fR "on"|"off"|"single_line" Enable or disable to enter dialog mode after all program arguments are processed. In dialog mode input lines get prompted via readline or from stdin. .br If no \-abort_on severity was set when dialog starts, then "NEVER" is set to avoid abort in most cases of wrong input or other problems. Before dialog begins, the default is "FAILURE" which e.g. aborts on unknown commands. .br Mode "on" supports input of newline characters within quotation marks and line continuation by trailing backslash outside quotation marks. Mode "single_line" does not. .TP \fB\-page\fR length width Describe terminal to the text pager. See also above, paragraph Result pager. .br If parameter length is nonzero then the user gets prompted after that number of terminal lines. Zero length disables paging. .br Parameter width is the number of characters per terminal line. It is used to compute the number of terminal lines which get occupied by an output line. A usual terminal width is 80. .TP \fB\-use_readline\fR "on"|"off" If "on" then use readline for dialog. Else use plain stdin. .br See also above, paragraph Dialog, Readline, Result pager. .TP \fB\-reassure\fR "on"|"tree"|"off" If "on" then ask the user for "y" or "n": .br before deleting or overwriting any file in the ISO image, .br before overwriting any disk file during restore operations, .br before rolling back pending image changes, .br before committing image changes to media, .br before changing the input drive, .br before blanking or formatting media, .br before ending the program. .br With setting "tree" the reassuring prompt will appear for an eventual directory only once and not for each file in its whole subtree. .br Setting "off" silently kills any kind of image file object and performs above irrevocable actions. .br To really produce user prompts, command \-dialog needs to be set to "on". Note that the prompt does not appear in situations where file removal is forbidden by command \-overwrite. \-reassure only imposes an additional curb for removing existing file objects. .br Be aware that file objects get deleted from the ISO image immediately after confirmation. They are gone even if the running command gets aborted and its desired effect gets revoked. In case of severe mess\-up, consider to use \-rollback to revoke the whole session. .TP .B Drive and media related inquiry actions: .TP \fB\-devices\fR Show list of available MMC drives with the addresses of their libburn standard device files. .br This is only possible when no ISO image changes are pending. After this command was executed, there is no drive current and no image loaded. .br In order to be visible, a device has to offer rw\-permissions with its libburn standard device file. Thus it might be only the \fBsuperuser\fR who is able to see all drives. .br Drives which are occupied by other processes get not shown. .TP \fB\-device_links\fR Like \-devices, but presenting the drives with addresses of symbolic links which point to the actual device files. .br Modern GNU/Linux systems may shuffle drive addresses from boot to boot. The udev daemon is supposed to create links which always point to the same drive, regardless of its system address. The command \-device_links shows the addresses of such links if they begin by "/dev/dvd" or "/dev/cd". Precedence is: "dvdrw", "cdrw", "dvd", "cdrom", "cd". .TP \fB\-toc\fR .br Show media specific tables of content. This is the session history of the medium, not the ISO image directory tree. .br In case of overwritable media holding a valid ISO image, it may happen that only a single session gets shown. But if the first session on the overwritable media was written by \fBxorriso\fR then a complete session history can be emulated. .br A drive which is incapable of writing may show any media as CD\-ROM or DVD\-ROM with only one or two sessions on it. The last of these sessions is supposed to be the most recent real session then. .br Some read\-only drives and media show no usable session history at all. Command \-rom_toc_scan might help. .br If input device and output device are both acquired and not the same, then both tables\-of\-content get shown. .TP \fB\-toc_of\fR "in"|"out"|"all"[":short"] Like command \-toc but explicitly choosing which drive's table\-of\-content to show. "in" shows \-indev or \-dev, "out" shows \-outdev or \-dev, "all" shows the same as \-toc. .br If ":short" is appended to the drive choosing word, then only a short summary of drive state and medium content is printed. .br As further difference to \-toc, this command does not emit FAILURE events if the desired drive is not acquired. .TP \fB\-mount_cmd\fR drive entity id path Emit an appropriate command line for mounting the ISO session indicated by drive, entity and id. The result will be different on GNU/Linux and on FreeBSD or NetBSD. .br drive can be "indev" or "outdev" to indicate already acquired drives, or it can be the path of a not yet acquired drive. Prefix "stdio:" for non\-MMC drives is not mandatory. .br For entity and id, see also command \-load. They must be either "sbsector" with the superblock sector address as id, or "track" with a track number as id, or "session" with a session number, or "volid" with a search pattern for the volume id, or "auto" with which any text as id mounts the first track of the last session. .br path will be used as mount point and must already exist as a directory on disk. .br The command gets printed to the result channel. See command \-mount for direct execution of this command. .TP \fB\-mount_opts\fR option[:option...] Set options which influence \-mount and \-mount_cmd. Currently there is only option "exclusive" which is default and its counterpart "shared". The latter causes \fBxorriso\fR not to give up the affected drive with command \-mount. On GNU/Linux it adds mount option "loop" which may enable mounting of several sessions of the same block device at the same time. One should not write to a mounted optical medium, of course. Take care to umount all sessions before ejecting. .TP \fB\-session_string\fR drive entity id format Print to the result channel a text which gets composed according to format and the parameters of the addressed session. .br Formats "linux:"path or "freebsd:"path produce the output of \-mount_cmd for the given operating systems. .br In other texts \fBxorriso\fR will substitute the following parameter names. An optional prefix "string:" will be removed. .br "%device%" will be substituted by the mountable device path of the drive address. .br "%sbsector%" will be substituted by the session start sector. .br "%track%", "%session%", "%volid%" will be substituted by track number, session number, or volume id of the depicted session. .TP \fB\-print_size\fR Print the foreseeable consumption of 2048 byte blocks by next \-commit. This can last a while as a \-commit gets prepared and only in last moment is revoked by this command. The result depends on several settings and also on the kind of output device. If no \-jigdo options are set and not command \-as "mkisofs" was used, then \-padding (300 kB by default) is not counted as part of the image size. .br If an El Torito boot image file is already depicted, then command \-print_size automatically executes \-boot_image "any" "next". This means that the properties of that boot image cannot be edited by subsequent commands. .TP \fB\-tell_media_space\fR Print available space on the output medium and the free space after subtracting already foreseeable consumption by next \-commit. .br Note that the title of the prediction "After commit :" is misleading. It is rather the space that may still be filled in this session without making the next \-commit fail from medium overflow. .br The free space after the next \-commit might be smaller by several MB. This depends on medium type, number of recorded sessions, and drive habits. .TP \fB\-pvd_info\fR Print various ID strings and timestamps which can be found in loaded ISO images. Some of the IDs may be changed by commands like \-volid or \-publisher. For these IDs \-pvd_info reports what would be written with the next \-commit. The timestamps get not automatically propagated from loaded image to newly written image. The ones for new images may be set by command \-volume_date. See there for the meaning of the particular timestamps. .TP \fB\-report_el_torito\fR mode .br With mode \fBplain\fR print a report about the information found in the El Torito boot catalog of the loaded ISO image. .br With mode \fBhelp\fR print a text which explains the meaning of the lines put out by "plain". .br Mode \fBcmd\fR tries to print the \fBxorriso\fR commands which are necessary to produce the found boot equipment: disk identifiers, El Torito boot images, and System Area. Disk identifiers are strings which the booting operating system might use to find the ISO filesystem from where it comes. Currently known is the use of volume id and modification date. .br The intended use case is modification of the filesystem by having \-indev and \-outdev pointing to different images or drives. The result might be insufficient, if the found equipment cannot be produced by xorriso. Various SORRY events may arise in this case, but it is not guaranteed that xorriso recognizes all its insufficiencies. .br Mode \fBas_mkisofs\fR tries to print the \fBxorriso \-as mkisofs\fR options, which are necessary to produce the found equipment. The intended use case is to use the mounted filesystem as input tree together with the printed options. .TP \fB\-report_system_area\fR mode With mode \fBplain\fR print a report about the information found in the System Area of the loaded ISO image. The report consists of zero to many lines with a header text, a colon, and information text. .br With mode \fBhelp\fR print a text which explains the meaning of the lines put out by "plain". You probably will have to look for more documentation which explains the technical details of the mentioned boot facilities. .br Modes \fBcmd\fR and \fBas_mkisofs\fR work like with command \-report_el_torito. See above. .br With mode \fBgpt_disk_guid\fR print the GPT disk GUID of the loaded ISO in RFC 4122 text format to result channel. It is not considered an error if no GPT is present. In this case nothing is printed to result channel. .br With mode \fBgpt_crc_of:\fRdisk_path read up to 32 KiB from the disk file with the path given after the colon. Compute the GPT compliant CRC number and print it to the result channel. The number is shown like "0x690fd979". The special disk_path "\-" causes reading from standard input. .br With mode \fBmake_guid\fR print a pseudo\-random GUID in RFC 4122 text format to result channel. .TP .B Navigation in ISO image and disk filesystem: .TP \fB\-cd\fR iso_rr_path Change the current working directory in the ISO image. This is prepended to iso_rr_paths which do not begin with '/'. .br It is possible to set the working directory to a path which does not exist yet in the ISO image. The necessary parent directories will be created when the first file object is inserted into that virtual directory. Use \-mkdir if you want to enforce the existence of the directory already at first insertion. .TP \fB\-cdx\fR disk_path Change the current working directory in the local filesystem. To be prepended to disk_paths which do not begin with '/'. .TP \fB\-pwd\fR .br Tell the current working directory in the ISO image. .TP \fB\-pwdx\fR .br Tell the current working directory in the local filesystem. .TP \fB\-ls\fR iso_rr_pattern [***] List files in the ISO image which match shell patterns (i.e. with wildcards '*' '?' '[a\-z]'). If a pattern does not begin with '/' then it is compared with addresses relative to \-cd. .br Directories are listed by their content rather than as single file item. .br Pattern expansion may be disabled by command \-iso_rr_pattern. .TP \fB\-lsd\fR iso_rr_pattern [***] Like \-ls but listing directories as themselves and not by their content. This resembles shell command ls \-d. .TP \fB\-lsl\fR iso_rr_pattern [***] Like \-ls but also list some of the file attributes. The output format resembles shell command ls \-ln. .br File type 'e' indicates the El Torito boot catalog. .br If the file has non\-trivial ACL, then a '+' is appended to the permission info. If the file is hidden, then 'I' for "iso_rr", 'J' for "joliet", 'A' for "hfsplus", 'H' for multiple hiding gets appended. Together with ACL it is 'i', 'j', 'a', 'h'. .TP \fB\-lsdl\fR iso_rr_pattern [***] Like \-lsd but also list some of the file attributes. The output format resembles shell command ls \-dln. .TP \fB\-lsx\fR disk_pattern [***] List files in the local filesystem which match shell patterns. Patterns which do not begin with '/' are used relative to \-cdx. .br Directories are listed by their content rather than as single file item. .br Pattern expansion may be disabled by command \-disk_pattern. .TP \fB\-lsdx\fR disk_pattern [***] Like \-lsx but listing directories as themselves and not by their content. This resembles shell command ls \-d. .TP \fB\-lslx\fR disk_pattern [***] Like \-lsx but also listing some of the file attributes. Output format resembles shell command ls \-ln. .TP \fB\-lsdlx\fR disk_pattern [***] Like \-lsdx but also listing some of the file attributes. Output format resembles shell command ls \-dln. .TP \fB\-getfacl\fR iso_rr_pattern [***] Print the access permissions of the given files in the ISO image using the format of shell command getfacl. If a file has no ACL then it gets fabricated from the \-chmod settings. A file may have a real ACL if it was introduced into the ISO image while command \-acl was set to "on". .TP \fB\-getfacl_r\fR iso_rr_pattern [***] Like \-gefacl but listing recursively the whole file trees underneath eventual directories. .TP \fB\-getfattr\fR iso_rr_pattern [***] Print the xattr of the given files in the ISO image. If a file has no such xattr then noting is printed for it. The choice of namespaces depends on the setting of command \-xattr: "on" or "user" restricts it to namespace "user", "any" only omits namespace "isofs". .TP \fB\-getfattr_r\fR iso_rr_pattern [***] Like \-gefattr but listing recursively the whole file trees underneath of directories. .TP \fB\-du\fR iso_rr_pattern [***] Recursively list size of directories and files in the ISO image which match one of the patterns. similar to shell command du \-k. .TP \fB\-dus\fR iso_rr_pattern [***] List size of directories and files in the ISO image which match one of the patterns. Similar to shell command du \-sk. .TP \fB\-dux\fR disk_pattern [***] Recursively list size of directories and files in the local filesystem which match one of the patterns. Similar to shell command du \-k. .TP \fB\-dusx\fR disk_pattern [***] List size of directories and files in the local filesystem which match one of the patterns. Similar to shell command du \-sk. .TP \fB\-findx\fR disk_path [-name pattern] [-type t] [-exec action [params]] -- Like \-find but operating on local filesystem and not on the ISO image. This is subject to the settings of \-follow. .br \-findx accepts the same \-type parameters as \-find. Additionally it recognizes type "mountpoint" (or "m") which matches subdirectories which reside on a different device than their parent. It never matches the disk_path given as start address for \-findx. .br \-findx accepts the \-exec actions as does \-find. But except the following few actions it will always perform action "echo". .br \fBin_iso\fR reports the path if its counterpart exists in the ISO image. For this the disk_path of the \-findx command gets replaced by the iso_rr_path given as parameter. .br E.g.: \-findx /home/thomas \-exec in_iso /thomas_on_cd \-\- .br \fBnot_in_iso\fR reports the path if its counterpart does not exist in the ISO image. The report format is the same as with command \-compare. .br \fBadd_missing\fR iso_rr_path_start adds the counterpart if it does not yet exist in the ISO image and marks it for "rm_merge" as non\-removable. .br E.g.: \-findx /home/thomas \-exec add_missing /thomas_on_cd \-\- .br \fBis_full_in_iso\fR reports if the counterpart in the ISO image contains files. To be used with \-type "m" to report mount points. .br \fBempty_iso_dir\fR deletes all files from the counterpart in the ISO image. To be used with \-type "m" to truncate mount points. .br \fBestimate_size\fR prints a lower and an upper estimation of the number of blocks which the found files together will occupy in the emerging ISO image. This does not account for the superblock, for the directories in the \-findx path, or for image padding. .br \fBlist_extattr\fR mode prints a script to the result channel, which would use FreeBSD command setextattr to set the file's xattr name\-value pairs of user namespace. See \-find for a description of parameter mode. .br E.g. \-exec list_extattr e \-\- .TP \fB\-compare\fR disk_path iso_rr_path Compare attributes and eventual data file content of a fileobject in the local filesystem with a file object in the ISO image. The iso_rr_path may well point to an image file object which is not yet committed, i.e. of which the data content still resides in the local filesystem. Such data content is prone to externally caused changes. .br If iso_rr_path is empty then disk_path is used as path in the ISO image too. .br Differing attributes are reported in detail, differing content is summarized. Both to the result channel. In case of no differences no result lines are emitted. .TP \fB\-compare_r\fR disk_path iso_rr_path Like \-compare but working recursively. I.e. all file objects below both addresses get compared whether they have counterparts below the other address and whether both counterparts match. .TP \fB\-compare_l\fR disk_prefix iso_rr_prefix disk_path [***] Perform \-compare_r with each of the disk_path parameters. iso_rr_path will be composed from disk_path by replacing disk_prefix by iso_rr_prefix. .TP \fB\-show_stream\fR iso_rr_path [***] Display the content stream chain of data files in the ISO image. The chain consists of the iso_rr_name and one or more streams, separated by " < " marks. A stream description consists of one or more texts, separated by ":" characters. The first text tells the stream type, the following ones, if ever, describe its individual properties. Frequently used types are: .br disk:'disk_path' for local filesystem objects. .br image:'iso_rr_path' for ISO image file objects. .br cout:'disk_path offset count' for \-cut_out files. .br extf:'filter_name' for external filters. .br \-\-zisofs:algorithm:block_size for zisofs compression filters. .br \-\-zisofs\-decode:algorithm:block_size for zisofs uncompression filters. .br \-\-gzip for internal gzip compression filters. .br \-\-gunzip for internal gzip uncompression filters. .br Example: .br '/abc/xyz.gz' < extf:'gzip' < disk:'/home/me/x' .TP \fB\-show_stream_r\fR iso_rr_path [***] Like \-show_stream but working recursively. .TP .B Evaluation of readability and recovery: .PP It is not uncommon that optical media produce read errors. The reasons may be various and get obscured by error correction which is performed by the drives and based on extra data on the media. If a drive returns data then one can quite trust that they are valid. But at some degree of read problems the correction will fail and the drive is supposed to indicate error. .br \fBxorriso\fR can scan a medium for readable data blocks, classify them according to their read speed, save them to a file, and keep track of successfully saved blocks for further tries on the same medium. .br By command \-md5 checksums may get recorded with data files and whole sessions. These checksums are reachable only via indev and a loaded image. They work independently of the media type and can detect transmission errors. .TP \fB\-check_media\fR [option [option ...]] -- Try to read data blocks from the indev drive, optionally copy them to a disk file, and finally report about the encountered quality. Several options may be used to modify the default behavior. .br The parameters given with this command override the default settings which may have been changed by command \-check_media_defaults. See there for a description of available options. .br The result list tells intervals of 2 KiB blocks with start address, number of blocks and quality. Qualities which begin with "+" are supposed to be valid readable data. Qualities with "\-" are unreadable or corrupted data. "0" indicates qualities which are not covered by the check run or are regularly allowed to be unreadable (e.g. gaps between tracks). .br Alternatively it is possible to report damaged files rather than blocks. .br If \-md5 is "on" then the default mode what=tracks looks out for libisofs checksum tags for the ISO session data and checks them against the checksums computed from the data stream. .TP \fB\-check_media_defaults\fR [option [option ...]] -- Preset options for runs of \-check_media, \-extract_cut and best_effort file extraction. Options given with \-check_media will override the preset options. \-extract_cut will override some options automatically. .br An option consists of a keyword, a "=" character, and a value. Options may override each other. So their sequence matters. .br The default setting at program start is: .br use=indev what=tracks min_lba=\-1 max_lba=\-1 retry=default .br time_limit=28800 item_limit=100000 data_to='' event=ALL .br abort_file=/var/opt/xorriso/do_abort_check_media .br sector_map='' map_with_volid=off patch_lba0=off report=blocks .br bad_limit=invalid slow_limit=1.0 chunk_size=0s async_chunks=0 .br Option "reset=now" restores these startup defaults. .br Non\-default options are: .br \fBreport="files"\fR lists the files which use damaged blocks (not with use=outdev). The format is like with find \-exec report_damage. Note that a MD5 session mismatch marks all files of the session as damaged. If finer distinction is desired, perform \-md5 off before \-check_media. .br \fBreport="blocks_files"\fR first lists damaged blocks and then affected files. .br \fBuse="outdev"\fR reads from the output drive instead of the input drive. This avoids loading the ISO image tree from media. .br \fBuse="sector_map"\fR does not read any media but loads the file given by option sector_map= and processes this virtual outcome. .br \fBwhat="disc"\fR scans the payload range of a medium without respecting track gaps. .br \fBwhat="image"\fR similar to "disc", but restricts scanning to the range of the ISO 9660 image, if present. .br \fBmin_lba=limit\fR omits all blocks with addresses lower than limit. .br \fBmax_lba=limit\fR switches to what=disc and omits all blocks above limit. .br \fBchunk_size=size\fR sets the number of bytes to be read in one low\-level read operation. This gets rounded down to full blocks of 2048 bytes. 0 means automatic size. .br \fBretry="on"\fR forces read retries with minimal senseful chunk size when the normal read chunk produces a read error. This size is 1s with CD and stdio files, 16s with DVD (1 ECC Block), and 32s with BD (1 Cluster). By default, retries are only enabled with CD media. "retry=off" forbits retries for all media types. .br \fBabort_file=disk_path\fR gives the path of the file which may abort a scan run. Abort happens if the file exists and its mtime is not older than the start time of the run. Use shell command "touch" to trigger this. Other than an aborted program run, this will report the tested and untested blocks and go on with running \fBxorriso\fR. .br \fBtime_limit=seconds\fR gives the number of seconds after which the scan shall be aborted. This is useful for unattended scanning of media which may else overwork the drive in its effort to squeeze out some readable blocks. Abort may be delayed by the drive gnawing on the last single read operation. Value \-1 means unlimited time. .br \fBitem_limit=number\fR gives the number of report list items after which to abort. Value \-1 means unlimited item number. .br \fBdata_to=disk_path\fR copies the valid blocks to the given file, which must support random access writing, unless disk_path is "\-" which means standard output. .br In the latter case, patch_lba0= settings other than "off" yield failure. Further the usual result messages of \-check_media get redirected to the info channel. But beware of result messages from other commands. Beware of \-*dev "\-" which redirect standard output to standard error. Keep the run simple: .br xorriso \-indev /dev/sr0 \-check_media data_to=\- \-\- | md5sum .br xorriso \-outdev /dev/sr0 \-check_media data_to=\- use=outdev \\ what=disc min_lba=0 max_lba=999999 \-\- | sha256sum .br \fBevent=severity\fR sets the given severity for a problem event which shall be issued at the end of a check run if data blocks were unreadable or failed to match recorded MD5 checksums. Severity "ALL" disables this event. .br \fBsector_map=disk_path\fR tries to read the file given by disk_path as sector bitmap and to store such a map file after the scan run. The bitmap tells which blocks have been read successfully in previous runs. It is the persistent memory for several scans on the same medium, even with intermediate eject, in order to collect readable blocks whenever the drive is lucky enough to produce them. The stored file contains a human readable TOC of tracks and their start block addresses, followed by binary bitmap data. .br By default, untested blocks are not considered bad, but rather as intentionally unread. If you expect time_limit= or item_limit= to abort the run, then consider to use bad_limit="untested". .br \fBmap_with_volid="on"\fR examines tracks whether they are ISO images and prints their volume IDs into the human readable TOC of sector_map=. .br \fBpatch_lba0="on"\fR transfers within the data_to= file a copy of the currently loaded session head to the start of that file and patches it to be valid at that position. This makes the loaded session the last valid session of the image file when it gets mounted or loaded as stdio: drive. New sessions will be appended after this last session and will overwrite any sessions which have followed it. .br \fBpatch_lba0="force"\fR performs patch_lba0="on" even if \fBxorriso\fR believes that the copied data are not valid. .br patch_lba0= may also bear a number. If it is 32 or higher it is taken as start address of the session to be copied. In this case it is not necessary to have an \-indev and a loaded image. ":force" may be appended after the number. .br \fBbad_limit=threshold\fR sets the highest quality which shall be considered as damage. Choose one of "good", "md5_match", "slow", "partial", "valid", "untested", "md5_mismatch", "invalid", "tao_end", "off_track", "unreadable". .br "valid" and "invalid" are qualities imported from a sector_map file. "tao_end" and "off_track" are intentionally not readable, but not bad either. "partial" are blocks retrieved from a partially readable chunk. They are supposed to be ok but stem from a suspicious neighborhood. .br "md5_match" and "md5_mismatch" regions overlap with regions of other quality. The former is a strong confirmation for quality, the latter only tells that one or more blocks of the region must be wrong. .br By default bad_limit is set higher than md5_mismatch, so that mismatches are classified as quality class "0" rather than "\-". This means that the sectors of a MD5 mismatch range are recorded in the sector_map as successfully read, if the drive handed them out at all. Set "bad_limit=md5_mismatch" to let the sector_map record the whole mismatching range as yet not retrieved. .br \fBslow_limit=threshold\fR sets the time threshold for a single read chunk to be considered slow. This may be a fractional number like 0.1 or 1.5. .br \fBasync_chunks=number\fR enables asynchronous MD5 processing if number is 2 or larger. In this case the given number of read chunks is allocated as fifo buffer. On very fast MMC drives try: chunk_size=64s async_chunks=16. .TP \fB\-check_md5\fR severity iso_rr_path [***] Compare the data content of the given files in the loaded image with their recorded MD5 checksums, if there are any. In case of any mismatch an event of the given severity is issued. It may then be handled by appropriate settings of commands \-abort_on or \-return_with which both can cause non\-zero exit values of the program run. Severity ALL suppresses that event. .br This command reports match and mismatch of data files to the result channel. Non\-data files cause NOTE events. There will also be UPDATE events from data reading. .br If no iso_rr_path is given then the whole loaded session is compared with its MD5 sum. Be aware that this covers only one session and not the whole image if there are older sessions. .TP \fB\-check_md5_r\fR severity iso_rr_path [***] Like \-check_md5 but checking all data files underneath the given paths. Only mismatching data files will be reported. .TP .B osirrox ISO-to-disk restore commands: .PP Normally \fBxorriso\fR only writes to disk files which were given as stdio: pseudo\-drives or as log files. But its alter ego osirrox is able to extract file objects from ISO images and to create, overwrite, or delete file objects on disk. .br Disk file exclusions by \-not_mgt, \-not_leaf, \-not_paths apply. If disk file objects already exist then the settings of \-overwrite and \-reassure apply. But \-overwrite "on" only triggers the behavior of \-overwrite "nondir". I.e. directories cannot be deleted. .br Access permissions of files in the ISO image do not restrict restoring. The directory permissions on disk have to allow rwx. .TP \fB\-osirrox\fR setting[:option:...] Setting \fBoff\fR disables disk filesystem manipulations. This is the default unless the program was started with leafname \fBosirrox\fR. Elsewise the capability to restore files can be enabled explicitly by \-osirrox \fBon\fR. It can be irrevocably disabled by \-osirrox \fBbanned\fR. .br The setting \fBblocked\fR is like \fBoff\fR. But it can only be revoked by setting \fBunblock\fR, which elsewise is like \fBon\fR. This can be used to curb command scripts which might use \fBon\fR undesiredly. .br To enable restoring of special files by \fBdevice_files\fR is potentially dangerous. The meaning of the number st_rdev (see man 2 stat) depends much on the operating system. Best is to restore device files only to the same system from where they were copied. If not enabled, device files in the ISO image are ignored during restore operations. .br Due to a bug of previous versions, device files from previous sessions might have been altered to major=0, minor=1. So this combination does not get restored. .br Option \fBconcat_split_on\fR is default. It enables restoring of split file directories as data files if the directory contains a complete collection of \-cut_out part files. With option \fBconcat_split_off\fR such directories are handled like any other ISO image directory. .br Option \fBauto_chmod_off\fR is default. If \fBauto_chmod_on\fR is set then access restrictions for disk directories get circumvented if those directories are owned by the effective user who runs \fBxorriso\fR. This happens by temporarily granting rwx permission to the owner. .br Option \fBsort_lba_on\fR may improve read performance with optical drives. It can restore large numbers of hard links without exhausting \-temp_mem_limit. It does not preserve directory mtime and it needs \-osirrox option auto_chmod_on in order to extract directories which offer no write permission. Default is \fBsort_lba_off\fR. .br Option \fBo_excl_on\fR is the default unless the program was started with leafname "osirrox". On GNU/Linux it tries to avoid using drives which are mounted or in use by other libburn programs. Option \fBo_excl_off\fR on GNU/Linux enables access to such drives by the equivalent of \-drive_access "shared:readonly". I.e. drives which get acquired while \fBo_excl_off\fR will refuse to get blanked, formatted, written, or ejected. But be aware that even harmless inquiries can spoil ongoing burns of CD\-R[W] and DVD\-R[W]. .br Option \fBstrict_acl_off\fR is default. It tolerates on FreeBSD the presence of directory "default" ACLs in the ISO image. With \fBstrict_acl_on\fR these GNU/Linux ACLs cause on FreeBSD a FAILURE event during restore with \-acl "on". .br Option \fBcheck_md5_off\fR disables MD5 checking during copy to disk. The default option \fBcheck_md5_on\fR enables it if \-md5 is "on". If a data file with recorded MD5 is copied as a whole to the disk filesystem, then the MD5 of the copied content gets computed and compared with the recorded MD5. A mismatch causes an error message of severity SORRY. Option \fBcheck_md5_force\fR causes an error message if \-md5 is "on" but no MD5 is recorded for the data file. .br Option \fBsparse=\fR controls production of sparse files during extraction of files from the ISO filesystem. Default is \fBsparse=off\fR. .br A positive number like in \fBsparse=1m\fR sets the minimum requirement for the length of a sequence of 0\-bytes which shall be represented by a gap. This saves disk space if the disk filesystem supports sparse files. A gap gets created by help of lseek(2) if a sequence of read buffers, which contain only 0\-bytes, bears at least the minimum amount of bytes. Expect read buffers to be in the size range of 32k or 64k. .br Command \-paste_in creates gaps only if the writing begins at or after the end of the existing disk file. So the sequence of \-paste_in commands matters. Command \-concat does not create sparse files. .TP \fB\-extract\fR iso_rr_path disk_path Copy the file objects at and underneath iso_rr_path to their corresponding addresses at and underneath disk_path. This is the inverse of \-map or \-update_r. .br If iso_rr_path is a directory and disk_path is an existing directory then both trees will be merged. Directory attributes get extracted only if the disk directory is newly created by the copy operation. Disk files get removed only if they are to be replaced by file objects from the ISO image. .br As many attributes as possible are copied together with restored file objects. .TP \fB\-extract_single\fR iso_rr_path disk_path Like \-extract, but if iso_rr_path is a directory then its sub tree gets not restored. .TP \fB\-extract_l\fR iso_rr_prefix disk_prefix iso_rr_path [***] Perform \-extract with each of the iso_rr_path parameters. disk_path will be composed from iso_rr_path by replacing iso_rr_prefix by disk_prefix. .TP \fB\-extract_cut\fR iso_rr_path byte_offset byte_count disk_path Copy a byte interval from a data file out of an ISO image into a newly created disk file. The main purpose for this is to offer a way of handling large files if they are not supported by mount \-t iso9660 or if the target disk filesystem cannot store large files. .br If the data bytes of iso_rr_path are stored in the loaded ISO image, and no filter is applied, and byte_offset is a multiple of 2048, then a special run of \-check_media is performed. It may be quicker and more rugged than the general reading method. .TP \fB\-cpx\fR iso_rr_path [***] disk_path Copy single leaf file objects from the ISO image to the address given by disk_path. If more then one iso_rr_path is given then disk_path must be a directory or non\-existent. In the latter case it gets created and the extracted files get installed in it with the same leafnames. .br Missing directory components in disk_path will get created, if possible. .br Directories are allowed as iso_rr_path only with \-osirrox "concat_split_on" and only if they actually represent a complete collection of \-cut_out split file parts. .TP \fB\-cpax\fR iso_rr_path [***] disk_path Like \-cpx but restoring mtime, atime as in ISO image and trying to set ownership and group as in ISO image. .TP \fB\-cp_rx\fR iso_rr_path [***] disk_path Like \-cpx but also extracting whole directory trees from the ISO image. .br The resulting disk paths are determined as with shell command cp \-r : If disk_path is an existing directory then the trees will be inserted or merged underneath this directory and will keep their leaf names. The ISO directory "/" has no leaf name and thus gets mapped directly to disk_path. .TP \fB\-cp_rax\fR iso_rr_path [***] disk_path Like \-cp_rx but restoring mtime, atime as in ISO image and trying to set ownership and group as in ISO image. .TP \fB\-paste_in\fR iso_rr_path disk_path byte_offset byte_count Read the content of a ISO data file and write it into a data file on disk beginning at the byte_offset. Write at most byte_count bytes. This is the inverse of command \-cut_out. .TP \fB\-concat\fR mode [target | lim prog [args [...]] lim] iso_rr_path [***] Copy the data content of one or more data files of the ISO image into a disk file object, into a file descriptor, or start a program and copy the data into its standard input. The latter is subject to the security restrictions for external filters. .br Modes \fBoverwrite\fR and \fBappend\fR write into the target which is given by the second parameter. This may be the path to a disk file object, or "\-" which means standard output, or a text of the form /dev/fd/number, where number is an open file descriptor (e.g. standard error is /dev/fd/2). An existing target file is not removed before writing begins. If it is not able to take content data, then this command fails. Mode overwrite truncates regular data files to 0 size before writing into them. Example: .br \-concat append /home/me/accumulated_text /my/iso/text \-\- .br Mode \fBpipe\fR expects as second parameter a delimiter word which shall mark the end of the program argument list. The third argument is the disk_path to the program. It must contain at least one '/'. $PATH is not applied. Further parameters up to the announced delimiter word are used as arguments with the program start. Example: .br \-iso_rr_pattern on \\ .br \-concat pipe + /usr/bin/wc + "/my/iso/files*" \-\- .br The further parameters in all modes are the iso_rr_paths of data files. Their content gets concatenated in the copy. .TP \fB\-extract_boot_images\fR disk_path Copy boot equipment to disk, which is not necessarily represented as data files in the ISO filesystem. The data get written into various files in a disk directory, which may already exist or of which the parent must exist so that it can get created. .br Files may be missing if their corresponding information is not present in the ISO filesystem. Existing files do not get overwritten but rather cause a failure event. .br The same data may appear in different files. E.g. the El Torito boot image for EFI is often the same data as the EFI partition in MBR or GPT. .br File "eltorito_catalog.img" contains the El Torito Boot Catalog. .br Files "eltorito_img*_*.img" contain El Torito Boot images. The first "*" gives the image number, the second "*" gives the type: "bios", "mac", "ppc", "uefi", or a hex number. .br File "mbr_code_isohybrid.img" contains the ISOLINUX MBR template. .br File "mbr_code_grub2.img" contains the GRUB2 MBR template. .br File "systemarea.img" contains the whole 32 KiB of System Area if not all zero. .br Files "mbr_part*_efi.img" contain EFI partition images from the MBR partition table. The "*" text part gives the partition number. .br Files "mbr_part*_prep.img" contain PReP partition images. .br Files "gpt_part*_efi.img" contain EFI partition images from GPT. .br Files "gpt_part*_hfsplus.img" contain HFS+ partition images from GPT. To avoid extracting the whole HFS+ aspect of hybrid ISO filesystems, the partition image is extracted only if it has less than half of the size of the ISO filesystem or if the partition is outside the ISO filesystem. .TP \fB\-mount\fR drive entity id path Produce the same line as \-mount_cmd and then execute it as external program run after giving up the depicted drive. See also \-mount_opts. This demands \-osirrox to be enabled and normally will succeed only for the superuser. For safety reasons the mount program is only executed if it is reachable as /bin/mount or /sbin/mount. .TP .B Command compatibility emulations: .PP Writing of ISO 9660 on CD is traditionally done by program mkisofs as ISO 9660 image producer and cdrecord as burn program. \fBxorriso\fR does not strive for their comprehensive emulation. Nevertheless it is ready to perform some of its core tasks under control of commands which in said programs trigger comparable actions. .TP \fB\-as\fR personality option [options] -- .br Perform the variable length option list as sparse emulation of the program depicted by the personality word. .br Personality "\fBmkisofs\fR" accepts the options listed with: .br \-as mkisofs \-help \-\- .br Among them: \-R (always on), \-r, \-J, \-o, \-M, \-C, \-dir\-mode, \-file\-mode, \-path\-list, \-m, \-exclude\-list, \-f, \-print\-size, \-pad, \-no\-pad, \-V, \-v, \-version, \-graft\-points, \-z, \-no\-emul\-boot, \-b, \-c, \-boot\-info\-table, \-boot\-load\-size, \-input\-charset, \-G, \-output\-charset, \-U, \-hide, \-hide\-joliet, \-hide\-list, \-hide\-joliet\-list, file paths and pathspecs. A lot of options are not supported and lead to failure of the mkisofs emulation. Some are ignored, but better do not rely on this tolerance. .br The supported options are documented in detail in xorrisofs.info and in man xorrisofs. The description here is focused on the effect of mkisofs emulation in the context of a \fBxorriso\fR run. .br Other than with the "cdrecord" personality there is no automatic \-commit at the end of a "mkisofs" option list. Verbosity settings \-v (= "UPDATE") and \-quiet (= "SORRY") persist. The output file persists until things happen like \-commit, \-rollback, \-dev, or end of \fBxorriso\fR. .br Options which affect all file objects in the ISO image, like \-r or \-dir\-mode, will be applied only to files which are present in the ISO image when the command \-as ends. If you use several \-as mkisofs commands in the same run, then consider to put such options into the last \-as command. .br If files are added to the image, then \-pacifier gets set to "mkisofs" and \-stdio_sync is defaulted to "off" if no such setting was made yet. .br \-graft\-points is equivalent to \-pathspecs on. Note that pathspecs without "=" are interpreted differently than with \fBxorriso\fR command \-add. Directories get merged with the root directory of the ISO image, other filetypes get mapped into that root directory. .br If pathspecs are given and if no output file was chosen before or during the "mkisofs" option list, then standard output (\-outdev "\-") will get into effect. If \-o points to a regular file, then it will be truncated to 0 bytes when finally writing begins. This truncation does not happen if the drive is chosen by \fBxorriso\fR commands before \-as mkisofs or after its list delimiter. Directories and symbolic links are no valid \-o targets. .br Writing to stdout is possible only if \-as "mkisofs" was among the start arguments or if other start arguments pointed the output drive to standard output. .br \-print\-size inhibits automatic image production at program end. This ban is lifted only if the pending image changes get discarded. .br Padding is counted as part of the ISO image if not option \-\-emul\-toc is given. .br If no \-iso\-level is given, then level 1 is chosen when the first file or directory is added to the image. At the same occasion directory names get allowed to violate the standard by \-compliance option allow_dir_id_ext. This may be avoided by option \-disallow_dir_id_ext. .br Option \-root is supported. Option \-old\-root is implemented by \fBxorriso\fR commands \-mkdir, \-cp_clone, \-find update_merge, and \-find rm_merge. \-root and \-old\-root set command \-disk_dev_ino to "ino_only" and \-md5 to "on", by default. \-disk_dev_ino can be set to "off" by \-\-old\-root\-no\-ino or to "on" by \-\-old\-root\-devno . \-md5 can be set to "off" by \-\-old\-root\-no\-md5 . .br Not original mkisofs options are \-\-quoted_path_list , \-\-hardlinks , \-\-acl , \-\-xattr , \-\-md5 , \-\-stdio_sync . They work like the \fBxorriso\fR commands with the same name and hardcoded parameter "on", e.g. \-acl "on". Explicit parameters are expected by \-\-stdio_sync and \-\-scdbackup_tag. .br The capability to preserve multi\-session history on overwritable media gets disabled by default. It can be enabled by using \-\-emul\-toc with the first session. See \-compliance no_emul_toc. .br \-\-sort\-weight gets as parameters a number and an iso_rr_path. The number becomes the LBA sorting weight of regular file iso_rr_path or of all regular files underneath directory iso_rr_path. (See \-find \-exec sort_weight). .br Adopted from grub\-mkisofs are \-\-protective\-msdos\-label (see \-boot_image grub partition_table=on) and \-\-modification\-date=YYYYMMDDhhmmsscc (see \-volume_date uuid). For EFI bootable GRUB boot images use \-\-efi\-boot. It performs \-boot_image grub efi_path= surrounded by two \-boot_image "any" "next". Alternative option \-e from Fedora genisoimage sets bin_path and platform_id for EFI, but performs no "next". .br For MBR bootable ISOLINUX images there is \-isohybrid\-mbr FILE, where FILE is one of the Syslinux files mbr/isohdp[fp]x*.bin . Use this instead of \-G to apply the effect of \-boot_image isolinux partition_table=on. .br \-\-boot\-catalog\-hide is \-boot_image any cat_hidden=on. .br \-mips\-boot is the same as \-boot_image any mips_path= . .br \-mipsel\-boot leads to mipsel_path= . .br \-partition_offset number is \-boot_image any partition_offset=number. .br Command \-append_partition is supported. .br \-untranslated_name_len number is \-compliance untranslated_name_len=number. .br \-\-old\-empty is \-compliance old_empty. .br The options of genisoimage Jigdo Template Extraction are recognized and performed via \fBxorriso\fR command \-jigdo. See the "Alias:" names there for the meaning of the genisoimage options. .br Personalities "\fBxorrisofs\fR", "\fBgenisoimage\fR", and "\fBgenisofs\fR" are aliases for "mkisofs". .br If \fBxorriso\fR is started with one of the leafnames "xorrisofs", "genisofs", "mkisofs", or "genisoimage", then it performs \-read_mkisofsrc and prepends \-as "genisofs" to the program arguments. I.e. all arguments will be interpreted mkisofs style until "\-\-" is encountered. From then on, arguments are interpreted as \fBxorriso\fR commands. .br \-\-no_rc as first argument of such a program start prevents interpretation of startup files. See section FILES below. .br Personality "\fBcdrecord\fR" accepts the options listed with: .br \-as cdrecord \-help \-\- .br Among them: \-v, dev=, speed=, blank=, fs=, \-eject, \-atip, padsize=, tsize=, \-isosize, \-multi, \-msinfo, \-\-grow_overwriteable_iso, write_start_address=, track source file path or "\-" for standard input as track source. .br It ignores most other options of cdrecord and cdrskin but refuses on \-audio, \-scanbus, and on blanking modes unknown to \fBxorriso\fR. .br The scope is only a single data track per session to be written to blank, overwritable, or appendable media. The medium gets closed if closing is applicable and not option \-multi is present. .br If an input drive was acquired, then it is given up. This is only allowed if no image changes are pending. .br dev= must be given as \fBxorriso\fR device address. Addresses like 0,0,0 or ATA:1,1,0 are not supported. .br If a track source is given, then an automatic \-commit happens at the end of the "cdrecord" option list. .br \-\-grow_overwriteable_iso enables emulation of multi\-session on overwritable media. To enable emulation of a TOC, the first session needs \-C 0,32 with \-as mkisofs (but no \-M) and \-\-grow_overwriteable_iso write_start_address=32s with \-as cdrecord. .br A much more elaborate libburn based cdrecord emulator is the program cdrskin. .br Personalites "\fBxorrecord\fR", "\fBwodim\fR", and "\fBcdrskin\fR" are aliases for "cdrecord". .br If \fBxorriso\fR is started with one of the leafnames "xorrecord", "cdrskin", "cdrecord", or "wodim", then it automatically prepends \-as "cdrskin" to the program arguments. I.e. all arguments will be interpreted cdrecord style until "\-\-" is encountered. From then on, arguments are interpreted as \fBxorriso\fR commands. .br \-\-no_rc as first argument of such a program start prevents interpretation of \fBxorriso\fR startup files. See section FILES below. .TP \fB\-read_mkisofsrc\fR Try one by one to open for reading: ./.mkisofsrc , $MKISOFSRC , $HOME/.mkisofsrc , $(dirname $0)/.mkisofsrc .br On success interpret the file content as of man mkisofs CONFIGURATION, and end this command. Do not try further files. The last address is used only if start argument 0 has a non\-trivial dirname. .br The reader currently interprets the following NAME=VALUE pairs: APPI (\-application_id) , PUBL (\-publisher) , SYSI (\-system_id) , VOLI (\-volid) , VOLS (\-volset_id) .br Any other lines will be silently ignored. .TP \fB\-pacifier\fR behavior_code Control behavior of UPDATE pacifiers during write operations. The following behavior codes are defined: .br "xorriso" is the default format: .br Writing: sector XXXXX of YYYYYY [fifo active, nn% fill] .br "cdrecord" looks like: .br X of Y MB written (fifo nn%) [buf mmm%] .br "mkisofs" .br nn% done, estimate finish Tue Jul 15 20:13:28 2008 .br The frequency of the messages can be adjusted by .br "interval=number" .br where number gives the seconds between two messages. Permissible settings are 0.1 to 60.0. .TP \fB\-scdbackup_tag\fR list_path record_name Set the parameter "name" for a scdbackup checksum record. It will be appended in an scdbackup checksum tag to the \-md5 session tag if the image starts at LBA 0. This is the case if it gets written as first session onto a sequential medium, or piped into a program, named pipe or character device. .br If list_path is not empty then the record will also be appended to the data file given by this path. .br Program scdbackup_verify will recognize and verify tag and file record. .br An empty record_name disables this feature. .TP .B Scripting, dialog and program control features: .TP \fB\-no_rc\fR .br Only if used as first program argument this command prevents reading and interpretation of startup files. See section FILES below. .TP \fB\-options_from_file\fR fileaddress Read quoted input from fileaddress and execute it like dialog lines. Empty lines and lines which begin by # are ignored. Normally one line should hold one \fBxorriso\fR command and all its parameters. Nevertheless lines may be concatenated by a trailing backslash. .br See also section "Command processing", paragraph "Quoted input". .TP \fB\-help\fR .br Print helptext. .TP \fB\-version\fR Print program name and version, component versions, license. .TP \fB\-list_extras\fR code Tell whether certain extra features were enabled at compile time. Code "all" lists all features and a headline. Other codes pick a single feature. Code "codes" lists them. They share names with related commands (see also there): .br "acl" tells whether xorriso has an adapter for local filesystems ACLs. .br "xattr" tells whether xorriso has an adapter for local filesystems EA. .br "jigdo" tells whether production of Jigdo files is possible. .br "zisofs" tells whether zisofs and built\-in gzip filters are enabled. .br "external_filter" tells whether external filter processes are allowed and whether they are allowed if real user id and effective user id differ. .br "dvd_obs" tells whether 64 kB output to DVD media is default. .br "use_readline" tells whether readline may be enabled in dialog mode. .br .TP \fB\-history\fR textline Copy textline into libreadline history. .TP \fB\-status\fR mode|filter Print the current settings of \fBxorriso\fR. Modes: .br short... print only important or altered settings .br long ... print all settings including defaults .br long_history like long plus history lines .br Filters begin with '\-' and are compared literally against the output lines of \-status:long_history. A line is put out only if its start matches the filter text. No wildcards. .TP \fB\-status_history_max\fR number Set maximum number of history lines to be reported with \-status "long_history". .TP \fB\-list_delimiter\fR word Set the list delimiter to be used instead of "\-\-". It has to be a single word, must not be empty, not longer than 80 characters, and must not contain quotation marks. .br For brevity the list delimiter is referred as "\-\-" throughout this text. .TP \fB\-sh_style_result\fR "on"|"off" Make the result output of some filesystem inspection commands look more like the output of equivalent shell commands. The most important effect is to prevent the wrapping of file addresses into quotation marks with commands \-pwd \-pwdx \-ls \-lsd \-lsl \-lsdl \-lsx \-lsdx \-lslx \-lsdlx \-du \-dus \-dux \-dusx \-findx \-find .br This will make ambiguous the representation of file names which contain newline characters. On the other hand it should facilitate integration of xorriso into shell scripts which already use the corresponding shell commands. .TP \fB\-backslash_codes\fR "on"|"off"|mode[:mode] Enable or disable the interpretation of symbolic representations of special characters with quoted input, or with program arguments, or with program text output. If enabled the following translations apply: .br \\a=bell(007) \\b=backspace(010) \\e=Escape(033) \\f=formfeed(014) .br \\n=linefeed(012) \\r=carriage_return(015) \\t=tab(011) .br \\v=vtab(013) \\\\=backslash(134) \\[0\-7][0\-7][0\-7]=octal_code .br \\x[0\-9a\-f][0\-9a\-f]=hex_code \\cC=control\-C .br Translations can occur with quoted input in 3 modes: .br "in_double_quotes" translates only inside " quotation. .br "in_quotes" translates inside " and ' quotation. .br "with_quoted_input" translates inside and outside quotes. .br With the start program arguments there is mode: .br "with_program_arguments" translates program arguments. .br .br Mode "encode_output" encodes output characters. It combines "encode_results" with "encode_infos". Inside single or double quotation marks encoding applies to 8\-bit characters octal 001 to 037 , 177 to 377 and to backslash(134). Outside quotation marks some harmless ASCII control characters stay unencoded: bell(007), backspace(010), tab(011), linefeed(012), formfeed(014), carriage_return(015). .br Mode "off" is default and disables any translation. Mode "on" is "with_quoted_input:with_program_arguments:encode_output". .TP \fB\-temp_mem_limit\fR number["k"|"m"] Set the maximum size of temporary memory to be used for image dependent buffering. Currently this applies to pattern expansion, LBA sorting, restoring of hard links. .br Default is 16m = 16 MiB, minimum 64k = 64 kiB, maximum 1024m = 1 GiB. .TP \fB\-print\fR text Print a text line to the result channel which is by default stdout. .TP \fB\-print_info\fR text Print a text line to the info channel which is by default stderr. .TP \fB\-print_mark\fR text Print a text line to the mark channel which is by default directed to both, result and info channel. An empty text will cause no output at all. .TP \fB\-prompt\fR text Show text at beginning of output line and wait for the user to hit the Enter key or to send a line via stdin. .TP \fB\-sleep\fR seconds Wait for the given number of seconds before performing the next command. Expect coarse granularity no better than 1/100 seconds. .TP \fB\-errfile_log\fR mode path|channel .br If problem events are related to input files from the filesystem, then their disk_paths can be logged to a file or to output channels R or I. .br Mode can either be "plain" or "marked". The latter causes marker lines which give the time of log start, burn session start, burn session end, log end or program end. In mode "plain", only the file paths are logged. .br If path is "\-" or "\-R" then the log is directed to the result channel. Path "\-I" directs it to the info message channel. Any text that does not begin with "\-" is used as path for a file to append the log lines. .br Problematic files can be recorded multiple times during one program run. If the program run aborts then the list might not be complete because some input files might not have been processed at all. .br The errfile paths are transported as messages of very low severity "ERRFILE". This transport becomes visible with \-report_about "ALL". .TP \fB\-session_log\fR path If path is not empty it gives the address of a plain text file where a log record gets appended after each session. This log can be used to determine the start_lba of a session for mount options \-o sbsector= (on GNU/Linux) or \-s (on FreeBSD) from date or volume ID. .br Record format is: timestamp start_lba size volume\-id .br The first three items are single words, the rest of the line is the volume ID. .TP \fB\-scsi_log\fR "on"|"off" Mode "on" enables very verbose logging of SCSI commands and drive replies. Logging messages get printed to stderr, not to any of the \fBxorriso\fR output channels. .br A special property of this command is that the first \-scsi_log setting among the start arguments is in effect already when the first operations of \fBxorriso\fR begin. Only "\-scsi_log" with dash "\-" is recognized that way. .TP \fB\-end\fR .br End program after writing pending changes. .TP \fB\-rollback_end\fR Discard pending changes. End program immediately. .TP \fB#\fR any text Only in dialog or file execution mode, and only as first non\-whitespace in line: Do not execute the line but store it in readline history. .TP .B Support for frontend programs via stdin and stdout: .TP \fB\-pkt_output\fR "on"|"off" Consolidate text output on stdout and classify each line by a channel indicator: .br 'R:' for result lines, .br 'I:' for notes and error messages, .br 'M:' for \-mark texts. .br Next is a decimal number of which only bit 0 has a meaning for now. 0 means no newline at end of payload, 1 means that the newline character at the end of the output line belongs to the payload. After another colon and a blank follows the payload text. .br Example: .br I:1: enter option and parameters : .TP \fB\-logfile\fR channel fileaddress Copy output of a channel to the given file. Channel may be one of: "." for all channels, "I" for info messages, "R" for result lines, "M" for \-mark texts. .TP \fB\-mark\fR text If text is not empty it will get put out on "M" channel each time \fBxorriso\fR is ready for the next dialog line or before \fBxorriso\fR performs a command that was entered to the pager prompt. .TP \fB\-msg_op\fR opcode parameter_text This command shall facilitate extraction of particular information from the message output of other commands. It gives access to the C API function Xorriso_parse_line() and to the message sieve that is provided by the C API. Please refer to their descriptions in file xorriso.h. Further it helps to interpret the severity codes of info messages. .br Intended users are frontend programs which operate xorriso in dialog mode. .br The result output of this command is not caught by the message sieve. .br The following opcodes are defined: .br \fBstart_sieve\fR .br Install the message sieve as of Xorriso_sieve_big() and start watching program messages. The parameter_text has no meaning. .br \fBshow_sieve\fR .br Show a list of filter rule names. The parameter_text has no meaning. The list begins by a line with the return value of Xorriso_sieve_get_result() with flag bit3. If this value is larger than 0, then the next line tells the number of names. The following lines show one name each. .br \fBread_sieve\fR .br Use the parameter_text as name of a filter rule and inquire its next recorded result. See Xorriso_sieve_big() for a list of names and reply strings. .br The recorded strings are put out on result channel. They get wrapped into lines which tell their structure. The first line tells the return value of Xorriso_sieve_get_result(). The next line tells the number of strings. Each string begins by a line that tells the number of lines of the string. Then follow these lines. They are to be concatenated with a newline character between each of them. Finally the number of still available recorded results of the given name is put out. .br \fBclear_sieve\fR .br Dispose all recorded strings and continue watching program messages. The parameter_text has no meaning. .br \fBend_sieve\fR .br Dispose the sieve with its filter rules and stop watching program messages. The parameter_text has no meaning. .br \fBparse\fR .br Read a text from dialog input and submit it to Xorriso_parse_line(). The parameter_text word shall consist of several words separated by blanks. It will be necessary to use both kinds of quotation marks. .br E.g. "'ISO session :' '' 0 0 1" .br The five parameter words are: prefix, separators, max_words, flag, number_of_input_lines. The former four are handed over to Xorriso_parse_line(). The number of input lines minus one tells xorriso how many newline characters are part of the input text. .br The announced number of text lines will be read from dialog input, concatenated with a newline character between each of them, and submitted to Xorriso_parse_line() as parameter line. Note that newlines outside of quotation marks are interpreted as separators if the separators parameter is empty. .br The parsed strings are put out on result channel. They get wrapped into lines which tell their structure. The first line tells the return value of Xorriso_parse_line(). The next line tells the number of strings. Each string begins by a line that tells the number of lines of the string. Then follow these lines. They are to be concatenated with a newline character between each of them. .br If \-backslash_codes "encode_output" is enabled, then the strings undergo encoding as if they were enclosed in quotes. Escpecially each string will be put out as a single result line. .br \fBparse_bulk\fR .br Like "parse", but with the fifth parameter word being number_of_input_texts rather than number_of_input_lines. Each input text has to be preceded by a line that tells number_of_input_lines as with "parse". Then come the announced number of text lines. .br All input texts will be read before printing of result lines begins. This consumes memory in xorriso. So the number_of_input_texts should not be extremely high. On the other hand, large transactions of command, input texts, and results are desirable if connection latency is an issue. .br \fBparse_silently\fR .br Like "parse" but not issuing a prompting message. Confusing to humans. .br \fBparse_bulk_silently\fR .br Like "parse_bulk" but not issuing a prompting message. Confusing to humans. .br \fBcompare_sev\fR .br The parameter_text should contain two comma separated severity texts as issued by this program. Like "SORRY,UPDATE". See also paragraph "Exception processing". .br These two severity texts get compared and a number gets printed to the result channel. This number is 0 if both severities are equal. It is \-1 if the first severity is lower than the second one. It is 1 is the first severity is higher than the second one. .br Above example "SORRY,UPDATE" will yield 1. .br \fBlist_sev\fR .br Print to the result channel a blank separated list of all severity names. Sorted from low to high severity. .TP \fB\-named_pipe_loop\fR mode[:mode] disk_path_stdin disk_path_stdout disk_path_stderr Temporarily replace standard input, standard output and standard error by named pipes. Enter dialog mode without readline. .br Defined modes are: .br "cleanup" removes the submitted pipe files when the loop ends. .br "keep" does not delete them. This is the default. .br "buffered" reads all lines from the input pipe until EOF before it opens the output pipes and processes the input lines. .br "direct" opens the output pipes after the first input line was read. Each line is executed directly after it is read. This is the default. .br The other three parameters must either be disk paths to existing named pipes, or be "\-" to leave the according standard i/o channel unreplaced. .br xorriso will open the stdin pipe, read and execute dialog lines from it until the sender closes the pipe. The output pipes get opened depending on mode "buffered" or "direct". After all lines are executed, xorriso will close its side of the pipes and enter a new cycle of opening, reading and executing. .br If an input line consists only of the word "end_named_pipe_loop" then \-named_pipe_loop will end and further xorriso commands may be executed from other sources. .TP \fB\-launch_frontend\fR program [arguments ...] -- Start the program that is given as first parameter. Submit the other parameters as program arguments. Enable xorriso dialog mode. .br Two nameless pipe objects are created. xorriso standard input gets connected to the standard output of the started program. xorriso standard output and standard error get connected to the standard input of that program. .br xorriso will abort when the started program ends or if it cannot be started at all. In both cases it will return a non\-zero exit value. The exit value will be zero if the frontend sends \-end or \-rollback_end before ending itself. .br This command may be totaly banned at compile time. It is banned by default if xorriso runs under setuid permissions. .br The program name will not be searched in the $PATH directories. To make this clear, it must contain at least one /\-character. Best is an absolute path. .br Example: .br xorriso \-launch_frontend "$(which xorriso\-tcltk)" \-stdio \-\- .br The frontend program should first send via its standard output: .br \-mark 0 \-pkt_output on \-msg_op start_sieve \- \-reassure off .br It should be ready to decode \-pkt_output and to react on \-mark messages. Best is to increment the \-mark number after each sent command sequence and then to wait for the new number to show up in a mark message: .br ...some...commands... \-mark .br Further are advised: .br \-report_about UPDATE \-abort_on NEVER .br \-iso_rr_pattern off \-disk_pattern off .br A check of the xorriso version should be done, in order to make sure that all desired features are present. .br Command \-launch_frontend will only work once per xorriso run. If no command parameters are submitted or if program is an empty text, then no program will be started but nevertheless \-launch_frontend will be irrevocably disabled. .TP \fB\-prog\fR text Use text as name of this program in subsequent messages .TP \fB\-prog_help\fR text Use text as name of this program and perform \-help. .br .SH EXAMPLES .SS .B Overview of examples: As superuser learn about available drives .br Blank medium and compose a new ISO image as batch run .br A dialog session doing about the same .br Manipulate an existing ISO image on the same medium .br Copy modified ISO image from one medium to another .br Bring a prepared ISOLINUX tree onto medium and make it bootable .br Change existing file name tree from ISO-8859-1 to UTF-8 .br Operate on storage facilities other than optical drives .br Burn an existing ISO image file to medium .br Perform multi-session runs as of cdrtools traditions .br Let xorriso work underneath growisofs .br Adjust thresholds for verbosity, exit value and program abort .br Examples of input timestrings .br Incremental backup of a few directory trees .br Restore directory trees from a particular ISO session to disk .br Try to retrieve blocks from a damaged medium .SS .B As superuser learn about available drives On Linux, FreeBSD or NetBSD consider to give rw\-permissions to those users or groups which shall be able to use the drives with \fBxorriso\fR. On Solaris use pfexec. Consider to restrict privileges of \fBxorriso\fR to "base,sys_devices" and to give r\-permission to user or group. .br $ xorriso \-device_links .br 1 \-dev '/dev/cdrom1' rwrw\-\- : 'TSSTcorp' 'DVD\-ROM SH\-D162C .br 1 \-dev '/dev/cdrw' rwrw\-\- : 'TSSTcorp' 'CDDVDW SH\-S223B' .br 2 \-dev '/dev/cdrw3' rwrw\-\- : 'HL\-DT\-ST' 'BDDVDRW_GGC\-H20L' .SS .B Blank medium and compose a new ISO image as batch run Acquire drive /dev/sr2, make medium ready for writing a new image, fill the image with the files from hard disk directories /home/me/sounds and /home/me/pictures. .br Because no \-dialog "on" is given, the program will then end by writing the session to the medium. .br $ xorriso \-outdev /dev/sr2 \\ .br \-blank as_needed \\ .br \-map /home/me/sounds /sounds \\ .br \-map /home/me/pictures /pictures .br .br The ISO image may be shaped in a more elaborate way like the following: Omit some unwanted stuff by removing it from the image directory tree. Reintroduce some wanted stuff. .br $ cd /home/me .br $ xorriso \-outdev /dev/sr2 \\ .br \-blank as_needed \\ .br \-map /home/me/sounds /sounds \\ .br \-map /home/me/pictures /pictures \\ .br \-rm_r \\ .br /sounds/indecent \\ .br '/pictures/*private*' \\ .br /pictures/confidential \\ .br \-\- \\ .br \-cd / \\ .br \-add pictures/confidential/work* \-\- .br Note that '/pictures/*private*' is a pattern for iso_rr_paths while pictures/confidential/work* gets expanded by the shell with addresses from the hard disk. Commands \-add and \-map have different parameter rules but finally the same effect: they put files into the image. .SS .B A dialog session doing about the same .br Some settings are already given as start argument. The other activities are done as dialog input. The pager gets set to 20 lines of 80 characters. .br The drive is acquired by command \-dev rather than \-outdev in order to see the message about its current content. By command \-blank this content is made ready for being overwritten and the loaded ISO image is made empty. .br In order to be able to eject the medium, the session needs to be committed explicitly. .br .B $ xorriso -dialog on -page 20 80 -disk_pattern on .br enter option and arguments : .br .B \-dev /dev/sr2 .br enter option and arguments : .br .B \-blank as_needed .br enter option and arguments : .br .B \-map /home/me/sounds /sounds -map /home/me/pictures /pictures .br enter option and arguments : .br .B \-rm_r /sounds/indecent /pictures/*private* /pictures/confidential .br enter option and arguments : .br .B \-cdx /home/me/pictures -cd /pictures .br enter option and arguments : .br .B \-add confidential/office confidential/factory .br enter option and arguments : .br .B \-du / .br enter option and arguments : .br .B \-commit_eject all -end .br .br .br .br .br .br .br .br .br .SS .B Manipulate an existing ISO image on the same medium Load image from drive. Remove (i.e. hide) directory /sounds and its subordinates. Rename directory /pictures/confidential to /pictures/restricted. Change access permissions of directory /pictures/restricted. Add new directory trees /sounds and /movies. Burn to the same medium, check whether the tree can be loaded, and eject. .br $ xorriso \-dev /dev/sr2 \\ .br \-rm_r /sounds \-\- \\ .br \-mv \\ .br /pictures/confidential \\ .br /pictures/restricted \\ .br \-\- \\ .br \-chmod go\-rwx /pictures/restricted \-\- \\ .br \-map /home/me/prepared_for_dvd/sounds_dummy /sounds \\ .br \-map /home/me/prepared_for_dvd/movies /movies \\ .br \-commit \-eject all .SS .B Copy modified ISO image from one medium to another Load image from input drive. Do the same manipulations as in the previous example. Acquire output drive and blank it. Burn the modified image as first and only session to the output drive. .br $ xorriso \-indev /dev/sr2 \\ .br \-rm_r /sounds \-\- \\ .br ... .br \-outdev /dev/sr0 \-blank as_needed \\ .br \-commit \-eject all .SS .B Bring a prepared ISOLINUX tree onto medium and make it bootable The user has already created a suitable file tree on disk and copied the ISOLINUX files into subdirectory ./boot/isolinux of that tree. Now \fBxorriso\fR can burn an El Torito bootable medium: .br $ xorriso \-outdev /dev/sr0 \-blank as_needed \\ .br \-map /home/me/ISOLINUX_prepared_tree / \\ .br \-boot_image isolinux dir=/boot/isolinux .SS .B Change existing file name tree from ISO-8859-1 to UTF-8 This example assumes that the existing ISO image was written with character set ISO\-8859\-1 but that the readers expected UTF\-8. Now a new session gets added with converted file names. Command \-changes_pending "yes" enables writing despite the lack of any manipulation command. .br In order to avoid any weaknesses of the local character set, this command pretends that it uses already the final target set UTF\-8. Therefore strange file names may appear in messages, which will be made terminal\-safe by command \-backslash_codes. .br $ xorriso \-in_charset ISO\-8859\-1 \-local_charset UTF\-8 \\ .br \-out_charset UTF\-8 \-backslash_codes on \-dev /dev/sr0 \\ .br \-changes_pending yes \-commit \-eject all .SS .B Operate on storage facilities other than optical drives Full read\-write operation is possible with regular files and block devices: .br $ xorriso \-dev /tmp/regular_file ... .br Paths underneath /dev normally need prefix "stdio:" .br $ xorriso \-dev stdio:/dev/sdb ... .br If /dev/sdb is to be used frequently and /dev/sda is the system disk, then consider to place the following lines in a \fBxorriso\fR Startup File. They allow you to use /dev/sdb without prefix and protect disk /dev/sda from \fBxorriso\fR: .br \-drive_class banned /dev/sda* .br \-drive_class harmless /dev/sdb .br Other writeable file types are supported write\-only: .br $ xorriso \-outdev /tmp/named_pipe ... .br Among the write\-only drives is standard output: .br $ xorriso \-outdev \- \\ .br ... .br | gzip >image.iso.gz .SS .B Burn an existing ISO image file to medium Actually this works with any kind of data, not only ISO images: .br $ xorriso \-as cdrecord \-v dev=/dev/sr0 blank=as_needed image.iso .SS .B Perform multi-session runs as of cdrtools traditions Between both processes there can be performed arbitrary transportation or filtering. .br The first session is written like this: .br $ xorriso \-as mkisofs prepared_for_iso/tree1 | \\ .br xorriso \-as cdrecord \-v dev=/dev/sr0 blank=fast \-multi \-eject \- .br Follow\-up sessions are written like this (the run of dd is only to give demons a chance to spoil it): .br $ m=$(xorriso \-as cdrecord dev=/dev/sr0 \-msinfo) .br $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 .br $ xorriso \-as mkisofs \-M /dev/sr0 \-C $m prepared_for_iso/tree2 | \\ .br xorriso \-as cdrecord \-v dev=/dev/sr0 \-waiti \-multi \-eject \- .br Always eject the drive tray between sessions. .br The run of xorriso \-as mkisofs will read old sessions via the CD\-ROM driver of /dev/sr0. This driver might not be aware of the changed content as long as the medium is not loaded again. In this case the previous session would not be properly assessed by xorriso and the new session would contain only the newly added files. .br Some systems have not enough patience with automatic tray loading and some demons may interfere with a first CD\-ROM driver read attempt from a freshly loaded medium. .br When loading the tray manually, wait 10 seconds after the drive has stopped blinking. .br A safe automatic way seems to be a separate run of xorriso for loading the tray with proper waiting, and a subsequent run of dd which shall offer itself to any problems caused by demons assessing the changed drive status. If this does not help, insert a run of "sleep 10" between xorriso and dd. .br This example works for multi\-session media only. Add cdrskin option \-\-grow_overwriteable_iso to all \-as cdrecord runs in order to enable multi\-session emulation on overwritable media. .SS .B Let xorriso work underneath growisofs growisofs expects an ISO formatter program which understands options \-C and \-M. If \fBxorriso\fR gets started by name "xorrisofs" then it is suitable for that. .br $ export MKISOFS="xorrisofs" .br $ growisofs \-Z /dev/dvd /some/files .br $ growisofs \-M /dev/dvd /more/files .br If no "xorrisofs" is available on your system, then you will have to create a link pointing to the \fBxorriso\fR binary and tell growisofs to use it. E.g. by: .br $ ln \-s $(which xorriso) "$HOME/xorrisofs" .br $ export MKISOFS="$HOME/xorrisofs" .br One may quit mkisofs emulation by argument "\-\-" and make use of all \fBxorriso\fR commands. growisofs dislikes options which start with "\-o" but \-outdev must be set to "\-". So use "outdev" instead: .br $ growisofs \-Z /dev/dvd \-\- outdev \- \-update_r /my/files /files .br $ growisofs \-M /dev/dvd \-\- outdev \- \-update_r /my/files /files .br growisofs has excellent burn capabilities with DVD and BD. It does not emulate session history on overwritable media, though. .SS .B Adjust thresholds for verbosity, exit value and program abort Be quite verbose, exit 32 if severity "FAILURE" was encountered, do not abort prematurely but forcibly go on until the end of commands. .br $ xorriso ... \\ .br \-report_about UPDATE \\ .br \-return_with FAILURE 32 \\ .br \-abort_on NEVER \\ .br ... .SS .B Examples of input timestrings .br As printed by program date: .B 'Thu Nov 8 14:51:13 CET 2007' .br The same without ignored parts: .B 'Nov 8 14:51:13 2007' .br The same as expected by date: .B 110814512007.13 .br Four weeks in the future: .B +4w .br The current time: .B +0 .br Three hours ago: .B \-3h .br Seconds since Jan 1 1970: .B =1194531416 .br .br .br .br .br .br .br .SS .B Incremental backup of a few directory trees This changes the directory trees /projects and /personal_mail in the ISO image so that they become exact copies of their disk counterparts. ISO file objects get created, deleted or get their attributes adjusted accordingly. .br ACL, xattr, hard links and MD5 checksums will be recorded. Accelerated comparison is enabled at the expense of potentially larger backup size. Only media with the expected volume ID or blank media are accepted. Files with names matching *.o or *.swp get excluded explicitly. .br When done with writing the new session gets checked by its recorded MD5. .br $ xorriso \\ .br \-abort_on FATAL \\ .br \-for_backup \-disk_dev_ino on \\ .br \-assert_volid 'PROJECTS_MAIL_*' FATAL \\ .br \-dev /dev/sr0 \\ .br \-volid PROJECTS_MAIL_"$(date '+%Y_%m_%d_%H%M%S')" \\ .br \-not_leaf '*.o' \-not_leaf '*.swp' \\ .br \-update_r /home/thomas/projects /projects \\ .br \-update_r /home/thomas/personal_mail /personal_mail \\ .br \-commit \-toc \-check_md5 FAILURE \-\- \-eject all .br To be used several times on the same medium, whenever an update of the two disk trees to the medium is desired. Begin with a blank medium and update it until the run fails gracefully due to lack of remaining space on the old one. .br This makes sense if the full backup leaves substantial remaining capacity on media and if the expected changes are much smaller than the full backup. To apply zisofs compression to those data files which get newly copied from the local filesystem, insert these commands immediately before \-commit : .br \-hardlinks perform_update \\ .br \-find / \-type f \-pending_data \-exec set_filter \-\-zisofs \-\- \\ .br Commands \-disk_dev_ino and \-for_backup depend on stable device and inode numbers on disk. Without them, an update run may use \-md5 "on" to match recorded MD5 sums against the current file content on hard disk. This is usually much faster than the default which compares both contents directly. .br With \fBmount\fR option \fB\-o "sbsector="\fR on GNU/Linux or \fB\-s\fR on FreeBSD or NetBSD it is possible to access the session trees which represent the older backup versions. With CD media, GNU/Linux mount accepts session numbers directly by its option "session=". .br Multi\-session media and most overwritable media written by \fBxorriso\fR can tell the sbsectors of their sessions by \fBxorriso\fR command \-toc. Used after \-commit the following command prints the matching mount command for the newly written session (here for mount point /mnt): .br \-mount_cmd "indev" "auto" "auto" /mnt .br Commands \-mount_cmd and \-mount are also able to produce the mount commands for older sessions in the table\-of\-content. E.g. as superuser: .br # osirrox \-mount /dev/sr0 "volid" '*2008_12_05*' /mnt .br .sp 1 Above example produces a result similar to \-root / \-old\-root / with mkisofs. For getting the session trees accumulated in the new sessions, let all \-update commands use a common parent directory and clone it after updating is done: .br \-update_r /home/thomas/projects /current/projects \\ .br \-update_r /home/thomas/personal_mail /current/personal_mail \\ .br \-clone /current /"$(date '+%Y_%m_%d_%H%M%S')" \\ .br The cloned tree will have a name like /2011_02_12_155700. .br .sp 1 Sessions on multi\-session media are separated by several MB of unused blocks. So with small sessions the payload capacity can become substantially lower than the overall media capacity. If the remaining space on a medium does not suffice for the next gap, the drive is supposed to close the medium automatically. .br .sp 1 \fBBetter do not use your youngest backup for \-update_r\fR. Have at least two media which you use alternatingly. So only older backups get endangered by the new write operation, while the newest backup is stored safely on a different medium. .br Always have a blank medium ready to perform a full backup in case the update attempt fails due to insufficient remaining capacity. This failure will not spoil the old medium, of course. .SS .B Restore directory trees from a particular ISO session to disk This is an alternative to mounting the medium and using normal file operations. .br First check which backup sessions are on the medium: .br $ xorriso \-outdev /dev/sr0 \-toc .br Then enable restoring of ACL, xattr and hard links. Load the desired session and copy the file trees to disk. Avoid to create /home/thomas/restored without rwx\-permission. .br $ xorriso \-for_backup \\ .br \-load volid 'PROJECTS_MAIL_2008_06_19*' \\ .br \-indev /dev/sr0 \\ .br \-osirrox on:auto_chmod_on \\ .br \-chmod u+rwx / \-\- \\ .br \-extract /projects /home/thomas/restored/projects \\ .br \-extract /personal_mail /home/thomas/restored/personal_mail \\ .br \-rollback_end .br The final command \-rollback_end prevents an error message about the altered image being discarded. .SS .B Try to retrieve blocks from a damaged medium .br $ xorriso \-abort_on NEVER \-indev /dev/sr0 \\ .br \-check_media time_limit=1800 report=blocks_files \\ .br data_to="$HOME"/dvd_copy sector_map="$HOME"/dvd_copy.map \-\- .br This can be repeated several times, if necessary with \-eject or with other \-indev drives. See the human readable part of "$HOME"/dvd_copy.map for addresses which can be used on "$HOME"/dvd_copy with mount option \-o sbsector= or \-s. .SH FILES .SS .B Program alias names: .br Normal installation of \fBxorriso\fR creates three links or copies which by their program name pre\-select certain settings: .br \fBxorrisofs\fR starts \fBxorriso\fR with \-as mkisofs emulation. .br \fBxorrecord\fR starts \fBxorriso\fR with \-as cdrecord emulation. .br \fBosirrox\fR starts with \-osirrox "on:o_excl_off" which allows further commands to copy files from ISO image to disk and to apply command \-mount to one or more of the existing ISO sessions. .SS .B Startup files: .br If not \-no_rc is given as the first argument then \fBxorriso\fR attempts on startup to read and execute lines from the following files: .br /etc/default/xorriso .br /etc/opt/xorriso/rc .br /etc/xorriso/xorriso.conf .br $HOME/.xorrisorc .br The files are read in the sequence given above, but none of them is required to exist. The line format is described with command \-options_from_file. .br If mkisofs emulation was enabled by program name "xorrisofs", "mkisofs", "genisoimage", or "genisofs", then afterwards \-read_mkisofsrc is performed, which reads .mkisofsrc files. See there. .SS .B Runtime control files: .br The default setting of \-check_media abort_file= is: .br /var/opt/xorriso/do_abort_check_media .br .SS .SH ENVIRONMENT The following environment variables influence the program behavior: .br HOME is used to find startup files of xorriso and mkisofs. .br SOURCE_DATE_EPOCH belongs to the specs of reproducible\-builds.org. It is supposed to be either undefined or to contain a decimal number which tells the seconds since january 1st 1970. If it contains a number, then it is used as time value to set the default of \-volume date "uuid", sets \-boot_image "any" "gpt_disk_guid=" to "volume_date_uuid", \-volume_date "all_file_dates" to "set_to_mtime", and \-iso_nowtime to "=$SOURCE_DATE_EPOCH". .br Startup files and program options can override the effect of SOURCE_DATE_EPOCH. .br .SS .SH SEE ALSO .TP For the mkisofs emulation of xorriso .BR xorrisofs(1) .TP For the cdrecord emulation of xorriso .BR xorrecord(1) .TP For mounting xorriso generated ISO 9660 images (-t iso9660) .BR mount(8) .TP Libreadline, a comfortable input line facility .BR readline(3) .TP Other programs which produce ISO 9660 images .BR mkisofs(8), .BR genisoimage(1) .TP Other programs which burn sessions to optical media .BR growisofs(1), .BR cdrecord(1), .BR wodim(1), .BR cdrskin(1) .TP ACL and xattr .BR getfacl(1), .BR setfacl(1), .BR getfattr(1), .BR setfattr(1) .TP MD5 checksums .BR md5sum(1) .TP On FreeBSD the commands for xattr and MD5 differ .BR getextattr(8), .BR setextattr(8), .BR md5(1) .SH BUGS To report bugs, request help, or suggest enhancements for \fBxorriso\fR, please send electronic mail to the public list . If more privacy is desired, mail to . .br Please describe what you expect \fBxorriso\fR to do, the program arguments or dialog commands by which you tried to achieve it, the messages of \fBxorriso\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 .br for libburnia\-project.org .SH COPYRIGHT Copyright (c) 2007 \- 2021 Thomas Schmitt .br Permission is granted to distribute this text freely. It shall only be modified in sync with the technical properties of \fBxorriso\fR. If you make use of the license to derive modified versions of \fBxorriso\fR then you are entitled to modify this text under that same license. .SH CREDITS \fBxorriso\fR is in part based on work by Vreixo Formoso who provides libisofs together with Mario Danic who also leads the libburnia team. Vladimir Serbinenko contributed the HFS+ filesystem code and related knowledge. Thanks to Andy Polyakov who invented emulated growing, to Derek Foreman and Ben Jansens who once founded libburn. .br Compliments towards Joerg Schilling whose cdrtools served me for ten years. libisoburn-1.5.4/xorriso/xorriso_timestamp.h0000644000175700017510000000005614005265711016272 00000000000000#define Xorriso_timestamP "2021.01.30.150001" libisoburn-1.5.4/xorriso/iso_img.h0000644000175700017510000000271413701321754014135 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2015 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of functions which operate on ISO images and their global properties. */ #ifndef Xorriso_pvt_iso_img_includeD #define Xorriso_pvt_iso_img_includeD yes int Xorriso_update_volid(struct XorrisO *xorriso, int flag); int Xorriso_record_boot_info(struct XorrisO *xorriso, int flag); int Xorriso_assert_volid(struct XorrisO *xorriso, int msc1, int flag); int Xorriso_is_isohybrid(struct XorrisO *xorriso, IsoFile *bootimg_node, int flag); int Xorriso_boot_item_status(struct XorrisO *xorriso, char *cat_path, char *bin_path, int platform_id, int patch_isolinux, int emul, off_t load_size, unsigned char *id_string, unsigned char *selection_crit, char *form, char *filter, FILE *fp, int flag); int Xorriso__append_boot_params(char *line, ElToritoBootImage *bootimg, int flag); int Xorriso_get_volume(struct XorrisO *xorriso, IsoImage **volume, int flag); int Xorriso_record_cmd_line(struct XorrisO *xorriso, char *buf, char **cmds, int *cmd_count, int flag); #endif /* ! Xorriso_pvt_iso_img_includeD */ libisoburn-1.5.4/xorriso/iso_manip.h0000644000175700017510000000635613701321754014473 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2010 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of functions which manipulate the libisofs tree model. */ #ifndef Xorriso_pvt_iso_manip_includeD #define Xorriso_pvt_iso_manip_includeD yes int Xorriso_transfer_properties(struct XorrisO *xorriso, struct stat *stbuf, char *disk_path, IsoNode *node, int flag); int Xorriso_graft_split(struct XorrisO *xorriso, IsoImage *volume, IsoDir *dir, char *disk_path, char *img_name, char *nominal_source, char *nominal_target, off_t size, IsoNode **node, int flag); int Xorriso_tree_graft_node(struct XorrisO *xorriso, IsoImage *volume, IsoDir *dir, char *disk_path, char *img_name, char *nominal_source, char *nominal_target, off_t offset, off_t cut_size, IsoNode **node, int flag); int Xorriso_add_tree(struct XorrisO *xorriso, IsoDir *dir, char *img_dir_path, char *disk_dir_path, struct LinkiteM *link_stack, int flag); int Xorriso_copy_implicit_properties(struct XorrisO *xorriso, IsoDir *dir, char *full_img_path, char *img_path, char *full_disk_path, int flag); int Xorriso_mkisofs_lower_r(struct XorrisO *xorriso, IsoNode *node, int flag); int Xorriso_widen_hardlink(struct XorrisO *xorriso, void * boss_iter, IsoNode *node, char *abs_path, char *iso_prefix, char *disk_prefix, int flag); int Xorriso_cannot_create_iter(struct XorrisO *xorriso, int iso_error, int flag); int Xorriso_findi_iter(struct XorrisO *xorriso, IsoDir *dir_node, off_t *mem, IsoDirIter **iter, IsoNode ***node_array, int *node_count, int *node_idx, IsoNode **iterated_node, int flag); int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job, IsoDirIter *boss_iter, off_t boss_mem, char *abs_path, char *show_path, IsoNode *node, int depth, int flag); int Xorriso_findi_headline(struct XorrisO *xorriso, struct FindjoB *job, int flag); int Xorriso_findi_sorted(struct XorrisO *xorriso, struct FindjoB *job, off_t boss_mem, int filec, char **filev, int flag); int Xorriso_all_node_array(struct XorrisO *xorriso, int addon_nodes, int flag); int Xorriso__file_start_lba(IsoNode *node, int *lba, int flag); int Xorriso__mark_update_xinfo(void *data, int flag); int Xorriso__mark_update_cloner(void *old_data, void **new_data, int flag); int Xorriso_get_blessing(struct XorrisO *xorriso, IsoNode *node, int *bless_idx, char bless_code[17], int flag); int Xorriso_truncate_uniquely(struct XorrisO *xorriso, int length, IsoNode *node, char *abs_path, char *show_path, int flag); #endif /* ! Xorriso_pvt_iso_manip_includeD */ libisoburn-1.5.4/xorriso/write_run.c0000644000175700017510000040402413751503556014527 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains functions which are needed to write sessions. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_STDINT_H #include #else #ifdef HAVE_INTTYPES_H #include #endif #endif /* O_BINARY is needed for Cygwin but undefined elsewhere */ #ifndef O_BINARY #define O_BINARY 0 #endif #ifdef Xorriso_standalonE #ifdef Xorriso_with_libjtE #include "../libjte/libjte.h" #endif #else #ifdef Xorriso_with_libjtE #include #endif #endif /* ! Xorriso_standalonE */ #include "xorriso.h" #include "xorriso_private.h" #include "lib_mgt.h" #include "drive_mgt.h" #include "iso_img.h" #include "iso_tree.h" #include "write_run.h" /* @param flag bit0= talk of -as cdrecord -multi rather than of -close */ int Xorriso_check_multi(struct XorrisO *xorriso, struct burn_drive *drive, int flag) { int profile_no= 0, ret; struct burn_multi_caps *caps= NULL; char profile_name[80]; if(xorriso->auto_close) xorriso->do_close= 0; if(!xorriso->do_close) { burn_disc_get_profile(drive, &profile_no, profile_name); if(profile_no == 0x14) { /* DVD-RW sequential */ ret= burn_disc_get_multi_caps(drive, BURN_WRITE_TAO, &caps, 0); if(caps != NULL) burn_disc_free_multi_caps(&caps); if(ret == 0) { if(xorriso->auto_close) { sprintf(xorriso->info_text, "-close \"as_needed\" triggered -close \"on\""); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); xorriso->do_close= 1; } else if(flag & 1) { sprintf(xorriso->info_text, "This DVD-RW media can only be written without option -multi"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); sprintf(xorriso->info_text, "Possibly it was blanked by blank=deformat_quickest"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); sprintf(xorriso->info_text, "After writing a session without -multi, apply blank=all"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); return(0); } else { sprintf(xorriso->info_text, "This DVD-RW media can only be written with -close \"on\""); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); sprintf(xorriso->info_text, "Possibly it was blanked by -blank \"deformat_quickest\""); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); sprintf(xorriso->info_text, "After writing a session with -close \"on\", apply -blank \"all\""); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); return(0); } } } else if(profile_no == 0x15) { /* DVD-RW DL */ if(xorriso->auto_close) { sprintf(xorriso->info_text, "-close \"as_needed\" triggered -close \"on\""); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); xorriso->do_close= 1; } else if(flag & 1) { sprintf(xorriso->info_text, "DVD-R DL media can only be written without option -multi"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } else { sprintf(xorriso->info_text, "DVD-R DL media can only be written with -close \"on\""); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } } return(1); } int Xorriso_make_write_options( struct XorrisO *xorriso, struct burn_drive *drive, struct burn_write_opts **burn_options, int flag) { int drive_role, stream_mode= 0, ret, profile; char profile_name[80]; enum burn_disc_status s; *burn_options= burn_write_opts_new(drive); if(*burn_options==NULL) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text,"Cannot allocate option set"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } burn_write_opts_set_simulate(*burn_options, !!xorriso->do_dummy); drive_role= burn_drive_get_drive_role(drive); burn_write_opts_set_multi(*burn_options, !(xorriso->do_close || drive_role==0 || drive_role==3)); ret= burn_disc_get_profile(drive, &profile, profile_name); if(ret > 0) { s= isoburn_disc_get_status(drive); if(xorriso->auto_close && xorriso->do_close == 0 && profile == 0x14 && s == BURN_DISC_BLANK) /* Prepare for missing feature 21h despite drive's announcement */ burn_write_opts_set_fail21h_sev(*burn_options, "NOTE"); } if(xorriso->write_speed != -2) burn_drive_set_speed(drive, 0, xorriso->write_speed); burn_drive_set_buffer_waiting(drive, xorriso->modesty_on_drive, xorriso->min_buffer_usec, xorriso->max_buffer_usec, xorriso->buffer_timeout_sec, xorriso->min_buffer_percent, xorriso->max_buffer_percent); if(xorriso->do_stream_recording == 1) stream_mode= 1; else if(xorriso->do_stream_recording == 2) stream_mode= 51200; /* 100 MB */ else if(xorriso->do_stream_recording >= 16) stream_mode= xorriso->do_stream_recording; burn_write_opts_set_stream_recording(*burn_options, stream_mode); #ifdef Xorriso_dvd_obs_default_64K if(xorriso->dvd_obs == 0) burn_write_opts_set_dvd_obs(*burn_options, 64 * 1024); else #endif burn_write_opts_set_dvd_obs(*burn_options, xorriso->dvd_obs); burn_write_opts_set_stdio_fsync(*burn_options, xorriso->stdio_sync); burn_write_opts_set_underrun_proof(*burn_options, 1); return(1); } /* @param flag bit0= do not write but only prepare and return size in sectors bit1= do not use isoburn wrappers, do not assume libisofs */ int Xorriso_sanitize_image_size(struct XorrisO *xorriso, struct burn_drive *drive, struct burn_disc *disc, struct burn_write_opts *burn_options, int flag) { int ret, img_sectors, num_sessions= 0, num_tracks= 0, padding= 0, profile; off_t media_space; int lba, nwa, multi_emul_blocks= 0; char profile_name[80]; struct burn_session **sessions; struct burn_track **tracks; enum burn_disc_status s; img_sectors= burn_disc_get_sectors(disc); sessions= burn_disc_get_sessions(disc, &num_sessions); if(sessions==NULL || num_sessions < 1) { no_track:; Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text,"Program error : no track in prepared disc"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } tracks= burn_session_get_tracks(sessions[0], &num_tracks); if(tracks==NULL || num_tracks < 1) goto no_track; padding= 0; ret= burn_disc_get_profile(drive, &profile, profile_name); padding= xorriso->padding / 2048; if(xorriso->padding > padding * 2048) padding++; if(img_sectors>0 && ret>0 && (profile==0x09 || profile==0x0a)) { /* CD-R , CD-RW */ if(img_sectors + padding < Xorriso_cd_min_track_sizE) { padding= Xorriso_cd_min_track_sizE - img_sectors; sprintf(xorriso->info_text, "Expanded track to minimum size of %d sectors", Xorriso_cd_min_track_sizE); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } } if(xorriso->alignment == 0 && ! (xorriso->no_emul_toc & 1)) { ret= isoburn_needs_emulation(drive); if(ret > 0) { /* Take care that the session is padded up to the future NWA. Else with padding < 32 it could happen that PVDs from older sessions survive and confuse -rom_toc_scan. */ xorriso->alignment= 32; s= isoburn_disc_get_status(drive); if(s == BURN_DISC_BLANK) { /* Count blocks before nwa as part of the image */; ret= isoburn_disc_track_lba_nwa(drive, burn_options, 0, &lba, &nwa); if(ret <= 0) nwa= 0; multi_emul_blocks= nwa; } } } if(!(flag & 2)) { #ifdef Xorriso_with_libjtE /* JTE : no multi-session, no_emul_toc, padding in libisofs */ if(xorriso->libjte_handle != NULL) padding= 0; #endif /* ! Xorriso_with_libjtE */ if(xorriso->do_padding_by_libisofs) padding= 0; } if(xorriso->alignment > 0) { if(img_sectors > 0) { ret= isoburn_disc_track_lba_nwa(drive, burn_options, 0, &lba, &nwa); if(ret <= 0) nwa= 0; lba= (nwa + img_sectors + padding) % xorriso->alignment; if(lba > 0) padding+= xorriso->alignment - lba; } } burn_track_define_data(tracks[0], 0, padding * 2048, 0, BURN_MODE1); Xorriso_process_msg_queues(xorriso,0); if(flag&2) media_space= burn_disc_available_space(drive, burn_options) / (off_t) 2048; else media_space= isoburn_disc_available_space(drive, burn_options) / (off_t) 2048; if(media_space < img_sectors + padding) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "Image size %ds exceeds free space on media %.fs", img_sectors + padding, (double) media_space); if(flag & 1) { Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } else { Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } if(flag&1) { ret= multi_emul_blocks + img_sectors + padding; } else ret= 1; ex:; return(ret); } int Xorriso_auto_format(struct XorrisO *xorriso, int flag) { int ret, profile, status, num_formats; char profile_name[80]; struct burn_drive_info *dinfo; struct burn_drive *drive; off_t size; unsigned dummy; ret= Xorriso_may_burn(xorriso, 0); if(ret <= 0) return(0); ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to autoformat", 2); if(ret<=0) return(0); ret= burn_disc_get_profile(drive, &profile, profile_name); if(ret>0 && (profile==0x12 || profile==0x43)) { /* DVD-RAM or BD-RE */ ret= burn_disc_get_formats(drive, &status, &size, &dummy, &num_formats); if(ret>0 && status==BURN_FORMAT_IS_UNFORMATTED) { sprintf(xorriso->info_text, "Unformatted %s medium detected. Trying -format fast.", profile_name); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= Xorriso_format_media(xorriso, (off_t) 0, 1 | 4); if(ret<=0) { sprintf(xorriso->info_text, "Automatic formatting of %s failed", profile_name); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(ret); } burn_drive_re_assess(drive, 0); } } return(1); } /* @param flag bit0= fail on indev == outdev with "imported_iso" bit1= fail on indev == NULL with "imported_iso" */ int Xorriso_check_intvl_string(struct XorrisO *xorriso, char **part_image, int flag) { char *cpt, *ipt, *orig; orig= *part_image; if(strncmp(*part_image, "--interval:", 11) != 0) return(0); if(strchr(*part_image + 11, ':') == NULL) return(0); (*part_image)+= 11; if(!(flag & 3)) return(1); cpt= strchr(*part_image, ':'); ipt= strstr(*part_image, "imported_iso"); if(ipt == NULL || ipt > cpt) return(1); if((flag & 2) && xorriso->in_drive_handle == NULL) { sprintf(xorriso->info_text, "Interval reader lacks of -indev to read from \"imported_iso\""); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto failure; } if(!(flag & 1)) return(1); if(xorriso->out_drive_handle != xorriso->in_drive_handle) return(1); sprintf(xorriso->info_text, "Interval reader may not read from \"imported_iso\" during write run to same drive"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); failure:; sprintf(xorriso->info_text, "Rejected: "); Text_shellsafe(orig, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(-1); } int Xorriso_set_system_area(struct XorrisO *xorriso, struct burn_drive *drive, IsoImage *img, struct isoburn_imgen_opts *sopts, int flag) { int ret, options, system_area_options, iso_lba= -1, start_lba, image_blocks; int sa_loaded, read_count, i, read_sum= 0; char volid[33]; FILE *fp= NULL; char *buf= NULL, *bufpt= NULL, *intvl; uint8_t *intvl_buf; off_t hd_lba, byte_count; unsigned char *ub; ElToritoBootImage *bootimg; IsoFile *bootimg_node; IsoNode *sparc_core_node; uint32_t offst; enum burn_disc_status state; struct iso_interval_reader *ivr = NULL; if(xorriso->grub2_sparc_core[0]) { ret= Xorriso_node_from_path(xorriso, img, xorriso->grub2_sparc_core, &sparc_core_node, 1); if(ret <= 0) { sprintf(xorriso->info_text, "Cannot find in ISO image: -boot_image grub grub2_sparc_core="); Text_shellsafe(xorriso->grub2_sparc_core, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } if(!ISO_NODE_IS_FILE(sparc_core_node)) { sprintf(xorriso->info_text, "Not a data file: -boot_image grub grub2_sparc_core="); Text_shellsafe(xorriso->grub2_sparc_core, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } ret = iso_image_set_sparc_core(img, (IsoFile *) sparc_core_node, 0); if(ret < 0) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, "", ret, "Error when setting up -boot_image grub grub2_sparc_core=", 0, "FAILURE", 1); {ret= 0; goto ex;} } } Xorriso_alloc_meM(buf, char, 32768); memset(buf, 0, 32768); system_area_options= xorriso->system_area_options; if(xorriso->system_area_clear_loaded) sa_loaded= 0; else sa_loaded= iso_image_get_system_area(img, buf, &options, 0); if(sa_loaded < 0) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, "", sa_loaded, "Error when inquiring System Area data of ISO 9660 image", 0, "FAILURE", 1); {ret= 0; goto ex;} } if(sa_loaded > 0) bufpt= buf; if(xorriso->system_area_disk_path[0] == 0) { if(xorriso->patch_system_area && xorriso->system_area_options == 0 && sa_loaded > 0) { system_area_options= xorriso->patch_system_area; /* Check whether partition 1 ends at image end */; ub= (unsigned char *) buf; hd_lba= (ub[454] | (ub[455] << 8) | (ub[456] << 16) | (((unsigned int) ub[457]) << 24)) + (ub[458] | (ub[459] << 8) | (ub[460] << 16) | (((unsigned int) ub[461]) << 24)); iso_lba= -1; ret= isoburn_disc_get_msc1(drive, &start_lba); if(ret > 0) { ret= isoburn_read_iso_head(drive, start_lba, &image_blocks, volid, 1); if(ret > 0) iso_lba= start_lba + image_blocks; } if(((off_t) iso_lba) * (off_t) 4 > hd_lba) { system_area_options= 0; } else if((xorriso->patch_system_area & 1) && ((off_t) iso_lba) * (off_t) 4 != hd_lba) { system_area_options= 0; } else if((xorriso->patch_system_area & 2) && ((off_t) iso_lba) * (off_t) 4 + (off_t) (63 * 256) < hd_lba) { system_area_options= 0; } else if(xorriso->patch_system_area & 2) { /* isohybrid patching */ /* Check whether bytes 432-345 point to ElTorito LBA */ hd_lba= ub[432] | (ub[433] << 8) | (ub[434] << 16) | (((unsigned int) ub[435]) << 24); ret= iso_image_get_boot_image(img, &bootimg, &bootimg_node, NULL); if(ret != 1) { system_area_options= 0; } else if(bootimg_node != NULL) { Xorriso__file_start_lba((IsoNode *) bootimg_node, &(iso_lba), 0); if(((off_t) iso_lba) * (off_t) 4 != hd_lba) system_area_options= 0; } } if(system_area_options == 0) { Xorriso_msgs_submit(xorriso, 0, "Loaded System Area data are not suitable for MBR patching.", 0, "DEBUG", 0); } } {ret= 1; goto do_set;} } bufpt= buf; if(strcmp(xorriso->system_area_disk_path, "/dev/zero") == 0) { memset(buf, 0, 32768); {ret= 1; goto do_set;} } intvl= xorriso->system_area_disk_path; ret= Xorriso_check_intvl_string(xorriso, &intvl, 2); if(ret < 0) { {ret= 0; goto ex;} } else if(ret > 0) { ret= iso_interval_reader_new(img, intvl, &ivr, &byte_count, 0); Xorriso_process_msg_queues(xorriso, 0); if(ret < 0) { intvl_reader_err:; sprintf(xorriso->info_text, "Error when reading -boot_image system_area="); Text_shellsafe(xorriso->system_area_disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); {ret= 0; goto ex;} } for(i= 0; i < 16; i++) { intvl_buf= (uint8_t *) (buf + 2048 * i); ret= iso_interval_reader_read(ivr, intvl_buf, &read_count, 0); Xorriso_process_msg_queues(xorriso, 0); if(ret == 0) break; if(ret < 0) goto intvl_reader_err; read_sum+= read_count; } ret= read_sum; } else { ret= Xorriso_afile_fopen(xorriso, xorriso->system_area_disk_path, "rb", &fp, 2); if(ret <= 0) {ret= 0; goto ex;} ret= fread(buf, 1, 32768, fp); if(ret < 32768) { if(ferror(fp)) { sprintf(xorriso->info_text, "Error when reading -boot_image system_area="); Text_shellsafe(xorriso->system_area_disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); {ret= 0; goto ex;} } } } do_set:; if(ret > 0 && xorriso->system_area_disk_path[0]) { sprintf(xorriso->info_text, "Copying to System Area: %d bytes from file ", ret); Text_shellsafe(xorriso->system_area_disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } ret= isoburn_igopt_set_system_area(sopts, bufpt, system_area_options); if(ret != ISO_SUCCESS) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, "", ret, "Error when attaching System Area data to ISO 9660 image", 0, "FAILURE", 1); {ret= 0; goto ex;} } offst= xorriso->partition_offset; state= isoburn_disc_get_status(drive); if(state == BURN_DISC_APPENDABLE) { ret= isoburn_get_img_partition_offset(drive, &offst); if(ret == 1) { sprintf(xorriso->info_text, "Preserving in ISO image: -boot_image any partition_offset=%lu", (unsigned long) offst); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } else offst= xorriso->partition_offset; } ret= isoburn_igopt_set_part_offset(sopts, offst, xorriso->partition_secs_per_head, xorriso->partition_heads_per_cyl); if(ret != ISO_SUCCESS) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, "", ret, "Error when setting partition offset", 0, "FAILURE", 1); {ret= 0; goto ex;} } ret= 1; ex:; if(fp != NULL && fp != stdin) fclose(fp); iso_interval_reader_destroy(&ivr, 0); Xorriso_free_meM(buf); return(ret); } /* @param flag bit0= do not increment boot_count and do not reset boot parameters bit1= dispose attached boot images */ int Xorriso_attach_boot_image(struct XorrisO *xorriso, int flag) { int ret; char *cpt; struct burn_drive_info *source_dinfo; struct burn_drive *source_drive; IsoImage *image= NULL; IsoNode *node= NULL; ElToritoBootImage *bootimg; enum eltorito_boot_media_type emul_type= ELTORITO_NO_EMUL; char *bin_path; int emul, platform_id; off_t load_size; struct stat stbuf; int hflag= 0, is_interval= 0; if(xorriso->boot_image_bin_path[0] == 0 && !(flag & 2)) { /* >>> no boot image path given : no op */; ret= 2; goto ex; } if(xorriso->in_drive_handle == NULL) hflag= 2; ret= Xorriso_get_drive_handles(xorriso, &source_dinfo, &source_drive, "on attempt to attach boot image", hflag); if(ret<=0) goto ex; image= isoburn_get_attached_image(source_drive); if(image == NULL) { /* (should not happen) */ sprintf(xorriso->info_text, "No ISO image present on attempt to attach boot image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(flag & 2) { iso_image_remove_boot_image(image); xorriso->boot_count= 0; ret= 1; goto ex; } bin_path= xorriso->boot_image_bin_path; emul= xorriso->boot_image_emul; platform_id= xorriso->boot_platform_id; load_size= xorriso->boot_image_load_size; if(strncmp(bin_path, "--interval:appended_partition_", 30) == 0) { is_interval= 1; if(load_size <= 0) load_size= 512; } if(xorriso->boot_efi_default) { emul= 0; platform_id= 0xef; xorriso->patch_isolinux_image= (xorriso->patch_isolinux_image & ~3) | 0; } if((platform_id == 0xef || load_size < 0) && !is_interval) { ret= Xorriso_iso_lstat(xorriso, bin_path, &stbuf, 2 | 4); if(ret != 0) {ret= 0; goto ex;} load_size= ((stbuf.st_size / (off_t) 512) + !!(stbuf.st_size % (off_t) 512)) * 512; } sprintf(xorriso->info_text, "Adding boot image "); Text_shellsafe(bin_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); if(emul == 0) emul_type= ELTORITO_NO_EMUL; else if(emul == 1) emul_type= ELTORITO_HARD_DISC_EMUL; else if(emul == 2) emul_type= ELTORITO_FLOPPY_EMUL; if (!is_interval) { ret= Xorriso_node_from_path(xorriso, image, bin_path, &node, 1); if(ret <= 0) { sprintf(xorriso->info_text, "Cannot find in ISO image: -boot_image ... bin_path="); Text_shellsafe(bin_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } if(xorriso->boot_count == 0) { if(xorriso->boot_image_cat_path[0] == 0) { strcpy(xorriso->boot_image_cat_path, bin_path); cpt= strrchr(xorriso->boot_image_cat_path, '/'); if(cpt == NULL) { strcpy(xorriso->boot_image_cat_path, "/"); cpt= xorriso->boot_image_cat_path + 1; } else { cpt++; } strcpy(cpt, "boot.cat"); } ret= Xorriso_node_from_path(xorriso, image, xorriso->boot_image_cat_path, &node, 1); if(ret > 0) { if(!xorriso->do_overwrite) { sprintf(xorriso->info_text, "May not overwrite existing -boot_image ... cat_path="); Text_shellsafe(xorriso->boot_image_cat_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } ret= Xorriso_rmi(xorriso, NULL, (off_t) 0, xorriso->boot_image_cat_path, 8 | (xorriso->do_overwrite == 1)); if(ret != 1) { sprintf(xorriso->info_text, "Could not remove existing -boot_image cat_path="); Text_shellsafe(xorriso->boot_image_cat_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } /* Discard old boot image, set new one */ ret= iso_image_get_boot_image(image, &bootimg, NULL, NULL); if(ret == 1) iso_image_remove_boot_image(image); ret= iso_image_set_boot_image(image, bin_path, emul_type, xorriso->boot_image_cat_path, &bootimg); if(ret > 0) iso_image_set_boot_catalog_weight(image, 1000000000); } else { ret= iso_image_add_boot_image(image, bin_path, emul_type, 0, &bootimg); } if(ret < 0) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, "", ret, "Error when attaching El-Torito boot image to ISO 9660 image", 0, "FAILURE", 1); sprintf(xorriso->info_text, "Could not attach El-Torito boot image to ISO 9660 image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } el_torito_set_boot_platform_id(bootimg, (uint8_t) platform_id); if(load_size / 512 > 65535) { sprintf(xorriso->info_text, "Boot image load size exceeds 65535 blocks of 512 bytes. "); if(platform_id == 0xef) { strcat(xorriso->info_text, "Will record 0 in El Torito to extend ESP to end-of-medium."); load_size= 0; } else { strcat(xorriso->info_text, "Will record 65535 in El Torito."); load_size= 65535 * 512; } Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } if(xorriso->boot_img_full_size) { el_torito_set_full_load(bootimg, 1); } else { /* The function will understand negative short as positive unsigned */ el_torito_set_load_size(bootimg, (short) (load_size / 512)); } el_torito_set_id_string(bootimg, xorriso->boot_id_string); el_torito_set_selection_crit(bootimg, xorriso->boot_selection_crit); ret= Xorriso_set_isolinux_options(xorriso, image, 1); if(!(flag & 1)) { /* Register attachment and reset even in case of error return */ xorriso->boot_count++; xorriso->boot_platform_id= 0; xorriso->patch_isolinux_image= 0; xorriso->boot_image_bin_path[0]= 0; xorriso->boot_image_bin_form[0]= 0; xorriso->boot_image_emul= 0; xorriso->boot_emul_default= 1; xorriso->boot_image_load_size= 4 * 512; xorriso->boot_img_size_default= 1; xorriso->boot_img_full_size= 0; memset(xorriso->boot_id_string, 0, sizeof(xorriso->boot_id_string)); memset(xorriso->boot_selection_crit, 0, sizeof(xorriso->boot_selection_crit)); xorriso->boot_efi_default= 0; } if(ret <= 0) goto ex; ret= 1; ex:; if(image != NULL) iso_image_unref(image); return(ret); } int Xorriso_write_application_use(struct XorrisO *xorriso, IsoImage *image, int flag) { int l, ret, count= 512; unsigned int byte= 0; char *path, data[512]; FILE *fp= NULL; path= xorriso->application_use; l= strlen(path); if(l <= 1) { memset(data, path[0], 512); } else if(l == 4 && path[0] == '0' && path[1] == 'x' && isxdigit(path[2]) && isxdigit(path[3])) { sscanf(path + 2, "%x", &byte); memset(data, (int) byte, 512); } else { /* Read up to 512 bytes from file path */ ret= Xorriso_afile_fopen(xorriso, path, "rb", &fp, 0); if(ret <= 0) {ret= 0; goto ex;} ret= fread(data, 1, 512, fp); if(ret < 512) { if(ferror(fp)) { sprintf(xorriso->info_text, "-application_use: Error while reading file "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= 0; goto ex; } } if(ret < 0) count= 0; else count= ret; } iso_image_set_app_use(image, data, count); ret= 1; ex: if(fp != NULL && fp != stdin) fclose(fp); return(ret); } int Xorriso_retry_write_session(struct XorrisO *xorriso, int flag) { int ret, auto_close_mem, do_close_mem; if(xorriso->do_tao == 1) { Xorriso_msgs_submit(xorriso, 0, "There is no hope for a re-try with -close \"on\" as long as -write_type is \"tao\"", 0, "FAILURE", 0); return(0); } Xorriso_msgs_submit(xorriso, 0, "Re-trying with -close \"on\"", 0, "NOTE", 0); do_close_mem= xorriso->do_close; auto_close_mem= xorriso->auto_close; xorriso->do_close= 1; xorriso->auto_close= 0; ret= Xorriso_write_session(xorriso, 0); xorriso->do_close= do_close_mem; xorriso->auto_close= auto_close_mem; return(ret); } int Xorriso_make_iso_write_opts(struct XorrisO *xorriso, IsoImage *image, struct isoburn_imgen_opts *sopts, int flag) { int ext, i, ret, pad_by_libisofs= 0, is_bootable= 0, relax, intvl_string= 0; int intvl_check= 2; /* 3 forbids "imported_iso" */ char *out_cs, *part_image; IsoNode *root_node; uint32_t padding; relax= xorriso->relax_compliance; if(image != NULL) is_bootable= iso_image_get_boot_image(image, NULL, NULL, NULL); /* xorriso->patch_isolinux_image gets reset in Xorriso_attach_boot_image() So this applies only to -boot_image ... "patch" or "keep". >>> Better would be to analyze and keep the relaxations of the loaded image. */ if((xorriso->patch_isolinux_image & 1) && is_bootable == 1) relax|= isoburn_igopt_allow_full_ascii; out_cs= xorriso->out_charset; if(out_cs == NULL) Xorriso_get_local_charset(xorriso, &out_cs, 0); isoburn_igopt_set_level(sopts, xorriso->iso_level); ext= ((!!xorriso->do_rockridge) * isoburn_igopt_rockridge) | ((!!xorriso->do_joliet) * isoburn_igopt_joliet) | ((!!xorriso->do_hfsplus) * isoburn_igopt_hfsplus) | ((!!xorriso->do_fat) * isoburn_igopt_fat) | ((!!xorriso->do_iso1999) * isoburn_igopt_iso1999) | (( !(xorriso->ino_behavior & 2)) * isoburn_igopt_hardlinks) | (( (!(xorriso->ino_behavior & 2)) || (xorriso->do_aaip & (2 | 8 | 16 | 256)) || (xorriso->do_md5 & (2 | 4)) || xorriso->do_hfsplus ) * isoburn_igopt_aaip) | ((!!(xorriso->do_md5 & 2)) * isoburn_igopt_session_md5) | ((!!(xorriso->do_md5 & 4)) * isoburn_igopt_file_md5) | ((!!(xorriso->do_md5 & 8)) * isoburn_igopt_file_stability) | ((!!xorriso->do_old_empty) * isoburn_igopt_old_empty) | ((flag & 1) * isoburn_igopt_will_cancel); if(xorriso->no_emul_toc & 1) ext|= isoburn_igopt_no_emul_toc; isoburn_igopt_set_extensions(sopts, ext); isoburn_igopt_set_relaxed(sopts, relax); ret = isoburn_igopt_set_rr_reloc(sopts, xorriso->rr_reloc_dir, xorriso->rr_reloc_flags); if(ret <= 0) {ret= 0; goto ex;} ret= isoburn_igopt_set_untranslated_name_len(sopts, xorriso->untranslated_name_len); if(ret <= 0) {ret= 0; goto ex;} isoburn_igopt_set_sort_files(sopts, 1); isoburn_igopt_set_over_mode(sopts, 0, 0, (mode_t) 0, (mode_t) 0); isoburn_igopt_set_over_ugid(sopts, 2 * !!xorriso->do_global_uid, 2 * !!xorriso->do_global_gid, (uid_t) xorriso->global_uid, (gid_t) xorriso->global_gid); isoburn_igopt_set_out_charset(sopts, out_cs); isoburn_igopt_set_fifo_size(sopts, xorriso->fs * 2048); Ftimetxt(time(NULL), xorriso->scdbackup_tag_time, 8); isoburn_igopt_set_scdbackup_tag(sopts, xorriso->scdbackup_tag_name, xorriso->scdbackup_tag_time, xorriso->scdbackup_tag_written); if(xorriso->prep_partition[0]) { part_image= xorriso->prep_partition; intvl_string= Xorriso_check_intvl_string(xorriso, &part_image, intvl_check); if(intvl_string < 0) {ret= 0; goto ex;} ret= isoburn_igopt_set_prep_partition(sopts, part_image, intvl_string); if(ret <= 0) {ret= 0; goto ex;} } if(xorriso->efi_boot_partition[0]) { part_image= xorriso->efi_boot_partition; intvl_string= Xorriso_check_intvl_string(xorriso, &part_image, intvl_check); if(intvl_string < 0) {ret= 0; goto ex;} ret= isoburn_igopt_set_efi_bootp(sopts, part_image, intvl_string); if(ret <= 0) {ret= 0; goto ex;} } for(i= 0; i < Xorriso_max_appended_partitionS; i++) { if(xorriso->appended_partitions[i] == NULL) continue; if(xorriso->appended_partitions[i][0] == 0) continue; if(strcmp(xorriso->appended_partitions[i], ".") == 0) part_image= ""; else part_image= xorriso->appended_partitions[i]; intvl_string= Xorriso_check_intvl_string(xorriso, &part_image, intvl_check); if(intvl_string < 0) {ret= 0; goto ex;} isoburn_igopt_set_partition_img(sopts, i + 1, xorriso->appended_part_types[i], part_image); isoburn_igopt_set_part_flag(sopts, i + 1, intvl_string); isoburn_igopt_set_part_type_guid(sopts, i + 1, xorriso->appended_part_type_guids[i], xorriso->appended_part_gpt_flags[i] & 1); } isoburn_igopt_set_appended_as_gpt(sopts, xorriso->appended_as_gpt); isoburn_igopt_set_appended_as_apm(sopts, xorriso->appended_as_apm); isoburn_igopt_set_part_like_isohybrid(sopts, xorriso->part_like_isohybrid); isoburn_igopt_set_iso_mbr_part_type(sopts, xorriso->iso_mbr_part_type); isoburn_igopt_set_iso_type_guid(sopts, xorriso->iso_gpt_type_guid, xorriso->iso_mbr_part_flag & 1); isoburn_igopt_set_gpt_guid(sopts, xorriso->gpt_guid, xorriso->gpt_guid_mode); isoburn_igopt_set_disc_label(sopts, xorriso->ascii_disc_label); isoburn_igopt_set_hfsp_serial_number(sopts, xorriso->hfsp_serial_number); isoburn_igopt_set_hfsp_block_size(sopts, xorriso->hfsp_block_size, xorriso->apm_block_size); isoburn_igopt_set_pvd_times(sopts, xorriso->vol_creation_time, xorriso->vol_modification_time, xorriso->vol_expiration_time, xorriso->vol_effective_time, xorriso->vol_uuid); #ifdef Xorriso_with_libjtE if(xorriso->libjte_handle && (xorriso->libjte_params_given & (4 | 8))) { /* >>> Check whether the mandatory parameters are set */; ret= libjte_set_outfile(xorriso->libjte_handle, xorriso->outdev); Xorriso_process_msg_queues(xorriso, 0); if(ret <= 0) goto ex; isoburn_igopt_attach_jte(sopts, xorriso->libjte_handle); pad_by_libisofs= 1; } #endif /* Xorriso_with_libjtE */ if(xorriso->do_padding_by_libisofs || pad_by_libisofs) { /* Padding to be done by libisofs, not by libburn. */ padding= xorriso->padding / 2048; if((uint32_t) xorriso->padding > padding * 2048) padding++; /* fprintf(stderr, "XORRISO_DEBUG: isoburn_igopt_set_tail_blocks(%d)\n", (int) padding); */ isoburn_igopt_set_tail_blocks(sopts, padding); } /* Make final abort check before starting expensive activities */ ret= Xorriso_eval_problem_status(xorriso, 1, 0); if(ret<0) {ret= 0; goto ex;} if(xorriso->zisofs_by_magic && image != NULL) { sprintf(xorriso->info_text, "Checking disk file content for zisofs compression headers."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0); root_node= (IsoNode *) iso_image_get_root(image); ret= iso_node_zf_by_magic(root_node, (xorriso->out_drive_handle == xorriso->in_drive_handle) | 2 | 16 | (xorriso->zisofs_by_magic << 8)); if(ret<0) { Xorriso_report_iso_error(xorriso, "", ret, "Error when examining file content for zisofs headers", 0, "FAILURE", 1); } ret= Xorriso_eval_problem_status(xorriso, 1, 0); if(ret<0) {ret= 0; goto ex;} sprintf(xorriso->info_text, "Check for zisofs compression headers done."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0); } ret = isoburn_igopt_set_write_type(sopts, xorriso->do_tao); if(ret <= 0) goto ex; ret = isoburn_igopt_set_stdio_endsync(sopts, xorriso->stdio_sync >= 0); if(ret <= 0) goto ex; ret= 1; ex:; return(ret); } int Xorriso_set_all_file_dates(struct XorrisO *xorriso, int flag) { int idx, ret, was_failure= 0; char *hargv[4]; if(xorriso->all_file_dates[0] == 0) return(2); if(strcmp(xorriso->all_file_dates, "set_to_mtime") == 0) { hargv[0]= "/"; hargv[1]= "-exec"; hargv[2]= "set_to_mtime"; hargv[3]= "--"; idx= 0; ret= Xorriso_option_find(xorriso, 4, hargv, &idx, 0); if(ret <= 0) was_failure= 1; } else { hargv[0]= "/"; idx= 0; ret= Xorriso_option_alter_date(xorriso, "b", xorriso->all_file_dates, 1, hargv, &idx, 1); if(ret <= 0) was_failure= 1; idx= 0; ret= Xorriso_option_alter_date(xorriso, "c", xorriso->all_file_dates, 1, hargv, &idx, 1); if(ret <= 0) was_failure= 1; } Xorriso_relax_compliance(xorriso, "always_gmt", 0); return(!was_failure); } /* @param flag bit0= do not write but only prepare and return size in sectors @return <=0 error , 1= success 2= failure with DVD-RW, please call Xorriso_retry_write_session() */ int Xorriso_write_session(struct XorrisO *xorriso, int flag) { int ret, i, pacifier_speed= 0, data_lba, is_bootable= 0; int freshly_bootable= 0, hide_attr, signal_mode, role, is_bdr_pow= 0; char *xorriso_id= NULL, *img_id, *sfe= NULL, *out_cs; struct isoburn_imgen_opts *sopts= NULL; struct burn_drive_info *dinfo, *source_dinfo; struct burn_drive *drive, *source_drive; struct burn_disc *disc= NULL; struct burn_write_opts *burn_options= NULL; off_t readcounter= 0,writecounter= 0; int num_sessions= 0, num_tracks= 0; struct burn_session **sessions; struct burn_track **tracks; enum burn_disc_status s; IsoImage *image= NULL; int profile_number; char *profile_name= NULL, *reasons= NULL; IsoBoot *bootcat_node; Xorriso_alloc_meM(sfe, char, 5 * SfileadrL); Xorriso_alloc_meM(xorriso_id, char, 256); Xorriso_alloc_meM(profile_name, char, 80); Xorriso_alloc_meM(reasons, char, BURN_REASONS_LEN); ret= Xorriso_finish_hl_update(xorriso, 0); if(ret <= 0) goto ex; ret= Xorriso_set_all_file_dates(xorriso, 1); if(ret <= 0) goto ex; out_cs= xorriso->out_charset; if(out_cs == NULL) Xorriso_get_local_charset(xorriso, &out_cs, 0); ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to write", 2); if(ret<=0) goto ex; if(!(flag & 1)) { ret= Xorriso_auto_format(xorriso, 0); if(ret <=0 ) {ret= 0; goto ex;} } is_bdr_pow= burn_drive_get_bd_r_pow(drive); if(is_bdr_pow) { sprintf(xorriso->info_text, "May not write to Pseudo Overwrite formatted BD-R medium"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } s= isoburn_disc_get_status(drive); if (xorriso->do_hfsplus && ( (xorriso->grow_blindly_msc2 >= 0 && xorriso->out_drive_handle != xorriso->in_drive_handle) || (xorriso->out_drive_handle == xorriso->in_drive_handle && s != BURN_DISC_BLANK) )) { sprintf(xorriso->info_text, "May not grow ISO image while -hfsplus is enabled"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } if(xorriso->out_drive_handle == xorriso->in_drive_handle) { if(abs(xorriso->displacement_sign) == 1 && xorriso->displacement != 0 && s != BURN_DISC_BLANK) { sprintf(xorriso->info_text, "May not grow ISO image while -displacement is non-zero"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } source_drive= drive; } else { if(xorriso->in_drive_handle == NULL) { source_drive= drive; } else { ret= Xorriso_get_drive_handles(xorriso, &source_dinfo, &source_drive, "on attempt to get source for write", 0); if(ret<=0) goto ex; } if(s!=BURN_DISC_BLANK) { s= burn_disc_get_status(drive); if(s!=BURN_DISC_BLANK) sprintf(xorriso->info_text, "-indev differs from -outdev and -outdev media is not blank"); else sprintf(xorriso->info_text, "-indev differs from -outdev and -outdev media holds non-zero data"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } ret= Xorriso_get_profile(xorriso, &profile_number, profile_name, 2); if(ret == 2) pacifier_speed= 1; else if(ret == 3) pacifier_speed= 2; ret= Xorriso_check_multi(xorriso, drive, 0); if(ret<=0) goto ex; ret= isoburn_igopt_new(&sopts, 0); if(ret<=0) { Xorriso_process_msg_queues(xorriso, 0); goto ex; } xorriso->alignment= 0; image= isoburn_get_attached_image(source_drive); if(image != NULL) { iso_image_set_application_id(image, xorriso->application_id); iso_image_set_publisher_id(image, xorriso->publisher); iso_image_set_system_id(image, xorriso->system_id); iso_image_set_volset_id(image, xorriso->volset_id); iso_image_set_copyright_file_id(image, xorriso->copyright_file); iso_image_set_biblio_file_id(image, xorriso->biblio_file); iso_image_set_abstract_file_id(image, xorriso->abstract_file); Xorriso_write_application_use(xorriso, image, 0); Xorriso_process_msg_queues(xorriso,0); } if((xorriso->do_aaip & 256) && out_cs != NULL) { static char *names = "isofs.cs"; size_t value_lengths[1]; value_lengths[0]= strlen(out_cs); ret= Xorriso_setfattr(xorriso, NULL, "/", (size_t) 1, &names, value_lengths, &out_cs, 2 | 8); if(ret<=0) goto ex; } if(iso_image_was_blind_attrs(image, 0)) Xorriso_msgs_submit(xorriso, 0, "Some file xattr namespace could not be explored", 0, "WARNING", 0); if(image!=NULL && 12+strlen(Xorriso_timestamP)<80) { strcpy(xorriso_id, xorriso->preparer_id); img_id= (char *) iso_image_get_data_preparer_id(image); if(img_id!=NULL) { for(i= strlen(img_id)-1; i>=0 && img_id[i]==' '; i--); if(i>0) { sprintf(xorriso->info_text, "Overwrote previous preparer id '%s'", img_id); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); } } iso_image_set_data_preparer_id(image, xorriso_id); } ret= Xorriso_set_system_area(xorriso, source_drive, image, sopts, 0); if(ret <= 0) goto ex; /* Activate, adjust or discard boot image */ if(image!=NULL) { if(xorriso->boot_image_bin_path[0]) { ret= Xorriso_attach_boot_image(xorriso, xorriso->boot_count == 0); if(ret <= 0) goto ex; freshly_bootable= 1; } is_bootable= iso_image_get_boot_image(image, NULL, NULL, &bootcat_node); } if(image!=NULL && !(flag&1)) { if(xorriso->boot_count > 0 || freshly_bootable) { /* Eventually rename boot catalog node to changed boot_image_cat_path */ if(is_bootable > 0) { ret= Xorriso_path_from_node(xorriso, (IsoNode *) bootcat_node, sfe, 0); if(ret > 0) { if(strcmp(sfe, xorriso->boot_image_cat_path) != 0) { ret= Xorriso_rename(xorriso, NULL, sfe, xorriso->boot_image_cat_path, 1); if(ret <= 0) goto ex; } } } hide_attr= !!(xorriso->boot_image_cat_hidden); if(xorriso->boot_image_cat_hidden & 1) hide_attr|= LIBISO_HIDE_ON_RR; if(xorriso->boot_image_cat_hidden & 2) hide_attr|= LIBISO_HIDE_ON_JOLIET; if(xorriso->boot_image_cat_hidden & 4) hide_attr|= LIBISO_HIDE_ON_HFSPLUS; iso_image_set_boot_catalog_hidden(image, hide_attr); } else if(xorriso->patch_isolinux_image & 1) { if(is_bootable == 1) { /* will imply isoburn_igopt_allow_full_ascii */ sprintf(xorriso->info_text, "Patching boot info table"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= Xorriso_path_from_lba(xorriso, NULL, xorriso->loaded_boot_bin_lba, sfe, 1); if(ret < 0) goto ex; if(ret == 0) { sprintf(xorriso->info_text, "Cannot patch boot image: no file found for its LBA."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); sprintf(xorriso->info_text, "Probably the loaded boot image file was deleted in this session."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); sprintf(xorriso->info_text, "Use -boot_image \"any\" \"discard\" or set new boot image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); goto ex; } ret= Xorriso_set_isolinux_options(xorriso, image, 0); if(ret <= 0) goto ex; } else if(!freshly_bootable) { sprintf(xorriso->info_text, "Could not find any boot image for -boot_image patching"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } } else if(xorriso->keep_boot_image && is_bootable == 1) { /* will imply isoburn_igopt_allow_full_ascii */ sprintf(xorriso->info_text, "Keeping boot image unchanged"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } else if(is_bootable == 1) { iso_image_remove_boot_image(image); sprintf(xorriso->info_text, "Discarded boot image from old session"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } /* hardcoded and regardless whether a catalog will get written */ iso_image_set_boot_catalog_weight(image, 1000000000); } if((xorriso->do_aaip & 16) || !(xorriso->ino_behavior & 2)) { /* Overwrite isofs.st of root node by xorriso->isofs_st_out */ char *name= "isofs.st"; char timestamp[16], *value= timestamp; size_t value_length; sprintf(timestamp, "%.f", (double) xorriso->isofs_st_out); value_length= strlen(timestamp); Xorriso_setfattr(xorriso, NULL, "/", (size_t) 1, &name, &value_length, &value, 2 | 8); } ret= Xorriso_make_iso_write_opts(xorriso, image, sopts, flag & 1); if(ret <= 0) goto ex; /* >>> omit iso_image_update_sizes if the image was filled up very quickly */; ret= iso_image_update_sizes(image); if(ret < 0) { Xorriso_process_msg_queues(xorriso, 0); if(ret<0) { Xorriso_report_iso_error(xorriso, "", ret, "Error when updating file sizes", 0, "FAILURE", 1); } ret= Xorriso_eval_problem_status(xorriso, 1, 0); if(ret<0) {ret= 0; goto ex;} } Xorriso_set_abort_severity(xorriso, 1); if (xorriso->grow_blindly_msc2 >= 0 && xorriso->out_drive_handle != xorriso->in_drive_handle) { ret= isoburn_prepare_blind_grow(source_drive, &disc, sopts, drive, xorriso->grow_blindly_msc2); if(ret>0) { /* Allow the consumer of output to access the input drive */ source_drive= NULL; ret= Xorriso_give_up_drive(xorriso, 1|8); if(ret<=0) goto ex; } } else if(xorriso->out_drive_handle == xorriso->in_drive_handle || xorriso->in_drive_handle == NULL) { ret= isoburn_prepare_disc(source_drive, &disc, sopts); } else { ret= isoburn_prepare_new_image(source_drive, &disc, sopts, drive); } if(ret <= 0) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text,"Failed to prepare session write run"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } ret= Xorriso_make_write_options(xorriso, drive, &burn_options, 0); if(ret<=0) goto cancel_iso; isoburn_igopt_get_effective_lba(sopts, &(xorriso->session_lba)); if(xorriso->do_stream_recording == 2) { ret= isoburn_igopt_get_data_start(sopts, &data_lba); if(ret > 0 && data_lba >= 16) burn_write_opts_set_stream_recording(burn_options, data_lba); } ret= Xorriso_sanitize_image_size(xorriso, drive, disc, burn_options, flag&1); if(ret<=0 || (flag&1)) { Xorriso_process_msg_queues(xorriso,0); if(flag&1) /* set queue severity to FAILURE */ Xorriso_set_image_severities(xorriso, 2); if(flag&1) /* reset queue severity */ Xorriso_set_image_severities(xorriso, 0); goto cancel_iso; } ret= Xorriso_may_burn(xorriso, 0); if(ret <= 0) goto cancel_iso; role= burn_drive_get_drive_role(drive); /* Important: do not return until burn_is_aborting() was checked */ signal_mode= 1; if(role == 1) signal_mode|= 2; Xorriso_set_signal_handling(xorriso, signal_mode); /* De-activate eventual target file truncation in dummy mode */ ret= isoburn_set_truncate(drive, (!xorriso->do_dummy) | 2 | 4); if(ret < 0) goto cancel_iso; xorriso->run_state= 1; /* Indicate that burning has started */ isoburn_disc_write(burn_options, disc); burn_write_opts_free(burn_options); burn_options= NULL; ret= Xorriso_pacifier_loop(xorriso, drive, pacifier_speed << 4); if(burn_is_aborting(0)) Xorriso_abort(xorriso, 0); /* Never comes back */ Xorriso_set_signal_handling(xorriso, 0); if(ret<=0) goto ex; if(!isoburn_drive_wrote_well(drive)) { isoburn_cancel_prepared_write(source_drive, drive, 0); Xorriso_process_msg_queues(xorriso,0); if(xorriso->auto_close && xorriso->do_close == 0) { if(burn_drive_was_feat21_failure(drive)) { sprintf(xorriso->info_text, "libburn indicates failure with writing DVD-RW to appendable state."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); /* Urge caller to call Xorriso_retry_write_session() */ ret= 2; goto ex; } } sprintf(xorriso->info_text, "libburn indicates failure with writing."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } Xorriso_process_msg_queues(xorriso,0); sessions= burn_disc_get_sessions(disc, &num_sessions); if(num_sessions>0) { tracks= burn_session_get_tracks(sessions[0], &num_tracks); if(tracks!=NULL && num_tracks>0) { burn_track_get_counters(tracks[0],&readcounter,&writecounter); xorriso->session_blocks= (int) (writecounter/ (off_t) 2048); sprintf(xorriso->info_text, "ISO image produced: %d sectors\nWritten to medium : %d sectors at LBA %d\n", (int) (readcounter/ (off_t) 2048), xorriso->session_blocks, xorriso->session_lba); Xorriso_info(xorriso, 0); } } ret= isoburn_activate_session(drive); Xorriso_process_msg_queues(xorriso,0); if(ret<=0) { sprintf(xorriso->info_text, "Could not write new set of volume descriptors"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); goto ex; } /* Done early to free any reference to the libisofs resources via disc */ if(disc!=NULL) burn_disc_free(disc); disc= NULL; /* To wait for the end of the libisofs threads and their messages. */ isoburn_sync_after_write(source_drive, drive, 0); Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "Writing to %s completed successfully.\n\n", Text_shellsafe(xorriso->outdev,sfe,0)); Xorriso_info(xorriso, 0); ret= 1; ex:; xorriso->run_state= 0; /* Indicate that burning has ended */ Xorriso_set_abort_severity(xorriso, 0); if(ret<=0) { /* >>> ??? revive discarded boot image */; /* suppress automatic -commit at program end */ xorriso->volset_change_pending= 3; } if(disc!=NULL) burn_disc_free(disc); if(image != NULL) iso_image_unref(image); isoburn_igopt_destroy(&sopts, 0); if(burn_options != NULL) burn_write_opts_free(burn_options); Xorriso_process_msg_queues(xorriso,0); Xorriso_append_scdbackup_record(xorriso, 0); Xorriso_free_meM(sfe); Xorriso_free_meM(xorriso_id); Xorriso_free_meM(profile_name); Xorriso_free_meM(reasons); return(ret); cancel_iso:; isoburn_cancel_prepared_write(source_drive, drive, 0); goto ex; } int Xorriso_check_burn_abort(struct XorrisO *xorriso, int flag) { int ret; struct burn_drive_info *dinfo; struct burn_drive *drive; if(burn_is_aborting(0)) return(2); if(xorriso->run_state!=1) return(0); ret= Xorriso_eval_problem_status(xorriso, 1, 1); if(ret>=0) return(0); sprintf(xorriso->info_text, "-abort_on '%s' encountered '%s' during image writing", xorriso->abort_on_text, xorriso->problem_status_text); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, xorriso->problem_status_text, 0); ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to abort burn run", 2); if(ret<=0) return(0); burn_drive_cancel(drive); sprintf(xorriso->info_text, "libburn has now been urged to cancel its operation"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(1); } /* This loop watches burn runs until they end. It issues pacifying update messages to the user. @param flag bit0-3 = emulation mode 0= xorriso 1= mkisofs 2= cdrecord bit4= report speed in CD units bit5= report speed in BD units */ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive, int flag) { int ret, size, free_bytes, i, aborting= 0, emul, buffer_fill= 50, last_sector; int iso_wait_counter= 0, iso_cancel_limit= 5; struct burn_progress progress; char *status_text, date_text[80], *speed_unit, mem_text[8]; enum burn_drive_status drive_status; double start_time, current_time, last_time, base_time= 0.0, base_count= 0.0; double next_base_time= 0.0, next_base_count= 0.0, first_base_time= 0.0; double first_base_count= 0.0, norm= 0.0, now_time, fract_offset= 0.0; double measured_speed, speed_factor= 1385000, quot, speed_min_time; double tdiff, now_fract; time_t time_prediction; IsoImage *image= NULL; image= isoburn_get_attached_image(drive); start_time= Sfile_microtime(0); while(burn_drive_get_status(drive, NULL) == BURN_DRIVE_SPAWNING) usleep(100002); emul= flag&15; if(emul==0) emul= xorriso->pacifier_style; fract_offset= 1.0 / 3.0 * (double) emul - ((int) (1.0 / 3.0 * (double) emul)); speed_min_time= 0.2 * xorriso->pacifier_interval; speed_unit= "D"; if(flag&16) { speed_factor= 150.0*1024; speed_unit= "C"; } else if(flag & 32) { speed_factor= 4495625; speed_unit= "B"; } progress.sector= 0; current_time= Sfile_microtime(0); measured_speed= 0.0; while(1) { last_time= current_time; last_sector= progress.sector; drive_status= burn_drive_get_status(drive, &progress); if(drive_status == BURN_DRIVE_IDLE) { /* To avoid a race condition between burn_source and libisofs writer thread: Wait for ISO generator thread to have finished. After some seconds kick it by isoburn_cancel_prepared_write() which waits for the write thread to end. */ if(image == NULL) break; if(!iso_image_generator_is_running(image)) break; iso_wait_counter++; if(iso_wait_counter > iso_cancel_limit) { isoburn_cancel_prepared_write(drive, NULL, 0); break; } } current_time= Sfile_microtime(0); if(drive_status == BURN_DRIVE_WRITING && progress.sectors > 0) { if(current_time-last_time > speed_min_time) measured_speed= (progress.sector - last_sector) * 2048.0 / (current_time - last_time); buffer_fill= 50; if(progress.buffer_capacity>0) buffer_fill= (double) (progress.buffer_capacity - progress.buffer_available) * 100.0 / (double) progress.buffer_capacity; if(emul==2) { if(progress.sector<=progress.sectors) sprintf(xorriso->info_text, "%4d of %4d MB written", progress.sector / 512, progress.sectors / 512); else sprintf(xorriso->info_text, "%4d MB written", progress.sector / 512); if(xorriso->pacifier_fifo!=NULL) ret= burn_fifo_inquire_status(xorriso->pacifier_fifo, &size, &free_bytes, &status_text); else ret= isoburn_get_fifo_status(drive, &size, &free_bytes, &status_text); if(ret>0 ) sprintf(xorriso->info_text+strlen(xorriso->info_text), " (fifo %2d%%)", (int) (100.0-100.0*((double) free_bytes)/(double) size)); sprintf(xorriso->info_text+strlen(xorriso->info_text), " [buf %3d%%]", buffer_fill); if(current_time-last_time > speed_min_time) sprintf(xorriso->info_text+strlen(xorriso->info_text), " %4.1fx.", measured_speed/speed_factor); } else if(emul == 1 && progress.sectors > 0 && progress.sector <= progress.sectors) { /* "37.87% done, estimate finish Tue Jul 15 18:55:07 2008" */ quot= ((double) progress.sector) / ((double) progress.sectors); sprintf(xorriso->info_text, " %2.2f%% done", quot*100.0); if(current_time - start_time >= 2 && quot > 0.0 && (quot >= 0.02 || progress.sector >= 5*1024)) { if(base_time == 0.0 && progress.sector >= 16*1024) { first_base_time= base_time= next_base_time= current_time; first_base_count= next_base_count= progress.sector; } else if(next_base_time > 0 && current_time - next_base_time >= 10) { base_time= next_base_time; base_count= next_base_count; next_base_time= current_time; next_base_count= progress.sector; } if(first_base_time > 0 && current_time - first_base_time >= 10 && progress.sectors > first_base_count && progress.sector > first_base_count) { norm= (1.0 - quot); if(norm < 0.0001) norm= 0.0001; quot= ((double) progress.sector - first_base_count) / ((double) progress.sectors - first_base_count); time_prediction= norm * (1.0 - quot) / quot * (current_time - first_base_time); } else { time_prediction= (1.0 - quot) / quot * (current_time - start_time); norm= 1.0; } if(base_time > 0 && current_time - base_time >= 10 && progress.sectors > base_count) { quot= ((double) progress.sector - base_count) / ((double) progress.sectors - base_count); time_prediction+= (1.0 - quot) / quot * (current_time - base_time); norm+= 1.0; } time_prediction/= norm; if(time_prediction < 30*86400 && time_prediction > 0) { time_prediction+= current_time + 1; Ftimetxt(time_prediction, date_text, 4); sprintf(xorriso->info_text+strlen(xorriso->info_text), ", estimate finish %s", date_text); } } } else { if(progress.sector<=progress.sectors) { if(progress.sectors <= 0) strcpy(mem_text, " 99.9"); else sprintf(mem_text, "%5.1f", 100.0 * ((double) progress.sector) / ((double) progress.sectors)); mem_text[5]= 0; sprintf(xorriso->info_text, "Writing: %10ds %s%% ", progress.sector, mem_text); } else { Sfile_scale(2048.0 * (double) progress.sector, mem_text, 5, 1e4, 1); sprintf(xorriso->info_text, "Writing: %10ds %s ", progress.sector, mem_text); } ret= isoburn_get_fifo_status(drive, &size, &free_bytes, &status_text); if(ret>0 ) sprintf(xorriso->info_text+strlen(xorriso->info_text), " fifo %3d%% buf %3d%%", (int) (100.0-100.0*((double) free_bytes)/(double) size), buffer_fill); if(current_time - last_time > speed_min_time) sprintf(xorriso->info_text+strlen(xorriso->info_text), " %5.1fx%s ", measured_speed/speed_factor, speed_unit); } } else if(drive_status == BURN_DRIVE_CLOSING_SESSION || drive_status == BURN_DRIVE_CLOSING_TRACK) sprintf(xorriso->info_text, "Closing track/session. Working since %.f seconds", current_time-start_time); else if(drive_status == BURN_DRIVE_FORMATTING) sprintf(xorriso->info_text, "Formatting. Working since %.f seconds", current_time-start_time); else sprintf(xorriso->info_text, "Thank you for being patient. Working since %.f seconds.", current_time-start_time); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0); for(i= 0; i < 20; i++) { /* 10 usleeps more than supposed to be needed */ Xorriso_process_msg_queues(xorriso, 0); if(aborting<=0) aborting= Xorriso_check_burn_abort(xorriso, 0); usleep((unsigned long) (100000.0 * xorriso->pacifier_interval)); now_time= Sfile_microtime(0); tdiff= ((off_t)(now_time / xorriso->pacifier_interval)) - (off_t)(current_time / xorriso->pacifier_interval); now_fract= (now_time / xorriso->pacifier_interval - (off_t)(now_time / xorriso->pacifier_interval)); if(tdiff < 1.0) continue; if(fract_offset <= 0.0) /* "xorriso" pacifier shall not wait for slot */ break; if((now_fract >= fract_offset && now_fract < fract_offset + 0.3) || tdiff >= 2.0) break; } } iso_image_unref(image); return(1); } /* @param flag bit0= fast bit1= deformat bit2= do not re-aquire drive @return 0=failure, did not touch medium , -1=failure, altered medium 1=success, altered medium , 2=success, did not touch medium */ int Xorriso_blank_media(struct XorrisO *xorriso, int flag) { int ret, do_deformat= 0, signal_mode, using_immed; struct burn_drive_info *dinfo; struct burn_drive *drive; enum burn_disc_status disc_state; struct burn_progress p; double percent = 1.0; int current_profile; char current_profile_name[80]; time_t start_time; char mode_names[4][80]= {"all", "fast", "deformat", "deformat_quickest"}; char progress_text[40]; ret= Xorriso_may_burn(xorriso, 0); if(ret <= 0) return(0); ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to -blank", 2); if(ret<=0) return(0); burn_disc_get_profile(drive, ¤t_profile, current_profile_name); disc_state = isoburn_disc_get_status(drive); if(current_profile == 0x13) { /* overwritable DVD-RW */ /* Depending on flag bit1 formatted DVD-RW will get blanked to sequential state or pseudo blanked by invalidating an eventual ISO image. */ if(flag&2) do_deformat= 1; } else if(current_profile == 0x14) { /* sequential DVD-RW */ if((flag&1) && !(flag&2)) { sprintf(xorriso->info_text, "-blank: DVD-RW present. Mode 'fast' defaulted to mode 'all'."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); sprintf(xorriso->info_text, "Mode 'deformat_quickest' produces single-session-only media."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); flag&= ~1; } } if(disc_state == BURN_DISC_BLANK) { if(!do_deformat) { sprintf(xorriso->info_text, "Blank medium detected. Will leave it untouched"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return 2; } } else if(disc_state==BURN_DISC_FULL || disc_state==BURN_DISC_APPENDABLE) { ; } else if(disc_state == BURN_DISC_EMPTY) { sprintf(xorriso->info_text,"No media detected in drive"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return 0; } else { sprintf(xorriso->info_text, "Unsuitable drive and media state"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return 0; } if(!isoburn_disc_erasable(drive)) { sprintf(xorriso->info_text, "Media is not of erasable type"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return 0; } if(xorriso->do_dummy) { sprintf(xorriso->info_text, "-dummy mode prevents blanking of medium in mode '%s'.", mode_names[flag&3]); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(1); } using_immed= burn_drive_get_immed(drive); sprintf(xorriso->info_text, "Beginning to blank medium in mode '%s'.\n", mode_names[flag&3]); Xorriso_info(xorriso,0); /* Important: do not return until burn_is_aborting() was checked */ signal_mode= 1; ret= burn_drive_get_drive_role(drive); if(ret == 1) signal_mode|= 2; Xorriso_set_signal_handling(xorriso, signal_mode); if(do_deformat) burn_disc_erase(drive, (flag&1)); else isoburn_disc_erase(drive, (flag&1)); start_time= time(0); usleep(1000000); if(!using_immed) sprintf(progress_text, "synchronously since"); while (burn_drive_get_status(drive, &p) != BURN_DRIVE_IDLE) { Xorriso_process_msg_queues(xorriso,0); if(p.sectors>0 && p.sector>=0) /* display 1 to 99 percent */ percent = 1.0 + ((double) p.sector+1.0) / ((double) p.sectors) * 98.0; if(using_immed) sprintf(progress_text, "%.1f%% done in", percent); sprintf(xorriso->info_text, "Blanking ( %s %d seconds )", progress_text, (int) (time(0) - start_time)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0); usleep(1000000); } Xorriso_process_msg_queues(xorriso,0); if(burn_is_aborting(0)) Xorriso_abort(xorriso, 0); /* Never comes back */ Xorriso_set_signal_handling(xorriso, 0); if(burn_drive_wrote_well(drive)) { sprintf(xorriso->info_text, "Blanking done\n"); Xorriso_info(xorriso,0); } else { sprintf(xorriso->info_text, "Blanking failed."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } if(!(flag & 4)) { ret= Xorriso_reaquire_outdev(xorriso, 2 + (xorriso->in_drive_handle == xorriso->out_drive_handle)); if(ret <= 0) return(-1); } return(1); } /* @param flag bit0= try to achieve faster formatting bit1= use parameter size (else use default size) bit2= do not re-aquire drive bit5= try to disable Defect Management bit7= by_index mode: bit8 to bit15 contain the index of the format to use. @return 0=failure, did not touch medium , -1=failure, altered medium 1=success, altered medium , 2=success, did not touch medium */ int Xorriso_format_media(struct XorrisO *xorriso, off_t in_size, int flag) { int ret, mode_flag= 0, index, status, num_formats, signal_mode, using_immed; unsigned dummy; struct burn_drive_info *dinfo; struct burn_drive *drive; struct burn_progress p; double percent = 1.0; int current_profile; char current_profile_name[80], progress_text[40]; off_t size= 0; time_t start_time; enum burn_disc_status disc_state; ret= Xorriso_may_burn(xorriso, 0); if(ret <= 0) return(0); ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to -format", 2); if(ret<=0) return(0); if(flag & 2) { mode_flag= 0; /* format to given size */ } else { mode_flag= 4; /* format to full size */ } if(flag & 32) mode_flag|= 32; /* try to disable Defect Management */ burn_disc_get_profile(drive, ¤t_profile, current_profile_name); if(flag&128) { /* by_index */ index= (flag>>8) & 0xff; ret= burn_disc_get_formats(drive, &status, &size, &dummy, &num_formats); if(ret<=0) num_formats= 0; if(ret<=0 || index<0 || index>=num_formats) { if(num_formats>0) sprintf(xorriso->info_text, "-format by_index_%d: format descriptors range from index 0 to %d", index, num_formats-1); else sprintf(xorriso->info_text, "-format by_index_%d: no format descriptors available", index); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } mode_flag|= (flag & 0xff80); if(flag&1) mode_flag|= (1<<6); } else if(current_profile == 0x12) { /* DVD+RAM */ if(!(flag & 2)) mode_flag= 6; /* format to default payload size */ if(flag&1) mode_flag|= (1<<6); } else if(current_profile == 0x13) { /* DVD-RW */ if(flag&1) { sprintf(xorriso->info_text, "Detected formatted DVD-RW. Thus omitting desired fast format run."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(2); } } else if(current_profile == 0x14) { /* DVD-RW sequential */ if(flag & 1) { size= 128*1024*1024; mode_flag= 1; /* format to size, then write size of zeros */ } else mode_flag= 4; } else if(current_profile == 0x1a) { /* DVD+RW */ if(flag&1) { sprintf(xorriso->info_text, "Detected DVD+RW. Thus omitting desired fast format run."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(2); } } else if(current_profile == 0x41) { /* BD-R SRM */ if(!(flag & 2)) mode_flag= 6; /* format to default payload size */ if(flag&1) mode_flag|= (1<<6); } else if(current_profile == 0x43) { /* BD-RE */ if(!(flag & (2 | 32))) mode_flag= 6; /* format to default payload size */ if(flag&1) mode_flag|= (1<<6); } else { sprintf(xorriso->info_text, "-format: Unsuitable media detected."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); sprintf(xorriso->info_text,"Media current: %s (%4.4xh)", current_profile_name, current_profile); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(0); } if(!(flag & 1)) mode_flag|= 16; /* enable re-formatting */ if(xorriso->do_dummy) { sprintf(xorriso->info_text, "-dummy mode prevents formatting of medium."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(1); } using_immed= burn_drive_get_immed(drive); sprintf(xorriso->info_text, "Beginning to format medium.\n"); Xorriso_info(xorriso, 0); if(flag & 2) size= in_size; /* Important: do not return until burn_is_aborting() was checked */ signal_mode= 1; ret= burn_drive_get_drive_role(drive); if(ret == 1) signal_mode|= 2; Xorriso_set_signal_handling(xorriso, signal_mode); burn_disc_format(drive, size, mode_flag); start_time= time(0); usleep(1000000); if(!using_immed) sprintf(progress_text, "synchronously since"); while (burn_drive_get_status(drive, &p) != BURN_DRIVE_IDLE) { Xorriso_process_msg_queues(xorriso,0); if(p.sectors>0 && p.sector>=0) /* display 1 to 99 percent */ percent = 1.0 + ((double) p.sector+1.0) / ((double) p.sectors) * 98.0; if(using_immed) sprintf(progress_text, "%.1f%% done in", percent); sprintf(xorriso->info_text, "Formatting ( %s %d seconds )", progress_text, (int) (time(0) - start_time)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0); usleep(1000000); } Xorriso_process_msg_queues(xorriso,0); if(burn_is_aborting(0)) Xorriso_abort(xorriso, 0); /* Never comes back */ Xorriso_set_signal_handling(xorriso, 0); if(burn_drive_wrote_well(drive)) { sprintf(xorriso->info_text, "Formatting done\n"); Xorriso_info(xorriso,0); } else { sprintf(xorriso->info_text, "libburn indicates failure with formatting."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(-1); } if(!(flag & 4)) { ret= Xorriso_reaquire_outdev(xorriso, 2 + (xorriso->in_drive_handle == xorriso->out_drive_handle)); if(ret <= 0) return(-1); } disc_state = isoburn_disc_get_status(drive); if(disc_state==BURN_DISC_FULL && !(flag&1)) { /* Blank because full format certification pattern might be non-zero */ ret= Xorriso_blank_media(xorriso, 1); if(ret <= 0) return(0); } return(1); } /* @param flag bit2= formatting rather than blanking @return 0=failure, did not touch medium , -1=failure, altered medium 1=success, altered medium , 2=success, did not touch medium */ int Xorriso_blank_as_needed(struct XorrisO *xorriso, int flag) { int ret, is_formatted= -1, status, num_formats, did_work= 0; struct burn_drive_info *dinfo; struct burn_drive *drive; enum burn_disc_status disc_state; unsigned dummy; int current_profile; char current_profile_name[80]; off_t size; ret= Xorriso_may_burn(xorriso, 0); if(ret <= 0) return(0); ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to blank or format", 2); if(ret<=0) return(0); burn_disc_get_profile(drive, ¤t_profile, current_profile_name); ret= burn_disc_get_formats(drive, &status, &size, &dummy, &num_formats); if(ret>0) { if(status==BURN_FORMAT_IS_FORMATTED) is_formatted= 1; else if(status == BURN_FORMAT_IS_UNFORMATTED) is_formatted= 0; } if(current_profile == 0x12 || current_profile == 0x43) { /* DVD+RAM , BD-RE */ if(is_formatted<0) { sprintf(xorriso->info_text, "-blank or -format: Unclear formatting status of %s", current_profile_name); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(!is_formatted) { ret= Xorriso_format_media(xorriso, (off_t) 0, (current_profile == 0x43)); if(ret <= 0) return(ret); did_work= (ret == 1); } } else if(current_profile == 0x14 && (flag&4)) { /* DVD-RW sequential */ ret= Xorriso_format_media(xorriso, (off_t) 0, 0); if(ret <= 0) return(ret); did_work= (ret == 1); } else if(current_profile == 0x41) { /* BD-R SRM */ if((flag & 4) && !is_formatted) { ret= Xorriso_format_media(xorriso, (off_t) 0, 1); if(ret <= 0) return(ret); did_work= (ret == 1); } } disc_state = isoburn_disc_get_status(drive); if(disc_state != BURN_DISC_BLANK && !(flag&4)) { ret= Xorriso_blank_media(xorriso, 1); return(ret); } if(did_work) return(1); sprintf(xorriso->info_text, "%s as_needed: no need for action detected", (flag&4) ? "-format" : "-blank"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(2); } int Xorriso_retry_burn_track(struct XorrisO *xorriso, off_t write_start_address, char *track_source, off_t tsize, int flag) { int ret, auto_close_mem, do_close_mem; if(xorriso->do_tao == 1) { Xorriso_msgs_submit(xorriso, 0, "There is no hope for a re-try with -close \"on\" as long as -write_type is \"tao\"", 0, "FAILURE", 0); return(0); } Xorriso_msgs_submit(xorriso, 0, "Re-trying with -close \"on\"", 0, "NOTE", 0); do_close_mem= xorriso->do_close; auto_close_mem= xorriso->auto_close; xorriso->do_close= 1; xorriso->auto_close= 0; ret= Xorriso_burn_track(xorriso, write_start_address, track_source, tsize, flag); xorriso->do_close= do_close_mem; xorriso->auto_close= auto_close_mem; return(ret); } /* @param write_start_address is valid if >=0 @param tsize is valid if >0 @param flag bit0= grow_overwriteable_iso bit1= do_isosize bit2= do_xa1 conversion @return <=0 error , 1= success 2= failure with DVD-RW, please call Xorriso_retry_burn_track() */ int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address, char *track_source, off_t tsize, int flag) { int ret, fd, profile_number, is_cd= 0, dummy, nwa= -1; int isosize= -1, do_isosize, is_bd= 0, signal_mode; struct burn_drive_info *dinfo; struct burn_drive *drive; struct burn_write_opts *burn_options= NULL; struct burn_disc *disc= NULL; struct burn_session *session= NULL; struct burn_track *track= NULL; struct stat stbuf; off_t fixed_size= 0; struct burn_source *data_src= NULL, *fifo_src= NULL; enum burn_disc_status disc_state; char *reasons= NULL, *profile_name= NULL; char *head_buffer= NULL; Xorriso_alloc_meM(reasons, char, BURN_REASONS_LEN); Xorriso_alloc_meM(profile_name, char, 80); Xorriso_alloc_meM(head_buffer, char, 64 * 1024); ret= Xorriso_may_burn(xorriso, 0); if(ret <= 0) {ret= 0; goto ex;} ret= Xorriso_auto_format(xorriso, 0); if(ret <=0 ) {ret= 0; goto ex;} do_isosize= !!(flag&2); ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to burn track", 2); if(ret<=0) {ret= 0; goto ex;} ret= Xorriso_check_multi(xorriso, drive, 1); if(ret<=0) goto ex; ret= Xorriso_make_write_options(xorriso, drive, &burn_options, 0); if(ret<=0) goto ex; disc= burn_disc_create(); session= burn_session_create(); ret= burn_disc_add_session(disc,session,BURN_POS_END); if(ret==0) { sprintf(xorriso->info_text, "Cannot add session object to disc object."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); goto ex; } track= burn_track_create(); if(track_source[0] == '-' && track_source[1] == 0) { fd= 0; } else { if(xorriso->fs >= 64) fd= burn_os_open_track_src(track_source, O_RDONLY, 0); else fd= open(track_source, O_RDONLY | O_BINARY); if(fd>=0) if(fstat(fd,&stbuf)!=-1) if((stbuf.st_mode&S_IFMT)==S_IFREG) fixed_size= stbuf.st_size; } if(fd>=0) data_src= burn_fd_source_new(fd, -1, fixed_size); if(data_src==NULL) { sprintf(xorriso->info_text, "Could not open data source "); Text_shellsafe(track_source, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= 0; goto ex; } if((do_isosize || xorriso->fs != 0) && xorriso->fs < 64) xorriso->fs= 64; if(xorriso->fs > 0) { fifo_src= burn_fifo_source_new(data_src, 2048 + 8 * !!(flag & 4), xorriso->fs, 1); if(fifo_src == NULL) { sprintf(xorriso->info_text, "Could not create fifo object of %.f MB", ((double) xorriso->fs) / 1024.0 / 1024.0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); ret= 0; goto ex; } } xorriso->pacifier_fifo= fifo_src; if(burn_track_set_source(track, fifo_src == NULL ? data_src : fifo_src) != BURN_SOURCE_OK) { sprintf(xorriso->info_text, "Cannot attach source object to track object"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); ret= 0; goto ex; } burn_track_set_cdxa_conv(track, !!(flag & 4)); burn_session_add_track(session, track, BURN_POS_END); burn_source_free(data_src); if(flag&1) /* consider overwriteables with ISO as appendable */ disc_state= isoburn_disc_get_status(drive); else /* handle overwriteables as always blank */ disc_state= burn_disc_get_status(drive); if(disc_state == BURN_DISC_BLANK || disc_state == BURN_DISC_APPENDABLE) { /* ok */; } else { if(disc_state == BURN_DISC_FULL) { sprintf(xorriso->info_text, "Closed media with data detected. Need blank or appendable media."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); if(burn_disc_erasable(drive)) { sprintf(xorriso->info_text, "Try -blank as_needed\n"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); } } else if(disc_state == BURN_DISC_EMPTY) { sprintf(xorriso->info_text, "No media detected in drive"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } else { sprintf(xorriso->info_text, "Cannot recognize state of drive and media"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } ret= 0; goto ex; } if(isoburn_needs_emulation(drive)) burn_write_opts_set_multi(burn_options, 0); if(tsize > 0) { fixed_size= tsize; burn_track_set_size(track, fixed_size); } if(do_isosize) { ret= burn_fifo_peek_data(xorriso->pacifier_fifo, head_buffer, 64*1024, 0); if(ret<=0) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "Cannot obtain first 64 kB from input stream."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } /* read isosize from head_buffer, not from medium */ ret= isoburn_read_iso_head(drive, 0, &isosize, head_buffer, (1<<13)); if(ret<=0) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "Option -isosize given but data stream seems not to be ISO 9660"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } sprintf(xorriso->info_text, "Size of ISO 9660 image: %ds", isosize); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); fixed_size= ((off_t) (isosize)) * (off_t) 2048; burn_track_set_size(track, fixed_size); } ret= Xorriso_get_profile(xorriso, &profile_number, profile_name, 2); is_cd= (ret==2); is_bd= (ret == 3); if(isoburn_needs_emulation(drive)) { if(flag&1) { ret= isoburn_disc_track_lba_nwa(drive, burn_options, 0, &dummy, &nwa); Xorriso_process_msg_queues(xorriso,0); if(ret<=0) { sprintf(xorriso->info_text, "Cannot obtain next writeable address of emulated multi-session media\n"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(nwa == 32 && disc_state != BURN_DISC_APPENDABLE) nwa= 0; /* No automatic toc emulation. Formatter might not be aware. */ } else { nwa= 0; if (disc_state == BURN_DISC_APPENDABLE) { ret= isoburn_disc_track_lba_nwa(drive, burn_options, 0, &dummy, &nwa); Xorriso_process_msg_queues(xorriso,0); if(ret<=0) { sprintf(xorriso->info_text, "Cannot obtain next writeable address of emulated appendable media\n"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } } burn_write_opts_set_start_byte(burn_options,((off_t) nwa) * (off_t) 2048); } if(write_start_address>=0) { nwa= write_start_address / (off_t) 2048; if(((off_t) nwa) * (off_t) 2048 < write_start_address ) nwa++; burn_write_opts_set_start_byte(burn_options, ((off_t) nwa) * (off_t) 2048); } if(xorriso->do_tao) { if (xorriso->do_tao > 0) burn_write_opts_set_write_type(burn_options, BURN_WRITE_TAO, BURN_BLOCK_MODE1); else burn_write_opts_set_write_type(burn_options, BURN_WRITE_SAO, BURN_BLOCK_SAO); ret = burn_precheck_write(burn_options, disc, reasons, 0); if(ret<=0) { sprintf(xorriso->info_text, "Cannot set write type %s for this medium.\n", xorriso->do_tao > 0 ? "TAO" : "SAO"); sprintf(xorriso->info_text+strlen(xorriso->info_text), "Reasons given:\n%s", reasons); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } sprintf(xorriso->info_text, "Explicitly chosen write type: %s", xorriso->do_tao > 0 ? "TAO" : "SAO"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); } else { if(burn_write_opts_auto_write_type(burn_options, disc, reasons, 0) == BURN_WRITE_NONE) { sprintf(xorriso->info_text, "Failed to find a suitable write mode with this media.\n"); sprintf(xorriso->info_text+strlen(xorriso->info_text), "Reasons given:\n%s", reasons); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } ret= Xorriso_sanitize_image_size(xorriso, drive, disc, burn_options, 2); if(ret<=0) goto ex; sprintf(xorriso->info_text, "Beginning to write data track.\n"); Xorriso_info(xorriso,0); /* Important: do not return until burn_is_aborting() was checked */ signal_mode= 1; ret= burn_drive_get_drive_role(drive); if(ret == 1) signal_mode|= 2; Xorriso_set_signal_handling(xorriso, signal_mode); xorriso->run_state= 1; /* Indicate that burning has started */ burn_disc_write(burn_options, disc); ret= Xorriso_pacifier_loop(xorriso, drive, 2 | (is_cd << 4) | (is_bd << 5)); if(burn_is_aborting(0)) Xorriso_abort(xorriso, 0); /* Never comes back */ Xorriso_set_signal_handling(xorriso, 0); if(ret<=0) goto ex; if(!burn_drive_wrote_well(drive)) { Xorriso_process_msg_queues(xorriso,0); if(xorriso->auto_close && xorriso->do_close == 0) { if(burn_drive_was_feat21_failure(drive)) { sprintf(xorriso->info_text, "libburn indicates failure with writing DVD-RW to appendable state."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); /* Urge caller to call Xorriso_retry_burn_rack() */ ret= 2; goto ex; } } sprintf(xorriso->info_text, "libburn indicates failure with writing."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(flag & 1) { ret= Xorriso_update_iso_lba0(xorriso, nwa, isosize, head_buffer, NULL, flag & 2); if(ret <= 0) goto ex; } sprintf(xorriso->info_text, "Writing to "); Text_shellsafe(xorriso->outdev, xorriso->info_text, 1); strcat(xorriso->info_text, " completed successfully.\n\n"); Xorriso_info(xorriso, 0); ret= 1; ex:; Xorriso_process_msg_queues(xorriso,0); if(disc!=NULL) burn_disc_free(disc); if(session != NULL) burn_session_free(session); if(track != NULL) burn_track_free(track); if(burn_options != NULL) burn_write_opts_free(burn_options); if(xorriso->pacifier_fifo!=NULL) burn_source_free(xorriso->pacifier_fifo); xorriso->pacifier_fifo= NULL; xorriso->run_state= 0; /* Indicate that burning has ended */ Xorriso_free_meM(reasons); Xorriso_free_meM(profile_name); Xorriso_free_meM(head_buffer); return(ret); } int Xorriso_relax_compliance(struct XorrisO *xorriso, char *mode, int flag) { char *npt, *cpt; int l, was, value, ret; struct isoburn_imgen_opts *opts= NULL; char *msg= NULL; off_t limit; was= xorriso->relax_compliance; npt= cpt= mode; for(; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l == 0) continue; if((l == 6 && strncmp(cpt, "strict", l) == 0) || (l == 5 && strncmp(cpt, "clear", l) == 0)) { xorriso->relax_compliance= 0; } else if(l == 7 && strncmp(cpt, "default", l) == 0) { xorriso->relax_compliance= Xorriso_relax_compliance_defaulT; } else if((l == 18 && strncmp(cpt, "untranslated_names", l) == 0) || (l == 21 && strncmp(cpt, "untranslated_names_on", l) == 0) ) { xorriso->untranslated_name_len = -1; } else if((l == 22 && strncmp(cpt, "untranslated_names_off", l) == 0)) { xorriso->untranslated_name_len = 0; } else if((l >= 22 && strncmp(cpt, "untranslated_name_len=", 22) == 0)) { value= -1; sscanf(cpt + 22, "%d", &value); /* Let libisoburn check the value */ ret= isoburn_igopt_new(&opts, 0); if(ret != 1) return(-1); ret= isoburn_igopt_set_untranslated_name_len(opts, value); isoburn_igopt_destroy(&opts, 0); if(ret <= 0) { /* Not a tasty value */ xorriso->relax_compliance= was; return(0); } xorriso->untranslated_name_len = value; } else if((l == 16 && strncmp(cpt, "allow_dir_id_ext", l) == 0) || (l == 19 && strncmp(cpt, "allow_dir_id_ext_on", l) == 0) ) { xorriso->relax_compliance|= isoburn_igopt_allow_dir_id_ext; xorriso->allow_dir_id_ext_dflt= 0; } else if((l == 20 && strncmp(cpt, "allow_dir_id_ext_off", l) == 0)) { xorriso->relax_compliance&= ~isoburn_igopt_allow_dir_id_ext; xorriso->allow_dir_id_ext_dflt= 0; } else if((l == 12 && strncmp(cpt, "omit_version", l) == 0) || (l == 15 && strncmp(cpt, "omit_version_on", l) == 0) ) { xorriso->relax_compliance|= isoburn_igopt_omit_version_numbers; } else if((l == 16 && strncmp(cpt, "omit_version_off", l) == 0)) { xorriso->relax_compliance&= ~isoburn_igopt_omit_version_numbers; } else if((l == 16 && strncmp(cpt, "only_iso_version", l) == 0) || (l == 19 && strncmp(cpt, "only_iso_version_on", l) == 0) ) { xorriso->relax_compliance|= isoburn_igopt_only_iso_versions; } else if((l == 20 && strncmp(cpt, "only_iso_version_off", l) == 0)) { xorriso->relax_compliance&= ~isoburn_igopt_only_iso_versions; } else if((l == 10 && strncmp(cpt, "deep_paths", l) == 0) || (l == 13 && strncmp(cpt, "deep_paths_on", l) == 0)) { xorriso->relax_compliance|= isoburn_igopt_allow_deep_paths; } else if(l == 14 && strncmp(cpt, "deep_paths_off", l) == 0) { xorriso->relax_compliance&= ~isoburn_igopt_allow_deep_paths; } else if((l == 10 && strncmp(cpt, "long_paths", l) == 0) || (l == 13 && strncmp(cpt, "long_paths_on", l) == 0) ) { xorriso->relax_compliance|= isoburn_igopt_allow_longer_paths; } else if(l == 14 && strncmp(cpt, "long_paths_off", l) == 0) { xorriso->relax_compliance&= ~isoburn_igopt_allow_longer_paths; } else if((l == 10 && strncmp(cpt, "long_names", l) == 0) || (l == 13 && strncmp(cpt, "long_names_on", l) == 0)) { xorriso->relax_compliance|= isoburn_igopt_max_37_char_filenames; } else if(l == 14 && strncmp(cpt, "long_names_off", l) == 0) { xorriso->relax_compliance&= ~isoburn_igopt_max_37_char_filenames; } else if((l == 13 && strncmp(cpt, "no_force_dots", l) == 0) || (l == 16 && strncmp(cpt, "no_force_dots_on", l) == 0)) { xorriso->relax_compliance|= isoburn_igopt_no_force_dots; } else if(l == 17 && strncmp(cpt, "no_force_dots_off", l) == 0) { xorriso->relax_compliance&= ~isoburn_igopt_no_force_dots; } else if((l == 15 && strncmp(cpt, "no_j_force_dots", l) == 0) || (l == 18 && strncmp(cpt, "no_j_force_dots_on", l) == 0)) { xorriso->relax_compliance|= isoburn_igopt_no_j_force_dots; } else if(l == 19 && strncmp(cpt, "no_j_force_dots_off", l) == 0) { xorriso->relax_compliance&= ~isoburn_igopt_no_j_force_dots; } else if((l == 9 && strncmp(cpt, "lowercase", l) == 0) || (l == 12 && strncmp(cpt, "lowercase_on", l) == 0)) { xorriso->relax_compliance|= isoburn_igopt_allow_lowercase; } else if(l == 13 && strncmp(cpt, "lowercase_off", l) == 0) { xorriso->relax_compliance&= ~isoburn_igopt_allow_lowercase; } else if((l == 10 && strncmp(cpt, "full_ascii", l) == 0) || (l == 13 && strncmp(cpt, "full_ascii_on", l) == 0)) { xorriso->relax_compliance|= isoburn_igopt_allow_full_ascii; } else if(l == 14 && strncmp(cpt, "full_ascii_off", l) == 0) { xorriso->relax_compliance&= ~isoburn_igopt_allow_full_ascii; } else if((l == 10 && strncmp(cpt, "7bit_ascii", l) == 0) || (l == 13 && strncmp(cpt, "7bit_ascii_on", l) == 0)) { xorriso->relax_compliance|= isoburn_igopt_allow_7bit_ascii; } else if(l == 14 && strncmp(cpt, "7bit_ascii_off", l) == 0) { xorriso->relax_compliance&= ~isoburn_igopt_allow_7bit_ascii; } else if((l == 17 && strncmp(cpt, "joliet_long_paths", l) == 0) || (l == 20 && strncmp(cpt, "joliet_long_paths_on", l) == 0)) { xorriso->relax_compliance|= isoburn_igopt_joliet_longer_paths; } else if(l == 21 && strncmp(cpt, "joliet_long_paths_off", l) == 0) { xorriso->relax_compliance&= ~isoburn_igopt_joliet_longer_paths; } else if((l == 17 && strncmp(cpt, "joliet_long_names", l) == 0) || (l == 20 && strncmp(cpt, "joliet_long_names_on", l) == 0)) { xorriso->relax_compliance|= isoburn_igopt_joliet_long_names; } else if(l == 21 && strncmp(cpt, "joliet_long_names_off", l) == 0) { xorriso->relax_compliance&= ~isoburn_igopt_joliet_long_names; } else if((l == 12 && strncmp(cpt, "joliet_utf16", l) == 0) || (l == 15 && strncmp(cpt, "joliet_utf16_on", l) == 0)) { xorriso->relax_compliance|= isoburn_igopt_joliet_utf16; } else if(l == 16 && strncmp(cpt, "joliet_utf16_off", l) == 0) { xorriso->relax_compliance&= ~isoburn_igopt_joliet_utf16; } else if((l == 10 && strncmp(cpt, "always_gmt", l) == 0) || (l == 13 && strncmp(cpt, "always_gmt_on", l) == 0)) { xorriso->relax_compliance|= isoburn_igopt_always_gmt; } else if(l == 14 && strncmp(cpt, "always_gmt_off", l) == 0) { xorriso->relax_compliance&= ~isoburn_igopt_always_gmt; } else if((l == 9 && strncmp(cpt, "rec_mtime", l) == 0) || (l == 12 && strncmp(cpt, "rec_mtime_on", l) == 0)) { xorriso->relax_compliance|= (isoburn_igopt_dir_rec_mtime | isoburn_igopt_joliet_rec_mtime | isoburn_igopt_iso1999_rec_mtime); } else if(l == 13 && strncmp(cpt, "rec_mtime_off", l) == 0) { xorriso->relax_compliance&= ~(isoburn_igopt_dir_rec_mtime | isoburn_igopt_joliet_rec_mtime | isoburn_igopt_iso1999_rec_mtime); } else if((l == 6 && strncmp(cpt, "old_rr", l) == 0) || (l == 9 && strncmp(cpt, "old_rr_on", l) == 0) || (l == 10 && strncmp(cpt, "new_rr_off", l) == 0)) { xorriso->relax_compliance|= isoburn_igopt_rrip_version_1_10 | isoburn_igopt_aaip_susp_1_10; } else if((l == 10 && strncmp(cpt, "old_rr_off", l) == 0) || (l == 9 && strncmp(cpt, "new_rr_on", l) == 0) || (l == 6 && strncmp(cpt, "new_rr", l) == 0)) { xorriso->relax_compliance&= ~(isoburn_igopt_rrip_version_1_10 | isoburn_igopt_aaip_susp_1_10); } else if((l == 14 && strncmp(cpt, "aaip_susp_1_10", l) == 0) || (l == 17 && strncmp(cpt, "aaip_susp_1_10_on", l) == 0) || (l == 18 && strncmp(cpt, "aaip_susp_1_12_off", l) == 0)) { xorriso->relax_compliance|= isoburn_igopt_aaip_susp_1_10; } else if((l == 18 && strncmp(cpt, "aaip_susp_1_10_off", l) == 0) || (l == 17 && strncmp(cpt, "aaip_susp_1_12_on", l) == 0) || (l == 14 && strncmp(cpt, "aaip_susp_1_12", l) == 0)) { xorriso->relax_compliance&= ~isoburn_igopt_aaip_susp_1_10; } else if((l == 11 && strncmp(cpt, "no_emul_toc", l) == 0) || (l == 14 && strncmp(cpt, "no_emul_toc_on", l) == 0)) { xorriso->no_emul_toc|= 1; } else if((l == 15 && strncmp(cpt, "no_emul_toc_off", l) == 0) || (l == 8 && strncmp(cpt, "emul_toc", l) == 0)) { xorriso->no_emul_toc&= ~1; } else if((l == 13 && strncmp(cpt, "iso_9660_1999", l) == 0) || (l == 16 && strncmp(cpt, "iso_9660_1999_on", l) == 0)) { xorriso->do_iso1999= 1; } else if(l == 17 && strncmp(cpt, "iso_9660_1999_off", l) == 0) { xorriso->do_iso1999= 0; } else if((l >= 15 && strncmp(cpt, "iso_9660_level=", 15) == 0)) { value= 0; sscanf(cpt + 15, "%d", &value); if(value == 1 || value == 2) { limit= ((off_t) 4) * ((off_t) 1024*1024*1024) - ((off_t) 1); xorriso->iso_level= value; xorriso->iso_level_is_default= 0; if(xorriso->file_size_limit > limit) xorriso->file_size_limit= limit; } else if(value == 3) { xorriso->iso_level= value; xorriso->iso_level_is_default= 0; if(xorriso->file_size_limit < Xorriso_default_file_size_limiT) xorriso->file_size_limit= Xorriso_default_file_size_limiT; } else { Xorriso_alloc_meM(msg, char, 160); sprintf(msg, "-compliance iso_9660_level=%d : Only 1, 2, or 3 are permissible", value); Xorriso_msgs_submit(xorriso, 0, msg, 0, "FAILURE", 0); Xorriso_free_meM(msg); msg= NULL; xorriso->relax_compliance= was; return(0); } } else if((l == 8 && strncmp(cpt, "iso_9660", l) == 0) || (l == 11 && strncmp(cpt, "iso_9660_on", l) == 0)) { /* may have a meaning in future */; } else if(l == 12 && strncmp(cpt, "iso_9660_off", l) == 0) { /* may have a meaning in future */; Xorriso_msgs_submit(xorriso, 0, "-compliance -iso_9660_off : Cannot do anything else but ISO 9660", 0, "FAILURE", 0); xorriso->relax_compliance= was; return(0); } else if((l == 9 && strncmp(cpt, "old_empty", l) == 0) || (l == 12 && strncmp(cpt, "old_empty_on", l) == 0)) { xorriso->do_old_empty= 1; } else if(l == 13 && strncmp(cpt, "old_empty_off", l) == 0) { xorriso->do_old_empty= 0; } else { if(linfo_text, "-compliance: unknown rule '%s'", cpt); else sprintf(xorriso->info_text, "-compliance: oversized rule parameter (%d)", l); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); xorriso->relax_compliance= was; return(0); } } return(1); ex:; Xorriso_free_meM(msg); return(ret); } /* @return 1=ok 2=ok, is default setting */ int Xorriso_get_relax_text(struct XorrisO *xorriso, char mode[1024], int flag) { int r; r= xorriso->relax_compliance; if(r == 0) { strcpy(mode, "strict"); return(1); } strcpy(mode, "clear"); sprintf(mode + strlen(mode), ":iso_9660_level=%d", xorriso->iso_level); if(r & isoburn_igopt_allow_dir_id_ext) strcat(mode, ":allow_dir_id_ext"); if(r & isoburn_igopt_omit_version_numbers) strcat(mode, ":omit_version"); if(r & isoburn_igopt_only_iso_versions) strcat(mode, ":only_iso_version"); if(r & isoburn_igopt_allow_deep_paths) strcat(mode, ":deep_paths"); if(r & isoburn_igopt_allow_longer_paths) strcat(mode, ":long_paths"); if(r & isoburn_igopt_max_37_char_filenames) strcat(mode, ":long_names"); if(r & isoburn_igopt_no_force_dots) strcat(mode, ":no_force_dots"); if(r & isoburn_igopt_no_j_force_dots) strcat(mode, ":no_j_force_dots"); if(r & isoburn_igopt_allow_lowercase) strcat(mode, ":lowercase"); if(r & isoburn_igopt_allow_full_ascii) strcat(mode, ":full_ascii"); else if(r & isoburn_igopt_allow_7bit_ascii) strcat(mode, ":7bit_ascii"); if(r & isoburn_igopt_joliet_longer_paths) strcat(mode, ":joliet_long_paths"); if(r & isoburn_igopt_joliet_long_names) strcat(mode, ":joliet_long_names"); if(r & isoburn_igopt_joliet_utf16) strcat(mode, ":joliet_utf16"); if(r & isoburn_igopt_always_gmt) strcat(mode, ":always_gmt"); if(r & isoburn_igopt_dir_rec_mtime) strcat(mode, ":rec_mtime"); if(r & isoburn_igopt_rrip_version_1_10) { strcat(mode, ":old_rr"); if(!(r & isoburn_igopt_aaip_susp_1_10)) strcat(mode, ":aaip_susp_1_10_off"); } else { strcat(mode, ":new_rr"); if(r & isoburn_igopt_aaip_susp_1_10) strcat(mode, ":aaip_susp_1_10"); } if(xorriso->no_emul_toc & 1) strcat(mode, ":no_emul_toc"); if(xorriso->untranslated_name_len != 0) sprintf(mode + strlen(mode), ":untranslated_name_len=%d", xorriso->untranslated_name_len); if(xorriso->do_iso1999) sprintf(mode + strlen(mode), ":iso_9660_1999"); if(xorriso->do_old_empty) sprintf(mode + strlen(mode), ":old_empty"); return(1 + (r == Xorriso_relax_compliance_defaulT && !(xorriso->no_emul_toc & 1) && xorriso->untranslated_name_len == 0 && !xorriso->do_iso1999 && xorriso->iso_level == 3)); } /* @param flag bit0= operating on newly attached boot image */ int Xorriso_set_isolinux_options(struct XorrisO *xorriso, IsoImage *image, int flag) { int make_isohybrid_mbr= 0, ret, patch_table= 0, num_boots, i; ElToritoBootImage *bootimg, **boots = NULL; IsoFile *bootimg_node, **bootnodes = NULL; ret= iso_image_get_boot_image(image, &bootimg, &bootimg_node, NULL); Xorriso_process_msg_queues(xorriso,0); if(ret != 1) { sprintf(xorriso->info_text, "Programming error: No boot image available in Xorriso_set_isolinux_options()"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); ret= -1; goto ex; } ret= iso_image_get_all_boot_imgs(image, &num_boots, &boots, &bootnodes, 0); Xorriso_process_msg_queues(xorriso,0); if(ret != 1) { Xorriso_report_iso_error(xorriso, "", ret, "Cannot inquire boot images", 0, "FATAL", 1); ret= -1; goto ex; } /* bit0 : 1=boot-info-table , bit2-7 : 1=EFI , 2=HFS+ , bit8 : 1=APM */ patch_table = xorriso->patch_isolinux_image & 0x3fd; if((flag & 1) && num_boots > 1) { ret= el_torito_set_isolinux_options(boots[num_boots - 1], patch_table, 0); ret= (ret == 1); goto ex; } /* Handle patching of first attached boot image or of imported boot images */ for(i= 0; i < num_boots; i++) { patch_table = xorriso->patch_isolinux_image & 0x3fd; if(patch_table && !(flag & 1)) { if(!el_torito_seems_boot_info_table(boots[i], 0)) patch_table&= ~1; else if((xorriso->patch_isolinux_image & 2) && el_torito_get_boot_platform_id(boots[i]) == 0xef) patch_table&= ~1; } if(i > 0 || xorriso->boot_image_isohybrid == 0) { ret= el_torito_set_isolinux_options(boots[i], patch_table, 0); if(ret != 1) {ret= 0; goto ex;} continue; } /* <<< From here on only with first boot image and deprecated builtin isohybrid MBR */ if(xorriso->boot_image_isohybrid == 3) { make_isohybrid_mbr= 1; } else { ret= Xorriso_is_isohybrid(xorriso, bootimg_node, 0); if(ret < 0) {ret= 0; goto ex;} if(ret > 0) make_isohybrid_mbr= 1; } if(xorriso->boot_image_isohybrid == 2 && !make_isohybrid_mbr) { sprintf(xorriso->info_text, "Isohybrid signature is demanded but not found in boot image file."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } if(make_isohybrid_mbr) { sprintf(xorriso->info_text, "Will write isohybrid MBR."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } ret= el_torito_set_isolinux_options(bootimg, patch_table | (make_isohybrid_mbr << 1),0); if(ret != 1) {ret= 0; goto ex;} } ex: Xorriso_process_msg_queues(xorriso,0); if(boots != NULL) free(boots); if(bootnodes != NULL) free(bootnodes); return(ret); } int Xorriso_overwrite_iso_head(struct XorrisO *xorriso, struct burn_drive *drive, char *head_buffer, int lba, int flag) { int ret; off_t to_write; to_write= 64 * 1024; burn_drive_reset_simulate(drive, xorriso->do_dummy); ret= burn_random_access_write(drive, (off_t) lba * (off_t) 2048, head_buffer, to_write, 1); if(ret <= 0) { Xorriso_process_msg_queues(xorriso, 0); sprintf(xorriso->info_text, "Cannot write new ISO image head to LBA %d", lba); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* @param flag bit0= insist on tag_type 4 (relocated superblock tag) */ int Xorriso_find_sb_checksum(struct XorrisO *xorriso, char *head_buffer, int *vd_end, int flag) { int i, tag_type, ret; uint32_t pos, range_start, range_size, next_tag; char md5[16]; *vd_end= 0; /* Look for volume descriptor end */ for(i= 16; i < 32; i++) if(((unsigned char *) head_buffer)[i * 2048] == 0xff && strncmp(head_buffer + i * 2048 + 1, "CD001", 5) == 0) break; /* Check whether the next one is a libisofs checksum tag */ if(i < 32) { *vd_end= i; i++; ret= iso_util_decode_md5_tag(head_buffer + i * 2048, &tag_type, &pos, &range_start, &range_size, &next_tag, md5, 0); if(ret <= 0) return(ret); if((flag & 1) && tag_type != 4) return(0); /* No other tag type is supposed to occur before type 4 */ } return(i + 1); } /* @param field_head Example: " md5=" */ int Xorriso__set_iso_check_tag_md5(char *tag_data, char *field_head, void **ctx, int *field_end, int flag) { char md5_bin[16], m32, *cpt; int i; iso_md5_end(ctx, md5_bin); cpt= strstr(tag_data, field_head); if(cpt == NULL) return(0); cpt+= strlen(field_head); m32= cpt[32]; for(i= 0; i < 16; i++) sprintf(cpt + 2 * i, "%2.2x", ((unsigned char *) md5_bin)[i]); cpt[32]= m32; *field_end= (cpt - tag_data) + 32; return(1); } int Xorriso_verify_sb_tag(struct XorrisO *xorriso, char *head_buffer, int checksum_block, int flag) { int tag_type, ret; uint32_t pos, range_start, range_size, next_tag; char md5_rec[16], md5_comp[16]; void *ctx= NULL; /* Obtain checksum */ iso_util_decode_md5_tag(head_buffer + checksum_block * 2048, &tag_type, &pos, &range_start, &range_size, &next_tag, md5_rec, 0); /* Verify checksum */ ret= iso_md5_start(&ctx); if(ret <= 0) { Xorriso_process_msg_queues(xorriso,0); Xorriso_no_malloc_memory(xorriso, NULL, 0); return(0); } ret= iso_md5_compute(ctx, head_buffer, checksum_block * 2048); iso_md5_end(&ctx, md5_comp); if(ret <= 0) { Xorriso_process_msg_queues(xorriso,0); return(0); } if(iso_md5_match(md5_rec, md5_comp)) return(1); Xorriso_msgs_submit(xorriso, 0, "Superblock data do not match superblock checksum tag", 0, "WARNING", 0); return(0); } int Xorriso_refresh_sb_tag(struct XorrisO *xorriso, char *head_buffer, int checksum_block, int flag) { int ret, field_end; char md5_bin[16]; void *ctx= NULL; /* Recompute checksum and update found checksum tag */; ret= iso_md5_start(&ctx); if(ret <= 0) { no_md5_ctx:; Xorriso_process_msg_queues(xorriso,0); Xorriso_no_malloc_memory(xorriso, NULL, 0); return(0); } ret= iso_md5_compute(ctx, head_buffer, checksum_block * 2048); if(ret <= 0) { md5_comp_failed:; iso_md5_end(&ctx, md5_bin); return(0); } Xorriso__set_iso_check_tag_md5(head_buffer + checksum_block * 2048, " md5=", &ctx, &field_end, 0); if(ret <= 0) return(2); ret= iso_md5_start(&ctx); if(ret <= 0) goto no_md5_ctx; ret= iso_md5_compute(ctx, head_buffer + checksum_block * 2048, field_end); if(ret <= 0) goto md5_comp_failed; Xorriso__set_iso_check_tag_md5(head_buffer + checksum_block * 2048, " self=", &ctx, &field_end, 0); return(1); } /* @param flag bit0= obtain iso_lba from indev bit1= head_buffer already contains a valid head bit2= issue message about success bit3= check whether source blocks are banned by in_sector_map bit4= refresh relocated sb checksum tag */ int Xorriso_update_iso_lba0(struct XorrisO *xorriso, int iso_lba, int isosize, char *head_buffer, struct CheckmediajoB *job, int flag) { int ret, full_size, i, checksum_block= -1, vd_end; char *headpt; struct burn_drive_info *dinfo; struct burn_drive *drive = NULL; off_t seek_ret, to_write; ret= Xorriso_may_burn(xorriso, 0); if(ret <= 0) return(0); if(flag & 1) { ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to learn current session lba", 0); if(ret<=0) return(0); ret= isoburn_disc_get_msc1(drive, &iso_lba); if(ret<=0) return(0); drive= NULL; /* indev will not be used furtherly */ } if(job == NULL) { ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to update at lba 0 to 31", 2); if(ret<=0) return(0); } if(iso_lba < 32) return(2); if(!(flag & 2)) { /* head_buffer was not filled yet. Read it from output media. */ if(drive != NULL) if(burn_drive_get_drive_role(drive) == 5) /* write-only */ return(2); if(job != NULL && job->data_to_fd >= 0) { if((flag & 8) && job->sector_map != NULL) { ret= Sectorbitmap_bytes_are_set(job->sector_map, ((off_t) iso_lba) * (off_t) 2048, ((off_t) (iso_lba + 32)) * ((off_t) 2048) - (off_t) 1, 0); if(ret <= 0) { sprintf(xorriso->info_text, "ISO image head at lba %d is marked as invalid blocks in file copy", iso_lba); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); return(0); } } seek_ret= lseek(job->data_to_fd, ((off_t) 2048) * (off_t) iso_lba, SEEK_SET); if(seek_ret == -1) ret= 0; else ret= read(job->data_to_fd, head_buffer, 64 * 1024); if(ret < 64 * 1024) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "Cannot read ISO image head from file copy"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE",0); return(0); } ret= isoburn_read_iso_head(NULL, 0, &isosize, head_buffer, 1 << 13); if(ret<=0) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "Alleged session start does not look like ISO 9660."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE",0); return(0); } } else { ret= 0; if(drive != NULL) ret= isoburn_read_iso_head(drive, iso_lba, &isosize, head_buffer, 2); if(ret<=0) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "Cannot read freshly written ISO image head"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } } /* patch ISO header */ full_size= iso_lba + isosize; headpt= head_buffer + 32*1024; for(i=0;i<4;i++) headpt[87-i]= headpt[80+i]= (full_size >> (8*i)) & 0xff; /* >>> What about Joliet et.al. ? */; if(flag & 16) { /* Find relocated sb checksum tag */ ret= Xorriso_find_sb_checksum(xorriso, head_buffer, &vd_end, 1); if(ret > 0) { /* If it is recognizable then it matched in Xorriso_adjust_relocated_sb */ checksum_block= ret - 1; ret= Xorriso_refresh_sb_tag(xorriso, head_buffer, checksum_block, 0); if(ret <= 0) return(0); } } if(job != NULL) { /* This is a check_media superblock relocation: Invalidate eventual libisofs checksum tags. Write only up to PVD end plus eventual invalidated tag. */ to_write= 2048 * 32; ret= Xorriso_find_sb_checksum(xorriso, head_buffer, &i, 0); if(ret > 0) { if(!(flag & 16)) /* invalidate */ memset(head_buffer + (ret - 1) * 2048, 0, 8); to_write= 2048 * ret; } else if(i > 0) { to_write= 2048 * (i + 1); } seek_ret= lseek(job->data_to_fd, (off_t) 0, SEEK_SET); if(seek_ret == -1) ret= 0; else ret= write(job->data_to_fd, head_buffer, to_write); if(ret < to_write) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "Cannot write ISO image head to file copy"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE",0); return(0); } } else { /* This is a regular superblock relocation. Write full 64 kB. */ ret= Xorriso_overwrite_iso_head(xorriso, drive, head_buffer, 0, 0); if(ret <= 0) return(ret); } if(flag & 4) { sprintf(xorriso->info_text, "Overwrote LBA 0 to 31 by 64 KiB from LBA %d", iso_lba); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } return(1); } /* @return 1= ok, 0= no match, -1= MD5 computation error, -2= MD5 clone or start error */ int Xorriso_migrate_checksum_tag(struct XorrisO *xorriso, char *buffer, int buf_base, int start, int checksum_block, char md5_rec[16], void *ctx_unch, void *ctx_chng, int flag) { int ret, to_compute; char *headpt, md5_clone[16]; void *ctx_clone= NULL; int field_end; /* Checksum both up to before checksum tag */ headpt= buffer + start * 2048; to_compute= (checksum_block - start) * 2048; if(to_compute > 0) { ret= iso_md5_compute(ctx_unch, headpt, to_compute); if(ret <= 0) {ret= -1; goto ex;} ret= iso_md5_compute(ctx_chng, headpt, to_compute); if(ret <= 0) {ret= -1; goto ex;} } /* Verify with unchanged checksum */ ret= iso_md5_clone(ctx_unch, &ctx_clone); if(ret <= 0) {ret= -2; goto ex;} iso_md5_end(&ctx_clone, md5_clone); if(!iso_md5_match(md5_rec, md5_clone)) {ret= 0; goto ex;} /* Compute unchanged rest of block range */ headpt= buffer + checksum_block * 2048; to_compute= 2048; ret= iso_md5_compute(ctx_unch, headpt, to_compute); if(ret <= 0) {ret= -1; goto ex;} /* Replace checksum in tag by changed checksum */ ret= iso_md5_clone(ctx_chng, &ctx_clone); if(ret <= 0) {ret= -2; goto ex;} Xorriso__set_iso_check_tag_md5(headpt, " md5=", &ctx_clone, &field_end, 0); /* Recompute and write self= checksum */ ret= iso_md5_start(&ctx_clone); if(ret <= 0) {ret= -2; goto ex;} ret= iso_md5_compute(ctx_clone, headpt, field_end); if(ret <= 0) {ret= -1; goto ex;} Xorriso__set_iso_check_tag_md5(headpt, " self=", &ctx_clone, &field_end, 0); /* Add rest of head_buffer to changed checksum */ ret= iso_md5_compute(ctx_chng, headpt, to_compute); if(ret <= 0) {ret= -1; goto ex;} ret= 1; ex:; if(ctx_clone != NULL) iso_md5_end(&ctx_clone, md5_clone); return(ret); } /* Verify and re-compute tree and session checksum tag */ int Xorriso_refresh_ts_tags(struct XorrisO *xorriso, struct burn_drive *drive, void *ctx_unch, void *ctx_chng, int iso_lba, int session_size, int checksum_block, int flag) { int i, ret, tag_type, look_for_tag, check_start, look_from_block, was_change; off_t read_pos, to_read, data_count; uint32_t pos, range_start, range_size, next_tag; char md5_rec[16]; char *buf= NULL; look_for_tag= 3; /* tree tag */ look_from_block= checksum_block + 1; /* first buffer is already partly done */ Xorriso_alloc_meM(buf, char, 32 * 2048); for(read_pos= iso_lba; read_pos < iso_lba + session_size; read_pos+= 32) { was_change= 0; to_read= 32; if(read_pos + to_read > iso_lba + session_size) to_read= iso_lba + session_size - read_pos; ret= burn_read_data(drive, read_pos * (off_t) 2048, buf, to_read * (off_t) 2048, &data_count, 0); if(ret <= 0) {ret= 0; goto ex;} check_start= look_from_block; for(i= look_from_block; i < to_read; i++) { /* Watch out for tag */ ret= iso_util_decode_md5_tag(buf + i * 2048, &tag_type, &pos, &range_start, &range_size, &next_tag, md5_rec, look_for_tag); if(ret < 0 ) { ret= 0; goto ex; } else if(ret == 1) { if(tag_type != look_for_tag) { sprintf(xorriso->info_text, "Encountered checksum tag type %d while looking for %d", tag_type, look_for_tag); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "MISHAP", 0); ret= 2; goto ex; } /* Checksum up to before tag, verify, if match replace checksum and write */ ret= Xorriso_migrate_checksum_tag(xorriso, buf, read_pos, check_start, i, md5_rec, ctx_unch, ctx_chng, 0); if(ret == -2) goto ex; if(ret < 0) {ret= 0; goto ex;} if(ret == 0) { sprintf(xorriso->info_text, "Checksum tag MD5 mismatch in old session state"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "MISHAP", 0); ret= 2; goto ex; } was_change= 1; if(look_for_tag == 3) { look_for_tag= 1; /* session tag */ } else { look_for_tag= -1; break; } check_start= i + 1; } } look_from_block= 0; /* all following buffer need processing from start */ if(was_change) { ret= burn_random_access_write(drive, (off_t) read_pos * (off_t) 2048, buf, to_read * (off_t) 2048, 1); if(ret <= 0) { Xorriso_process_msg_queues(xorriso, 0); sprintf(xorriso->info_text, "Cannot write new checksum tag data to LBA %d", (int) read_pos); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } if(look_for_tag < 0) {ret= 1; goto ex;} /* Checksum what was not checksummed yet */ if(to_read - check_start > 0) { ret= iso_md5_compute(ctx_unch, buf + 2048 * check_start, (to_read - check_start) * 2048); if(ret <= 0) {ret= 0; goto ex;} ret= iso_md5_compute(ctx_chng, buf + 2048 * check_start, (to_read - check_start) * 2048); if(ret <= 0) {ret= 0; goto ex;} } } ret= 1; ex:; Xorriso_free_meM(buf); return(ret); } int Xorriso_adjust_session_size(struct XorrisO *xorriso, struct burn_drive *drive, char *head_buffer, int iso_lba, int iso_size, int checksum_block, int session_size, int flag) { int i, ret, tag_type; uint32_t pos, range_start, range_size, next_tag; char *headpt, md5_unch[16], md5_chng[16], md5_clone[16], md5_rec[16]; void *ctx_unch= NULL, *ctx_chng= NULL, *ctx_clone= NULL; if(checksum_block > 0) { /* Obtain recorded superblock MD5 */ ret= iso_util_decode_md5_tag(head_buffer + checksum_block * 2048, &tag_type, &pos, &range_start, &range_size, &next_tag, md5_rec, 0); if(ret <= 0 || tag_type != 2) { sprintf(xorriso->info_text, "Encountered checksum tag type %d while looking for 2", tag_type); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "MISHAP", 0); checksum_block= 0; } } if(checksum_block > 0) { /* Create md5 context for unchanged state */ ret= iso_md5_start(&ctx_unch); if(ret <= 0) { no_ctx:; Xorriso_process_msg_queues(xorriso, 0); Xorriso_no_malloc_memory(xorriso, NULL, 0); goto ex; } /* Checksum up to before PVD */ ret= iso_md5_compute(ctx_unch, head_buffer, 32768); if(ret <= 0) goto ex; /* Before the first change: obtain md5 object for changed state */ ret= iso_md5_clone(ctx_unch, &ctx_chng); if(ret <= 0) goto no_ctx; /* Add PVD to unchanged checksum */ ret= iso_md5_compute(ctx_unch, head_buffer + 32768, 2048); if(ret <= 0) goto ex; } /* Update session PVD at iso_lba+16 to iso_size */ headpt= head_buffer + 32 * 1024; for(i= 0; i < 4; i++) headpt[87 - i]= headpt[80 + i]= (iso_size >> (8 * i)) & 0xff; if(checksum_block > 0) { /* Add changed PVD to changed checksum */ ret= iso_md5_compute(ctx_chng, head_buffer + 32768, 2048); if(ret <= 0) goto ex; ret= Xorriso_migrate_checksum_tag(xorriso, head_buffer, iso_lba, 17, checksum_block, md5_rec, ctx_unch, ctx_chng, 0); if(ret == -2) goto no_ctx; if(ret < 0) {ret= 0; goto ex;} if(ret == 0) { sprintf(xorriso->info_text, "Superblock MD5 mismatch in old session state"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "MISHAP", 0); checksum_block= 0; } } ret= Xorriso_overwrite_iso_head(xorriso, drive, head_buffer, iso_lba, 0); if(ret <= 0) goto ex; if(checksum_block > 0) { /* Verify and re-compute existing checksum tree and session tag */ ret= Xorriso_refresh_ts_tags(xorriso, drive, ctx_unch, ctx_chng, iso_lba, session_size, checksum_block, 0); if(ret == -2) goto no_ctx; if(ret <= 0) goto ex; } ret= 1; ex:; Xorriso_process_msg_queues(xorriso, 0); if(ctx_unch != NULL) iso_md5_end(&ctx_unch, md5_unch); if(ctx_chng != NULL) iso_md5_end(&ctx_chng, md5_chng); if(ctx_clone != NULL) iso_md5_end(&ctx_clone, md5_clone); return(ret); } /* Read relocated superblock and patch in the VDs of the session superblock */ int Xorriso_adjust_relocated_sb(struct XorrisO *xorriso, struct burn_drive *drive, char *head_buffer, char **sb_buffer, int flag) { int ret, old_size, i, vd_end, checksum_block= -1; char *buffer, *checksum= NULL; *sb_buffer= NULL; Xorriso_alloc_meM(*sb_buffer, char, 32 * 2048); buffer= *sb_buffer; Xorriso_alloc_meM(checksum, char, 2048); ret= isoburn_read_iso_head(drive, 0, &old_size, buffer, 2); if(ret <= 0) goto ex; ret= Xorriso_find_sb_checksum(xorriso, buffer, &vd_end, 0); if(ret <= 0) goto ex; if(ret > 0) { checksum_block= ret - 1; memcpy(checksum, buffer + checksum_block * 2048, 2048); ret= Xorriso_verify_sb_tag(xorriso, buffer, checksum_block, 0); if(ret <= 0) { checksum_block= -1; memset(checksum, 0, 8); } } for(i= 16; i < 32; i++) { memcpy(buffer + i * 2048, head_buffer + i * 2048, 2048); if(((unsigned char *) head_buffer)[i * 2048] == 0xff && strncmp(head_buffer + i * 2048 + 1, "CD001", 5) == 0) { i++; break; } } if(checksum_block >= 0 && i < 32) memcpy(buffer + i * 2048, checksum, 2048); ret= 1; ex: if(ret <= 0) Xorriso_free_meM(*sb_buffer); Xorriso_free_meM(checksum); return(ret); } int Xorriso_truncate_overwritable(struct XorrisO *xorriso, char *adr_mode, char *adr_value, char *adjust, int flag) { int ret, iso_lba= 0, iso_session, iso_track, iso_size= 0, image_start_mode= 0; int old_size, new_size, blocks, was_indev= 0, checksum_block= 0, vd_end; int readable_blocks; char image_start_value[81], *head_buffer= NULL, iso_volid[33]; char *sb_buffer= NULL; struct burn_drive_info *dinfo; struct burn_drive *drive = NULL, *in_drive = NULL; struct burn_multi_caps *caps= NULL; Xorriso_alloc_meM(head_buffer, char, 32 * 2048); if(Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text, "-truncate_overwritable: Image changes pending. -commit or -rollback first"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } ret= Xorriso_may_burn(xorriso, 0); if(ret <= 0) goto ex; ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to activate an older session", 2); if(ret <= 0) goto ex; /* Is it overwritable ? */ ret= burn_disc_get_multi_caps(drive, BURN_WRITE_NONE, &caps, 0); if(ret > 0) { if(caps->start_adr == 0) ret= 0; } if(ret <= 0) { sprintf(xorriso->info_text, "-truncate_overwritable: Loaded medium is not random-access overwritable"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } ret= Xorriso_reassure(xorriso, "-truncate_overwritable", "activates an older session and destroys newer ones", 0); if(ret <= 0) {ret= 2; goto ex;} /* Learn old size */ ret= isoburn_read_iso_head(drive, 0, &old_size, iso_volid, 0); if(ret <= 0) { sprintf(xorriso->info_text, "-truncate_overwritable: Cannot read ISO 9660 Volume Descriptor from LBA 0"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } /* Check for PVD at image_start_value and learn new size */ ret= Xorriso_decode_load_adr(xorriso, "-truncate_overwritable", adr_mode, adr_value, &image_start_mode, image_start_value, 0); if(ret <= 0) goto ex; ret= isoburn_get_mount_params(drive, image_start_mode, image_start_value, &iso_lba, &iso_track, &iso_session, iso_volid, 0); if(ret <= 0) goto ex; if(ret != 1) { sprintf(xorriso->info_text, "-truncate_overwritable: Given address does not lead to ISO 9660 Volume Descriptor"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(iso_lba >= old_size) { sprintf(xorriso->info_text, "-truncate_overwritable: Given address is larger than current ISO size"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } ret= isoburn_read_iso_head(drive, iso_lba, &new_size, head_buffer, 2); if(ret <= 0) goto ex; ret= Xorriso_find_sb_checksum(xorriso, head_buffer, &vd_end, 0); if(ret > 0) checksum_block= ret - 1; /* Default is "new" */ iso_size= new_size; if(strcmp(adjust, "old") == 0) { /* ISO size before truncation */ iso_size= old_size - iso_lba; } else if(adjust[0] == '+') { /* Add-on size to new */ blocks= Scanf_io_size(adjust + 1, 0) / 2048; if(blocks < 0) goto wrong_adjust; iso_size+= blocks; } else if(adjust[0] >= '0' && adjust[0] <= '9') { /* Add-on size to new */ blocks= Scanf_io_size(adjust, 0) / 2048; if(blocks < iso_lba + iso_size) { wrong_adjust:; sprintf(xorriso->info_text, "-truncate_overwritable: Given total filesystem size is smaller than new session size"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } iso_size= blocks - iso_lba; } ret= burn_get_read_capacity(drive, &readable_blocks, 0); Xorriso_process_msg_queues(xorriso, 0); if(ret > 0) { if(iso_lba + iso_size > readable_blocks) { sprintf(xorriso->info_text, "-truncate_overwritable: Given total filesystem size is larger than formatted medium size"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } /* Give up possible input drive */ ret= Xorriso_get_drive_handles(xorriso, &dinfo, &in_drive, "", 16); if(ret < 0) goto ex; if(ret == 1) { ret= Xorriso_give_up_drive(xorriso, 1); if(ret<=0) goto ex; was_indev= 1; } if(iso_size != new_size) { ret=Xorriso_adjust_session_size(xorriso, drive, head_buffer, iso_lba, iso_size, checksum_block, new_size, 0); if(ret <= 0) goto ex; } /* Load first 64 kB and transfer VDs from head_buffer */ ret= Xorriso_adjust_relocated_sb(xorriso, drive, head_buffer, &sb_buffer, 0); if(ret <= 0) goto ex; /* Patch the size and write back */ ret= Xorriso_update_iso_lba0(xorriso, iso_lba, iso_size, sb_buffer, NULL, 2 | 16); if(ret <= 0) goto ex; ret= Xorriso_reaquire_outdev(xorriso, 2 + was_indev); if(ret <= 0) goto ex; ret= 1; ex: if(caps!=NULL) burn_disc_free_multi_caps(&caps); Xorriso_free_meM(head_buffer); Xorriso_free_meM(sb_buffer); Xorriso_process_msg_queues(xorriso,0); return(ret); } int Xorriso_set_system_area_path(struct XorrisO *xorriso, char *path, int flag) { int ret; char *eff_src= NULL, *intvl; struct iso_interval_reader *ivr= NULL; off_t byte_count; IsoImage *img= NULL; struct burn_drive_info *source_dinfo; struct burn_drive *source_drive; if(path[0] == 0) { xorriso->system_area_disk_path[0]= 0; {ret= 1; goto ex;} } Xorriso_alloc_meM(eff_src, char, SfileadrL); intvl = path; ret = Xorriso_check_intvl_string(xorriso, &intvl, 0); if(ret > 0) { /* Check for syntactical correctness */ if(xorriso->in_drive_handle != NULL) { ret= Xorriso_get_drive_handles(xorriso, &source_dinfo, &source_drive, "on attempt to verify interval reader string", 0); if(ret<=0) goto ex; img= isoburn_get_attached_image(source_drive); } ret= iso_interval_reader_new(img, intvl, &ivr, &byte_count, 1); Xorriso_process_msg_queues(xorriso, 0); if(ret < 0) { sprintf(xorriso->info_text, "Given path for system area is not accepted by interval reader"); Text_shellsafe(eff_src, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } iso_interval_reader_destroy(&ivr, 0); ret= Sfile_str(xorriso->system_area_disk_path, path, 0); if(ret <= 0) {ret= -1; goto ex;} ret= 1; goto ex; } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, path, eff_src, 2|4|16); if(ret < 0) goto ex; if(ret == 0) { sprintf(xorriso->info_text, "Given path does not exist on disk: -boot_image system_area="); Text_shellsafe(eff_src, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } if(ret == 2) { sprintf(xorriso->info_text, "Given path leads to a directory: -boot_image system_area="); Text_shellsafe(eff_src, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } ret= Sfile_str(xorriso->system_area_disk_path, eff_src, 0); if(ret <= 0) {ret= -1; goto ex;} ret= 1; ex: Xorriso_free_meM(eff_src); if(img != NULL) iso_image_unref(img); return(ret); } /* @param flag bit0=force burn_disc_close_damaged() */ int Xorriso_close_damaged(struct XorrisO *xorriso, int flag) { int ret; struct burn_drive_info *dinfo; struct burn_drive *drive; struct burn_write_opts *burn_options= NULL; if(Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text, "Image changes pending. -commit or -rollback first"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to close damaged session", 2); if(ret<=0) goto ex; ret= Xorriso_check_multi(xorriso, drive, 0); if(ret<=0) goto ex; ret= Xorriso_make_write_options(xorriso, drive, &burn_options, 0); if(ret <= 0) goto ex; ret= burn_disc_close_damaged(burn_options, flag & 1); Xorriso_process_msg_queues(xorriso, 0); Xorriso_option_dev(xorriso, "", 3 | 4); /* Give up drives */ if(ret <= 0) goto ex; ret= 1; ex:; Xorriso_process_msg_queues(xorriso, 0); if(burn_options != NULL) burn_write_opts_free(burn_options); return(ret); } /* @param flag bit0= no error message */ int Xorriso_parse_guid(struct XorrisO *xorriso, char *text, uint8_t guid[16], int flag) { int bin_count= 0, ret; uint8_t u[16], tr; /* Try RFC 4122 : big endian XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX Translate to UEFI: first three components to little-endian */ if(strlen(text) == 36) { if(text[8] == '-' && text[13] == '-' && text[18] == '-' && text[23] == '-'){ ret= Hex_to_bin(text, 4, &bin_count, u, 0); if(ret < 0 || bin_count != 4) goto malformed; tr= u[0]; u[0]= u[3]; u[3]= tr; tr= u[1]; u[1]= u[2]; u[2]= tr; ret= Hex_to_bin(text + 9, 2, &bin_count, u + 4, 0); if(ret < 0 || bin_count != 2) goto malformed; tr= u[4]; u[4]= u[5]; u[5]= tr; ret= Hex_to_bin(text + 14, 2, &bin_count, u + 6, 0); if(ret < 0 || bin_count != 2) goto malformed; tr= u[6]; u[6]= u[7]; u[7]= tr; ret= Hex_to_bin(text + 19, 2, &bin_count, u + 8, 0); if(ret < 0 || bin_count != 2) goto malformed; ret= Hex_to_bin(text + 24, 6, &bin_count, u + 10, 0); if(ret < 0 || bin_count != 6) goto malformed; memcpy(guid, u, 16); return(1); } } if(strlen(text) == 32) { ret= Hex_to_bin(text, 16, &bin_count, u, 0); if(ret < 0 || bin_count != 16) goto malformed; memcpy(guid, u, 16); return(1); } malformed:; if(!(flag & 1)) { sprintf(xorriso->info_text, "Malformed GUID string: "); Text_shellsafe(text, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } return(0); } int Xorriso_parse_gpt_guid(struct XorrisO *xorriso, char *text, int flag) { int ret; if(strcmp(text, "random") == 0) { xorriso->gpt_guid_mode= 0; return(1); } if(strcmp(text, "modification-date") == 0 || strcmp(text, "volume_date_uuid") == 0) { xorriso->gpt_guid_mode= 2; return(1); } ret= Xorriso_parse_guid(xorriso, text, xorriso->gpt_guid, 0); if(ret <= 0) return(ret); xorriso->gpt_guid_mode= 1; return(1); } /* @return Tells the recognition status 0= not recognized as GUID 1= non-EFI type GUID 2= EFI type GUID */ int Xorriso_parse_type_guid(struct XorrisO *xorriso, char *text, uint8_t guid[16], int *mbr_type, int flag) { int j, ret; static uint8_t efi_sys_uuid[16] = { 0x28, 0x73, 0x2a, 0xc1, 0x1f, 0xf8, 0xd2, 0x11, 0xba, 0x4b, 0x00, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b }; ret= Xorriso_parse_guid(xorriso, text, guid, 1); if(ret > 0) { for(j= 0; j < 16; j++) if(guid[j] != efi_sys_uuid[j]) break; if(j >= 16) { *mbr_type= 0xef; return(2); } else { *mbr_type= 0x83; return(1); } } return(0); } libisoburn-1.5.4/xorriso/xorriso_private.h0000644000175700017510000010312713763670413015755 00000000000000 /* Command line oriented batch and dialog tool which creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains inner declarations of xorriso. The public interface is in xorriso.h */ /* For now, #ifdef Xorriso_is_xorriso_selF has no meaning. But it is already now to be set only by the xorriso.c module. */ #ifndef Xorriso_private_includeD #define Xorriso_private_includeD yes /* <<< Disable this to disable pthread_mutex locking on message and result output. */ #define Xorriso_fetch_with_msg_queueS yes /* for uint32_t */ #ifdef HAVE_STDINT_H #include #else #ifdef HAVE_INTTYPES_H #include #endif #endif /* for pthread_mutex_t on OpenBSD */ #include /** The source code release timestamp */ #include "xorriso_timestamp.h" #ifndef Xorriso_timestamP #define Xorriso_timestamP "-none-given-" #endif /** The binary build timestamp is to be set externally by the compiler or by a macro definition in xorriso_buildstamp.h. */ #include "xorriso_buildstamp.h" #ifndef Xorriso_build_timestamP #define Xorriso_build_timestamP "-none-given-" #endif #include "sfile.h" #include "misc_funct.h" struct ExclusionS; /* List of -not_* conditions */ struct PermiteM; /* Stack of temporarily altered access permissions */ struct CheckmediajoB; /* Parameters for Xorriso_check_media() */ struct SectorbitmaP; /* Distiniction between valid and invalid sectors */ struct FindjoB; /* Program and status of a find run */ /* maximum number of history lines to be reported with -status:long_history */ #define Xorriso_status_history_maX 100 /** The list of startup file names */ #define Xorriso_rc_nuM 4 /* Default setting for the size limit of single data files: 100 extents with 4 GB - 2 kB each = 400 GB - 200 kB */ #define Xorriso_default_file_size_limiT \ (((off_t) 400) * ((off_t) 1024*1024*1024) - (off_t) 204800) /* Maximum number of appended partitions. Effectively usable number depends on system area type. */ #define Xorriso_max_appended_partitionS 8 /* Maximum length of a disc label text plus 1. */ #define Xorriso_disc_label_sizE 129 struct XorrisO { /* the global context of xorriso */ int libs_are_started; /* source */ char progname[SfileadrL]; char initial_wdx[SfileadrL]; int no_rc; /* Command line argument emulations: 0=xorriso mode 1=mkisofs mode 2=cdrecord mode */ int argument_emulation; /** List of startupfiles */ char rc_filenames[Xorriso_rc_nuM][SfileadrL]; int rc_filename_count; int arrange_args; /* Whether .mkisofsrc has already been read */ int mkisofsrc_done; char wdi[SfileadrL]; char wdx[SfileadrL]; int did_something_useful; int add_plainly; off_t split_size; char list_delimiter[81]; /* >>> put libisofs aspects here <<< */ int ino_behavior; /* bit0= at image load time: Do not load PX inode numbers but generate new unique ones for all loaded IsoNode. bit1= at image generation time: Do not consolidate suitable nodes to hardlinks. bit2= at restore-to-disk time: Do not consolidate suitable nodes to hardlinks. bit3= with update: Do not try to detect hardlink splits and joinings. bit4= with extract: Do not create or use hln arrays if sort_lba_on bit5= with command -lsl Do not create hln array for hard link count */ int iso_level; int iso_level_is_default; int do_joliet; int do_hfsplus; int do_fat; int do_rockridge; int do_iso1999; int ecma119_map; /* 0=unmapped , 1=stripped , 2=uppercase , 3=lowercase */ int joliet_map; /* 0=unmapped , 1=stripped */ int do_aaip; /* bit0= ACL in bit1= ACL out bit2= EA in bit3= EA out bit4= record dev,inode per node, isofs_st_out in root bit5= check dev,inode,isofs_st_in bit6= omit content check if bit5 check is conclusive bit7= omit dev check with bit5 bit8= store output charset in xattr "isofs.cs" bit9= set input charset from xattr "isofs.cs" bit10= if bit2: import from local filesystem all xattr namespaces, not only "user." if bit3: export to local filesystem all xattr namespaces, not only "user." */ int do_md5; /* bit0= read MD5 array bit1= write session MD5 bit2= write MD5 for each data file bit3= make file content stability check by double reading bit4= use recorded MD5 as proxy of ISO file bit5= with bit0: do not check tags of superblock,tree,session bit6= during extraction verify file content by recorded MD5 bit7= with bit6: take lack of MD5 as error */ int no_emul_toc; /* bit0= On overwritables: write first session to LBA 0 rather than 32. */ int do_old_empty; /* See -compliance old_empty own data content: range [0,31]. The new way is to have a dedicated block to which all such files will point. */ char scdbackup_tag_name[81]; char scdbackup_tag_time[19]; char scdbackup_tag_written[512]; char scdbackup_tag_listname[SfileadrL]; int relax_compliance; /* opaque bitfield to be set by xorrisoburn */ int allow_dir_id_ext_dflt; /* -compliance allow_dir_id_ext still on default */ char rr_reloc_dir[256]; int rr_reloc_flags; int untranslated_name_len; int do_follow_pattern; int do_follow_param; int do_follow_links; int follow_link_limit; int resolve_link_rec_count; int resolve_link_rec_limit; int do_follow_concat; int do_follow_mount; int do_global_uid; uid_t global_uid; int do_global_gid; gid_t global_gid; int do_global_mode; mode_t global_dir_mode; mode_t global_file_mode; int do_tao; /* 1= Use TAO or Incremental -1= Use SAO or DAO 0= let libburn choose */ struct Xorriso_lsT *filters; int filter_list_closed; int zlib_level; int zlib_level_default; int zisofs_block_size; int zisofs_block_size_default; int zisofs_by_magic; int zisofs_v2_enabled; /* 0=no, 1=as_needed, 2=force */ uint64_t zisofs_max_total_blocks; uint64_t zisofs_max_total_blocks_default; uint64_t zisofs_max_file_blocks; uint64_t zisofs_max_file_blocks_default; int zisofs_v2_block_size; int zisofs_v2_block_size_default; int64_t zisofs_block_number_target; double zisofs_bpt_discard_free_ratio; double zisofs_bpt_discard_free_ratio_default; int zisofs_susp_z2; int zisofs_susp_z2_default; int do_overwrite; /* 0=off, 1=on, 2=nondir */ int do_reassure; /* 0=off, 1=on, 2=tree */ uint32_t isofs_size; /* Size of loaded ISO filesystem */ int isofs_has_what; /* bit0= hasRR bit1= hasJoliet bit2= hasIso1999 bit3= hasElTorito */ int tree_loaded; /* 0= ISO 9660 , 1 = Joliet , 2 = ISO 9660:1999 */ int rr_loaded; /* 1= Rock Ridge information was used, 0= Not */ char volid[33]; int volid_default; char loaded_volid[33]; char assert_volid[SfileadrL]; char assert_volid_sev[80]; char preparer_id[129]; char publisher[129]; char application_id[129]; char system_id[33]; char volset_id[129]; char copyright_file[38]; char biblio_file[38]; char abstract_file[38]; char application_use[SfileadrL]; char session_logfile[SfileadrL]; int session_lba; int session_blocks; /* >>> put libburn/isoburn aspects here */ struct Xorriso_lsT *drive_blacklist; struct Xorriso_lsT *drive_greylist; struct Xorriso_lsT *drive_whitelist; int toc_emulation_flag; /* bit0= bit3 for isoburn_drive_aquire() scan -ROM profiles for ISO sessions bit1= bit4 for isoburn_drive_aquire() do not emulate TOC on overwritable media bit2= bit7 for isoburn_drive_aquire() pretend any media to be -ROM bit3= bit9 for isoburn_drive_aquire() Ignore enclosing session at LBA 0 */ int image_start_mode; /* From what address to load the ISO image bit0-15= addressing mode 0= automatic lba as deduced from media 1= value is session number 2= value is track number 3= value is lba bit16= with mode 3 : value is possibly 16 too high. Let isoburn_set_msc1() adjust it. bit30= interference with normal msc1 processing is enabled. Without this bit, isoburn_set_msc1() will not be called. bit31= image loading has happened, setting is kept for rollback only. Always apply as 0=auto. */ char image_start_value[81]; /* value according image_start_mode */ uint32_t displacement; int displacement_sign; int read_fs; /* bit0=norock , bit1=nojoliet */ int drives_exclusive; /* burn_preset_device_open() param exclusive */ int drives_access; /* 0=readonly , 1=unrestricted */ int linux_scsi_dev_family; /* 0= default, 1= sr, 2= scd, (3= st), 4= sg */ int early_stdio_test; /* For burn_allow_drive_role_4(): bit1= Test whether a stdio drive can be opened for read-write resp. read-only resp. write only. bit2= Classify files which cannot be opened at all as role 0 : useless dummy. bit3= Classify non-empty role 5 drives as BURN_DISC_APPENDABLE with NWA after the end of the file. It is nevertheless possible to change this address by call burn_write_opts_set_start_byte(). */ int cache_num_tiles; /* -data_cache_size */ int cache_tile_blocks; int cache_default; /* bit0= cache_num_tiles, bit1= cache_tile_blocks */ int do_calm_drive; /* bit0= calm down drive after acquiring it */ char indev[SfileadrL]; void *in_drive_handle; /* interpreted only by libburnia oriented modules */ void *in_volset_handle; /* interpreted only by libburnia oriented modules */ char *in_charset; /* The charset to interpret the filename bytes */ int indev_is_exclusive; int indev_access; /* see drives_access */ char indev_off_adr[SfileadrL]; /* Result of burn_drive_convert_fs_adr(indev) when indev gets acquired. */ time_t isofs_st_out; /* A time point at least 1 second before image composition began. To be stored with image as xattr "isofs.st". */ time_t isofs_st_in; /* That time point as read from "isofs.st" of the loaded image. */ int volset_change_pending; /* whether -commit would make sense 0= no change pending 1= change pending 2= change pending, but -as misofs -print-size was performed on the changed image model 3= change pending, but the attempt to write it failed */ int no_volset_present; /* set to 1 on first failure */ struct CheckmediajoB *check_media_default; int check_media_bad_limit; /* values defined as Xorriso_read_quality_* */ struct SectorbitmaP *in_sector_map; /* eventual sector validity bitmap */ char outdev[SfileadrL]; void *out_drive_handle; /* interpreted only by xorrisoburn.c */ char *out_charset; /* The charset to produce the filename bytes for */ int dev_fd_1; /* The fd which substitutes for /dev/fd/1 and is connected to externaly perveived stdout. */ int outdev_is_exclusive; int outdev_access; /* see drives_access */ char outdev_off_adr[SfileadrL]; /* Result of burn_drive_convert_fs_adr(outdev) when outdev gets acquired. */ int grow_blindly_msc2; /* if >= 0 this causes growing from drive to drive. The value is used as block address offset for image generation. Like in: mkisofs -C msc1,msc2 */ int ban_stdio_write; int do_dummy; int do_close; int auto_close; /* Whether to let do_close depend on media state */ int write_speed; /* Write speed in libburn units : 1000 bytes/second , 0 = Max, -1 = Min, -2= do not set */ int read_speed; /* Read speed. See above */ int read_speed_force; /* >0 : use burn_nominal_slowdown() in Xorriso_check_interval() */ int read_speed_corr; /* parameter max_corr for burn_nominal_slowdown */ int fs; /* fifo size in 2048 byte chunks : at most 1 GB */ int padding; /* number of bytes to add after ISO 9660 image */ int do_padding_by_libisofs; /* 0= by libburn , 1= by libisofs */ int alignment; /* if > 0 : output size alignment in 2048 byte blocks. This is always done by libburn, i.e. attached outside the image. Eventual inner alignment of the image end happens first. */ int do_stream_recording; /* 0=no, 1=yes, 2=for data, not for dir >=16 means yes with number as start LBA */ int dvd_obs; /* DVD write chunk size: 0, 32k or 64k */ int modesty_on_drive; /* "enable" of burn_drive_set_buffer_waiting() 0= disable , 1= enable waiting , (-1 = do not change setting) */ int min_buffer_usec; /* The other parameters for this function */ int max_buffer_usec; int buffer_timeout_sec; int min_buffer_percent; int max_buffer_percent; int use_immed_bit; /* 1= on , 0= default , -1 = off */ int use_immed_bit_default; /* 1= on , 0= yet undefined , -1 = off */ int stdio_sync; /* stdio fsync interval: -1, 0, >=32 */ int stdio_sync_is_default; /* 1= is still default , 0= has been set */ int keep_boot_image; char boot_image_cat_path[SfileadrL]; int boot_image_cat_hidden; /* bit0= hidden in ISO/RR , bit1= in Joliet , bit2= in HFS+ */ int boot_count; /* number of already attached boot images */ char boot_image_bin_path[SfileadrL]; char boot_image_bin_form[16]; int boot_platform_id; int patch_isolinux_image; /* bit0= boot-info-table , bit1= not with EFI bit2-7= Mentioning in isohybrid GPT 1=EFI, 2=HFS+ bit8= Mention in isohybrid Apple Partition Map bit9= GRUB2 boot provisions (patch at byte 1012) */ int boot_image_emul; /* 0=no emulation 1=emulation as hard disk 2=emulation as floppy */ int boot_emul_default; /* 1= boot_image_emul is still default */ off_t boot_image_load_size; int boot_img_size_default; /* 1= boot_image_load_size is still default */ int boot_img_full_size; /* 1= override boot_image_load_size by image size */ unsigned char boot_id_string[29]; unsigned char boot_selection_crit[21]; int boot_image_isohybrid; /* 0=off , deprecated: 1=auto , 2=on , 3=force */ int boot_efi_default; /* 0= no effect , 1= apply --efi-boot parameters when attaching to img */ char system_area_disk_path[SfileadrL]; int system_area_clear_loaded; int system_area_options; /* bit0= "GRUB protective msdos label" (a simple partition table) bit1= isohybrid boot image pointer and partition table bit2-7= System area type 0= with bit0 or bit1: MBR else: unspecified type 1= MIPS Big Endian Volume Header 2= MIPS Little Endian Boot Block 3= SUN Disk Label for SUN SPARC 4= HP-PA PALO boot sector header version 4 5= HP-PA PALO boot sector header version 5 bit8-9= Only with System area type 0 Cylinder alignment mode 0 = auto (align if bit1) 1 = always align 2 = never align 3 = align external partitions bit10-13= System area sub type With type 0 = MBR: Gets overridden by bit0 and bit1. 0 = no particular sub type 1 = CHRP: A single MBR partition of type 0x96 covers the ISO image. Not compatible with any other feature which needs to have own MBR partition entries. 2 = generic MBR bit14= Only with System area type 0 GRUB2 boot provisions: Patch system area at byte 92 to 99 with 512-block address + 1 of the first boot image file. Little-endian 8-byte. Should be combined with options bit0. bit15= Only with MBR: Enforce MBR "bootable/active" flag. In worst case by dummy partition of type 0x00 which occupies block 0. */ int patch_system_area; /* Bits as of system_area_options. to be applied to the loaded system area of the image, if no system_area_disk_path and no system_area_options are set. */ /* The number of unclaimed 2K blocks before start of partition 1 as of the MBR in system area. If not 0 this will cause double volume descriptor sets and double tree. */ uint32_t partition_offset; /* Partition table parameter: 1 to 63, 0= disabled/default */ int partition_secs_per_head; /* 1 to 255, 0= disabled/default */ int partition_heads_per_cyl; /* Disk file paths of content of PreP partition and EFI system partition */ char prep_partition[SfileadrL]; char efi_boot_partition[SfileadrL]; /* Path and type of image files to be appended as MBR partitions */ char *appended_partitions[Xorriso_max_appended_partitionS]; uint8_t appended_part_types[Xorriso_max_appended_partitionS]; uint8_t appended_part_type_guids[Xorriso_max_appended_partitionS][16]; /* Flags in case that appended partitions show up in GPT: bit0= appended_part_type_guids is valid */ uint8_t appended_part_gpt_flags[Xorriso_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; /* MBR partition type of ISO filesystem partition or protective partition if not real GPT or CHRP. */ int iso_mbr_part_type; uint8_t iso_gpt_type_guid[16]; int iso_mbr_part_flag; /* Flags in case that the partition table is GPT: bit0= iso_gpt_type_guid is valid */ /* 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[Xorriso_disc_label_sizE]; /* A data file of which the position and size shall be written after a SUN Disk Label. */ char grub2_sparc_core[SfileadrL]; /* 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+ and APM : 0= auto , 512, or 2048 */ int hfsp_block_size; int apm_block_size; /* User settable PVD time stamps */ time_t vol_creation_time; time_t vol_modification_time; time_t vol_expiration_time; time_t vol_effective_time; /* To eventually override vol_modification_time by unconverted string and timezone 0 */ char vol_uuid[17]; /* To flatly set all file timestamps to the same value Special value: "set_to_mtime", see -find action "set_to_mtime" */ char all_file_dates[80]; /* Timestamp for ISO files which have no origin file on disk and thus normally get time(NULL) as timestamps */ int do_override_now_time; time_t now_time_override; #ifdef Xorriso_with_libjtE /* Parameters and state of Jigdo Template Export environment */ struct libjte_env *libjte_handle; #endif /* List of -jigdo parameters since the most recent -jigdo clear */ struct Xorriso_lsT *jigdo_params; struct Xorriso_lsT *jigdo_values; int libjte_params_given; /* bits: 0= outfile , 1= verbosity , 2= template_path 3= jigdo_path , 4= checksum_path 5= min_size , 6= checksum_iso 7= checksum_template , 8= compression 9= exclude , 10= demand_checksum 11= mapping , 12= checksum_algorithm */ /* LBA of boot image after image loading */ int loaded_boot_bin_lba; /* Path of the catalog node after image loading */ char loaded_boot_cat_path[SfileadrL]; /* XORRISO options */ int allow_graft_points; /* if not zero: yes special options: bit1= unescape '\\' too, continue unescaping after first real '=' */ int allow_restore; /* -2=disallowed until special mode "unblock" -1=permanently disallowed 0=disallowed, 1=allowed, 2=device files allowed */ int do_concat_split; /* 1= restore complete split file directories as regular files */ int do_auto_chmod; /* 1= eventually temporarily open access permissions of self-owned directories during restore */ int do_restore_sort_lba; /* 1= restore via node_array rather than via tree traversal. Better read performance, no directory mtime restore, needs do_auto_chmod */ int do_strict_acl; /* bit0= do not tolerate inappropriate presence or absence of directory "default" ACL */ int mount_opts_flag; /* bit0= "shared" = not "exclusive" Try to emit non-exclusive mount command. Do not give up drives. Linux: use loop device even on block devices in order to circumvent the ban to mount a device twice (with different sbsector=) FreeBSD: ? */ int dialog; /* 0=off , 1=single-line , 2=multi-line */ struct Xorriso_lsT *buffered_dialog; /* If not NULL : read by dialog */ int bsl_interpretation; /* whether to run input through Sfile_bsl_interpreter(): bit0-1= dialog and quoted file reading 0= no interpretation, leave unchanged 1= only inside double quotes 2= outside single quotes 3= everywhere bit2-3= reserved as future expansion of bit0-1 bit4= interpretation within program start arguments bit5= perform backslash encoding with results bit6= perform backslash encoding with info texts */ int sh_style_result; /* Whether not to wrap into quotation marks the file addresses reported by: pwd pwdx ls lsd lsl lsdl lsx lsdx lslx lsdlx du dus dux dusx findx find and to make du* numbers left adjusted, and not to append "/" to pwd* */ /* Pattern matching facility. It still carries legacy from scdbackup/askme.c but is fully functional for xorriso. */ int search_mode; /* 0= start text 1= fgrep , 2= regular expression 3= (eventually structured) shell parser expression 4= shell parser expression for leaf name */ int structured_search; /* 0= flat text search 1= '/' is a significant separator that cannot be matched by wildcards ( 2= like 1 : but report only occurrence in tree, no payload, no location ) ( 3= like 2 : but report first content level of matching directories ) 4= actually not structured but unique find mode (with search_mode 4) */ int do_iso_rr_pattern; /* 0=off, 1=on, 2=ls */ int do_disk_pattern; /* 0=off, 1=on, 2=ls */ int temp_mem_limit; off_t file_size_limit; int file_name_limit; struct ExclusionS *disk_exclusions; int disk_excl_mode; /* bit0= on (else off) bit1= parameter too (else recursion only) bit2= whole subtree banned (else only exact path) bit3= when comparing ignore excluded files rather than to treat them as truly missing on disk */ struct ExclusionS *iso_rr_hidings; struct ExclusionS *joliet_hidings; struct ExclusionS *hfsplus_hidings; int use_stdin; /* use raw stdin even if readline support is compiled */ int tolerate_stdin_eof; /* Do not abort on EOF in Xorriso_dialog_input but rather return -2. */ int result_page_length; int result_page_width; char mark_text[SfileadrL]; /* ( stdout+stderr, M: ) */ int packet_output; char logfile[4][SfileadrL]; FILE *logfile_fp[4]; FILE *pktlog_fp; FILE *stderr_fp; struct Xorriso_lsT *result_msglists[Xorriso_max_outlist_stacK]; struct Xorriso_lsT *info_msglists[Xorriso_max_outlist_stacK]; int msglist_flags[Xorriso_max_outlist_stacK]; /* bit0= result is redirected bit1= info is redirected */ int msglist_stackfill; int lib_msg_queue_lock_ini; int result_msglists_lock_ini; pthread_mutex_t lib_msg_queue_lock; pthread_mutex_t result_msglists_lock; int write_to_channel_lock_ini; pthread_mutex_t write_to_channel_lock; int msg_watcher_lock_ini; pthread_mutex_t msg_watcher_lock; int msg_watcher_state; /* 0= inactive 1= registered 2= started 3= request to end */ int (*msgw_result_handler)(void *handle, char *text); void *msgw_result_handle; int (*msgw_info_handler)(void *handle, char *text); void *msgw_info_handle; int msgw_stack_handle; int msgw_msg_pending; /* 0=no, 1=fetching(i.e. maybe) , 2=yes */ int msgw_fetch_lock_ini; pthread_mutex_t msgw_fetch_lock; struct Xorriso_msg_sievE *msg_sieve; int msg_sieve_disabled; int status_history_max; /* for -status long_history */ /* 0= no logging of SCSI commands, 1= to stderr */ int scsi_log; char report_about_text[20]; int report_about_severity; int library_msg_direct_print; char abort_on_text[20]; int abort_on_severity; /* A severity rank number as threshold */ int abort_on_is_default; /* will be set to 0 by first -abort_on */ int problem_status; /* Severity rank number. 0= no abort condition present */ char problem_status_text[20]; int problem_status_lock_ini; pthread_mutex_t problem_status_lock; char errfile_log[SfileadrL]; /* for -errfile_log */ int errfile_mode; /* bit0= marked */ FILE *errfile_fp; int img_read_error_mode; /* 0=best_effort , 1=failure , 2=fatal */ int extract_error_mode; /* 0=best_effort , 1=keep , 2=delete */ char return_with_text[20]; int return_with_severity; int return_with_value; int eternal_problem_status; char eternal_problem_status_text[20]; /* temporary search facilities */ regex_t *re; regmatch_t match[1]; char **re_constants; int re_count; int re_fill; char reg_expr[2*SfileadrL]; /* run state */ int run_state; /* 0=preparing , 1=writing image */ int is_dialog; int bar_is_fresh; char pending_option[SfileadrL]; /* eventual option entered at page prompt */ int request_to_abort; /* abort a single operation like -ls, not the program */ int request_not_to_ask; /* suppress reassure and pager */ double idle_time; int re_failed_at; /* mismatch position with structured_search */ int prepended_wd; double insert_count; double insert_bytes; double error_count; /* double will not roll over */ int launch_frontend_banned; /* pacifiers */ int pacifier_style; /* 0= xorriso, 1=mkisofs 2=cdrecord */ double pacifier_interval; double start_time; double last_update_time; /* optional global counters for brain reduced callback functions */ off_t pacifier_count; off_t pacifier_total; off_t pacifier_byte_count; /* auxiliary counter for data bytes */ off_t pacifier_prev_count; /* internal counter for speed measurement */ void *pacifier_fifo; int find_compare_result; /* 1=everything matches , 0=mismatch , -1=error */ int find_check_md5_result; /* bit0= seen mismatch bit1= seen error bit2= seen data file without MD5 bit3= seen match */ int find_unique_trunc_result; /* 0= some names are not uniquely truncatable 1= all names are uniquely truncatable 2= no names need truncation */ double last_abort_file_time; /* most recent check for aborting -check_md5 */ /* Tree node collection and LBA sorting facility */ int node_counter; int node_array_size; void **node_array; struct Xorriso_lsT *node_disk_prefixes; struct Xorriso_lsT *node_img_prefixes; /* Hardlink matching at restore time memorizes hardlink target paths. Array of nodes sorted by LBA. */ int hln_count; void **hln_array; void **hln_targets; int hln_change_pending; /* whether a change was made since hln creation */ /* >>> this should count all temp_mem and thus change its name */ off_t node_targets_availmem; /* Hardlink matching at update time: Array of all nodes in the tree, sorted by disk dev,ino. Bitmap of nodes which possibly got new hardlink siblings. List of involved disk-iso path pairs. */ int di_count; void **di_array; char *di_do_widen; struct Xorriso_lsT *di_disk_paths; struct Xorriso_lsT *di_iso_paths; struct PermiteM *perm_stack; /* Temporarily altered dir access permissions */ /* bit0= update_merge active: mark all newly added nodes as visited+found */ int update_flags; /* For find jobs show_hfs_cmd , show_hfs_as_mkisofs */ /* bit0= do not record but only count bit1= as_mkisofs mode */ int show_hfs_cmd_flag; int show_hfs_cmd_count; char **show_hfs_cmds; /* Extraction to sparse files */ off_t sparse_min_gap; /* result (stdout, R: ) */ char result_line[10*SfileadrL]; int result_line_counter; int result_page_counter; int result_open_line_len; /* info (stderr, I:) */ char info_text[10*SfileadrL]; }; #include "base_obj.h" #include "aux_objects.h" #include "findjob.h" #include "check_media.h" #include "misc_funct.h" #include "text_io.h" #include "match.h" #include "emulators.h" #include "disk_ops.h" #include "cmp_update.h" #include "parse_exec.h" #endif /* Xorriso_private_includeD */ libisoburn-1.5.4/xorriso/iso_tree.c0000644000175700017510000022676413742564100014327 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2019 Thomas Schmitt, Provided under GPL version 2 or later. This file contains functions which access nodes of the libisofs tree model. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" #include "lib_mgt.h" #include "iso_img.h" #include "iso_tree.h" #include "iso_manip.h" #include "sort_cmp.h" /* @param eff_path returns resulting effective path. Must provide at least SfileadrL bytes of storage. @param flag bit0= do not produce problem events (unless faulty path format) bit1= do not use libisofs (work literally or in disk world) bit2= (implies bit1) this is an address in the disk world bit3= return root directory as "/" and not as "" bit4= (with bit2) determine type of disk file eff_path and return 0 if not existing bit5= (with bit3) this is not a parameter bit6= insist in having an ISO image, even with bits1+2 @return -1 = faulty path format, 0 = not found , 1 = found simple node , 2 = found directory */ int Xorriso_normalize_img_path(struct XorrisO *xorriso, char *wd, char *img_path, char eff_path[], int flag) { int ret, is_dir= 0, done= 0; IsoImage *volume; IsoDir *dir= NULL; IsoNode *node= NULL; char *path= NULL, *apt, *npt, *cpt, *link_target= NULL; Xorriso_alloc_meM(path, char, SfileadrL); Xorriso_alloc_meM(link_target, char, SfileadrL); if(flag & 4) flag|= 2; if((flag&64) || !(flag&2)) { ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) goto ex; } eff_path[0]= 0; if(img_path[0]==0) { if(flag&8) strcpy(eff_path, "/"); {ret= 2; goto ex;} /* root directory */ } apt= npt= path; if(img_path[0]!='/') { strcpy(path, wd); ret= Sfile_add_to_path(path, img_path, 0); if(ret<=0) goto much_too_long; } else if(Sfile_str(path, img_path, 0)<=0) {ret= -1; goto ex;} if(path[0]!='/') { sprintf(xorriso->info_text, "Internal error: Unresolvable relative addressing in iso_rr_path '%s'", img_path); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FATAL", 0); {ret= -1; goto ex;} } else if(path[1]==0) { if(flag&8) strcpy(eff_path, "/"); {ret= 2; goto ex;} /* root directory */ } if(apt[0] == '.') if(apt[1] == 0 || apt[1] == '/') is_dir= 1; for(npt= apt; !done; apt= npt+1) { npt= strchr(apt, '/'); if(npt==NULL) { npt= apt+strlen(apt); done= 1; } else *npt= 0; if(*apt==0) { *apt= '/'; apt++; if(done) break; continue; } if(strcmp(apt,".")==0) continue; if(strcmp(apt,"..")==0) { if(!(flag&2)) { node= (IsoNode *) dir; if(node==NULL) { bonked_root:; sprintf(xorriso->info_text, "Relative addressing in path exceeds root directory: "); Text_shellsafe(img_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= -1; goto ex;} } dir= iso_node_get_parent(node); /* >>> Get absolute path of node as eff_path, to avoid link problems */; } if(flag & 4) { /* Linux-ish local filesystem semantics: If the parent is a symbolic link, do not ascend to its parent, but to the parent of the link target. >>> ??? Are there systems which do it differently ? */ if(Sfile_type(eff_path, 0) == 3) { ret= Xorriso_resolve_link(xorriso, eff_path, link_target, 2); if(ret <= 0) {ret= -1; goto ex;} strcpy(eff_path, link_target); } } /* truncate eff_path */; cpt= strrchr(eff_path, '/'); if(cpt==NULL) /* ??? if not flag&2 then this is a bug */ goto bonked_root; *cpt= 0; is_dir= 1; continue; } is_dir= 0; ret= Sfile_add_to_path(eff_path, apt, 0); if(ret<=0) { much_too_long:; sprintf(xorriso->info_text, "Effective path gets much too long (%d)", (int) (strlen(eff_path)+strlen(apt)+1)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= -1; goto ex;} } if(!(flag&2)) { dir= (IsoDir *) node; ret= Xorriso_node_from_path(xorriso, volume, eff_path, &node, flag&1); if(ret<=0) {ret= 0; goto ex;} if(dir==NULL) /* could be false with "/dir/.." */ dir= iso_node_get_parent(node); is_dir= LIBISO_ISDIR(node); } } if(flag&16) { ret= Sfile_type(eff_path, 1|(4*(xorriso->do_follow_links || (xorriso->do_follow_param && !(flag&32))) )); if(ret<0) {ret= 0; goto ex;} if(ret==2) is_dir= 1; else is_dir= 0; } ret= 1+!!is_dir; ex:; Xorriso_free_meM(path); Xorriso_free_meM(link_target); return(ret); } int Xorriso_get_node_by_path(struct XorrisO *xorriso, char *in_path, char *eff_path, IsoNode **node, int flag) { int ret; char *path= NULL; IsoImage *volume; Xorriso_alloc_meM(path, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, in_path, path, 0); if(ret<=0) goto ex; if(eff_path!=NULL) strcpy(eff_path, path); ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) goto ex; ret= Xorriso_node_from_path(xorriso, volume, path, node, 0); if(ret<=0) {ret= 0; goto ex;} ret= 1; ex:; Xorriso_free_meM(path); return(ret); } /* @param flag */ int Xorriso_node_get_dev(struct XorrisO *xorriso, IsoNode *node, char *path, dev_t *dev, int flag) { *dev= iso_special_get_dev((IsoSpecial *) node); return(1); } /* @param flag bit0= *node is already valid bit1= add extra block for size estimation bit2= complain loudely if path is missing in image bit3= stbuf is to be used without eventual ACL bit4= try to obtain a better st_nlink count if hardlinks are enabled bit5= do not look for truncated versions of path component */ int Xorriso_fake_stbuf(struct XorrisO *xorriso, char *path, struct stat *stbuf, IsoNode **node, int flag) { int ret, min_hl, max_hl, node_idx, i; IsoImage *volume; IsoBoot *bootcat; uint32_t lba; char *catcontent = NULL; off_t catsize; dev_t dev_number; memset((char *) stbuf, 0, sizeof(struct stat)); if(!(flag&1)) { ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) return(-1); ret= Xorriso_node_from_path(xorriso, volume, path, node, ((flag >> 4) & 2) | !(flag&4)); if(ret<=0) *node= NULL; } if(*node==NULL) return(0); /* >>> stbuf->st_dev */ /* >>> stbuf->st_ino */ if(flag & 8) stbuf->st_mode= iso_node_get_perms_wo_acl(*node) & 07777; else stbuf->st_mode= iso_node_get_permissions(*node) & 07777; if(LIBISO_ISDIR(*node)) stbuf->st_mode|= S_IFDIR; else if(LIBISO_ISREG(*node)) stbuf->st_mode|= S_IFREG; else if(LIBISO_ISLNK(*node)) stbuf->st_mode|= S_IFLNK; else if(LIBISO_ISCHR(*node)) { stbuf->st_mode|= S_IFCHR; Xorriso_node_get_dev(xorriso, *node, path, &dev_number, 0); stbuf->st_rdev= dev_number; } else if(LIBISO_ISBLK(*node)) { stbuf->st_mode|= S_IFBLK; /* ts B11124: Debian mips and mipsel have sizeof(stbuf.st_rdev) == 4 whereas sizeof(dev_t) is 8. This workaround assumes that the returned numbers fit into 4 bytes. The may stem from the local filesystem or from the ISO image. At least there will be no memory corruption but only an integer rollover. */ Xorriso_node_get_dev(xorriso, *node, path, &dev_number, 0); stbuf->st_rdev= dev_number; } else if(LIBISO_ISFIFO(*node)) stbuf->st_mode|= S_IFIFO; else if(LIBISO_ISSOCK(*node)) stbuf->st_mode|= S_IFSOCK; else if(LIBISO_ISBOOT(*node)) stbuf->st_mode|= Xorriso_IFBOOT; /* >>> With directories this should be : number of subdirs + 2 */ /* >>> ??? How to obtain RR hardlink number for other types ? */ /* This may get overridden farther down */ stbuf->st_nlink= 1; stbuf->st_uid= iso_node_get_uid(*node); stbuf->st_gid= iso_node_get_gid(*node); if(LIBISO_ISREG(*node)) stbuf->st_size= iso_file_get_size((IsoFile *) *node)+ (2048 * !!(flag&2)); else if(LIBISO_ISBOOT(*node)) { ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret <= 0) return(-1); ret= iso_image_get_bootcat(volume, &bootcat, &lba, &catcontent, &catsize); if(catcontent != NULL) free(catcontent); if(ret < 0) { Xorriso_process_msg_queues(xorriso,0); return(-1); } stbuf->st_size= catsize; } else stbuf->st_size= 0; stbuf->st_blksize= 2048; stbuf->st_blocks= stbuf->st_size / (off_t) 2048; if(stbuf->st_blocks * (off_t) 2048 != stbuf->st_size) stbuf->st_blocks++; stbuf->st_atime= iso_node_get_atime(*node); stbuf->st_mtime= iso_node_get_mtime(*node); stbuf->st_ctime= iso_node_get_ctime(*node); if(LIBISO_ISDIR(*node) || (xorriso->ino_behavior & 1) || (!(flag & 16)) || xorriso->hln_array == NULL) return(1); /* Try to obtain a better link count */ ret= Xorriso_search_hardlinks(xorriso, *node, &node_idx, &min_hl, &max_hl, 0); if(ret < 0) return(ret); if(ret > 0 && node_idx >= 0) { for(i= min_hl; i <= max_hl; i++) { if(i == node_idx) continue; /* Check whether node is still valid */ if(iso_node_get_parent(xorriso->hln_array[i]) != NULL) stbuf->st_nlink++; } } return(1); } /* @param flag >>> bit0= follow links (i.e. stat() rather than lstat() bit1= do not return -2 on severe errors bit2= complain loudely if path is missing in image */ int Xorriso_iso_lstat(struct XorrisO *xorriso, char *path, struct stat *stbuf, int flag) { int ret; IsoNode *node; if(flag&1) { /* >>> follow link in ISO image */; } ret= Xorriso_fake_stbuf(xorriso, path, stbuf, &node, flag&4); if(ret>0) return(0); if(ret<0 && !(flag&2)) return(-2); return(-1); } int Xorriso_node_is_valid(struct XorrisO *xorriso, IsoNode *in_node, int flag) { IsoNode *node, *parent; for(node= in_node; 1; node= parent) { parent= (IsoNode *) iso_node_get_parent(node); if(parent == node) break; if(parent == NULL) return(0); /* Node is not in the tree (any more) */ } return(1); } int Xorriso_path_from_node(struct XorrisO *xorriso, IsoNode *in_node, char path[SfileadrL], int flag) { int ret, i, comp_count= 0; IsoNode *node, *parent, **components= NULL; char *wpt, *npt; for(node= in_node; 1; node= parent) { parent= (IsoNode *) iso_node_get_parent(node); if(parent == node) break; if(parent == NULL) return(0); /* Node is not in the tree (any more) */ comp_count++; } if(comp_count == 0) { strcpy(path, "/"); return(1); } components= calloc(comp_count, sizeof(IsoNode *)); if(components == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } i= comp_count; for(node= in_node; 1; node= parent) { parent= (IsoNode *) iso_node_get_parent(node); if(parent == node) break; components[--i]= node; } wpt= path; for(i= 0; i < comp_count; i++) { npt= (char *) iso_node_get_name(components[i]); if((wpt - path) + strlen(npt) + 1 >= SfileadrL) { /* >>> path is getting much too long */; ret= -1; goto ex; } *(wpt++)= '/'; strcpy(wpt, npt); wpt+= strlen(npt); *wpt= 0; } ret= 1; ex:; if(components != NULL) free(components); return(ret); } /* <<< The lookup from node pointer will be done by Xorriso_path_from_node() (Currently it runs a full tree traversal) Parameter node and flag bit0 will vanish then */ /* @param flag bit0= use lba rather than node pointer */ int Xorriso_path_from_lba(struct XorrisO *xorriso, IsoNode *node, int lba, char path[SfileadrL], int flag) { int ret; struct FindjoB *job= NULL; struct stat dir_stbuf; char *found_path; path[0]= 0; if((flag & 1) && lba <= 0) return(0); ret= Findjob_new(&job, "/", 0); if(ret <= 0) { Xorriso_no_findjob(xorriso, "path_from_node", 0); return(ret); } if(flag & 1) Findjob_set_lba_range(job, lba, 1, 0); else Findjob_set_wanted_node(job, (void *) node, 0); Findjob_set_action_found_path(job, 0); ret= Xorriso_findi(xorriso, job, NULL, (off_t) 0, NULL, "/", &dir_stbuf, 0, 0); if(ret > 0) { ret= 1; Findjob_get_found_path(job, &found_path, 0); if(found_path == NULL) ret= 0; else if(Sfile_str(path, found_path, 0) <= 0) ret= -1; } Findjob_destroy(&job, 0); return(ret); } /* @param flag bit0= in_node is valid, do not resolve iso_adr bit2= recognize and parse split parts despite xorriso->split_size <= 0 */ int Xorriso_identify_split(struct XorrisO *xorriso, char *iso_adr, void *in_node, struct SplitparT **parts, int *count, struct stat *total_stbuf, int flag) { int ret, i, incomplete= 0, overlapping= 0; int partno, total_parts, first_total_parts= -1; off_t offset, bytes, total_bytes, first_total_bytes= -1, first_bytes= -1; off_t size, covered; IsoImage *volume; IsoDir *dir_node; IsoDirIter *iter= NULL; IsoNode *node; char *name; struct stat stbuf, first_stbuf; *count= 0; *parts= NULL; if(xorriso->split_size <= 0 && !(flag & 4)) return(0); if(flag&1) { node= (IsoNode *) in_node; } else { ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) return(-1); ret= Xorriso_node_from_path(xorriso, volume, iso_adr, &node, 1); if(ret<=0) return(-1); } if(!LIBISO_ISDIR(node)) return(0); dir_node= (IsoDir *) node; ret= iso_dir_get_children(dir_node, &iter); if(ret<0) { cannot_iter:; Xorriso_cannot_create_iter(xorriso, ret, 0); return(-1); } for(i= 0; iso_dir_iter_next(iter, &node) == 1; i++) { name= (char *) iso_node_get_name(node); ret= Splitpart__parse(name, &partno, &total_parts, &offset, &bytes, &total_bytes, 0); if(ret<=0) {ret= 0; goto ex;} if(i==0) { first_total_parts= total_parts; first_bytes= bytes; first_total_bytes= total_bytes; Xorriso_fake_stbuf(xorriso, "", &first_stbuf, &node, 1); size= first_stbuf.st_size; } else { if(first_total_parts!=total_parts || first_total_bytes!=total_bytes || (first_bytes!=bytes && partno!=total_parts)) {ret= 0; goto ex;} Xorriso_fake_stbuf(xorriso, "", &stbuf, &node, 1); if(first_stbuf.st_mode != stbuf.st_mode || first_stbuf.st_uid != stbuf.st_uid || first_stbuf.st_gid != stbuf.st_gid || first_stbuf.st_mtime != stbuf.st_mtime || first_stbuf.st_ctime != stbuf.st_ctime) {ret= 0; goto ex;} size= stbuf.st_size; } /* check for plausible size */ if(!((partno != total_parts && size == bytes) || (partno == total_parts && size <= bytes))) {ret= 0; goto ex;} if(offset != first_bytes * (off_t) (partno - 1)) {ret= 0; goto ex;} (*count)++; } if(*count <= 0 || *count != first_total_parts) {ret= 0; goto ex;} ret= Splitparts_new(parts, (*count)+1, 0); /* (have one end marker item) */ if(ret<=0) return(ret); iso_dir_iter_free(iter); ret= iso_dir_get_children(dir_node, &iter); if(ret<0) goto cannot_iter; for(i= 0; i<*count; i++) { ret= iso_dir_iter_next(iter, &node); if(ret!=1) break; name= (char *) iso_node_get_name(node); ret= Splitpart__parse(name, &partno, &total_parts, &offset, &bytes, &total_bytes, 0); if(ret<=0) {ret= 0; goto ex;} ret= Splitparts_set(*parts, i, name, partno, total_parts, offset, bytes, total_bytes, 0); if(ret<=0) goto ex; } Splitparts_sort(*parts, *count, 0); covered= 0; for(i= 0; i<*count; i++) { Splitparts_get(*parts, i, &name, &partno, &total_parts, &offset, &bytes, &total_bytes, 0); if(offset>covered) incomplete= 1; else if(offset covered) covered= offset+bytes; } if(total_bytes>covered) incomplete= 1; memcpy(total_stbuf, &first_stbuf, sizeof(struct stat)); total_stbuf->st_size= total_bytes; ret= !(overlapping || incomplete); ex:; if(iter!=NULL) iso_dir_iter_free(iter); return(ret); } /* @param flag bit0= node is valid, do not resolve path bit1= insist in complete collection of part files bit2= recognize and parse split parts despite xorriso->split_size <= 0 */ int Xorriso_is_split(struct XorrisO *xorriso, char *path, void *node, int flag) { struct SplitparT *split_parts= NULL; int split_count= 0, ret; struct stat stbuf; ret= Xorriso_identify_split(xorriso, path, node, &split_parts, &split_count, &stbuf, flag & 7); if(split_parts!=NULL) Splitparts_destroy(&split_parts, split_count, 0); return(ret>0); } /* @param node Opaque handle to IsoNode which is to be inquired instead of path if it is not NULL. @param path is used as address if node is NULL. @param acl_text if acl_text is not NULL, then *acl_text will be set to the ACL text (without comments) of the file object. In this case it finally has to be freed by the caller. @param flag bit0= do not report to result but only retrieve ACL text bit1= check for existence of true ACL (not fabricated), do not allocate and set acl_text but return 1 or 2 bit2-3: what ALC to retrieve: 0= "access" and "default", mark "default:" 1= "access" only 2= "default" only, do not mark "default:" bit4= get "access" ACL only if not trivial @return 2 ok, no ACL available, eventual *acl_text will be NULL 1 ok, ACL available, eventual *acl_text stems from malloc() <=0 error */ int Xorriso_getfacl(struct XorrisO *xorriso, void *in_node, char *path, char **acl_text, int flag) { int ret, d_ret, result_len= 0, pass, what; IsoNode *node; char *text= NULL, *d_text= NULL, *cpt, *npt; uid_t uid; gid_t gid; struct passwd *pwd; struct group *grp; what= (flag >> 2) & 3; if(acl_text != NULL) *acl_text= NULL; node= (IsoNode *) in_node; if(node == NULL) { ret= Xorriso_get_node_by_path(xorriso, path, NULL, &node, 0); if(ret<=0) goto ex; } ret= iso_node_get_acl_text(node, &text, &d_text, flag & 16); d_ret= (d_text != NULL); if(ret < 0 || d_ret < 0) { if(path != NULL && path[0] != 0) { strcpy(xorriso->info_text, "Error with obtaining ACL of "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } ret= 0; goto ex; } if(flag & 2) { ret= 1 + (ret != 1 && d_ret == 0); goto ex; } if((ret == 0 || ret == 2) && d_ret == 0) { if(flag & 1) { ret= 1 + (ret == 0); goto ex; } strcpy(xorriso->info_text, "No ACL associated with "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); if(ret == 0) {ret= 2; goto ex;} } if(!(flag & 1)) { ret= Xorriso_getfname(xorriso, path, 0); if(ret <= 0) goto ex; uid= iso_node_get_uid(node); pwd= getpwuid(uid); if(pwd == NULL) sprintf(xorriso->result_line, "# owner: %.f\n", (double) uid); else sprintf(xorriso->result_line, "# owner: %s\n", pwd->pw_name); Xorriso_result(xorriso, 0); gid= iso_node_get_gid(node); grp= getgrgid(gid); if(grp == NULL) sprintf(xorriso->result_line, "# group: %.f\n", (double) gid); else sprintf(xorriso->result_line, "# group: %s\n", grp->gr_name); Xorriso_result(xorriso, 0); } for(pass= 0; pass < 1 + (acl_text != NULL && !(flag & 2)); pass++) { if(pass) { if(result_len == 0) break; *acl_text= calloc(result_len + 1, 1); if(*acl_text == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } } if(text != NULL && what <= 1) { for(npt= cpt= text; npt != NULL; cpt= npt + 1) { npt= strchr(cpt, '\n'); if(npt != NULL) *npt= 0; if(*cpt == 0) { if(d_text != NULL || pass) { if(npt != NULL) *npt= '\n'; continue; } } else result_len+= strlen(cpt) + 1; if(pass) { sprintf(*acl_text + strlen(*acl_text), "%s\n", cpt); } else if(!(flag & 1)) { if(Sfile_str(xorriso->result_line, cpt, 0) <= 0) goto too_long; strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); } if(npt != NULL) *npt= '\n'; } } if(d_text != NULL && (what == 0 || what == 2)) { for(npt= cpt= d_text; npt != NULL; cpt= npt + 1) { npt= strchr(cpt, '\n'); if(npt != NULL) *npt= 0; if(*cpt != 0) { if(pass) { if(what == 0) sprintf(*acl_text + strlen(*acl_text), "default:%s\n", cpt); else sprintf(*acl_text + strlen(*acl_text), "%s\n", cpt); } else { xorriso->result_line[0]= 0; if(what == 0) if(Sfile_str(xorriso->result_line, "default:", 0) <= 0) goto too_long; if(Sfile_str(xorriso->result_line, cpt, 1) <= 0) goto too_long; result_len+= strlen(cpt) + 9; } } else xorriso->result_line[0]= 0; if(pass== 0 && !(flag & 1)) { strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); } if(npt != NULL) *npt= '\n'; } } } if(result_len == 0) { if(acl_text != NULL) *acl_text= NULL; ret= 2; } else { ret= 1; } ex:; iso_node_get_acl_text(node, &text, &d_text, 1 << 15); return(ret); too_long: Xorriso_msgs_submit(xorriso, 0, "Oversized ACL", 0, "FAILURE", 0); ret= 0; goto ex; } /* @param flag bit0= do not report to result but only retrieve attr text bit1= path is disk_path bit3= do not ignore non-user attributes bit4= ignore isofs. attributes despite bit3 bit5= in case of symbolic link on disk: inquire link target bit6= check for existence of xattr, return 0 or 1 (depends also on bit3) */ int Xorriso_getfattr(struct XorrisO *xorriso, void *in_node, char *path, char **attr_text, int flag) { int ret= 1, i, bsl_mem, result_len= 0, pass; size_t num_attrs= 0, *value_lengths= NULL; char **names= NULL, **values= NULL, *bsl; if(attr_text != NULL) *attr_text= NULL; if((xorriso->do_aaip & 1024) && !(flag & 8)) flag|= 8 | 16; ret= Xorriso_get_attrs(xorriso, in_node, path, &num_attrs, &names, &value_lengths, &values, flag & (2 | 8 | 32)); if(ret <= 0) goto ex; if(flag & 64) { ret= (num_attrs > 0); goto ex; } if(num_attrs == 0) {ret= 2; goto ex;} if(!(flag & 1)) { ret= Xorriso_getfname(xorriso, path, 0); if(ret <= 0) goto ex; } for(pass= 0; pass < 1 + (attr_text != NULL); pass++) { if(pass) { *attr_text= calloc(result_len + 1, 1); if(*attr_text == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } } for(i= 0; i < (int) num_attrs; i++) { if(flag & 16) if(strncmp(names[i], "isofs.", 6) == 0) continue; if(strlen(names[i]) + value_lengths[i] >= SfileadrL) { sprintf(xorriso->result_line, "# oversized: name %d , value %d bytes\n", (int) strlen(names[i]), (int) value_lengths[i]); } else { ret= Sfile_bsl_encoder(&bsl, names[i], strlen(names[i]), 8); if(ret <= 0) {ret= -1; goto ex;} strcpy(xorriso->result_line, bsl); free(bsl); ret= Sfile_bsl_encoder(&bsl, values[i], value_lengths[i], 8); if(ret <= 0) {ret= -1; goto ex;} sprintf(xorriso->result_line + strlen(xorriso->result_line), "=\"%s\"\n", bsl); free(bsl); } /* temporarily disable -backslash_codes with result output */ result_len+= strlen(xorriso->result_line); if(pass) { strcat(*attr_text, xorriso->result_line); } else if(!(flag & 1)) { bsl_mem= xorriso->bsl_interpretation; xorriso->bsl_interpretation= 0; Xorriso_result(xorriso, 0); xorriso->bsl_interpretation= bsl_mem; } } } if((flag & 16) && attr_text != NULL) if(*attr_text != NULL) if((*attr_text)[0] == 0) { free(*attr_text); *attr_text= NULL; ret= 2; goto ex; } if(!(flag & 1)) { strcpy(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); } ret= 1; ex:; Xorriso_get_attrs(xorriso, in_node, path, &num_attrs, &names, &value_lengths, &values, 1 << 15); return(ret); } /* @param flag bit0= with mode "e" : Use echo -e encoding but do not put out commands and quotation marks. Rather apply double backslash. */ int Xorriso_append_extattr_comp(struct XorrisO *xorriso, char *comp, size_t comp_len, char *mode, int flag) { int ret; size_t line_limit; char *line, *wpt, *bsl = NULL; unsigned char *upt, *uval; line= xorriso->result_line; line_limit= sizeof(xorriso->result_line); uval= (unsigned char *) comp; if(*mode == 'q') { Text_shellsafe(comp, line, 1); } else if(*mode == 'e' || mode[0] == 0) { for(upt= uval; (size_t) (upt - uval) < comp_len; upt++) if(*upt <= 037 || *upt >= 0177) break; if((size_t) (upt - uval) < comp_len || (flag & 1)) { /* Use "$(echo -e '\0xyz')" */; if(!(flag & 1)) strcat(line, "\"$(echo -e '"); wpt= line + strlen(line); for(upt= uval; (size_t) (upt - uval) < comp_len; upt++) { if(wpt - line + 5 + 3 + 1 > (ssize_t) line_limit) /* "\\0xyz" + "')\"" + 0 */ goto too_much; if(*upt <= 037 || *upt >= 0177 || *upt == '\\' || *upt == '\'') { if(flag & 1) *(wpt++)= '\\'; sprintf((char *) wpt, "\\0%-3.3o", *upt); wpt+= strlen(wpt); } else { *(wpt++)= *upt; } } *wpt= 0; if(!(flag & 1)) strcpy(wpt, "')\""); } else { Text_shellsafe(comp, line, 1); } } else if(*mode == 'b') { ret= Sfile_bsl_encoder(&bsl, comp, comp_len, 8); if(ret <= 0) {ret= -1; goto ex;} if(strlen(line) + strlen(bsl) + 1 > line_limit) goto too_much; strcat(line, bsl); free(bsl); bsl= NULL; } else if(*mode == 'r') { if(strlen(line) + strlen(comp) + 1 > line_limit) goto too_much; strcat(line, comp); } ret= 1; ex:; if(bsl != NULL) free(bsl); return(ret); too_much:; Xorriso_msgs_submit(xorriso, 0, "Oversized BSD-style file attribute", 0, "FAILURE", 0); ret= -1; goto ex; } /* @param flag bit1= path is disk_path bit3= do not ignore eventual non-user attributes. bit5= in case of symbolic link on disk: inquire link target */ int Xorriso_list_extattr(struct XorrisO *xorriso, void *in_node, char *path, char *show_path, char *mode, int flag) { int ret= 1, i, bsl_mem; size_t num_attrs= 0, *value_lengths= NULL; char **names= NULL, **values= NULL, *cpt, *space_pt, *name_pt, *path_pt; char *line; unsigned char *upt, *uval; line= xorriso->result_line; ret= Xorriso_get_attrs(xorriso, in_node, path, &num_attrs, &names, &value_lengths, &values, flag & (2 | 8 | 32)); if(ret <= 0) goto ex; if(flag & 64) { ret= (num_attrs > 0); goto ex; } if(num_attrs == 0) {ret= 2; goto ex;} strcpy(line, "n="); path_pt= show_path + (show_path[0] == '/'); if(path_pt[0] == 0) path_pt= "."; ret= Xorriso_append_extattr_comp(xorriso, path_pt, strlen(path_pt), mode, 0); if(ret <= 0) goto ex; strcat(line, "\n"); Xorriso_result(xorriso, 0); for(i= 0; i < (int) num_attrs; i++) { line[0]= 0; uval= (unsigned char *) values[i]; if(strlen(names[i]) + value_lengths[i] >= SfileadrL) { sprintf(line, "echo 'OMITTED: Oversized: name %d bytes, value %d bytes in file '\"$n\" >&2\n", (int) strlen(names[i]), (int) value_lengths[i]); Xorriso_result(xorriso, 0); continue; } /* Form: $c space name value $n */ /* Split namespace from name */ cpt= strchr(names[i], '.'); if(cpt == NULL) { space_pt= "user"; name_pt= names[i]; } else { *cpt= 0; space_pt= names[i]; name_pt= cpt + 1; } /* FreeBSD setextattr cannot set 0-bytes */ for(upt= uval; (size_t) (upt - uval) < value_lengths[i]; upt++) if(*upt == 0 ) break; if((size_t) (upt - uval) < value_lengths[i]) { strcpy(line, "echo 'OMITTED: Value contains 0-bytes : space \"'\""); ret= Xorriso_append_extattr_comp(xorriso, space_pt, strlen(space_pt), "e", 1); if(ret <= 0) goto ex; strcat(line, "\"'\" , name \"'\""); ret= Xorriso_append_extattr_comp(xorriso, name_pt, strlen(name_pt), "e", 1); if(ret <= 0) goto ex; strcat(line, "\"'\" in file '\""); ret= Xorriso_append_extattr_comp(xorriso, path_pt, strlen(path_pt), "e", 1); if(ret <= 0) goto ex; strcat(line, "\" >&2\n"); /* temporarily disable -backslash_codes with result output */ bsl_mem= xorriso->bsl_interpretation; xorriso->bsl_interpretation= 0; Xorriso_result(xorriso, 0); xorriso->bsl_interpretation= bsl_mem; strcpy(line, "# "); } strcat(line, "$c "); ret= Xorriso_append_extattr_comp(xorriso, space_pt, strlen(space_pt), mode, 0); if(ret <= 0) goto ex; strcat(line, " "); ret= Xorriso_append_extattr_comp(xorriso,name_pt, strlen(name_pt), mode, 0); if(ret <= 0) goto ex; strcat(line, " "); ret= Xorriso_append_extattr_comp(xorriso, values[i], value_lengths[i], mode, 0); if(ret <= 0) goto ex; strcat(line, " \"$n\"\n"); /* temporarily disable -backslash_codes with result output */ bsl_mem= xorriso->bsl_interpretation; xorriso->bsl_interpretation= 0; Xorriso_result(xorriso, 0); xorriso->bsl_interpretation= bsl_mem; } strcpy(line, "\n"); Xorriso_result(xorriso, 0); ret= 1; ex:; Xorriso_get_attrs(xorriso, in_node, path, &num_attrs, &names, &value_lengths, &values, 1 << 15); return(ret); } /* @param flag Bitfield for control purposes bit0= get default ACL rather than access ACL bit4= set *text = NULL and return 2 if the ACL matches st_mode permissions. bit5= in case of symbolic link: inquire link target bit15= free text and return 1 @return 1 ok 2 ok, trivial ACL found while bit4 is set, *text is NULL 0 no ACL manipulation adapter available / ACL not supported by fs -1 failure of system ACL service (see errno) -2 attempt to inquire ACL of a symbolic link without bit4 or bit5 resp. with no suitable link target */ int Xorriso_local_getfacl(struct XorrisO *xorriso, char *disk_path, char **text, int flag) { int ret, skip= 0, colons= 0, countdown= 0; char *acl= NULL, *cpt, *wpt; if(flag & (1 << 15)) { if(*text != NULL) free(*text); *text= NULL; return(1); } *text= NULL; ret= iso_local_get_acl_text(disk_path, &acl, flag & (1 | 16 | 32)); Xorriso_process_msg_queues(xorriso,0); if(ret < 0 || ret == 2) return(ret); if(acl == NULL) return(0); *text= strdup(acl); iso_local_get_acl_text(disk_path, &acl, 1 << 15); if(*text == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); return(-1); } /* Garbage collection about trailing remarks after 3 permission chars */ wpt= *text; for(cpt= *text; *cpt; cpt++) { if(skip) { if(*cpt == '\n') skip= 0; else continue; } if(*cpt == ':' && !countdown) { colons++; if(colons == 2) { countdown= 4; colons= 0; } } if(countdown > 0) { countdown--; if(countdown == 0) skip= 1; } *wpt= *cpt; wpt++; } *wpt= 0; return(1); } /* @param flag bit1= path is disk_path bit3= do not ignore eventual non-user attributes. bit5= in case of symbolic link on disk: inquire link target bit15= free memory */ int Xorriso_get_attrs(struct XorrisO *xorriso, void *in_node, char *path, size_t *num_attrs, char ***names, size_t **value_lengths, char ***values, int flag) { int ret, i, widx; IsoNode *node; if(flag & (1 << 15)) { if(flag & 2) { iso_local_get_attrs(NULL, num_attrs, names, value_lengths, values, 1 << 15); } else { iso_node_get_attrs(NULL, num_attrs, names, value_lengths, values, 1 << 15); } return(1); } *num_attrs= 0; if(flag & 2) { ret= iso_local_get_attrs(path, num_attrs, names, value_lengths, values, flag & (8 | 32)); if(ret < 0) { strcpy(xorriso->info_text, "Error with reading xattr of disk file "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); } } else { node= (IsoNode *) in_node; if(node == NULL) { ret= Xorriso_get_node_by_path(xorriso, path, NULL, &node, 0); if(ret<=0) goto ex; } ret= iso_node_get_attrs(node, num_attrs, names, value_lengths, values, 0); if(ret < 0) { Xorriso_report_iso_error(xorriso, "", ret, "Error when obtaining xattr of ISO node", 0, "FAILURE", 1); goto ex; } if(!(flag & 8)) { /* Filter away any non-userspace xattr */; widx= 0; for(i= 0; i < (int) *num_attrs; i++) { if(strncmp((*names)[i], "user.", 5) != 0) { free((*names)[i]); (*names)[i]= NULL; if((*values)[i] != NULL) { free((*values)[i]); (*values)[i]= NULL; } } else { if(widx != i) { (*names)[widx]= (*names)[i]; (*value_lengths)[widx]= (*value_lengths)[i]; (*values)[widx]= (*values)[i]; (*names)[i]= NULL; (*value_lengths)[i]= 0; (*values)[i]= NULL; } widx++; } } *num_attrs= widx; } } ret= 1; ex:; Xorriso_process_msg_queues(xorriso,0); return(ret); } int Xorriso_get_attr_value(struct XorrisO *xorriso, void *in_node, char *path, char *name, size_t *value_length, char **value, int flag) { int ret; size_t num_attrs= 0, *value_lengths= NULL, i; char **names = NULL, **values= NULL; *value= NULL; *value_length= 0; ret= Xorriso_get_attrs(xorriso, in_node, path, &num_attrs, &names, &value_lengths, &values, 8); if(ret <= 0) goto ex; for(i= 0; i < num_attrs; i++) { if(strcmp(name, names[i]) != 0) continue; *value= calloc(value_lengths[i] + 1, 1); if(*value == NULL) {ret= -1; goto ex;} memcpy(*value, values[i], value_lengths[i]); (*value)[value_lengths[i]]= 0; *value_length= value_lengths[i]; ret= 1; goto ex; } ret= 0; ex: Xorriso_get_attrs(xorriso, in_node, path, &num_attrs, &names, &value_lengths, &values, 1 << 15); return(ret); } int Xorriso_stream_type(struct XorrisO *xorriso, IsoNode *node, IsoStream *stream, char type_text[], int flag) { int ret, lba, stream_type, block_size_log2; uint8_t zisofs_algo[2], algo_num; char text[5]; strncpy(text, stream->class->type, 4); text[4]= 0; if(strcmp(text, "fsrc") == 0) { ret= Xorriso__file_start_lba(node, &lba, 0); if(ret > 0 && lba > 0) strcpy(type_text, "image"); else strcpy(type_text, "disk"); } else if(strcmp(text, "ziso") == 0 || strcmp(text, "osiz") == 0) { if(strcmp(text, "ziso") == 0) strcpy(type_text, "--zisofs"); else strcpy(type_text, "--zisofs-decode"); ret= iso_stream_get_zisofs_par(stream, &stream_type, zisofs_algo, &algo_num, &block_size_log2, 0); if(ret == 1) sprintf(type_text + strlen(type_text), ":%c%c:%dk", zisofs_algo[0], zisofs_algo[1], 1 << (block_size_log2 - 10)); } else if(strcmp(text, "gzip") == 0) { strcpy(type_text, "--gzip"); } else if(strcmp(text, "pizg") == 0) { strcpy(type_text, "--gunzip"); } else if(strcmp(text, "cout") == 0 || strcmp(text, "boot") == 0 || strcmp(text, "user") == 0 || strcmp(text, "extf") == 0) { strcpy(type_text, text); } else { Text_shellsafe(text, type_text, 0); } return(1); } /* @param flag bit0= do not report to result but only retrieve md5 text @return 1= ok, 0= no md5 available, <0= other error */ int Xorriso_get_md5(struct XorrisO *xorriso, void *in_node, char *path, char md5[16], int flag) { int ret= 1, i; char *wpt; IsoImage *image; IsoNode *node; ret= Xorriso_get_volume(xorriso, &image, 0); if(ret <= 0) goto ex; node= (IsoNode *) in_node; if(node == NULL) { ret= Xorriso_get_node_by_path(xorriso, path, NULL, &node, 0); if(ret<=0) goto ex; } if(!LIBISO_ISREG(node)) return(0); ret= iso_file_get_md5(image, (IsoFile *) node, md5, 0); Xorriso_process_msg_queues(xorriso,0); if(ret <= 0) goto ex; if(flag & 1) {ret= 1; goto ex;} wpt= xorriso->result_line; for(i= 0; i < 16; i++) { sprintf(wpt, "%2.2x", ((unsigned char *) md5)[i]); wpt+= 2; } strcpy(wpt, " "); wpt+= 2; Xorriso_getfname(xorriso, path, 1 | 2); ret= 1; ex:; return(ret); } int Xorriso_make_md5(struct XorrisO *xorriso, void *in_node, char *path, int flag) { int ret; off_t size; IsoNode *node; node= (IsoNode *) in_node; if(node == NULL) { ret= Xorriso_get_node_by_path(xorriso, path, NULL, &node, 0); if(ret <= 0) return(ret); } if(!LIBISO_ISREG(node)) return(0); ret= iso_file_make_md5((IsoFile *) node, 0); size= iso_file_get_size((IsoFile *) node); xorriso->pacifier_count+= size; xorriso->pacifier_byte_count+= size; Xorriso_pacifier_callback(xorriso, "content bytes read", xorriso->pacifier_count, 0, "", 8); Xorriso_process_msg_queues(xorriso, 0); if(ret < 0) { Xorriso_report_iso_error(xorriso, "", ret, "Error when computing MD5", 0, "FAILURE", 1); return(0); } Xorriso_set_change_pending(xorriso, 1); return(1); } /* @param flag bit0= do not only sum up sizes but also print subdirs bit2= do not report result by Xorriso_result() */ int Xorriso_show_du_subs(struct XorrisO *xorriso, IsoDir *dir_node, char *abs_path, char *rel_path, off_t *size, off_t boss_mem, int flag) { int i, ret, no_sort= 0, filec= 0, l; IsoDirIter *iter= NULL; IsoNode *node, **node_array= NULL; char *name; off_t sub_size, report_size, mem= 0; char *path= NULL, *show_path= NULL, *sfe= NULL; Xorriso_alloc_meM(sfe, char, 5 * SfileadrL); Xorriso_alloc_meM(path, char, SfileadrL); Xorriso_alloc_meM(show_path, char, SfileadrL); *size= 0; ret= iso_dir_get_children(dir_node, &iter); if(ret<0) { cannot_create_iter:; Xorriso_cannot_create_iter(xorriso, ret, 0); {ret= -1; goto ex;} } for(i= 0; iso_dir_iter_next(iter, &node) == 1; ) { sub_size= 0; name= (char *) iso_node_get_name(node); strcpy(show_path, rel_path); if(Sfile_add_to_path(show_path, name, 0)<=0) goto much_too_long; if(LIBISO_ISDIR(node)) { strcpy(path, abs_path); if(Sfile_add_to_path(path, name, 0)<=0) { much_too_long:; Xorriso_much_too_long(xorriso, strlen(path)+strlen(name)+1, 2); {ret= -1; goto ex;} } filec++; l= strlen(rel_path)+1; mem+= l; if(l % sizeof(char *)) mem+= sizeof(char *)-(l % sizeof(char *)); if(flag&1) /* diving and counting is done further below */ continue; ret= Xorriso_show_du_subs(xorriso, (IsoDir *) node, path, show_path, &sub_size, boss_mem, 0); if(ret<0) goto ex; if(ret==0) continue; } if(LIBISO_ISREG(node)) { sub_size+= iso_file_get_size((IsoFile *) node)+2048; /* sub_size+= iso_file_get_size((IsoFile *) node)+strlen(name)+1; */ } if(sub_size>0) (*size)+= sub_size; Xorriso_process_msg_queues(xorriso,0); } if(filec<=0 || !(flag&1)) {ret= 1; goto ex;} /* Reset iteration */ iso_dir_iter_free(iter); iter= NULL; Xorriso_process_msg_queues(xorriso,0); ret= Xorriso_sorted_node_array(xorriso, dir_node, &filec, &node_array, boss_mem, 1|2|4); if(ret<0) goto ex; if(ret==0) { no_sort= 1; ret= iso_dir_get_children(dir_node, &iter); if(ret<0) goto cannot_create_iter; } for(i= 0; (no_sort || irequest_to_abort); i++) { if(no_sort) { ret= iso_dir_iter_next(iter, &node); if(ret!=1) break; if(!LIBISO_ISDIR(node)) continue; } else node= node_array[i]; sub_size= 0; name= (char *) iso_node_get_name(node); strcpy(show_path, rel_path); if(Sfile_add_to_path(show_path, name, 0)<=0) goto much_too_long; strcpy(path, abs_path); if(Sfile_add_to_path(path, name, 0)<=0) goto much_too_long; ret= Xorriso_show_du_subs(xorriso, (IsoDir *) node, path, show_path, &sub_size, boss_mem+mem, flag&1); if(ret<0) goto ex; if(LIBISO_ISREG(node)) { sub_size+= iso_file_get_size((IsoFile *) node)+2048; /* sub_size+= iso_tree_node_get_size((IsoFile *) node)+strlen(name)+1; */ } if(sub_size>0) (*size)+= sub_size; report_size= sub_size/1024; if(report_size*1024sh_style_result) sprintf(xorriso->result_line, "%-7.f ",(double) (report_size)); else sprintf(xorriso->result_line, "%7.f ",(double) (report_size)); sprintf(xorriso->result_line+strlen(xorriso->result_line), "%s\n", Xorriso_esc_filepath(xorriso, show_path, sfe, 0)); Xorriso_result(xorriso, 0); } } ret= 1; ex:; Xorriso_free_meM(sfe); Xorriso_free_meM(path); Xorriso_free_meM(show_path); if(iter!=NULL) iso_dir_iter_free(iter); if(node_array!=NULL) free((char *) node_array); Xorriso_process_msg_queues(xorriso,0); return(ret); } int Xorriso_sorted_dir_i(struct XorrisO *xorriso, IsoDir *dir_node, int *filec, char ***filev, off_t boss_mem, int flag) { int i,j,ret; IsoDirIter *iter= NULL; IsoNode *node; char *name; off_t mem; (*filec)= 0; (*filev)= NULL; ret= iso_dir_get_children(dir_node, &iter); if(ret<0) { cannot_iter:; Xorriso_cannot_create_iter(xorriso, ret, 0); {ret= -1; goto ex;} } mem= 0; for(i= 0; iso_dir_iter_next(iter, &node) == 1; ) { name= (char *) iso_node_get_name(node); mem+= sizeof(char *)+strlen(name)+8; (*filec)++; } iso_dir_iter_free(iter); iter= NULL; if(*filec==0) {ret= 1; goto ex;} ret= Xorriso_check_temp_mem_limit(xorriso, mem+boss_mem, 2); if(ret<=0) goto ex; (*filev)= (char **) calloc(*filec, sizeof(char *)); if(*filev==NULL) {ret= -1; goto ex; } ret= iso_dir_get_children(dir_node, &iter); if(ret<0) goto cannot_iter; for(i= 0; i<*filec; i++) { ret= iso_dir_iter_next(iter, &node); if(ret!=1) break; name= (char *) iso_node_get_name(node); (*filev)[i]= strdup(name); if((*filev)[i]==NULL) { for(j= 0; j xorriso->file_name_limit) { ended= 0; break; } if(*rpt == '/') rpt++; } if(ended) return(1); /* All short enough */ /* Some truncation is needed */ buffer[0]= 0; wpt= buffer; if(path[0] == '/') *(wpt++)= '/'; rpt= path; if(*rpt == '/') rpt++; for(ended= 0; !ended;) { basrpt= rpt; baswpt= wpt; rpt= strchr(basrpt, '/'); if(rpt == NULL) { rpt= basrpt + strlen(basrpt); ended= 1; } skip= 0; for(cpt= basrpt; cpt < rpt; cpt++) { *(wpt++)= *cpt; if((flag & 1) && strchr("*?[", *cpt) != NULL) skip= 1; } *wpt= 0; if((!skip) && rpt - basrpt > xorriso->file_name_limit) { ret= iso_truncate_leaf_name(1, xorriso->file_name_limit, baswpt, 0); Xorriso_process_msg_queues(xorriso, 0); if(ret < 0) return(0); wpt= baswpt + strlen(baswpt); } if(!ended) { *(wpt++)= '/'; rpt++; } } *resultpt= buffer; return(1); } /* @param flag bit0= long format bit1= do not print count of nodes bit2= du format bit3= print directories as themselves (ls -d) bit5= do not look for truncated versions of path component */ int Xorriso_ls_filev(struct XorrisO *xorriso, char *wd, int filec, char **filev, off_t boss_mem, int flag) { int i, ret, was_error= 0, dfilec= 0, pass, passes, hidden_state= 0; IsoNode *node; IsoImage *volume; char *path= NULL, *link_target= NULL, *rpt, **dfilev= NULL; char *a_text= NULL, *d_text= NULL, *namept; off_t size; struct stat stbuf; Xorriso_alloc_meM(path, char, SfileadrL); Xorriso_alloc_meM(link_target, char, SfileadrL); rpt= xorriso->result_line; ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) goto ex; Sort_argv(filec, filev, 0); /* Count valid nodes, warn of invalid ones */ for(i= 0; i> 4) & 2)); if(ret<=0) { sprintf(xorriso->info_text, "Not found in ISO image: "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); was_error++; continue; } } if((flag&8) && !(flag&(2|4))) { sprintf(xorriso->info_text, "Valid ISO nodes found: %d\n", filec-was_error); Xorriso_info(xorriso,1); if(filec-was_error<=0) {ret= !was_error; goto ex;} } passes= 1+!(flag&(4|8)); for(pass= 0; passrequest_to_abort); i++) { rpt[0]= 0; ret= Xorriso_make_abs_adr(xorriso, wd, filev[i], path, 1|2|4); if(ret<=0) continue; ret= Xorriso_fake_stbuf(xorriso, path, &stbuf, &node, ((flag&4) >> 1) | 16); if(ret<=0) continue; if(LIBISO_ISDIR(node) && !(flag&(4|8))) { if(pass==0) continue; if(filec>1) { strcpy(xorriso->result_line, "\n"); Xorriso_result(xorriso,0); Xorriso_esc_filepath(xorriso, filev[i], xorriso->result_line, 0); strcat(xorriso->result_line, ":\n"); Xorriso_result(xorriso,0); } ret= Xorriso_sorted_dir_i(xorriso, (IsoDir *) node, &dfilec, &dfilev, boss_mem, 0); if(ret<=0) { /* >>> libisofs iterator loop and single item Xorriso_lsx_filev() */; } else { if(flag&1) { sprintf(xorriso->result_line, "total %d\n", dfilec); Xorriso_result(xorriso,0); } Xorriso_ls_filev(xorriso, path, dfilec, dfilev, boss_mem, (flag & 1) | 2 | 8); } if(dfilec>0) Sfile_destroy_argv(&dfilec, &dfilev, 0); continue; } else if(pass>0) continue; link_target[0]= 0; if((flag&5)==1) { /* -ls_l */ iso_node_get_acl_text(node, &a_text, &d_text, 16); hidden_state= Xorriso_node_eff_hidden(xorriso, node, 0); ret= Xorriso_format_ls_l(xorriso, &stbuf, 1 | ((a_text != NULL || d_text != NULL) << 1) | (hidden_state << 2)); iso_node_get_acl_text(node, &a_text, &d_text, 1 << 15); if(ret<=0) continue; if(LIBISO_ISLNK(node)) { if(Sfile_str(link_target, (char *) iso_symlink_get_dest( (IsoSymlink *) node), 0)<=0) link_target[0]= 0; } } else if(flag&4) { /* -du or -dus */ size= stbuf.st_size; if(S_ISDIR(stbuf.st_mode)) { ret= Xorriso_show_du_subs(xorriso, (IsoDir *) node, path, filev[i], &size, boss_mem, flag&1); if(ret<0) {ret= -1; goto ex;} if(ret==0) continue; } if(xorriso->sh_style_result) sprintf(rpt, "%-7.f ",(double) (size/1024)); else sprintf(rpt, "%7.f ",(double) (size/1024)); } Xorriso_truncate_path_comps(xorriso, filev[i], path, &namept, 0); if(link_target[0] && (flag&5)==1) { Xorriso_esc_filepath(xorriso, namept, xorriso->result_line, 1); strcat(xorriso->result_line, " -> "); Xorriso_esc_filepath(xorriso, link_target, xorriso->result_line, 1 | 2); } else { Xorriso_esc_filepath(xorriso, namept, xorriso->result_line, 1); } strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); } ret= !was_error; ex:; Xorriso_free_meM(path); Xorriso_free_meM(link_target); return(ret); } /* @return: <=0 = error, 1= directory tree, 2= path leads to non-directory */ int Xorriso_get_dus(struct XorrisO *xorriso, char *iso_rr_path, off_t *size, off_t boss_mem, int flag) { int ret; IsoNode *node; char *path= NULL; struct stat stbuf; Xorriso_alloc_meM(path, char, SfileadrL); ret= Xorriso_make_abs_adr(xorriso, xorriso->wdi, iso_rr_path, path, 1 | 2 | 4); if(ret <= 0) goto ex; ret= Xorriso_fake_stbuf(xorriso, path, &stbuf, &node, 0); if(ret <= 0) goto ex; if(!S_ISDIR(stbuf.st_mode)) { *size= stbuf.st_size; ret= 2; goto ex; } ret= Xorriso_show_du_subs(xorriso, (IsoDir *) node, path, iso_rr_path, size, boss_mem, 4); if(ret <= 0) goto ex; ret= 1; ex: Xorriso_free_meM(path); return(ret); } /* This function needs less buffer memory than Xorriso_ls_filev() but cannot perform structured pattern matching as done by Xorriso_expand_pattern() for subsequent Xorriso_ls_filev(). @param flag bit0= long format bit1= only check for directory existence bit2= do not apply search pattern but accept any file bit3= just count nodes and return number */ int Xorriso_ls(struct XorrisO *xorriso, int flag) { int ret, i, filec= 0, failed_at, no_sort= 0; IsoNode *node, **node_array= NULL; IsoDir *dir_node; IsoDirIter *iter= NULL; char *link_target= NULL, *npt, *rpt; struct stat stbuf; Xorriso_alloc_meM(link_target, char, SfileadrL); rpt= xorriso->result_line; ret= Xorriso_dir_from_path(xorriso, "Working directory", xorriso->wdi, &dir_node, 0); if(ret <= 0) goto ex; ret= iso_dir_get_children(dir_node, &iter); if(ret<0) { cannot_create_iter:; Xorriso_cannot_create_iter(xorriso, ret, 0); {ret= -1; goto ex;} } Xorriso_process_msg_queues(xorriso,0); for(i= 0; iso_dir_iter_next(iter, &node) == 1; ) { npt= (char *) iso_node_get_name(node); if(!(flag&4)) { ret= Xorriso_regexec(xorriso, npt, &failed_at, 0); if(ret) continue; /* no match */ } filec++; } /* Reset iteration */ iso_dir_iter_free(iter); iter= NULL; Xorriso_process_msg_queues(xorriso,0); if(flag&8) {ret= filec; goto ex;} sprintf(xorriso->info_text, "Valid ISO nodes found: %d\n", filec); Xorriso_info(xorriso,1); ret= Xorriso_sorted_node_array(xorriso, dir_node, &filec, &node_array, 0, flag&4); if(ret<0) goto ex; if(ret==0) { no_sort= 1; ret= iso_dir_get_children(dir_node, &iter); if(ret<0) goto cannot_create_iter; } for(i= 0; irequest_to_abort); i++) { if(no_sort) { ret= iso_dir_iter_next(iter, &node); if(ret!=1) break; npt= (char *) iso_node_get_name(node); if(!(flag&4)) { ret= Xorriso_regexec(xorriso, npt, &failed_at, 0); if(ret) continue; /* no match */ } } else node= node_array[i]; npt= (char *) iso_node_get_name(node); link_target[0]= 0; if(LIBISO_ISLNK(node)) { if(Sfile_str(link_target, (char *) iso_symlink_get_dest( (IsoSymlink *) node), 0)<=0) link_target[0]= 0; } rpt[0]= 0; if(flag&1) { ret= Xorriso_fake_stbuf(xorriso, "", &stbuf, &node, 1); if(ret<=0) continue; ret= Xorriso_format_ls_l(xorriso, &stbuf, 1); if(ret<=0) continue; } if(link_target[0] && (flag&1)) { Xorriso_esc_filepath(xorriso, npt, xorriso->result_line, 1); strcat(xorriso->result_line, " -> "); Xorriso_esc_filepath(xorriso, link_target, xorriso->result_line, 1 | 2); } else { Xorriso_esc_filepath(xorriso, npt, xorriso->result_line, 1); } strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); } ret= 1; ex:; if(iter!=NULL) iso_dir_iter_free(iter); Xorriso_process_msg_queues(xorriso,0); if(node_array!=NULL) free((char *) node_array); Xorriso_free_meM(link_target); return(ret); } /* @param flag bit0= count results rather than storing them bit1= this is a recursion bit2= prepend wd (automatically done if wd[0]!=0) */ int Xorriso_obtain_pattern_files_i( struct XorrisO *xorriso, char *wd, IsoDir *dir, int *filec, char **filev, int count_limit, off_t *mem, int *dive_count, int flag) { int ret, failed_at; IsoDirIter *iter= NULL; IsoNode *node; char *name; char *adr= NULL; adr= malloc(SfileadrL); if(adr==NULL) { Xorriso_no_malloc_memory(xorriso, &adr, 0); {ret= -1; goto ex;} } if(!(flag&2)) *dive_count= 0; else (*dive_count)++; ret= Xorriso_check_for_root_pattern(xorriso, filec, filev, count_limit, mem, (flag&1)|2); if(ret!=2) goto ex; ret= iso_dir_get_children(dir, &iter); if(ret<0) { Xorriso_cannot_create_iter(xorriso, ret, 0); {ret= -1; goto ex;} } while(iso_dir_iter_next(iter, &node) == 1) { name= (char *) iso_node_get_name(node); ret= Xorriso_make_abs_adr(xorriso, wd, name, adr, flag&4); if(ret<=0) goto ex; ret= Xorriso_regexec(xorriso, adr, &failed_at, 1); if(ret) { /* no match */ if(failed_at <= *dive_count) /* no hope for a match */ continue; if(!LIBISO_ISDIR(node)) { /* >>> How to deal with softlinks ? */ continue; } /* dive deeper */ ret= Xorriso_obtain_pattern_files_i( xorriso, adr, (IsoDir *) node, filec, filev, count_limit, mem, dive_count, flag|2); if(ret<=0) goto ex; } else { ret= Xorriso_register_matched_adr(xorriso, adr, count_limit, filec, filev, mem, (flag&1)|2); if(ret<=0) goto ex; } } ret= 1; ex:; if(adr!=NULL) free(adr); if(flag&2) (*dive_count)--; if(iter != NULL) iso_dir_iter_free(iter); return(ret); } /* @param flag bit0= a match count !=1 is a FAILURE event bit1= with bit0 tolerate 0 matches if pattern is a constant bit2= do not issue debug messages about temporary memory needs bit3= do not add unresolved pattern to filev */ int Xorriso_expand_pattern(struct XorrisO *xorriso, int num_patterns, char **patterns, int extra_filec, int *filec, char ***filev, off_t *mem, int flag) { int ret, count= 0, abs_adr= 0, i, was_count, was_filec; int nonconst_mismatches= 0, dive_count= 0; IsoImage *volume; IsoDir *dir= NULL, *root_dir; IsoNode *iso_node; *filec= 0; *filev= NULL; xorriso->search_mode= 3; xorriso->structured_search= 1; ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) return(ret); root_dir= iso_image_get_root(volume); if(root_dir==NULL) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "While expanding pattern : Cannot obtain root node of ISO image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); ret= -1; goto ex; } for(i= 0; iwdi does not exist yet, but one may not use it as base for relative address searches. */ ret= Xorriso_node_from_path(xorriso, volume, xorriso->wdi, &iso_node, 1); dir= (IsoDir *) iso_node; if(ret<=0) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "While expanding pattern "); Text_shellsafe(patterns[i], xorriso->info_text, 1); strcat(xorriso->info_text, " : Working directory does not exist in ISO image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(!LIBISO_ISDIR((IsoNode *) dir)) { sprintf(xorriso->info_text, "Working directory path does not lead to a directory in ISO image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } /* count the matches */ was_count= count; ret= Xorriso_obtain_pattern_files_i(xorriso, "", dir, &count, NULL, 0, mem, &dive_count, 1 | abs_adr); if(ret<=0) goto ex; if(was_count==count && strcmp(patterns[i],"*")!=0 && (flag&3)!=1 && !(flag & 8)) { count++; Xorriso_eval_nonmatch(xorriso, patterns[i], &nonconst_mismatches, mem, 0); } } ret= Xorriso_check_matchcount(xorriso, count, nonconst_mismatches, num_patterns, patterns, (flag&1)|2); if(ret<=0) goto ex; count+= extra_filec; (*mem)+= extra_filec * sizeof(char *); if(count<=0) {ret= !!(flag & 8); goto ex;} ret= Xorriso_alloc_pattern_mem(xorriso, *mem, count, filev, !!(flag & 4)); if(ret<=0) goto ex; /* now store addresses */ for(i= 0; i= SfileadrL) { free(source_path); return(0); } strcpy(disk_path, source_path); free(source_path); return(1); } /* @param flag bit0= show numbers from iso_stream_get_id */ int Xorriso_show_stream(struct XorrisO *xorriso, void *in_node, char *path, int flag) { int ret; IsoNode *node; IsoFile *file; IsoStream *stream= NULL, *input_stream; IsoExternalFilterCommand *cmd; char type_text[80], *source_path= NULL; unsigned int fs_id; dev_t dev_id; ino_t ino_id; node= (IsoNode *) in_node; if(node == NULL) { ret= Xorriso_get_node_by_path(xorriso, path, NULL, &node, 0); if(ret <= 0) goto ex; } if(!LIBISO_ISREG(node)) {ret= 2; goto ex;} file= (IsoFile *) node; input_stream= iso_file_get_stream(file); Text_shellsafe(path, xorriso->result_line, 0); while(1) { stream= input_stream; input_stream= iso_stream_get_input_stream(stream, 0); if(input_stream == NULL) break; strcat(xorriso->result_line, " < "); Xorriso_stream_type(xorriso, node, stream, type_text, 0); strcat(xorriso->result_line, type_text); if(flag & 1) { iso_stream_get_id(stream, &fs_id, &dev_id, &ino_id); sprintf(xorriso->result_line + strlen(xorriso->result_line), "[%u,%lu,%lu]", fs_id, (unsigned long) dev_id, (unsigned long) ino_id); } ret= iso_stream_get_external_filter(stream, &cmd, 0); if(ret < 0) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, "", ret, "Error when inquiring filter command of node", 0, "FAILURE", 1); ret= 0; goto ex; } if(ret > 0) { strcat(xorriso->result_line, ":"); Text_shellsafe(cmd->name, xorriso->result_line, 1); } if(strlen(xorriso->result_line) > SfileadrL) { Xorriso_result(xorriso, 0); xorriso->result_line[0]= 0; } } strcat(xorriso->result_line, " < "); Xorriso_stream_type(xorriso, node, stream, type_text, 0); strcat(xorriso->result_line, type_text); if(flag & 1) { iso_stream_get_id(stream, &fs_id, &dev_id, &ino_id); sprintf(xorriso->result_line + strlen(xorriso->result_line), "[%u,%lu,%lu]", fs_id, (unsigned long) dev_id, (unsigned long) ino_id); } source_path= iso_stream_get_source_path(stream, 0); if(source_path != NULL) { strcat(xorriso->result_line, ":"); Text_shellsafe(source_path, xorriso->result_line, 1); } strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); ret= 1; ex:; if(source_path != NULL) free(source_path); return(ret); } /* @param damage_start Returns first damaged byte address @param damage_end Returns first byte address after last damaged byte @return <0 error, 0=undamaged , 1=damaged */ int Xorriso_file_eval_damage(struct XorrisO *xorriso, IsoNode *node, off_t *damage_start, off_t *damage_end, int flag) { int *start_lbas= NULL, *end_lbas= NULL, lba_count= 0, sect; int i, sectors, sector_size, ret; off_t sect_base= 0, size= 0, byte, *section_sizes= NULL; struct SectorbitmaP *map; *damage_start= *damage_end= -1; map= xorriso->in_sector_map; if(map == NULL) return(0); Sectorbitmap_get_layout(map, §ors, §or_size, 0); sector_size/= 2048; ret= Xorriso__start_end_lbas(node, &lba_count, &start_lbas, &end_lbas, §ion_sizes, &size, 0); if(ret <= 0) { Xorriso_process_msg_queues(xorriso, 0); return(ret); } for(sect= 0; sect < lba_count; sect++) { for(i= start_lbas[sect]; i <= end_lbas[sect]; i+= sector_size) { if(Sectorbitmap_is_set(map, i / sector_size, 0) == 0) { byte= ((off_t) 2048) * ((off_t) (i - start_lbas[sect])) + sect_base; if(*damage_start < 0 || byte < *damage_start) *damage_start= byte; if(byte + (off_t) 2048 > *damage_end) *damage_end= byte + (off_t) 2048; } } sect_base+= ((off_t) 2048) * ((off_t) (end_lbas[sect] - start_lbas[sect] + 1)); } if(*damage_end > size) *damage_end= size; if(start_lbas != NULL) free((char *) start_lbas); if(end_lbas != NULL) free((char *) end_lbas); if(section_sizes != NULL) free((char *) section_sizes); if(*damage_start < 0) return(0); return(1); } /* @param flag bit0= report_sections : section size rather than total size bit1= last_data_file_block : looking for highest data file block */ int Xorriso_report_lba(struct XorrisO *xorriso, char *show_path, IsoNode *node, uint32_t *last_block, int flag) { int ret, *start_lbas= NULL, *end_lbas= NULL, lba_count, i; off_t size, *section_sizes= NULL; ret= Xorriso__start_end_lbas(node, &lba_count, &start_lbas, &end_lbas, §ion_sizes, &size, 0); if(ret < 0) { Xorriso_process_msg_queues(xorriso, 0); {ret= -1; goto ex;} } if(ret == 0) {ret= 1; goto ex;} /* it is ok to ignore other types */ for(i= 0; i < lba_count; i++) { if(flag & 1) size= section_sizes[i]; if(flag & 2) { if(end_lbas[i] > 0 && (uint32_t) end_lbas[i] > *last_block) *last_block= end_lbas[i]; } else { sprintf(xorriso->result_line, "File data lba: %2d , %8d , %8d , %8.f , ", i, start_lbas[i], end_lbas[i] + 1 - start_lbas[i], (double) size); Text_shellsafe(show_path, xorriso->result_line, 1); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); } } ret= 1; ex:; if(start_lbas != NULL) free((char *) start_lbas); if(end_lbas != NULL) free((char *) end_lbas); if(section_sizes != NULL) free((char *) section_sizes); return(ret); } int Xorriso_report_damage(struct XorrisO *xorriso, char *show_path, IsoNode *node, int flag) { int ret; off_t size= 0, damage_start, damage_end; ret= Xorriso_file_eval_damage(xorriso, node, &damage_start, &damage_end, 0); if(ret < 0) return(0); if(LIBISO_ISREG(node)) size= iso_file_get_size((IsoFile *) node); if(ret > 0) { sprintf(xorriso->result_line, "File damaged : %8.f , %8.f , %8.f , ", (double) damage_start, (double) (damage_end - damage_start) , (double) size); } else { sprintf(xorriso->result_line, "File seems ok: %8.f , %8.f , %8.f , ", -1.0, -1.0, (double) size); } Text_shellsafe(show_path, xorriso->result_line, 1); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); return(1); } /* @param flag bit0= do not accept hln_targets[i] != NULL as *node_idx bit1= use *node_idx as found index rather than searching it bit2= with bit1: use xorriso->node_array rather than hln_array */ int Xorriso_search_hardlinks(struct XorrisO *xorriso, IsoNode *node, int *node_idx, int *min_hl, int *max_hl, int flag) { int idx, ret, i, node_count; void *np, **node_array; node_array= xorriso->hln_array; node_count= xorriso->hln_count; *min_hl= *max_hl= -1; np= node; if(flag & 2) { idx= *node_idx; if(flag & 4) { node_array= xorriso->node_array; node_count= xorriso->node_counter; } } else { *node_idx= -1; ret= Xorriso_search_in_hln_array(xorriso, np, &idx, 0); if(ret <= 0) return(ret); } for(i= idx - 1; i >= 0 ; i--) if(Xorriso__findi_sorted_ino_cmp(&(node_array[i]), &np) != 0) break; *min_hl= i + 1; for(i= idx + 1; i < node_count; i++) if(Xorriso__findi_sorted_ino_cmp(&(node_array[i]), &np) != 0) break; *max_hl= i - 1; /* Search for *node_idx */ if(flag & 2) return(1); for(i= *min_hl; i <= *max_hl; i++) if(node_array[i] == np) { if((flag & 1) && xorriso->hln_targets != NULL && !(flag & 4)) if(xorriso->hln_targets[i] != NULL) continue; *node_idx= i; break; } return(1); } /* @param flag bit0=do not complain about non existent node bit1= do not try to find truncated name first */ int Xorriso_node_from_path(struct XorrisO *xorriso, IsoImage *volume, char *path, IsoNode **node, int flag) { int ret; char *path_pt; path_pt= path; if(path[0]==0) path_pt= "/"; if(volume == NULL) { ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret <= 0) return(ret); } *node= NULL; ret= 2; if(!(flag & 2)) ret= iso_image_path_to_node(volume, path_pt, node); if(ret == 2) ret= iso_tree_path_to_node(volume, path_pt, node); Xorriso_process_msg_queues(xorriso,0); if(ret<=0 || (*node)==NULL) { if(!(flag&1)) { sprintf(xorriso->info_text, "Cannot find path "); Text_shellsafe(path_pt, xorriso->info_text, 1); strcat(xorriso->info_text, " in loaded ISO image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } return(0); } return(1); } /* @param flag bit0=do not complain about non existent node bit1= do not try to find truncated name first */ int Xorriso_dir_from_path(struct XorrisO *xorriso, char *purpose, char *path, IsoDir **dir_node, int flag) { IsoImage *volume; IsoNode *node; int ret, is_dir= 0; ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) return(ret); ret= Xorriso_node_from_path(xorriso, volume, path, &node, flag & 3); if(ret<=0) goto wdi_is_not_a_dir; if(LIBISO_ISDIR(node)) is_dir= 1; if(!is_dir) { wdi_is_not_a_dir:; sprintf(xorriso->info_text, "%s path does not lead to a directory in ISO image", purpose); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } *dir_node= (IsoDir *) node; return(1); } /* @param flag bit0= do not remove leading slash bit1= append flatly to result_line and put out */ int Xorriso_getfname(struct XorrisO *xorriso, char *path, int flag) { int ret, path_offset= 0, bsl_mem; char *bsl_path= NULL; if(path[0] == '/' && !(flag & 1)) path_offset= 1; /* backslash escaped path rather than shellsafe path */ ret= Sfile_bsl_encoder(&bsl_path, path + path_offset, strlen(path + path_offset), 8); if(ret <= 0) return(-1); if(flag & 2) { sprintf(xorriso->result_line + strlen(xorriso->result_line), "%s\n", bsl_path[0] ? bsl_path : "."); } else { sprintf(xorriso->result_line, "# file: %s\n", bsl_path[0] ? bsl_path : "."); } free(bsl_path); bsl_path= NULL; /* temporarily disable -backslash_codes with result output */ bsl_mem= xorriso->bsl_interpretation; xorriso->bsl_interpretation= 0; Xorriso_result(xorriso, 0); xorriso->bsl_interpretation= bsl_mem; return(1); } int Xorriso_is_plain_image_file(struct XorrisO *xorriso, void *in_node, char *path, int flag) { int ret, lba; IsoStream *stream; IsoNode *node; node= (IsoNode *) in_node; if(node == NULL) { ret= Xorriso_get_node_by_path(xorriso, path, NULL, &node, 0); if(ret<=0) return(ret); } ret= Xorriso__file_start_lba(node, &lba, 0); if(ret > 0) { /* Stream source is from loaded image */ stream= iso_file_get_stream((IsoFile *) node); if(stream != NULL) if(iso_stream_get_input_stream(stream, 0) == NULL) return(1); } return(0); } libisoburn-1.5.4/xorriso/xorrecord.info0000644000175700017510000013562414005266126015230 00000000000000This is xorrecord.info, produced by makeinfo version 5.2 from xorrecord.texi. xorrecord - Emulation of CD/DVD/BD program cdrecord by program xorriso Copyright (C) 2011 - 2021 Thomas Schmitt Permission is granted to distribute this text freely. INFO-DIR-SECTION Archiving START-INFO-DIR-ENTRY * Xorrecord: (xorrecord). Emulates CD/DVD/BD program cdrecord END-INFO-DIR-ENTRY  File: xorrecord.info, Node: Top, Next: Overview, Up: (dir) xorrecord 1.5.4 *************** xorrecord - Emulation of CD/DVD/BD program cdrecord by program xorriso * Menu: * Overview:: Overview * Standards:: MMC, Session, Track, Media types * Drive:: Drive preparation and addressing * Xorriso:: Relation to program xorriso * Options:: Options * Examples:: Examples * Files:: Files * Seealso:: See also * Bugreport:: Reporting bugs * Legal:: Author, Copyright, Credits * CommandIdx:: Alphabetic Command List * ConceptIdx:: Alphabetic List of Concepts and Objects  File: xorrecord.info, Node: Overview, Next: Standards, Prev: Top, Up: Top 1 Overview ********** 'xorrecord' writes preformatted data to CD, DVD, and BD media. It understands some options of program cdrecord from cdrtools by Joerg Schilling. Its implementation is part of program xorriso which shares no source code with cdrtools, but rather makes use of libburn for communicating with the drive. Another, more complete cdrecord emulator is program *cdrskin* which uses the same burn functions as *xorrecord*, but is able to burn audio CDs and to handle CD-TEXT.  File: xorrecord.info, Node: Standards, Next: Drive, Prev: Overview, Up: Top 2 MMC, Session, Track, Media types ********************************** *MMC* is a standard out of the SCSI family which defines the interaction between computers and optical drives. Since more than a decade all CD, DVD, or BD recorders obey this standard regardless by what bus cabling they are attached to the computer. libburn relies on this standard compliance and on the capability of the operating system to perform SCSI transactions over the particular bus cabling. A *Session* is a data region on an optical disc which usually gets written in a single sweep. It contains at least one *Track* which is a contiguous string of readable blocks. 'xorrecord' produces a single session with a single data track which consists of blocks with 2048 bytes each. It chooses the write mode automatically according to media type, medium state, and option -multi. On CD media there are other track types, like audio, and particular write modes like TAO and SAO. CD and DVD- media can put more than one track into a session. Some of these features can be addressed by program *cdrskin*. MMC describes several recordable *media types* which roughly form two families. *Sequentially recordable media* are CD-R, CD-RW, DVD-R, DVD-R DL, DVD-RW, DVD+R, DVD+R DL, BD-R. Except DVD-R DL they can store more than one session if there is still unwritten space and if the previous session was written with option *-multi*. CD-RW and DVD-RW can be blanked in order to be re-usable from scratch. *Overwritable media* are DVD-RAM, DVD+RW, formatted DVD-RW, BD-RE. They offer a single session with a single track for random access writing. There is no need to blank overwritable media before re-use. DVD-RW media are sold in sequentially recordable state but can be formatted once to become overwritable. See options *blank=format_overwrite* and *blank=deformat*. If ISO 9660 filesystems are to be stored on overwritable media, then it is possible to emulate multiple sessions, by using option *-grow_overwriteable_iso*. In this case, the need for blanking before re-use is emulated too.  File: xorrecord.info, Node: Drive, Next: Xorriso, Prev: Standards, Up: Top 3 Drive preparation and addressing ********************************** The drives, CD, DVD, or BD burners, are accessed via file addresses which are specific to libburn and the operating system. Those addresses get listed by a run of 'xorrecord --devices' or 'xorriso -device_links'. On GNU/Linux, FreeBSD, and NetBSD, the user needs rw-permission for the device file. On Solaris, the user needs r-permission and privilege "sys_devices", which is usually gained by running 'xorrecord' via command pfexec. These permissions or privileges are needed already for listing a drive. So it might be necessary to get the overview as superuser or via pfexec. 'xorrecord' does not perform cdrecord option -scanbus and does not accept the addresses of form Bus,Target,Lun which are told by -scanbus. If support for these addresses is necessary, consider to use program cdrskin. It is possible to let 'xorrecord' work on emulated drives. Their addresses begin by prefix "stdio:" followed by a file address. The emulated media behavior depends on the file type. See man xorriso for details. If standard output is chosen as emulated drive, then all program result texts, which usually appear on standard output, will get redirected to standard error.  File: xorrecord.info, Node: Xorriso, Next: Options, Prev: Drive, Up: Top 4 Relation to program xorriso ***************************** 'xorrecord' is actually a command mode of program *xorriso*, which gets entered either by xorriso command "-as cdrecord" or by starting the program by one of the names "xorrecord", "cdrecord", "wodim", or "cdrskin". This command mode can be left by argument "--" which leads to generic xorriso command mode. See *man xorriso* for its description. Other than in xorriso command mode, the sequence of the cdrecord emulation options does not matter. All pending actions get performed in a fixed sequence before the program run ends or before cdrecord emulation ends.  File: xorrecord.info, Node: Options, Next: Examples, Prev: Xorriso, Up: Top 5 Options ********* * Menu: * DriveAddr:: Drive addressing * Inquire:: Inquiring drive and media * SetBurn:: Settings for the burn run * Verbose:: Program version and verbosity * NonCdrecord:: Options not compatible to cdrecord  File: xorrecord.info, Node: DriveAddr, Next: Inquire, Prev: Options, Up: Options 5.1 Addressing the drive ======================== --devices Print the list of accessible CD, DVD, or BD drives to standard output. Drives might be inaccessible if the user lacks of permissions to use them or if the drive is in use by another program. Each accessible drive is shown by a line like: 0 -dev '/dev/sr0' rwrw- : 'TSSTcorp' 'CDDVDW SH-S203B' The libburn address of this drive is '/dev/sr0'. 'TSSTcorp' is the name of the vendor (in this case: Toshiba Samsung Storage Technologies Corporation), 'CDDVDW SH-S203B' is the model name (in this case: a DVD burner). Afterwards end emulation without performing any further drive operation. dev=drive_address Set the libburn address of the drive to be used. E.g. on GNU/Linux: dev=/dev/sr0 E.g. on FreeBSD: dev=/dev/cd0 E.g. on NetBSD: dev=/dev/rcd0d E.g. on Solaris: dev=/dev/rdsk/c2t2d0s2 See also above "Drive preparation and addressing". The medium in the drive should not be mounted or be otherwise in use. This option will only get into effect if a track source, a blank= option, or a drive inquiry option is given. Else it will lead to a SORRY event and normally cause a non-zero exit value.  File: xorrecord.info, Node: Inquire, Next: SetBurn, Prev: DriveAddr, Up: Options 5.2 Inquiring drive and media ============================= -inq Print to standard output: vendor, model name, and firmware revision of the drive. -checkdrive Print unconditionally that the drive supports burnfree, SAO, and TAO. Also print the output of option -inq. -atip Print the output of -checkdrive, the most capable profile of the medium in the drive, the list of profiles which are supported by the drive, whether it is erasable (i.e. can be blanked), the media manufacturer, and the medium product name. Profiles are usage models, which are often tied to a particular media type (e.g. CD-RW), but may also apply to a family of media. E.g. profile CD-ROM applies to all CD media which contain data. -toc Print a table of content of the medium in the drive. The output is not compatible to cdrecord option -toc, but rather the one of 'xorriso' command -toc. It lists the address, vendor, model name, and firmware revision of the drive. About the medium it tells product name and manufacturer, whether there is already content written, and if so, whether the medium is closed or appendable. Appendable media can take another session. The amount of readable and writable data is told. If there are sessions, then their start block address and size is reported. If a session contains an ISO 9660 filesystem, then its Volume Id is reported. If the medium is writable, then the next writable block address is reported. If not option *-grow_overwriteable_iso* is given or no ISO 9660 file system is present on the medium, then overwritable media are reported as being blank. This is due to the fact that they can be written from scratch without further preparation, and that MMC does not distinguish between data written by the most previous burn run and older data which have not been overwritten by that burn run. Consequently, these media are reported with 0 readable blocks, although all their writable blocks normally are readable, too. -msinfo Print the argument text for option -C of programs mkisofs, genisoimage, or xorrisofs. It consists of two numbers separated by a comma. The first number tells the first block of the first track of the last recorded session. This is also the address used by default when operating systems mount a medium with e.g. ISO 9660 filesystem. The second number tells the next writable address, where 'xorrecord' will begin to write the next session. This option is only valid for written, appendable media. In all other cases it will yield no output text but will abort the program with non-zero exit value.  File: xorrecord.info, Node: SetBurn, Next: Verbose, Prev: Inquire, Up: Options 5.3 Settings for the burn run ============================= A burn run requires exactly one track source address argument, which tells from where to read the data which shall be put into the upcoming session. The medium state must be either blank or appendable. Track source may be "-" for standard input or the address of a readable file of any type except directories. Nearly all media types accept a track source with unpredictable byte count, like standard input or named pipes. Nevertheless, DVD-R DL and DVD-RW blanked by mode deformat_quickest demand exact in-advance reservation of the track size, so that they either need to be read from a source of predictable length, or need to be accompanied by option *tsize=* or by option *-isosize*. Several options expect a size value as argument. A number with a trailing letter "b" or without a trailing letter is a plain byte count. Other trailing letters cause multiplication of the given number by a scaling factor: "k" or "K" = 1024 , "m" or "M" = 1024k , "g" or "G" = 1024m , "s" or "S" = 2048 E.g. tsize=234567s means a size of 234567 * 2048 = 480393216 bytes. blank=mode Blank a CD-RW or DVD-RW to make it re-usable from scratch. Format a DVD-RW, DVD+RW, DVD-RAM, BD-R, or BD-RE if not yet formatted. This operation normally makes any recorded data on the medium unreadable. It is combinable with burning in the same run of 'xorrecord', or it may be performed without a track source, leaving the medium empty. The mode given with blank= selects the particular behavior: as_needed Try to make the media ready for writing from scratch. If it needs formatting, then format it. If it is not blank, then try to apply blank=fast. It is a reason to abort if the medium cannot assume thoroughly writeable state, e.g. if it is a non-blank write-once. This leaves unformatted DVD-RW in unformatted blank state. To format DVD-RW use blank=format_overwrite. Blank unformatted BD-R stay unformatted. (Note: blank=as_needed is not an original cdrecord option.) all Blank an entire CD-RW or an unformatted DVD-RW. fast Minimally blank an entire CD-RW or blank an unformatted DVD-RW. deformat Like blank=all but with the additional ability to blank overwritable DVD-RW. This will destroy their formatting and make them sequentially recordable. (Note: blank=deformat is not an original cdrecord options) deformat_quickest Like blank=deformat but blanking DVD-RW only minimally. This is faster than full blanking but yields media incapable of writing tracks of unpredictable size. Multi-session will not be possible either. (Note: blank=deformat_quickest is not an original cdrecord option.) format_overwrite Format a DVD-RW to "Restricted Overwrite". The user should bring some patience. Format unformatted DVD+RW, BD-RE or blank BD-R to their default size. It is not mandatory to do this with DVD+RW and BD-RE media, because they will get formatted automatically on the first write attempt. BD-R media may be written in unformatted state. This keeps disabled the replacement of bad blocks and enables full nominal write speed. Once BD-R media are written, they cannot be formatted any more. For re-formatting already formatted media or for formatting with non-default size, use program *xorriso* with command *-format*. (Note: blank=format_overwrite is not an original cdrecord options) help Print a short overview of blank modes to standard error output. Afterwards end emulation without performing any drive operation. -multi This option keeps CD, unformatted DVD-R[W], DVD+R, or BD-R appendable after the current session has been written. Without it the disc gets closed and may not be written any more - unless it is a -RW and gets blanked, which causes loss of its content. This option cannot be applied to DVD-R DL or to DVD-RW which were blanked by mode "deformat_quickest". Option -multi_if_possible may automatically recognize and handle this situation. In order to have all filesystem content accessible, the eventual ISO-9660 filesystem of a follow-up session needs to be prepared in a special way by the filesystem formatter program. mkisofs, genisoimage, and xorrisofs expect particular info about the situation which can be retrieved by 'xorrecord' option -msinfo. With overwritable DVD or BD media, -multi cannot mark the end of the session. So when adding a new session, this end has to be determined from the payload. Currently only ISO-9660 filesystems can be used that way. See option *-grow_overwriteable_iso*. -dummy Try to perform the drive operations without actually affecting the inserted media. There is no warranty that this will work with a particular combination of drive and media. Blanking is prevented reliably, though. To avoid inadverted real burning, -dummy refuses burn runs on anything but CD-R[W], DVD-R[W], or emulated stdio-drives. -waiti Wait until input data is available at stdin or EOF occurs at stdin. Only then begin to access any drives. One should use this if xorrisofs is working at the end of a pipe where the feeder process reads from the drive before it starts writing its output into xorrisofs. Example: xorrisofs ... -C 0,12800 -M /dev/sr0 ... | \ xorrecord dev=/dev/sr0 ... -waiti - This option works even if standard input is not the track source. If no process is piping in, then the Enter key of your terminal will act as trigger for 'xorrecord'. Note that this input line will not be consumed by cdrskin if standard input is not the track source. It will end up as shell command, usually. tsize=size Announce the exact size of the track source. This is necessary with DVD-R DL media and with quickest blanked DVD-RW, if the size cannot be determined in advance from the track source. E.g. if it is standard input or a named pipe. If the track source does not deliver the predicted amount of bytes, the remainder of the track is padded with zeros. This is not considered an error. If on the other hand the track source delivers more than the announced bytes then the track on media gets truncated to the predicted size and xorrecord exits with non-zero value. -isosize Try to obtain the track size from the content of the track source. This works only if the track source bears an ISO 9660 filesystem. Any other track source content will cause the burn run to abort. If the track source is not a regular file or block device, then this option will work only if the program's fifo size is at least 64k. See option fs=. padsize=size Add the given amount of trailing zeros to the upcoming track. This feature can be disabled by size 0. Default is 300 kB in order to work around a problem with GNU/Linux which often fails to read the last few blocks of a CD track which was written in write mode TAO. TAO is used by 'xorrecord' if the track size cannot be predicted or if the CD medium is not blank but appendable. -nopad The same as padsize=0. -pad The same as padsize=15s. This was once sufficient with older GNU/Linux kernels. Meanwhile one should at least use padsize=128k, if not padsize=300k. -data Explicitly announce that the track source shall be recorded as data track, and not as audio track. This option has no effect with 'xorrecord', because there is no support for other track formats anyway. -tao Explicitly demand that write type TAO shall be used for CD, or Incremental for DVD-R. Normally the program will choose the write type according to the given medium state, option -multi, and track source. Demanding it explicitly prevents the start of a write run, if it is not appropriate to the situation. -sao Explicitly demand that write type SAO shall be used for CD, or DAO for DVD-R. This might prevent the write run, if it is not appropriate to the situation. -dao Alias of -sao. fs=size Set the size of the program fifo buffer to the given value rather than the default of 4m. The fifo buffers a temporary surplus of track source data in order to provide the drive with a steady stream during times of temporary lack of track source supply. Other than cdrecord, xorrecord enables drive buffer underrun protection by default and does not wait with writing until the fifo is full for a first time. On very old CD drives and slow computers, this might cause aborted burn runs. In this case, consider to use program *cdrskin* for CD burning. DVD and BD drives tolerate buffer underrun without problems. The larger the fifo, the longer periods of poor source supply can be compensated. But a large fifo can deprive the operating system of read cache for better filesystem performance. speed=value Set the write speed. Default is 0 = maximum speed. Speed can be given in media type dependent x-speed numbers or as a desired throughput per second in MMC compliant kB (= 1000) or MB (= 1000 kB). Media x-speed factor can be set explicitly by appending "c" for CD, "d" for DVD, "b" for BD. "x" is optional. Example speeds: 706k = 706kB/s = 4c = 4xCD 5540k = 5540kB/s = 4d = 4xDVD If there is no hint about the speed unit attached, then the medium in the drive will decide. Default unit is CD, 1x = 176,400 raw bytes/second. With DVD, 1x = 1,385,000 bytes/second. With BD, 1x = 4,495,625 bytes/second. MMC drives usually activate their own idea of speed and take the speed value given by the burn program only as a hint for their own decision. minbuf=percentage Equivalent to: modesty_on_drive= -immed Equivalent to: modesty_on_drive=75 In cdrecord, this also controls use of the Immed bit. But xorriso uses Immed where possible and appropriate, unless it is disabled by option use_immed_bit=off . -eject Eject the drive tray after alll other work is done.  File: xorrecord.info, Node: Verbose, Next: NonCdrecord, Prev: SetBurn, Up: Options 5.4 Program version and verbosity ================================= -version Print to standard output a line beginning by "Cdrecord 2.01-Emulation Copyright" and further lines which report the version of xorriso and its supporting libraries. They also state the license under which the program is provided, and disclaim any warranty, to the extent permitted by law. Afterwards end emulation without performing any drive operation. -v Increase program verbosity by one level. There are four verbosity levels from nearly silent to debugging verbosity. The both highest levels can be enabled by repeated -v or by -vv or by -vvv. -V Log SCSI commands and drive replies to standard error. This might be of interest if *xorrecord* and a particular drive or medium do not cooperate as expected, or if you just want to know how libburn interacts with the drive. To understand this extremely verbose log, one needs to read SCSI specs SPC, SBC, and MMC. Please do not add such a log to a bug report on the first hand, unless you want to point out a particular deviation from said specs, or if you get asked for this log by a maintainer of 'xorrecord' who feels in charge for your bug report. -help Print a sparse list of program options to standard error and declare not to be cdrecord. Afterwards end emulation without performing any drive operation.  File: xorrecord.info, Node: NonCdrecord, Next: ExDevices, Prev: Verbose, Up: Options 5.5 Options not compatible to cdrecord ====================================== --no_rc Only if used as first command line argument this option prevents reading and interpretation of startup files. See section FILES below. --drive_not_exclusive This option disables the use of device file locking mechanisms when acquiring the drive. On GNU/Linux the locking is done by open(O_EXCL), on FreeBSD by flock(LOCK_EX). Be aware that it can cause problems if you use a drive which is mounted, or opened by some other process, or guarded by /dev/pktcdvd*. Make sure that other users of the drive do not cause drive activities while a xorrecord burn run is going on. drive_scsi_dev_family=sr|scd|sg|default GNU/Linux specific: By default, cdrskin tries to map Linux drive addresses to /dev/sr* before they get opened for operating the drive. This coordinates well with other use cases of optical drives, like mount(8). But since year 2010 all /dev/sr* share a global lock which allows only one drive to process an SCSI command while all others have to wait for its completion. This yields awful throughput if more than one drive is writing or reading simultaneously. The global lock is not applied to device files /dev/sg* and also not with the system calls read(2), write(2). But ioctl(SG_IO) is affected, which is needed to perform the SCSI commands for optical burning. So for simultaneous burn runs on modern GNU/Linux it is advisable to use drive_scsi_dev_family="sg". The drive addresses may then well be given as /dev/sr* but will nevertheless get used as /dev/sg*. --grow_overwriteable_iso Enable emulation of multi-session writing on overwritable media which contain an ISO 9660 filesystem. This emulation is learned from growisofs -M but adapted to the usage model of xorrecord -msinfo xorrisofs -C -M | xorrecord -waiti -multi - for sequential media. -grow_overwriteable_iso does not hamper the use of true multi-session media. I.e. it is possible to use the same 'xorrecord' options with both kinds of media and to achieve similar results if ISO 9660 filesystem images are to be written. This option implies option -isosize and therefore demands that the track source is a ISO 9660 filesystem image. With overwritable media and no option blank=fast|all present it expands an eventual ISO 9660 filesystem on media. It is assumed that this image's inner size description points to the end of the valuable data. Overwritable media with a recognizable ISO 9660 size will be regarded as appendable rather than as blank. I.e. options -msinfo and -toc will work. -toc will always show a single session with its size increasing with every added ISO 9660 image. --multi_if_possible Apply option -multi if the medium is suitable. Not suitable are DVD-R DL and DVD-RW, which were blanked with mode "deformat_quickest". Not all drives correctly recognize such fast-blanked DVD-RW which need "on". If there is well founded suspicion that a burn run failed due to -multi, then this causes a re-try without -multi. stream_recording="on"|"off"|number Mode "on" requests that compliance to the desired speed setting is preferred over management of write errors. With DVD-RAM and BD this can bring effective write speed near to the nominal write speed of the media. But it will also disable the automatic use of replacement blocks if write errors occur. It might as well be disliked or ignored by the drive. If a number is given, then error management stays enabled for all byte addresses below that number. Any number below 16s is the same as "off". dvd_obs="default"|"32k"|"64k" Linux specific: Set the number of bytes to be transmitted with each write operation to DVD or BD media. Tracks get padded up to the next multiple of this write size. A number of 64 KB may improve throughput with bus systems which show latency problems. The default depends on media type, option stream_recording=, and on compile time options. modesty_on_drive=parameter[:parameters] Control whether the drive buffer shall be kept from getting completely filled. Parameter "on" (or "1") keeps the program from trying to write to the burner drive while its buffer is in danger to be filled over a given limit. If this filling is exceeded then the program will wait until the filling reaches a given low percentage value. This can ease the load on operating system and drive controller and thus help with achieving better input bandwidth if disk and burner are not on independent controllers (like hda and hdb). It may also help with simultaneous burns on different burners with Linux kernels like 3.16, if one has reason not to fix the problem by drive_scsi_dev_family="sg". On the other hand it increases the risk of buffer underflow and thus reduced write speed. Some burners are not suitable because they report buffer fill with granularity too coarse in size or time, or expect their buffer to be filled to the top before they go to full speed. Parameters "off" or "0" disable this feature. The threshold for beginning to wait is given by parameter "max_percent=". Parameter "min_percent=" defines the threshold for resuming transmission. Percentages are permissible in the range of 25 to 100. Numbers in this range without a prepended name are interpreted as "on:min_percent=". E.g.: modesty_on_drive=75 The optimal values depend on the buffer behavior of the drive. Parameter "timeout_sec=" defines after which time of unsuccessful waiting the modesty shall be disabled because it does not work. Parameter "min_usec=" defines the initial sleeping period in microseconds. If the drive buffer appears to be too full for sending more data, the program will wait the given time and inquire the buffer fill state again. If repeated inquiry shows not enough free space, the sleep time will slowly be increased to what parameter "max_usec=" defines. Parameters, which are not mentioned with a modesty_on_drive= option, stay unchanged. Default is: modesty_on_drive=off:min_percent=90:max_percent=95: timeout_sec=120:min_usec=5000:max_usec=25000 use_immed_bit="on"|"off"|"default" Control whether several long lasting SCSI commands shall be executed with the Immed bit, which makes the commands end early while the drive operation is still going on. xorriso then inquires progress indication until the drive reports to be ready again. If this feature is turned off, then blanking and formatting will show no progress indication. It may depend on the operating system whether -use_immed_bit is set to "off" by default. write_start_address=value Set the block address on overwritable media where to start writing the track. With DVD+RW, DVD-RAM or BD-RE, byte_offset must be aligned to 2 kiB blocks, but better is 32 kiB on DVD and 64 kiB on BD. With formatted DVD-RW 32 kiB alignment is mandatory. Other media are not suitable for this option. stdio_sync="on"|"off"|number Set the number of bytes after which to force output to emulated stdio: drives. This forcing keeps the memory from being clogged with lots of pending data for slow devices. Default "on" is the same as "16m". Forced output can be disabled by "off".  File: xorrecord.info, Node: Examples, Next: Files, Prev: Options, Up: Top 6 Examples ********** * Menu: * ExDevices:: Get an overview of drives and their addresses * ExMedium:: Get info about a particular drive or loaded media * ExBlank:: Prepare CD-RW or DVD-RW for re-use * ExFormat:: Format DVD-RW to avoid need for blanking before re-use * ExDeformat:: De-format DVD-RW to make it capable of multi-session again * ExIsoSingle:: Write a single ISO 9660 filesystem image * ExIsoMulti:: Write multiple ISO 9660 sessions * ExIsoFly:: Write ISO 9660 session on-the-fly * ExAfio:: Write compressed afio archive on-the-fly  File: xorrecord.info, Node: ExDevices, Next: ExMedium, Prev: NonCdrecord, Up: Examples 6.1 Get an overview of drives and their addresses ================================================= $ xorrecord -devices  File: xorrecord.info, Node: ExMedium, Next: ExBlank, Prev: ExDevices, Up: Examples 6.2 Get info about a particular drive and loaded media ====================================================== $ xorrecord dev=/dev/sr0 -atip -toc -grow_overwriteable_iso  File: xorrecord.info, Node: ExBlank, Next: ExFormat, Prev: ExMedium, Up: Examples 6.3 Prepare CD-RW or DVD-RW for re-use ====================================== $ xorrecord -v dev=/dev/sr0 blank=as_needed -eject  File: xorrecord.info, Node: ExFormat, Next: ExDeformat, Prev: ExBlank, Up: Examples 6.4 Format DVD-RW to avoid need for blanking before re-use ========================================================== $ xorrecord -v dev=/dev/sr0 blank=format_overwrite -eject This command may also be used to format BD-R media before first use, in order to enable handling of write errors. Several hundred MB of spare blocks will be reserved and write runs on such media will perform with less than half nominal speed.  File: xorrecord.info, Node: ExDeformat, Next: ExIsoSingle, Prev: ExFormat, Up: Examples 6.5 De-format DVD-RW to make it capable of multi-session again ============================================================== $ xorrecord -v dev=/dev/sr0 blank=deformat  File: xorrecord.info, Node: ExIsoSingle, Next: ExIsoMulti, Prev: ExDeformat, Up: Examples 6.6 Write a single ISO 9660 filesystem image ============================================ $ xorrecord -v dev=/dev/sr0 speed=12 fs=8m \ blank=as_needed -eject padsize=300k my_image.iso  File: xorrecord.info, Node: ExIsoMulti, Next: ExIsoFly, Prev: ExIsoSingle, Up: Examples 6.7 Write multiple ISO 9660 sessions ==================================== This is possible with all media except minimally blanked DVD-RW and DVD-R DL, which cannot do multi-session. The first session is written like in the previous example, except that option -multi is used. It will contain the files of hard disk directory ./tree1 under the ISO 9660 directory /dir1: $ xorrisofs -o image_1.iso -J -graft-points /dir1=./tree1 $ xorrecord -v dev=/dev/sr0 speed=12 fs=8m \ -multi -grow_overwriteable_iso \ blank=as_needed -eject padsize=300k image_1.iso For the second session xorrisofs needs to know the -msinfo numbers of the medium. Further it will read data from the medium by using the system's read-only CD-ROM driver. Many systems do not take notice of xorrecord's write activities. It is necessary to force their attention by ejecting and reloading the drive tray. Therefore above run uses option -eject. Get the -msinfo numbers (and properly reload the tray if it has a motor) by: $ m=$(xorrecord dev=/dev/sr0 -msinfo) Offer a victim to any problem caused by obtrusive demons after tray loading: $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 Use the numbers with xorrisofs to add ./tree2 to the image as /dir2: $ xorrisofs -M /dev/sr0 -C $m -o image_2.iso \ -J -graft-points /dir2=./tree2 Now burn the new session onto the same medium. This time without blanking: $ xorrecord -v dev=/dev/sr0 speed=12 fs=8m \ -multi -grow_overwriteable_iso \ -eject padsize=300k image_2.iso Operating systems which mount this medium will read the superblock of the second session and show both directories /dir1 and /dir2.  File: xorrecord.info, Node: ExIsoFly, Next: ExAfio, Prev: ExIsoMulti, Up: Examples 6.8 Write ISO 9660 session on-the-fly ===================================== It is possible to combine the run of *xorrisofs* and 'xorrecord' in a pipeline without storing the ISO 9660 image as file on hard disk. The piped run is more vulnerable to the problem that some systems have not enough patience with automatic tray loading and that demons may interfere with a first CD-ROM driver read attempt from a freshly loaded medium. It is advised to load the tray manually or via a separate run of xorriso with a subsequent run of dd. Again, xorriso has the patience and dd is a dispensable victim for demons. $ m=$(xorrecord dev=/dev/sr0 -msinfo) $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 $ xorrisofs -M /dev/sr0 -C $m \ -J -graft-points /dir2=./tree2 \ | xorrecord -v dev=/dev/sr0 speed=12 fs=8m \ -waiti -multi -grow_overwriteable_iso \ -eject padsize=300k - This is also the main use case of program *xorriso* itself, where the run would need no system workarounds and simply look like: $ xorriso -dev /dev/sr0 -joliet on -speed 12 -fs 8m \ -map ./tree2 /dir2 -commit_eject all  File: xorrecord.info, Node: ExAfio, Prev: ExIsoFly, Up: Examples 6.9 Write compressed afio archive on-the-fly ============================================ This is possible with all media except minimally blanked DVD-RW and DVD-R DL. Since the compressed output stream is of very variable speed, a larger fifo is advised. Nevertheless, this example is not suitable for very old CD drives which have no underrun protection and thus would abort the burn run on temporary data shortage. $ find . | afio -oZ - | \ xorrecord -v dev=/dev/sr0 speed=12 fs=64m \ -multi padsize=300k - afio archives do not contain references to absolute data block addresses. So they need no special precautions for multi-session. One may get the session start addresses by option -toc, and then use dd option skip= to begin reading at one of those addresses. E.g. for listing its content: $ dd if=/dev/sr0 bs=2048 skip=64046 | afio -tvZ - afio will know when the end of the archive is reached.  File: xorrecord.info, Node: Files, Next: Seealso, Prev: Examples, Up: Top 7 Files ******* 7.1 Startup Files ================= If not -no_rc is given as the first argument then 'xorrecord' attempts on startup to read and execute lines from the following files: /etc/default/xorriso /etc/opt/xorriso/rc /etc/xorriso/xorriso.conf $HOME/.xorrisorc The files are read in the sequence given here, but none of them is required to exist. The lines are not interpreted as 'xorrecord' options but as generic *xorriso* commands. See man xorriso.  File: xorrecord.info, Node: Seealso, Next: Bugreport, Prev: Files, Up: Top 8 See also ********** For generic xorriso command mode xorriso(1) Formatting track sources for xorrecord xorrisofs(1), mkisofs(8), genisoimage(1), afio(1), star(1) Other programs which burn sessions to optical media growisofs(1), cdrecord(1), wodim(1), cdrskin(1)  File: xorrecord.info, Node: Bugreport, Next: Legal, Prev: Seealso, Up: Top 9 Reporting bugs **************** To report bugs, request help, or suggest enhancements for 'xorriso', please send electronic mail to the public list . If more privacy is desired, mail to . Please describe what you expect 'xorriso' to do, the program arguments or dialog commands by which you tried to achieve it, the messages of 'xorriso', and the undesirable outcome of your program run. Expect to get asked more questions before solutions can be proposed.  File: xorrecord.info, Node: Legal, Next: CommandIdx, Prev: Bugreport, Up: Top 10 Author, Copyright, Credits ***************************** 10.1 Author =========== Thomas Schmitt for libburnia-project.org 10.2 Copyright ============== Copyright (c) 2011 - 2021 Thomas Schmitt Permission is granted to distribute this text freely. It shall only be modified in sync with the technical properties of xorriso. If you make use of the license to derive modified versions of xorriso then you are entitled to modify this text under that same license. 10.3 Credits ============ 'xorriso' is in part based on work by Vreixo Formoso who provides libisofs together with Mario Danic who also leads the libburnia team. Thanks to Andy Polyakov who invented emulated growing, to Derek Foreman and Ben Jansens who once founded libburn. Compliments towards Joerg Schilling whose cdrtools served me for ten years.  File: xorrecord.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top 11 Alphabetic Command List ************************** [index] * Menu: * --devices get list of drives: DriveAddr. (line 8) * --drive_not_exclusive use drive even if busy: NonCdrecord. (line 12) * --grow_overwriteable_iso emulate ISO 9660 multi-session: NonCdrecord. (line 37) * --multi_if_possible apply -multi if medium is suitable: NonCdrecord. (line 57) * --no_rc do not execute xorriso startup files: NonCdrecord. (line 8) * -atip inquire medium state: Inquire. (line 14) * -checkdrive inquire drive CD capabilities: Inquire. (line 11) * -dao explicitly set write type SAO/DAO: SetBurn. (line 172) * -data explicitly announce a data track: SetBurn. (line 157) * -dummy control write simulation: SetBurn. (line 106) * -eject finally eject drive tray: SetBurn. (line 214) * -help print sparse overview of options: Verbose. (line 30) * -immed keep drive buffer hungry: SetBurn. (line 208) * -inq inquire drive identifiers: Inquire. (line 8) * -isosize obtain track size from ISO 9660 superblock: SetBurn. (line 137) * -modesty_on_drive keep drive buffer hungry: NonCdrecord. (line 81) * -msinfo retrieve multi-session info: Inquire. (line 43) * -multi keep media appendable after burn run: SetBurn. (line 89) * -nopad disable adding of bytes to end of track: SetBurn. (line 151) * -pad add 15 blocks to end of track: SetBurn. (line 153) * -sao explicitly set write type SAO/DAO: SetBurn. (line 168) * -tao explicitly set write type TAO: SetBurn. (line 162) * -toc inquire medium content: Inquire. (line 22) * -v increase program verbosity: Verbose. (line 16) * -V log SCSI command transactions to stderr: Verbose. (line 20) * -version report emulation and xorriso version: Verbose. (line 8) * -waiti access drive only after stdin delivers data: SetBurn. (line 113) * blank= make media re-usabable or format media: SetBurn. (line 28) * dev= address the drive to be used: DriveAddr. (line 21) * drive_scsi_dev_family= Linux device type to be used: NonCdrecord. (line 20) * dvd_obs= set write transaction payload size: NonCdrecord. (line 74) * fs= set program fifo size: SetBurn. (line 174) * minbuf= keep drive buffer hungry: SetBurn. (line 205) * padsize= add bytes to end of track: SetBurn. (line 144) * speed= set write speed: SetBurn. (line 189) * stdio_sync= control stdio buffer: NonCdrecord. (line 133) * stream_recording= try to get full speed on DVD-RAM, BD: NonCdrecord. (line 64) * tsize= set a fixed track size: SetBurn. (line 126) * use_immed_bit= control use of Immed bit: NonCdrecord. (line 118) * write_start_address= set block address for write start: NonCdrecord. (line 127)  File: xorrecord.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top 12 Alphabetic List of Concepts and Objects ****************************************** [index] * Menu: * Accessing drive, wait for stdin, -waiti: SetBurn. (line 113) * Blank, format, Immed bit, use_immed_bit=: NonCdrecord. (line 118) * Bugs, reporting: Bugreport. (line 6) * Data track, announce, -data: SetBurn. (line 157) * Defect management, control, stream_recording=: NonCdrecord. (line 64) * Drive, address, dev=: DriveAddr. (line 21) * Drive, get list of, --devices: DriveAddr. (line 8) * Drive, inquire CD capabilities, -checkdrive: Inquire. (line 11) * Drive, inquire identifiers, -inq: Inquire. (line 8) * Drive, Linux device type, drive_scsi_dev_family: NonCdrecord. (line 20) * Drive, use even if busy, --drive_not_exclusive: NonCdrecord. (line 12) * Eject, the tray, -eject: SetBurn. (line 214) * Examples: Examples. (line 6) * Fifo, set size, fs=: SetBurn. (line 174) * Full speed, on DVD-RAM and BD, stream_recording=: NonCdrecord. (line 64) * Media types, _definiton: Standards. (line 23) * Media, blank, blank=: SetBurn. (line 28) * Media, format, blank=: SetBurn. (line 28) * Media, keep appendable, --multi_if_possible: NonCdrecord. (line 57) * Media, keep appendable, -multi: SetBurn. (line 89) * Media, make re-usable, blank=: SetBurn. (line 28) * medium content, inquire, -toc: Inquire. (line 22) * medium state, inquire, -atip: Inquire. (line 14) * MMC, _definiton: Standards. (line 6) * multi-session info, retrieve, -msinfo: Inquire. (line 43) * Multi-session, emulate ISO 9660, --grow_overwriteable_iso: NonCdrecord. (line 37) * Options, overview, -help: Verbose. (line 30) * Overwritable media, _definiton: Standards. (line 30) * Padding, at end of track, padsize=: SetBurn. (line 144) * Padding, disable, -nopad: SetBurn. (line 151) * Padding, insufficient old, -pad: SetBurn. (line 153) * Problems, reporting: Bugreport. (line 6) * SCSI commands, log, -V: Verbose. (line 20) * Sequentially recordable media, _definiton: Standards. (line 25) * Session, _definiton: Standards. (line 12) * Speed, set for writing, speed=: SetBurn. (line 189) * Startup files, do not execute, --no_rc: NonCdrecord. (line 8) * Track size, obtain from ISO 9660, -isosize: SetBurn. (line 137) * Track size, set fixed, tsize=: SetBurn. (line 126) * Track, _definiton: Standards. (line 13) * Transaction size, set, dvd_obs=: NonCdrecord. (line 74) * Tray, eject, -eject: SetBurn. (line 214) * Verbosity, increase, -v: Verbose. (line 16) * Verbosity, SCSI commands, -V: Verbose. (line 20) * Version, report, -version: Verbose. (line 8) * Write simulation , control, -dummy: SetBurn. (line 106) * Write start address, set, write_start_address=: NonCdrecord. (line 127) * Write type, SAO/DAO, -dao: SetBurn. (line 172) * Write type, SAO/DAO, -sao: SetBurn. (line 168) * Write type, TAO, -tao: SetBurn. (line 162) * Write, buffer syncing, stdio_sync=: NonCdrecord. (line 133) * Write, drive buffer, -immed: SetBurn. (line 208) * Write, drive buffer, minbuf=: SetBurn. (line 205) * Write, drive buffer, modesty_on_drive=: NonCdrecord. (line 81) * xorriso, mkisofs emulation: Xorriso. (line 6) * xorriso, options: Options. (line 6)  Tag Table: Node: Top395 Node: Overview1103 Node: Standards1683 Node: Drive3845 Node: Xorriso5176 Node: Options5885 Node: DriveAddr6253 Node: Inquire7618 Node: SetBurn10487 Node: Verbose21111 Node: NonCdrecord22661 Node: Examples30471 Node: ExDevices31132 Node: ExMedium31350 Node: ExBlank31613 Node: ExFormat31834 Node: ExDeformat32352 Node: ExIsoSingle32619 Node: ExIsoMulti32903 Node: ExIsoFly34647 Node: ExAfio35839 Node: Files36837 Node: Seealso37393 Node: Bugreport37756 Node: Legal38347 Node: CommandIdx39276 Node: ConceptIdx42839  End Tag Table libisoburn-1.5.4/xorriso/opts_i_o.c0000644000175700017510000015621413762410231014316 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of options as mentioned in man page or info file derived from xorriso.texi. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" /* Command -iso_nowtime "dynamic"|timespec */ int Xorriso_option_iso_nowtime(struct XorrisO *xorriso, char *text, int flag) { char *time_type = "m"; int t_type= 0, ret; time_t t; if(strcmp(text, "dynamic") == 0) { xorriso->do_override_now_time= 0; Xorriso_set_libisofs_now(xorriso, 2); Xorriso_msgs_submit(xorriso, 0, "-iso_nowtime: Set to \"dynamic\"", 0, "NOTE", 0); return(1); } ret= Xorriso_convert_datestring(xorriso, "-iso_nowtime", time_type, text, &t_type, &t, 0); if(ret<=0) goto ex; xorriso->do_override_now_time= 1; xorriso->now_time_override= t; Xorriso_set_libisofs_now(xorriso, 1); sprintf(xorriso->info_text, "-iso_nowtime: Set to =%.f", (double) t); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= 1; ex:; return(ret); } /* Option -iso_rr_pattern "on"|"ls"|"off" */ int Xorriso_option_iso_rr_pattern(struct XorrisO *xorriso, char *mode,int flag) { if(strcmp(mode, "off")==0) xorriso->do_iso_rr_pattern= 0; else if(strcmp(mode, "on")==0) xorriso->do_iso_rr_pattern= 1; else if(strcmp(mode, "ls")==0) xorriso->do_iso_rr_pattern= 2; else { sprintf(xorriso->info_text, "-iso_rr_pattern: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -jigdo aspect argument */ int Xorriso_option_jigdo(struct XorrisO *xorriso, char *aspect, char *arg, int flag) { int ret; ret= Xorriso_jigdo_interpreter(xorriso, aspect, arg, 0); return(ret); } /* Option -joliet "on"|"off" */ int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off")==0) xorriso->do_joliet= 0; else if(strcmp(mode, "on")==0) xorriso->do_joliet= 1; else { sprintf(xorriso->info_text, "-joliet: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Command -joliet_map */ int Xorriso_option_joliet_map(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "unmapped") == 0) { xorriso->joliet_map= 0; } else if(strcmp(mode, "stripped") == 0) { xorriso->joliet_map= 1; } else { sprintf(xorriso->info_text, "-joliet_map: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } return(1); } /* Command -launch_frontend */ int Xorriso_option_launch_frontend(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); if(xorriso->launch_frontend_banned) { sprintf(xorriso->info_text, "-launch_frontend was already executed in this xorriso run"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 0; goto ex; } xorriso->launch_frontend_banned= 1; if(end_idx <= *idx) {ret= 1; goto ex;} if(argv[*idx][0] == 0) {ret= 1; goto ex;} xorriso->dialog= 2; ret= Xorriso_launch_frontend(xorriso, end_idx - *idx, argv + *idx, "", "", 0); ex:; (*idx)= end_idx; return(ret); } /* Option -list_arg_sorting */ int Xorriso_option_list_arg_sorting(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_cmd_sorting_rank(xorriso, 0, NULL, 0, 1); return(ret); } /* Option -list_delimiter */ int Xorriso_option_list_delimiter(struct XorrisO *xorriso, char *text, int flag) { int ret, argc; char **argv= NULL; if(text[0] == 0) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text is empty"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(strlen(text) > 80) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text is too long"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Sfile_make_argv(xorriso->progname, text, &argc, &argv, 4); if(ret > 0) { if(argc > 2) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text contains more than one word"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } Sfile_make_argv(xorriso->progname, text, &argc, &argv, 2); if(argc > 2) return(0); } if(strchr(text, '"') != NULL || strchr(text, '\'') != NULL) { sprintf(xorriso->info_text, "-list_delimiter: New delimiter text contains quotation marks"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } strcpy(xorriso->list_delimiter, text); return(1); } /* Option -list_extras */ int Xorriso_option_list_extras(struct XorrisO *xorriso, char *mode, int flag) { int ret; ret= Xorriso_list_extras(xorriso, mode, 0); return(ret); } /* Option -list_formats */ int Xorriso_option_list_formats(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_list_formats(xorriso, 0); return(ret); } /* Option -list_speeds */ int Xorriso_option_list_speeds(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_list_speeds(xorriso, 0); return(ret); } /* Option -list_profiles */ int Xorriso_option_list_profiles(struct XorrisO *xorriso, char *which, int flag) { int ret; int mode= 0; if(strncmp(which,"in",2)==0) mode|= 1; else if(strncmp(which,"out",3)==0) mode|= 2; else mode|= 3; if(mode & 1) { ret= Xorriso_toc(xorriso, 1 | 16 | 32); if(ret > 0) Xorriso_list_profiles(xorriso, 0); } if((mode & 2) && xorriso->in_drive_handle != xorriso->out_drive_handle) { ret= Xorriso_toc(xorriso, 1 | 2 | 16 | 32); if(ret > 0) Xorriso_list_profiles(xorriso, 2); } return(1); } /* Command -lns alias -lnsi */ int Xorriso_option_lnsi(struct XorrisO *xorriso, char *target, char *path, int flag) { int ret; char *eff_path= NULL, *buffer= NULL, *namept; Xorriso_alloc_meM(eff_path, char, SfileadrL); Xorriso_alloc_meM(buffer, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 1); if(ret < 0) {ret= 0; goto ex;} if(ret > 0) { sprintf(xorriso->info_text, "-lns: Address already existing: "); Text_shellsafe(eff_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 2); if(ret < 0) {ret= 0; goto ex;} ret= Xorriso_truncate_path_comps(xorriso, target, buffer, &namept, 0); if(ret < 0) {ret= 0; goto ex;} ret= Xorriso_graft_in(xorriso, NULL, namept, eff_path, (off_t) 0, (off_t) 0, 1024); if(ret <= 0) {ret= 0; goto ex;} ret= 1; ex:; Xorriso_free_meM(buffer); Xorriso_free_meM(eff_path); return(ret); } /* Option -load session|track|sbsector value */ /* @param flag bit0= with adr_mode sbsector: adr_value is possibly 16 too high @return <=0 error , 1 success, 2 revoked by -reassure */ int Xorriso_option_load(struct XorrisO *xorriso, char *adr_mode, char *adr_value, int flag) { int ret; if(Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text, "-load: Image changes pending. -commit or -rollback first"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_reassure(xorriso, "-load", "loads an alternative image", 0); if(ret<=0) return(2); ret= Xorriso_decode_load_adr(xorriso, "-load", adr_mode, adr_value, &(xorriso->image_start_mode), xorriso->image_start_value, flag & 1); if(ret <= 0) return(ret); xorriso->image_start_mode|= (1<<30); /* enable non-default msc1 processing */ if(strlen(xorriso->indev)>0) { ret= Xorriso_option_rollback(xorriso, 1); /* Load image, no -reassure */ if(ret<=0) return(ret); } return(1); } /* Option -logfile */ int Xorriso_option_logfile(struct XorrisO *xorriso, char *channel, char *fileadr, int flag) { int hflag,channel_no= 0, ret; if(channel[0]==0) { logfile_wrong_form:; sprintf(xorriso->info_text,"Wrong form. Correct would be: -logfile \".\"|\"R\"|\"I\"|\"M\" file_address"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } hflag= 2; if(channel[0]=='R') channel_no= 1; else if(channel[0]=='I') channel_no= 2; else if(channel[0]=='M') channel_no= 3; else if(channel[0]=='.') hflag= 4; else goto logfile_wrong_form; if(strcmp(fileadr,"-")==0 || fileadr[0]==0) hflag|= (1<<15); xorriso->logfile[channel_no][0]= 0; ret= Xorriso_write_to_channel(xorriso, fileadr, channel_no, hflag); if(ret<=0) { sprintf(xorriso->info_text, "Cannot open logfile: %s", fileadr); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } else if(!(hflag&(1<<15))) if(Sfile_str(xorriso->logfile[channel_no], fileadr, 0)<=0) return(-1); return(ret>0); } /* Options -ls alias -lsi and -lsl alias -lsli and -lsd alias -lsdi and -lsdl alias -lsdli and -du alias -dui and -dus alias -dusi @param flag bit0= long format (-lsl , -du, not -dus, not -ls) bit1= do not expand patterns but use literally bit2= -du rather than -ls bit3= list directories as themselves (-lsd) */ int Xorriso_option_lsi(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, filec= 0, nump, i, star= 1; char **filev= NULL, **patterns= NULL; off_t mem= 0; struct stat stbuf; if(flag & 4) { if(!(flag & 1)) star= 0; } else { if(flag & 8) star= 0; } end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); if(xorriso->do_iso_rr_pattern==0) flag|= 2; nump= end_idx - *idx; if((flag&2) && nump>0 ) { ; } else if(nump <= 0) { if(Xorriso_iso_lstat(xorriso, xorriso->wdi, &stbuf, 0)<0) { sprintf(xorriso->info_text, "Current -cd path does not yet exist in the ISO image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } if(!S_ISDIR(stbuf.st_mode)) { sprintf(xorriso->info_text, "Current -cd meanwhile points to a non-directory in ISO image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } patterns= calloc(1, sizeof(char *)); if(patterns == NULL) { no_memory:; sprintf(xorriso->info_text, "Cannot allocate enough memory for pattern expansion"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } nump= 1; if(star) patterns[0]= "*"; else patterns[0]= "."; flag&= ~2; } else { patterns= calloc(nump, sizeof(char *)); if(patterns==NULL) goto no_memory; for(i= 0; iino_behavior & 32)) { ret= Xorriso_make_hln_array(xorriso, 0); /* for stbuf.st_nlink */ if(ret < 0) goto ex; } if(flag&2) { ret= Xorriso_ls_filev(xorriso, xorriso->wdi, nump, argv + (*idx), mem, flag&(1|4|8)); } else if(nump==1 && strcmp(patterns[0],"*")==0 && !(flag&4)){ /* save temporary memory by calling simpler function */ ret= Xorriso_ls(xorriso, (flag&1)|4); } else { ret= Xorriso_expand_pattern(xorriso, nump, patterns, 0, &filec, &filev, &mem, 0); if(ret<=0) {ret= 0; goto ex;} ret= Xorriso_ls_filev(xorriso, xorriso->wdi, filec, filev, mem, flag&(1|4|8)); } if(ret<=0) {ret= 0; goto ex;} ret= 1; ex:; if(patterns!=NULL) free((char *) patterns); Sfile_destroy_argv(&filec, &filev, 0); (*idx)= end_idx; return(ret); } /* Options -lsx, -lslx, -lsdx , -lsdlx , -dux , -dusx @param flag bit0= long format (-lslx , -dux) bit1= do not expand patterns but use literally bit2= du rather than ls bit3= list directories as themselves (ls -d) */ int Xorriso_option_lsx(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, filec= 0, nump, i; char **filev= NULL, **patterns= NULL; off_t mem= 0; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1|2); if(xorriso->do_disk_pattern==0) flag|= 2; nump= end_idx - *idx; if((flag&2) && nump>0) { ; } else if(nump <= 0) { patterns= calloc(1, sizeof(char *)); if(patterns == NULL) { no_memory:; sprintf(xorriso->info_text, "Cannot allocate enough memory for pattern expansion"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } nump= 1; if(flag&8) patterns[0]= "."; else patterns[0]= "*"; flag&= ~2; } else { patterns= calloc(nump, sizeof(char *)); if(patterns==NULL) goto no_memory; for(i= 0; iwdx, nump, argv + (*idx), mem, flag&(1|4|8)); #ifdef Not_yeT } else if(nump==1 && strcmp(patterns[0],"*")==0 && !(flag&4)){ /* save temporary memory by calling simpler function */ ret= Xorriso_ls(xorriso, (flag&1)|4); #endif } else { ret= Xorriso_expand_disk_pattern(xorriso, nump, patterns, 0, &filec, &filev, &mem, 0); if(ret<=0) {ret= 0; goto ex;} ret= Xorriso_lsx_filev(xorriso, xorriso->wdx, filec, filev, mem, flag&(1|4|8)); } if(ret<=0) {ret= 0; goto ex;} ret= 1; ex:; if(patterns!=NULL) free((char *) patterns); Sfile_destroy_argv(&filec, &filev, 0); (*idx)= end_idx; return(ret); } /* Option -map , -map_single */ /* @param flag bit0=do not report the added item bit1=do not reset pacifier, no final pacifier message bit5= -map_single: do not insert directory tree */ int Xorriso_option_map(struct XorrisO *xorriso, char *disk_path, char *iso_path, int flag) { int ret; char *eff_origin= NULL, *eff_dest= NULL, *ipth; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); if(!(flag&2)) Xorriso_pacifier_reset(xorriso, 0); ipth= iso_path; if(ipth[0]==0) ipth= disk_path; if(disk_path[0]==0) { sprintf(xorriso->info_text, "-map: Empty disk_path given"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 1); {ret= 0; goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, disk_path, eff_origin, 2|4); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, ipth, eff_dest, 2); if(ret<=0) goto ex; ret= Xorriso_graft_in(xorriso, NULL, eff_origin, eff_dest, (off_t) 0, (off_t) 0, 2|(flag&32)); if(!(flag&2)) Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 1); if(ret<=0) goto ex; if(!(flag&1)) { sprintf(xorriso->info_text, "Added to ISO image: %s '%s'='%s'\n", (ret>1 ? "directory" : "file"), (eff_dest[0] ? eff_dest : "/"), eff_origin); Xorriso_info(xorriso,0); } ret= 1; ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); return(ret); } /* Command -map_l , -compare_l , -update_l , -extract_l , -update_lxi , -update_li */ /* @param flag bit4= do not establish and dispose xorriso->di_array for update_l bit8-11= mode 0= -map_l 1= -compare_l 2= -update_l 3= -extract_l 4= -update_lxi 5= -update_li */ int Xorriso_option_map_l(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, optc= 0, was_failure= 1, i, j, fret, mode, problem_count; int ns_flag= 2|4, nt_flag= 2, opt_args_flag= 2, arg2c= 0, opt2c= 0; int new_opt2c; char *source_prefix= NULL, *target_prefix= NULL, *cmd, **optv= NULL; char *eff_source= NULL, *eff_target= NULL, *s_wd, *t_wd; char **eff_src_array= NULL, **eff_tgt_array= NULL, **opt2v= NULL; char **arg2v= NULL; cmd= "-map_l"; s_wd= xorriso->wdx; t_wd= xorriso->wdi; Xorriso_pacifier_reset(xorriso, 0); mode= (flag>>8) & 15; if(mode==1) cmd= "-compare_l"; else if(mode==2) cmd= "-update_l"; else if(mode == 3 || mode == 5) { if(mode == 5) cmd= "-update_li"; else cmd= "-extract_l"; ns_flag= 2; s_wd= xorriso->wdi; nt_flag= 2|4; t_wd= xorriso->wdx; opt_args_flag= 0; } else if(mode == 4) { cmd= "-update_lxi"; } end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1|2); if(end_idx - (*idx) < 3) { sprintf(xorriso->info_text, "%s: Not enough arguments given (%d < 3)", cmd, end_idx - (*idx)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 1); ret= 0; goto ex; } Xorriso_alloc_meM(source_prefix, char, SfileadrL); Xorriso_alloc_meM(target_prefix, char, SfileadrL); Xorriso_alloc_meM(eff_source, char, SfileadrL); Xorriso_alloc_meM(eff_target, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, s_wd, argv[*idx], source_prefix, ns_flag | 64); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, t_wd, argv[(*idx)+1], target_prefix, nt_flag); if(ret<=0) goto ex; ret= Xorriso_opt_args(xorriso, cmd, argc, argv, (*idx)+2, &end_idx, &optc, &optv, opt_args_flag); if(ret<=0) goto ex; if(mode == 4) { /* Convert pattern from disk to iso_rr */ arg2c= end_idx - *idx - 2; Xorriso_alloc_meM(arg2v, char *, arg2c); for(i = 0; i < arg2c; i++) arg2v[i]= NULL; arg2c= 0; for(i = (*idx) + 2; i < end_idx; i++) { ret= Xorriso_normalize_img_path(xorriso, s_wd, argv[i], eff_source, ns_flag); if(ret<=0) goto ex; ret= Xorriso__exchange_prefix(source_prefix, target_prefix, eff_source, eff_target, 0); if(ret <= 0) continue; Xorriso_alloc_meM(arg2v[arg2c], char, strlen(eff_target) + 1); strcpy(arg2v[arg2c], eff_target); arg2c++; } /* Expand wildcards in iso_rr, do not include unmatched patterns */ ret= Xorriso_opt_args(xorriso, cmd, arg2c, arg2v, 0, &i, &opt2c, &opt2v, (1 << 10) | (1 << 7)); if(ret<=0) goto ex; /* Convert from iso_rr path to disk path */ new_opt2c= 0; for(i = 0; i < opt2c; i++) { ret= Xorriso__exchange_prefix(target_prefix, source_prefix, opt2v[i], eff_source, 0); free(opt2v[i]); opt2v[i]= NULL; if(ret <= 0) continue; Xorriso_alloc_meM(opt2v[new_opt2c], char, strlen(eff_source) + 1); strcpy(opt2v[new_opt2c], eff_source); new_opt2c++; } opt2c= new_opt2c; /* Merge both results */ if(opt2c > 0) { Sfile_destroy_argv(&arg2c, &arg2v, 0); Xorriso_alloc_meM(arg2v, char *, optc + opt2c); for(i = 0; i < optc + opt2c; i++) arg2v[i]= NULL; arg2c= 0; for(i= 0; i < optc; i++) { ret= Xorriso_normalize_img_path(xorriso, s_wd, optv[i], eff_source, ns_flag); if(ret<=0) goto ex; Xorriso_alloc_meM(arg2v[arg2c], char, strlen(eff_source) + 1); strcpy(arg2v[arg2c], eff_source); arg2c++; } for(i= 0; i < opt2c; i++) { for(j= 0; j < optc; j++) if(strcmp(opt2v[i], arg2v[j]) == 0) break; if(j < optc) continue; arg2v[arg2c++]= opt2v[i]; opt2v[i]= NULL; } Sfile_destroy_argv(&optc, &optv, 0); optv= arg2v; arg2v= NULL; optc= arg2c; arg2c= 0; } } if(mode == 3 && (xorriso->do_restore_sort_lba || !(xorriso->ino_behavior & 4))) { eff_src_array= calloc(optc, sizeof(char *)); eff_tgt_array= calloc(optc, sizeof(char *)); if(eff_src_array == NULL || eff_tgt_array == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } for(i= 0; i < optc; i++) eff_src_array[i]= eff_tgt_array[i]= NULL; } if((mode == 2 || mode == 4) && !((xorriso->ino_behavior & 2) || (flag & 16) || xorriso->di_array != NULL)) { /* Create all-image node array sorted by isofs.di */ ret= Xorriso_make_di_array(xorriso, 0); if(ret <= 0) goto ex; } for(i= 0; iinfo_text, "%s: disk_path ", cmd); Text_shellsafe(eff_source, xorriso->info_text, 1); strcat(xorriso->info_text, " does not begin with disk_prefix "); Text_shellsafe(source_prefix, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 1); } if(ret <= 0) goto ex; if(mode==0) ret= Xorriso_option_map(xorriso, eff_source, eff_target, 2); else if(mode==1) ret= Xorriso_option_compare(xorriso, eff_source, eff_target, 2|8); else if(mode == 2 || mode == 4) ret= Xorriso_option_update(xorriso, eff_source, eff_target, 2 | 8 | 16); else if(mode==3) { if(eff_src_array != NULL) { eff_src_array[i]= strdup(eff_source); eff_tgt_array[i]= strdup(eff_target); if(eff_src_array[i] == NULL || eff_tgt_array[i] == NULL) { Xorriso_no_malloc_memory(xorriso, &(eff_src_array[i]), 0); ret= -1; goto ex; } } else { ret= Xorriso_option_extract(xorriso, eff_source, eff_target, 2 | 4); } } else if(mode == 5) { ret= Xorriso_option_update(xorriso, eff_target, eff_source, 2 | 8 | 16); } if(ret>0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1 | 2); if(fret>=0) continue; goto ex; } ret= 1; if(mode == 3 && eff_src_array != NULL) { ret= Xorriso_lst_append_binary(&(xorriso->node_disk_prefixes), target_prefix, strlen(target_prefix) + 1, 0); if(ret <= 0) goto ex; ret= Xorriso_lst_append_binary(&(xorriso->node_img_prefixes), source_prefix, strlen(source_prefix) + 1, 0); if(ret <= 0) goto ex; ret= Xorriso_restore_sorted(xorriso, optc, eff_src_array, eff_tgt_array, &problem_count, 0); if(ret <= 0 || problem_count > 0) was_failure= 1; } if(mode==0) Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 1); else if(mode==1 || mode==2 || mode == 4 || mode == 5) Xorriso_pacifier_callback(xorriso, "content bytes read", xorriso->pacifier_count, 0, "", 1 | 8 | 32); else if(mode==3) Xorriso_pacifier_callback(xorriso, "files restored",xorriso->pacifier_count, xorriso->pacifier_total, "", 1|4); ex:; Xorriso_destroy_node_array(xorriso, 0); i= optc; Sfile_destroy_argv(&i, &eff_src_array, 0); i= optc; Sfile_destroy_argv(&i, &eff_tgt_array, 0); Xorriso_free_meM(source_prefix); Xorriso_free_meM(target_prefix); Xorriso_free_meM(eff_source); Xorriso_free_meM(eff_target); (*idx)= end_idx; Xorriso_opt_args(xorriso, cmd, argc, argv, *idx, &end_idx, &optc, &optv, 256); Xorriso_opt_args(xorriso, cmd, argc, argv, *idx, &end_idx, &opt2c, &opt2v, 256); if(arg2c > 0) Sfile_destroy_argv(&arg2c, &arg2v, 0); else if(arg2v != NULL) Xorriso_free_meM(arg2v); if(ret<=0) return(ret); return(!was_failure); } /* Option -mark */ int Xorriso_option_mark(struct XorrisO *xorriso, char *mark, int flag) { if(mark[0]==0) xorriso->mark_text[0]= 0; else strncpy(xorriso->mark_text,mark,sizeof(xorriso->mark_text)-1); xorriso->mark_text[sizeof(xorriso->mark_text)-1]= 0; return(1); } /* Option -md5 "on"|"all"|"off" */ int Xorriso_option_md5(struct XorrisO *xorriso, char *mode, int flag) { char *npt, *cpt; int l; npt= cpt= mode; for(; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l == 0) continue; if(l == 3 && strncmp(cpt, "off", l) == 0) xorriso->do_md5&= ~31; else if(l == 2 && strncmp(cpt, "on", l) == 0) xorriso->do_md5= (xorriso->do_md5 & ~31) | 7 | 16; else if(l == 3 && strncmp(cpt, "all", l) == 0) xorriso->do_md5|= 31; else if(l == 18 && strncmp(cpt, "stability_check_on", l) == 0) xorriso->do_md5|= 8; else if(l == 19 && strncmp(cpt, "stability_check_off", l) == 0) xorriso->do_md5&= ~8; else if(l == 13 && strncmp(cpt, "load_check_on", l) == 0) xorriso->do_md5&= ~32; else if(l == 14 && strncmp(cpt, "load_check_off", l) == 0) xorriso->do_md5|= 32; else { sprintf(xorriso->info_text, "-md5: unknown mode "); Text_shellsafe(cpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } return(1); } /* Option -mkdir alias -mkdiri */ int Xorriso_option_mkdiri(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int i, end_idx, ret, was_failure= 0, fret; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 0); for(i= *idx; i0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } ret= 1; ex:; (*idx)= end_idx; if(ret<=0) return(ret); return(!was_failure); } int Xorriso_option_modesty_on_drive(struct XorrisO *xorriso, char *mode, int flag) { char *npt, *cpt, *ppt; int l, num, set_min; npt= cpt= mode; for(; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l == 0) continue; if(l == 3 && strncmp(cpt, "off", l) == 0) { xorriso->modesty_on_drive= 0; } else if(l == 1 && strncmp(cpt, "0", l) == 0) { xorriso->modesty_on_drive= 0; } else if(l == 2 && strncmp(cpt, "on", l) == 0) { xorriso->modesty_on_drive= 1; } else if(l == 1 && strncmp(cpt, "1", l) == 0) { xorriso->modesty_on_drive= 1; } else if(l == 2 && strncmp(cpt, "-1", l) == 0) { ; } else if(*cpt >= '1' && *cpt <= '9') { ppt= cpt; set_min= 2; set_size_percent:; sscanf(ppt, "%d", &num); if(num == -1) { ; } else if(num < 25) { bad_percent:; sprintf(xorriso->info_text, "-modesty_on_drive: percentage out of range [25 to 100]"); Text_shellsafe(cpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } else if(num > 100) { goto bad_percent; } if(set_min == 2) { xorriso->modesty_on_drive= 1; } if(set_min) xorriso->min_buffer_percent= num; else xorriso->max_buffer_percent= num; } else if(l >= 12 && strncmp(cpt, "min_percent=", 12) == 0) { ppt= cpt + 12; set_min= 1; goto set_size_percent; } else if(l >= 12 && strncmp(cpt, "max_percent=", 12) == 0) { ppt= cpt + 12; set_min= 0; goto set_size_percent; } else if(l >= 9 && strncmp(cpt, "min_usec=", 9) == 0) { ppt= cpt + 9; set_min= 1; set_sec:; num= -1; sscanf(ppt, "%d", &num); if(num < 0) num= 0; if(set_min == 2) xorriso->max_buffer_usec= num; else if(set_min == 1) xorriso->min_buffer_usec= num; else if(set_min == 0) xorriso->max_buffer_percent= num; else xorriso->buffer_timeout_sec= num; } else if(l >= 9 && strncmp(cpt, "max_usec=", 9) == 0) { ppt= cpt + 9; set_min= 2; goto set_sec; } else if(l >= 12 && strncmp(cpt, "timeout_sec=", 12) == 0) { ppt= cpt + 12; set_min= -1; goto set_sec; } else { sprintf(xorriso->info_text, "-modesty_on_drive: unknown mode "); Text_shellsafe(cpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } return(1); } /* Options -mount , -mount_cmd , -session_string */ /* @param bit0= -mount_cmd: print mount command to result channel rather than performing it bit1= perform -session_string rather than -mount_cmd */ int Xorriso_option_mount(struct XorrisO *xorriso, char *dev, char *adr_mode, char *adr, char *cmd, int flag) { int ret, entity_code= 0, m_flag; char entity_id[81], *mnt; if(flag & 1) mnt= "-mount_cmd"; else if(flag & 2) mnt= "-session_string"; else { mnt= "-mount"; if(xorriso->allow_restore <= 0) { sprintf(xorriso->info_text, "-mount: image-to-disk features are not enabled by option -osirrox"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text, "%s: Image changes pending. -commit or -rollback first", mnt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } ret= Xorriso_decode_load_adr(xorriso, mnt, adr_mode, adr, &entity_code, entity_id, 0); if(ret <= 0) return(ret); if(flag & 2) m_flag= 1 | 4; else m_flag= (flag & 1) | 2; ret= Xorriso_mount(xorriso, dev, entity_code, entity_id, cmd, m_flag); return(ret); } /* Option -mount_opts option[:...] */ int Xorriso_option_mount_opts(struct XorrisO *xorriso, char *mode, int flag) { int was, l; char *cpt, *npt; was= xorriso->mount_opts_flag; npt= cpt= mode; for(cpt= mode; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0) goto unknown_mode; if(strncmp(cpt, "shared", l)==0) { xorriso->mount_opts_flag|= 1; } else if(strncmp(cpt, "exclusive", l)==0) { xorriso->mount_opts_flag&= ~1; } else { unknown_mode:; if(linfo_text, "-mount_opts: unknown option '%s'", cpt); else sprintf(xorriso->info_text, "-mount_opts: oversized parameter (%d)",l); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); xorriso->mount_opts_flag= was; return(0); } } return(1); } /* Command -move */ int Xorriso_option_move(struct XorrisO *xorriso, char *origin, char *dest, int flag) { int ret; char *eff_origin= NULL, *eff_dest= NULL; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, origin, eff_origin, 0); if(ret <= 0) {ret= 0; goto ex;} ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, dest, eff_dest, 2); if(ret < 0) {ret= 0; goto ex;} ret= Xorriso_rename(xorriso, NULL, eff_origin, eff_dest, 0); if(ret <= 0) goto ex; ret= 1; ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); return(ret); } /* Command -msg_op */ int Xorriso_option_msg_op(struct XorrisO *xorriso, char *what, char *arg, int flag) { int ret, available, argc, pargc, i, pflag, max_words, input_lines, msd_mem; char **argv= NULL, **pargv= NULL, *msg= ""; char *prefix, *separators; msd_mem= xorriso->msg_sieve_disabled; ret= 1; if(strcmp(what, "parse") == 0 || strcmp(what, "parse_silently") == 0 || strcmp(what, "parse_bulk") == 0 || strcmp(what, "parse_bulk_silently") == 0) { ret= Xorriso_parse_line(xorriso, arg, "", "", 5, &argc, &argv, 0); prefix= ""; if(argc > 0) prefix= argv[0]; separators= ""; if(argc > 1) separators= argv[1]; max_words= 0; if(argc > 2) sscanf(argv[2], "%d", &max_words); pflag= 0; if(argc > 3) sscanf(argv[3], "%d", &pflag); input_lines= 1; if(argc > 4) sscanf(argv[4], "%d", &input_lines); if(strcmp(what, "parse") == 0 || strcmp(what, "parse_silently") == 0) { ret= Xorriso_msg_op_parse(xorriso, "", prefix, separators, max_words, pflag, input_lines, (strcmp(what, "parse_silently") == 0)); } else { ret= Xorriso_msg_op_parse_bulk(xorriso, prefix, separators, max_words, pflag, input_lines, (strcmp(what, "parse_bulk_silently") == 0)); } if(ret <= 0) goto ex; xorriso->msg_sieve_disabled= msd_mem; Xorriso__dispose_words(&argc, &argv); } else if(strcmp(what, "start_sieve") == 0) { Xorriso_sieve_dispose(xorriso, 0); ret= Xorriso_sieve_big(xorriso, 0); msg= "Message sieve enabled"; /* >>> } else if(strcmp(what, "add_filter_rule") == 0) { */; } else if(strcmp(what, "clear_sieve") == 0) { ret= Xorriso_sieve_clear_results(xorriso, 0); msg= "Recorded message sieve results disposed"; } else if(strcmp(what, "end_sieve") == 0) { ret= Xorriso_sieve_dispose(xorriso, 0); msg= "Message sieve disabled"; } else if(strcmp(what, "read_sieve") == 0) { ret= Xorriso_sieve_get_result(xorriso, arg, &pargc, &pargv, &available, 0); xorriso->msg_sieve_disabled= 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); if(ret > 0) { sprintf(xorriso->result_line, "%d\n", pargc); Xorriso_result(xorriso, 1); for(i= 0; i < pargc; i++) { ret= Sfile_count_char(pargv[i], '\n') + 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); Sfile_str(xorriso->result_line, pargv[i], 0); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 1); } } else { strcpy(xorriso->result_line, "0\n"); Xorriso_result(xorriso, 1); available= 0; } sprintf(xorriso->result_line, "%d\n", available); Xorriso_result(xorriso, 1); xorriso->msg_sieve_disabled= msd_mem; Xorriso__dispose_words(&pargc, &pargv); ret= 1; } else if(strcmp(what, "show_sieve") == 0) { ret= Xorriso_sieve_get_result(xorriso, "", &pargc, &pargv, &available, 8); xorriso->msg_sieve_disabled= 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); if(ret > 0) { sprintf(xorriso->result_line, "%d\n", pargc); Xorriso_result(xorriso, 1); for(i= 0; i < pargc; i++) { sprintf(xorriso->result_line, "%s\n", pargv[i]); Xorriso_result(xorriso, 1); } } xorriso->msg_sieve_disabled= msd_mem; Xorriso__dispose_words(&pargc, &pargv); } else if(strcmp(what, "compare_sev") == 0) { ret= Xorriso_parse_line(xorriso, arg, "", ",", 2, &argc, &argv, 0); if(argc < 2) { sprintf(xorriso->info_text, "-msg_op cmp_sev: malformed severity pair '%s'", arg); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } else { ret= Xorriso__severity_cmp(argv[0], argv[1]); sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); } Xorriso__dispose_words(&argc, &argv); } else if(strcmp(what, "list_sev") == 0) { sprintf(xorriso->result_line, "%s\n", Xorriso__severity_list(0)); Xorriso_result(xorriso, 1); } else { sprintf(xorriso->info_text, "-msg_op: unknown operation '%s'", what); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 0; } if(ret > 0 && msg[0]) Xorriso_msgs_submit(xorriso, 0, msg, 0, "NOTE", 0); ex:; xorriso->msg_sieve_disabled= msd_mem; return(ret); } /* Option -mv alias -mvi */ int Xorriso_option_mvi(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int i, end_idx_dummy, ret, is_dir= 0, was_failure= 0, fret; char *eff_origin= NULL, *eff_dest= NULL, *dest_dir= NULL; char *leafname= NULL; int optc= 0; char **optv= NULL; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); Xorriso_alloc_meM(dest_dir, char, SfileadrL); Xorriso_alloc_meM(leafname, char, SfileadrL); ret= Xorriso_cpmv_args(xorriso, "-mvi", argc, argv, idx, &optc, &optv, eff_dest, 0); if(ret<=0) goto ex; if(ret==2) { is_dir= 1; strcpy(dest_dir, eff_dest); } /* Perform movements */ for(i= 0; iwdi,optv[i],eff_origin,0); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; if(is_dir) { ret= Sfile_leafname(eff_origin, leafname, 0); if(ret<=0) goto problem_handler; strcpy(eff_dest, dest_dir); ret= Sfile_add_to_path(eff_dest, leafname, 0); if(ret<=0) { sprintf(xorriso->info_text, "Effective path gets much too long (%d)", (int) (strlen(eff_dest)+strlen(leafname)+1)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto problem_handler; } } ret= Xorriso_rename(xorriso, NULL, eff_origin, eff_dest, 0); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; sprintf(xorriso->info_text, "Renamed in ISO image: "); Text_shellsafe(eff_origin, xorriso->info_text, 1); strcat(xorriso->info_text, " to "); Text_shellsafe(eff_dest, xorriso->info_text, 1 | 2); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso, 0); continue; /* regular bottom of loop */ problem_handler:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } ret= !was_failure; ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); Xorriso_free_meM(dest_dir); Xorriso_free_meM(leafname); Xorriso_opt_args(xorriso, "-mvi", argc, argv, *idx, &end_idx_dummy, &optc, &optv, 256); return(ret); } /* Option -named_pipe_loop */ int Xorriso_option_named_pipe_loop(struct XorrisO *xorriso, char *mode, char *stdin_pipe, char *stdout_pipe, char *stderr_pipe, int flag) { char *pipe_paths[3], *cpt, *npt; int ret, hflag= 0, l; npt= mode; for(cpt= mode; npt != NULL; cpt= npt + 1) { npt= strchr(cpt, ':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0) { ; } else if(strncmp(cpt, "-", l) == 0) { ; } else if(strncmp(cpt, "cleanup", l) == 0) { hflag|= 1; } else if(strncmp(cpt, "keep", l) == 0) { hflag&= ~1; } else if(strncmp(cpt, "buffered", l) == 0) { hflag|= 2; } else if(strncmp(cpt, "direct", l) == 0) { hflag&= ~2; } else { sprintf(xorriso->info_text, "-named_pipe_loop: unknown mode in '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } pipe_paths[0]= stdin_pipe; pipe_paths[1]= stdout_pipe; pipe_paths[2]= stderr_pipe; ret= Xorriso_named_pipe_loop(xorriso, pipe_paths, hflag); return(ret); } /* Option -no_rc */ int Xorriso_option_no_rc(struct XorrisO *xorriso, int flag) { xorriso->no_rc= 1; return(1); } /* Option -not_leaf , (-hide_disk_leaf , -as mkisofs -hide) */ /* @param flag bit0-bit5= hide rather than adding to disk_exclusions bit0= add to iso_rr_hidings bit1= add to joliet_hidings bit2= add to hfsplus_hidings */ int Xorriso_option_not_leaf(struct XorrisO *xorriso, char *pattern, int flag) { regex_t re; char *regexpr= NULL; int ret= 0; Xorriso_alloc_meM(regexpr, char, 2 * SfileadrL + 2); if(pattern[0]==0) {ret= 0; goto cannot_add;} Xorriso__bourne_to_reg(pattern, regexpr, 0); if(regcomp(&re, regexpr, 0)!=0) {ret= 0; goto cannot_add;} if(flag & 63) { if(flag & 1) { ret= Exclusions_add_not_leafs(xorriso->iso_rr_hidings, pattern, &re, 0); if(ret<=0) goto cannot_add; } if(flag & 2) { ret= Exclusions_add_not_leafs(xorriso->joliet_hidings, pattern, &re, 0); if(ret<=0) goto cannot_add; } if(flag & 4) { ret= Exclusions_add_not_leafs(xorriso->hfsplus_hidings, pattern, &re, 0); if(ret<=0) goto cannot_add; } } else { ret= Exclusions_add_not_leafs(xorriso->disk_exclusions, pattern, &re, 0); } if(ret<=0) { cannot_add:; sprintf(xorriso->info_text,"Cannot add pattern: %s ", (flag & 3) ? "-hide_disk_leaf" : "-not_leaf"); Text_shellsafe(pattern, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } ret= 1; ex:; Xorriso_free_meM(regexpr); return(ret); } /* Option -not_list , -quoted_not_list */ /* @param flag bit0= -quoted_not_list */ int Xorriso_option_not_list(struct XorrisO *xorriso, char *adr, int flag) { int ret, linecount= 0, insertcount= 0, null= 0, argc= 0, i; FILE *fp= NULL; char **argv= NULL; Xorriso_pacifier_reset(xorriso, 0); if(adr[0]==0) { sprintf(xorriso->info_text, "Empty file name given with %s", (flag & 1) ? "-quoted_not_list" : "-not_list"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_afile_fopen(xorriso, adr, "rb", &fp, 0); if(ret <= 0) return(0); while(1) { ret= Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 4 | (flag & 1) ); if(ret <= 0) goto ex; if(ret == 2) break; for(i= 0; i < argc; i++) { if(argv[i][0] == 0) continue; if(strchr(argv[i], '/')!=NULL) { null= 0; ret= Xorriso_option_not_paths(xorriso, 1, argv + i, &null, 0); } else ret= Xorriso_option_not_leaf(xorriso, argv[i], 0); if(ret<=0) goto ex; insertcount++; } } ret= 1; ex:; Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 2); if(fp != NULL && fp != stdin) fclose(fp); if(ret<=0) { sprintf(xorriso->info_text, "Aborted reading of file "); Text_shellsafe(adr, xorriso->info_text, 1); sprintf(xorriso->info_text + strlen(xorriso->info_text), " in line number %d", linecount); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } sprintf(xorriso->info_text, "Added %d exclusion list items from file ", insertcount); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso,0); return(ret); } /* Option -not_mgt */ int Xorriso_option_not_mgt(struct XorrisO *xorriso, char *setting, int flag) { int ret; char *what_data= NULL, *what, *what_next; Xorriso_alloc_meM(what_data, char, SfileadrL); if(Sfile_str(what_data, setting, 0)<=0) { sprintf(xorriso->info_text, "-not_mgt: setting string is much too long (%d)", (int) strlen(setting)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } for(what= what_data; what!=NULL; what= what_next) { what_next= strchr(what, ':'); if(what_next!=NULL) { *what_next= 0; what_next++; } if(strcmp(what, "reset")==0 || strcmp(what, "erase")==0) { if(strcmp(what, "reset")==0) xorriso->disk_excl_mode= 1; Exclusions_destroy(&(xorriso->disk_exclusions), 0); ret= Exclusions_new(&(xorriso->disk_exclusions), 0); if(ret<=0) { Xorriso_no_malloc_memory(xorriso, NULL, 0); goto ex; } } else if(strcmp(what, "on")==0) { xorriso->disk_excl_mode|= 1; } else if(strcmp(what, "off")==0) { xorriso->disk_excl_mode&= ~1; } else if(strcmp(what, "param_on")==0) { xorriso->disk_excl_mode|= 2; } else if(strcmp(what, "param_off")==0) { xorriso->disk_excl_mode&= ~2; } else if(strcmp(what, "subtree_on")==0) { xorriso->disk_excl_mode|= 4; } else if(strcmp(what, "subtree_off")==0) { xorriso->disk_excl_mode&= ~4; } else if(strcmp(what, "ignore_on")==0) { xorriso->disk_excl_mode|= 8; } else if(strcmp(what, "ignore_off")==0) { xorriso->disk_excl_mode&= ~8; } else { sprintf(xorriso->info_text, "-not_mgt: unknown setting '%s'", what); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } ret= 1; ex:; Xorriso_free_meM(what_data); return(ret); } /* Option -not_paths , (-hide_disk_paths , -as mkisofs -hide) */ /* @param flag bit0= add to iso_rr_hidings rather than disk_exclusions bit1= add to joliet_hidings rather than disk_exclusions bit2= enable disk pattern expansion regardless of -disk_pattern bit8-13= consolidated hide state bits, duplicating bit0-1 bit8= add to iso_rr_hidings bit9= add to joliet_hidings bit10= add to hfsplus_hidings */ int Xorriso_option_not_paths(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, num_descr= 0, dummy, optc= 0, i; char **descr= NULL, **optv= NULL, *eff_path= NULL, *hpt= NULL; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, (xorriso->do_disk_pattern == 1 || (flag & 4)) | 2); if(end_idx<=0) {ret= end_idx; goto ex;} num_descr= end_idx - *idx; if(num_descr<=0) {ret= 1; goto ex;} /* produce absolute patterns */ Xorriso_alloc_meM(eff_path, char, SfileadrL); descr= TSOB_FELD(char *, num_descr); if(descr==NULL) { no_memory:; Xorriso_no_pattern_memory(xorriso, sizeof(char *) * (off_t) num_descr, 0); ret= -1; goto ex; } for(i= 0; iwdx, argv[i+*idx], eff_path, 2|4); if(ret<=0) goto ex; descr[i]= strdup(eff_path); if(descr[i]==NULL) goto no_memory; } ret= Xorriso_opt_args(xorriso, (flag & 0x3f03) ? "-hide_disk_paths" : "-not_paths", num_descr, descr, 0, &dummy, &optc, &optv, 2 | ((flag & 4) << 7)); if(ret<=0) goto ex; if(flag & 0x3f03) { if(flag & 0x0101) { ret= Exclusions_add_not_paths(xorriso->iso_rr_hidings, num_descr, descr, optc, optv, 0); if(ret<=0) { no_hide:; sprintf(xorriso->info_text, "Cannot add path list: -hide_disk_paths "); hpt= Xorriso__hide_mode_text(flag & 0x3f03, 0); if(hpt != NULL) sprintf(xorriso->info_text + strlen(xorriso->info_text), "%s ", hpt); Xorriso_free_meM(hpt); Text_shellsafe(argv[*idx], xorriso->info_text, 1); strcat(xorriso->info_text, num_descr > 1 ? " ... " : " "); strcat(xorriso->info_text, xorriso->list_delimiter); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } } if(flag & 0x0202) { ret= Exclusions_add_not_paths(xorriso->joliet_hidings, num_descr, descr, optc, optv, 0); if(ret<=0) goto no_hide; } if(flag & 0x0400) { ret= Exclusions_add_not_paths(xorriso->hfsplus_hidings, num_descr, descr, optc, optv, 0); if(ret<=0) goto no_hide; } } else { ret= Exclusions_add_not_paths(xorriso->disk_exclusions, num_descr, descr, optc, optv, 0); if(ret<=0) { sprintf(xorriso->info_text,"Cannot add path list: -not_paths "); Text_shellsafe(argv[*idx], xorriso->info_text, 1); strcat(xorriso->info_text, num_descr > 1 ? " ... " : " "); strcat(xorriso->info_text, xorriso->list_delimiter); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } } ex:; (*idx)= end_idx; Xorriso_opt_args(xorriso, "-not_paths", num_descr, descr, 0, &dummy, &optc, &optv, 256); if(descr!=NULL) { for(i= 0; iinfo_text,"Empty file name given with -options_from_file"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } if(xorriso->is_dialog) { sprintf(xorriso->info_text,"+ performing command lines from file "); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, " :\n"); Xorriso_info(xorriso,1); } ret= Xorriso_afile_fopen(xorriso, adr, "rb", &fp, 0); if(ret <= 0) return(0); sprintf(xorriso->info_text, "Command file: "); Text_shellsafe(adr, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); while(1) { ret= Xorriso_read_lines(xorriso, fp, &linecount, &linec, &linev, 1 | 8); if(ret <= 0) goto ex; /* no problem_handler because there is no sense in going on */ if(ret == 2) break; line= linev[0]; if(line[0]==0 || line[0]=='#') continue; if(flag&1) { ret= Sfile_make_argv(xorriso->progname, line, &argc, &argv, 4 | 8 | ((xorriso->bsl_interpretation & 3) << 5)); if(ret<=0) goto problem_handler; ret= Xorriso_prescan_args(xorriso,argc,argv,1); if(ret==0) {ret= 3; goto ex;} if(ret<0) goto problem_handler; } else { if(xorriso->is_dialog) { sprintf(xorriso->info_text,"+ %d: %s\n",linecount,line); Xorriso_info(xorriso,1); } ret= Xorriso_execute_option(xorriso,line,1|(1<<16)); if(ret==3) goto ex; if(ret<=0) goto problem_handler; } continue; /* regular bottom of loop */ problem_handler:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1); if(fret>=0) continue; goto ex; } ret= 1; ex:; Sfile_make_argv("", "", &argc, &argv, 2); /* release memory */ Xorriso_read_lines(xorriso, fp, &linecount, &linec, &linev, 2); Xorriso_reset_counters(xorriso,0); if(fp != NULL && fp != stdin) fclose(fp); if(ret<=0) { sprintf(xorriso->info_text, "error triggered by line %d of file:\n ", linecount); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 1); } sprintf(xorriso->info_text, "Command file end: "); Text_shellsafe(adr, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); if(ret!=1) return(ret); return(!was_failure); } /* Option -osirrox "on"|"off" */ int Xorriso_option_osirrox(struct XorrisO *xorriso, char *mode, int flag) { int l, allow_restore; char *npt, *cpt; double num= 0.0; allow_restore= xorriso->allow_restore; npt= cpt= mode; for(cpt= mode; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0 && mode[0]!=0) goto unknown_mode; if(strncmp(cpt, "off", l)==0 && l >= 3) allow_restore= 0; else if(strncmp(cpt, "banned", l)==0 && l >= 5) allow_restore= -1; else if(strncmp(cpt, "blocked", l)==0 && l >= 7) allow_restore= -2; else if(strncmp(cpt, "unblock", l)==0 && l >= 7) { if(xorriso->allow_restore == -2) xorriso->allow_restore= 0; allow_restore= 1; } else if(strncmp(cpt, "device_files", l)==0 && l >= 12) allow_restore= 2; else if((strncmp(cpt, "on", l)==0 && l >= 2) || mode[0]==0) allow_restore= 1; else if(strncmp(cpt, "concat_split_on", l)==0 && l >= 15) xorriso->do_concat_split= 1; else if(strncmp(cpt, "concat_split_off", l)==0 && l >= 16) xorriso->do_concat_split= 0; else if(strncmp(cpt, "auto_chmod_on", l)==0 && l >= 13) xorriso->do_auto_chmod= 1; else if(strncmp(cpt, "auto_chmod_off", l)==0 && l >= 14) xorriso->do_auto_chmod= 0; else if(strncmp(cpt, "sort_lba_on", l)==0 && l >= 11) xorriso->do_restore_sort_lba= 1; else if(strncmp(cpt, "sort_lba_off", l)==0 && l >= 12) xorriso->do_restore_sort_lba= 0; else if(strncmp(cpt, "o_excl_on", l)==0 && l >= 9) xorriso->drives_exclusive= 1; else if(strncmp(cpt, "o_excl_off", l)==0 && l >= 10) xorriso->drives_exclusive= 0; else if(strncmp(cpt, "strict_acl_on", l)==0 && l >= 13) xorriso->do_strict_acl|= 1; else if(strncmp(cpt, "strict_acl_off", l)==0 && l >= 14) xorriso->do_strict_acl&= ~1; else if(strncmp(cpt, "check_md5_on", l) == 0 && l >= 12) { xorriso->do_md5|= 1 << 6; xorriso->do_md5&= ~(2 << 6); } else if(strncmp(cpt, "check_md5_force", l)==0 && l >= 15) { xorriso->do_md5|= 3 << 6; } else if(strncmp(cpt, "check_md5_off", l)==0 && l >= 13) { xorriso->do_md5&= ~(3 << 6); } else if(strncmp(cpt, "sparse=", 7) == 0 && l >= 7) { if(strncmp(cpt + 7, "off", 3) == 0 && l == 10) { num= 0.0; } else { Xorriso__parse_size_param(cpt, 7, l, &num); if(num < 1.0) num= 0.0; if(num > 1.0 * 1024.0 * 1024.0 * 1024.0) { strcpy(xorriso->info_text, "osirrox sparse= too large (allowed: off, 1 to 1g)"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } xorriso->sparse_min_gap= num; } else { unknown_mode:; sprintf(xorriso->info_text, "-osirrox: unknown mode '%s'", cpt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } if(allow_restore > 0 && xorriso->allow_restore == -1) { sprintf(xorriso->info_text, "-osirrox: was already permanently disabled by setting 'banned'"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(allow_restore > 0 && xorriso->allow_restore == -2) { sprintf(xorriso->info_text, "-osirrox: is currently disabled by setting 'blocked'"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(xorriso->allow_restore != -1) xorriso->allow_restore= allow_restore; sprintf(xorriso->info_text, "Copying of file objects from ISO image to disk filesystem is: %s\n", xorriso->allow_restore > 0 ? "Enabled" : "Disabled"); Xorriso_info(xorriso, 0); return(1); } /* Option -overwrite "on"|"nondir"|"off" */ int Xorriso_option_overwrite(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off")==0) xorriso->do_overwrite= 0; else if(strcmp(mode, "on")==0) xorriso->do_overwrite= 1; else if(strcmp(mode, "nondir")==0) xorriso->do_overwrite= 2; else { sprintf(xorriso->info_text, "-overwrite: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } libisoburn-1.5.4/xorriso/cmp_update.c0000644000175700017510000010174213701321754014624 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2019 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of actions which compare or update files between disk filesystem and ISO filesystem. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include /* O_BINARY is needed for Cygwin but undefined elsewhere */ #ifndef O_BINARY #define O_BINARY 0 #endif #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" /* @param result Bitfield indicationg type of mismatch bit11= cannot open regular disk file bit12= cannot open iso file bit13= early eof of disk file bit14= early eof of iso file bit15= content bytes differ @param flag bit0= mtimes of both file objects are equal bit29= do not issue pacifier messages bit31= do not issue result messages @return >0 ok , <=0 error */ int Xorriso_compare_2_contents(struct XorrisO *xorriso, char *common_adr, char *disk_adr, off_t disk_size, off_t offset, off_t bytes, char *iso_adr, off_t iso_size, int *result, int flag) { int fd1= -1, ret, r1, r2, done, wanted, i, was_error= 0, use_md5= 0; void *stream2= NULL; off_t r1count= 0, r2count= 0, diffcount= 0, first_diff= -1; char *respt, *buf1= NULL, *buf2= NULL, offset_text[80]; char disk_md5[16], iso_md5[16]; void *ctx= NULL; int buf_size= 32 * 1024; double dcount; Xorriso_alloc_meM(buf1, char, buf_size); Xorriso_alloc_meM(buf2, char, buf_size); respt= xorriso->result_line; fd1= open(disk_adr, O_RDONLY | O_BINARY); if(fd1==-1) { sprintf(respt, "- %s (DISK) : cannot open() : %s\n", disk_adr, strerror(errno)); cannot_address:; if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); (*result)|= 2048; {ret= 0; goto ex;} } if(offset>0) if(lseek(fd1, offset, SEEK_SET)==-1) { sprintf(respt, "- %s (DISK) : cannot lseek(%.f) : %s\n", disk_adr, (double) offset, strerror(errno)); close(fd1); goto cannot_address; } if(xorriso->do_md5 & 16) { use_md5= 1; ret= Xorriso_is_plain_image_file(xorriso, NULL, iso_adr, 0); if(ret <= 0) ret= 0; /* (reverse) filtered files are likely not to match their MD5 */ else ret= Xorriso_get_md5(xorriso, NULL, iso_adr, iso_md5, 1); if(ret <= 0) use_md5= 0; else { ret= Xorriso_md5_start(xorriso, &ctx, 0); if(ret <= 0) use_md5= 0; } } if (! use_md5) { ret= Xorriso_iso_file_open(xorriso, iso_adr, NULL, &stream2, 0); if(ret<=0) { sprintf(respt, "- %s (ISO) : cannot open() file in ISO image\n",iso_adr); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); close(fd1); (*result)|= 4096; {ret= 0; goto ex;} } } done= 0; while(!done) { wanted= buf_size; if(r1count+offset+wanted>disk_size) wanted= disk_size-r1count-offset; if(r1count+wanted>bytes) wanted= bytes-r1count; r1= 0; while(wanted>0) { ret= read(fd1, buf1, wanted); if(ret<=0) break; wanted-= ret; r1+= ret; } wanted= buf_size; if(r2count+wanted>iso_size) wanted= iso_size-r2count; /* if(r2count+wanted>bytes) wanted= bytes-r2count; */ if(use_md5) r2= r1; else if(wanted>0) r2= Xorriso_iso_file_read(xorriso, stream2, buf2, wanted, 0); else r2= 0; if(r1<0 || r2<0) was_error= 1; if(r1<=0 && r2<=0) break; if(r1<=0) { if(r1<0) r1= 0; if(disk_size > r1count + r1 + offset) { sprintf(respt, "- %s (DISK) : early EOF after %.f bytes\n", disk_adr, (double) r1count); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); (*result)|= 8196; } (*result)|= (1<<15); } r1count+= r1; if(r2<=0 || r2 r2count + r2) { sprintf(respt, "- %s (ISO) : early EOF after %.f bytes\n", iso_adr, (double) r2count); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); (*result)|= (1<<14); } (*result)|= (1<<15); done= 1; } if(r2>r1) { if(disk_size > r1count + r1 + offset) { sprintf(respt, "- %s (DISK) : early EOF after %.f bytes\n", disk_adr, (double) r1count); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); (*result)|= 8196; } (*result)|= (1<<15); done= 1; } r2count+= r2; if(r1>r2) r1= r2; if(use_md5) { Xorriso_md5_compute(xorriso, ctx, buf1, r1, 0); } else { for(i= 0; ipacifier_count+= r1; xorriso->pacifier_byte_count+= r1; if(flag&(1u<<31)) Xorriso_pacifier_callback(xorriso, "content bytes read", xorriso->pacifier_count, 0, "", 8); else Xorriso_pacifier_callback(xorriso, "bytes", xorriso->pacifier_count, 0, "", 8 | 1<<6); } } if(use_md5) { ret= Xorriso_md5_end(xorriso, &ctx, disk_md5, 0); if(ret <= 0) { *result |= (1 << 15); ret= -1; goto ex; } for(i= 0; i < 16; i++) if(iso_md5[i] != disk_md5[i]) break; if(i < 16 ) { offset_text[0]= 0; if(offset>0) sprintf(offset_text, "%.f+", (double) offset); sprintf(respt, "%s %s : differs by MD5 sums.\n", common_adr, (flag&1 ? "CONTENT": "content")); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); (*result)|= (1<<15); } } else if(diffcount>0 || r1count!=r2count) { if(first_diff<0) first_diff= (r1count>r2count ? r2count : r1count); offset_text[0]= 0; if(offset>0) sprintf(offset_text, "%.f+", (double) offset); if(r1count > r2count) dcount= diffcount + (r1count - r2count); else dcount= diffcount + (r2count - r1count); sprintf(respt, "%s %s : differs by at least %.f bytes. First at %s%.f\n", common_adr, (flag&1 ? "CONTENT": "content"), dcount, offset_text, (double) first_diff); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); (*result)|= (1<<15); } if(fd1!=-1) close(fd1); if(! use_md5) Xorriso_iso_file_close(xorriso, &stream2, 0); if(was_error) {ret= -1; goto ex;} ret= 1; ex:; if(ctx != NULL) Xorriso_md5_end(xorriso, &ctx, disk_md5, 0); Xorriso_free_meM(buf1); Xorriso_free_meM(buf2); return(ret); } /* @param result Bitfield indicationg type of mismatch bit0= disk_adr not existing bit1= iso_adr not existing bit2= access permissions bit3= file type bit4= user id bit5= group id bit6= minor, major with device file bit7= size bit8= mtime bit9= atime bit10= ctime bit11= cannot open regular disk file bit12= cannot open iso file bit13= early eof of disk file bit14= early eof of iso file bit15= content bytes differ bit16= symbolic link on disk pointing to dir, dir in iso bit17= file chunks detected and compared bit18= incomplete chunk collection encountered bit19= ACL differs (this condition sets also bit2) bit20= xattr differ bit21= mismatch of recorded dev,inode bit22= no recorded dev,inode found in node bit23= timestamps younger than xorriso->isofs_st_in bit24= hardlink split bit25= hardlink fusion @param flag bit0= compare atime bit1= compare ctime bit2= check only existence of both file objects count one or both missing as "difference" bit26= do not issue message about missing disk file bit27= for Xorriso_path_is_excluded(): bit0 bit28= examine eventual disk_path link target rather than link bit29= do not issue pacifier messages bit30= omit adr_common_tail in report messages bit31= do not issue result messages @return 1=files match properly , 0=difference detected , -1=error */ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr, char *iso_adr, char *adr_common_tail, int *result, int flag) { struct stat s1, s2, stbuf; int ret, missing= 0, is_split= 0, i, was_error= 0, diff_count= 0; int content_shortcut= 0, mask; char *respt; char *a= NULL; char ttx1[40], ttx2[40]; char *a1_acl= NULL, *a2_acl= NULL, *d1_acl= NULL, *d2_acl= NULL; char *attrlist1= NULL, *attrlist2= NULL; struct SplitparT *split_parts= NULL; int split_count= 0; time_t stamp; char *part_path= NULL, *part_name; int partno, total_parts= 0; off_t offset, bytes, total_bytes; Xorriso_alloc_meM(a, char, 5*SfileadrL); Xorriso_alloc_meM(part_path, char, SfileadrL); *result= 0; respt= xorriso->result_line; if(!(xorriso->disk_excl_mode&8)) { ret= Xorriso_path_is_excluded(xorriso, disk_adr, 2 | !!(flag&(1<<27))); if(ret>0) { strcpy(respt, "? "); Text_shellsafe(disk_adr, respt, 1); sprintf(respt + strlen(respt), " (DISK) : excluded by %s\n", (ret==1 ? "-not_paths" : "-not_leaf")); if(! (flag & ((1u << 31) | (1 << 26)))) Xorriso_result(xorriso,0); missing= 1; (*result)|= 1; } } if(!missing) { if(flag&(1<<28)) ret= stat(disk_adr, &s1); else ret= lstat(disk_adr, &s1); if(ret==-1) { strcpy(respt, "? "); Text_shellsafe(disk_adr, respt, 1); sprintf(respt + strlen(respt), " (DISK) : cannot lstat() : %s\n", strerror(errno)); if(! (flag & ((1u << 31) | (1 << 26)))) Xorriso_result(xorriso,0); missing= 1; (*result)|= 1; } } if(missing) strcpy(a, "?"); else strcpy(a, Ftypetxt(s1.st_mode, 1)); strcat(a, " "); if(adr_common_tail[0]) Text_shellsafe(adr_common_tail, a, 1); else { Text_shellsafe(disk_adr, a+strlen(a), 0); strcat(a, " (DISK)"); /* strcat(a, "'.'"); */ } strcat(a, " :"); if(flag&(1<<30)) a[0]= 0; ret= Xorriso_iso_lstat(xorriso, iso_adr, &s2, 0); if(ret<0) { strcpy(respt, "? "); Text_shellsafe(iso_adr, respt, 1); strcat(respt, " (ISO) : cannot find this file in ISO image\n"); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); missing= 1; (*result)|= 2; } if((flag&4)||missing) {ret= !missing; goto ex;} /* Splitfile parts */ if((S_ISREG(s1.st_mode) || S_ISBLK(s1.st_mode)) && S_ISDIR(s2.st_mode)) { is_split= Xorriso_identify_split(xorriso, iso_adr, NULL, &split_parts, &split_count, &s2, 0); if(is_split>0) (*result)|= (1<<17); else is_split= 0; } /* Attributes */ if(s1.st_mode != s2.st_mode) { if((s1.st_mode&~S_IFMT)!=(s2.st_mode&~S_IFMT)) { sprintf(respt, "%s st_mode : %7.7o <> %7.7o\n", a, (unsigned int) (s1.st_mode & ~S_IFMT), (unsigned int) (s2.st_mode & ~S_IFMT)); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); (*result)|= 4; } if((s1.st_mode&S_IFMT)!=(s2.st_mode&S_IFMT)) { sprintf(respt, "%s type : %s <> %s\n", a, Ftypetxt(s1.st_mode, 0), Ftypetxt(s2.st_mode, 0)); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); (*result)|= 8; if((s1.st_mode&S_IFMT) == S_IFLNK) { /* check whether link target type matches */ ret= stat(disk_adr, &stbuf); if(ret!=-1) if(S_ISDIR(stbuf.st_mode) && S_ISDIR(s2.st_mode)) (*result)|= (1<<16); } } } /* ACL */ if(xorriso->do_aaip & 3) { Xorriso_local_getfacl(xorriso, disk_adr, &a1_acl, 16 | ((flag & (1 << 28)) >> 23)); if(S_ISDIR(s1.st_mode)) Xorriso_local_getfacl(xorriso, disk_adr, &d1_acl, 1); ret= Xorriso_getfacl(xorriso, NULL, iso_adr, &a2_acl, 1 | 4 | 16); if(ret < 0) goto ex; if(S_ISDIR(s1.st_mode)) { ret= Xorriso_getfacl(xorriso, NULL, iso_adr, &d2_acl, 1 | 8); if(ret < 0) goto ex; } ret= Compare_text_lines(a1_acl, a2_acl, &diff_count, 0); if(ret < 0) goto ex; if(ret == 0) (*result)|= 4 | (1 << 19); ret= Compare_text_lines(d1_acl, d2_acl, &diff_count, 1); if(ret < 0) goto ex; if(ret == 0) (*result)|= 4 | (1 << 19); if((*result) & (1 << 19)) { sprintf(respt, "%s ACL : %d difference%s\n", a, diff_count, diff_count == 1 ? "" : "s"); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); } } /* xattr */ if(xorriso->do_aaip & 12) { ret= Xorriso_getfattr(xorriso, NULL, disk_adr, &attrlist1, 1 | 2 | ((flag & (1 << 28)) >> 23)); if(ret < 0) goto ex; ret= Xorriso_getfattr(xorriso, NULL, iso_adr, &attrlist2, 1); if(ret < 0) goto ex; ret= Compare_text_lines(attrlist1, attrlist2, &diff_count, 0); if(ret < 0) goto ex; if(ret == 0) { (*result)|= (1 << 20); sprintf(respt, "%s xattr : %d difference%s\n", a, diff_count, diff_count == 1 ? "" : "s"); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); } } if(s1.st_uid != s2.st_uid) { sprintf(respt, "%s st_uid : %lu <> %lu\n", a, (unsigned long) s1.st_uid, (unsigned long) s2.st_uid); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); (*result)|= 16; } if(s1.st_gid != s2.st_gid) { sprintf(respt, "%s st_gid : %lu <> %lu\n", a, (unsigned long) s1.st_gid, (unsigned long) s2.st_gid); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); (*result)|= 32; } if((S_ISCHR(s1.st_mode) && S_ISCHR(s2.st_mode)) || (S_ISBLK(s1.st_mode) && S_ISBLK(s2.st_mode))) { if(s1.st_rdev != s2.st_rdev) { sprintf(respt, "%s %s st_rdev : %lu <> %lu\n", a, (S_ISCHR(s1.st_mode) ? "S_IFCHR" : "S_IFBLK"), (unsigned long) s1.st_rdev, (unsigned long) s1.st_rdev); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); (*result)|= 64; } } if((!(xorriso->do_aaip & 32)) && S_ISREG(s2.st_mode) && s1.st_size != s2.st_size) { sprintf(respt, "%s st_size : %.f <> %.f diff= %.f\n", a, (double) s1.st_size, (double) s2.st_size, ((double) s1.st_size) - (double) s2.st_size); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); (*result)|= 128; } if(s1.st_mtime != s2.st_mtime) { sprintf(respt, "%s st_mtime : %s <> %s diff= %.f s\n", a, Ftimetxt(s1.st_mtime, ttx1, 0), Ftimetxt(s2.st_mtime, ttx2, 0), ((double) s1.st_mtime) - (double) s2.st_mtime); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); (*result)|= 256; } if(flag&1) { if(s1.st_atime != s2.st_atime) { sprintf(respt, "%s st_atime : %s <> %s diff= %.f s\n", a, Ftimetxt(s1.st_atime, ttx1, 0), Ftimetxt(s2.st_atime, ttx2, 0), ((double) s1.st_atime) - (double) s2.st_atime); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); (*result)|= 512; } } if(flag&2) { if(s1.st_ctime != s2.st_ctime) { sprintf(respt, "%s st_ctime : %s <> %s diff= %.f s\n", a, Ftimetxt(s1.st_ctime, ttx1, 0), Ftimetxt(s2.st_ctime, ttx2, 0), ((double) s1.st_ctime) - (double) s2.st_ctime); if(!(flag&(1u<<31))) Xorriso_result(xorriso,0); (*result)|= 1024; } } if(xorriso->isofs_st_in > 0 && (xorriso->isofs_st_in <= s2.st_mtime || ((flag & 1) && xorriso->isofs_st_in <= s2.st_atime) || ((flag & 2) && xorriso->isofs_st_in <= s2.st_ctime))) (*result)|= 1 << 23; if((xorriso->do_aaip & 32) || !(xorriso->ino_behavior & 2)) { /* dev,inode comparison. For skipping content comparison or for hardlink detection. */ ret= Xorriso_record_dev_inode(xorriso, "", s1.st_dev, s1.st_ino, NULL, iso_adr, 1 | 2 | ((flag & (1 << 28)) >> 23) | (xorriso->do_aaip & 128)); if(ret < 0) { ret= -1; goto ex; } else if(ret == 0) { /* match */ if((xorriso->do_aaip & 64) && S_ISREG(s1.st_mode) && S_ISREG(s2.st_mode)){ if(xorriso->do_aaip & 32) content_shortcut= 1; if((*result) & (8 | 128 | 256 | 512 | 1024 | (1 << 23))) { (*result)|= (1 << 15); /* content bytes differ */ if(((*result) & (1 << 23)) && !((*result) & (8 | 128 | 256 | 512 | 1024))) { sprintf(respt, "%s content : node timestamp younger than image timestamp\n", a); if((xorriso->do_aaip & 32) && !(flag&(1u<<31))) Xorriso_result(xorriso,0); stamp= s2.st_mtime; if((flag & 1) && s2.st_atime >= stamp) stamp= s2.st_atime; if((flag & 2) && s2.st_ctime >= stamp) stamp= s2.st_ctime; sprintf(respt, "%s content : %s > %s diff= %.f s\n", a, Ftimetxt(stamp, ttx1, 3 << 1), Ftimetxt(xorriso->isofs_st_in, ttx2, 3 << 1), ((double) stamp) - (double) xorriso->isofs_st_in); if((xorriso->do_aaip & 32) && !(flag&(1u<<31))) Xorriso_result(xorriso,0); } sprintf(respt, "%s content : assuming inequality due to size or timestamps\n", a); if((xorriso->do_aaip & 32) && !(flag&(1u<<31))) Xorriso_result(xorriso,0); } } } else if(ret == 1) { /* mismatch */ (*result)|= (1 << 21); sprintf(respt, "%s dev_ino : differing\n", a); if((xorriso->do_aaip & 32) && !(flag&(1u<<31))) Xorriso_result(xorriso,0); if((xorriso->do_aaip & 64) && S_ISREG(s1.st_mode) && S_ISREG(s2.st_mode)){ if(xorriso->do_aaip & 32) content_shortcut= 1; (*result)|= (1 << 15); /* content bytes differ */ sprintf(respt, "%s content : assuming inequality after dev_ino mismatch\n", a); if((xorriso->do_aaip & 32) && !(flag&(1u<<31))) Xorriso_result(xorriso,0); } } else { sprintf(respt, "%s dev_ino : no dev_ino stored with image node\n", a); if((xorriso->do_aaip & 32) && !(flag&(1u<<31))) Xorriso_result(xorriso,0); (*result)|= (1 << 22); } } if(S_ISREG(s1.st_mode) && S_ISREG(s2.st_mode) && !content_shortcut) { /* Content */ if(is_split) { for(i= 0; i0 && split_count!=total_parts) { sprintf(xorriso->info_text, "- %s/* (ISO) : Not all split parts present (%d of %d)\n", iso_adr, split_count, total_parts); if(!(flag&(1u<<31))) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 1); (*result)|= 1<<18; } } else { ret= Xorriso_compare_2_contents(xorriso, a, disk_adr, s1.st_size, (off_t) 0, s1.st_size, iso_adr, s2.st_size, result, (s1.st_mtime==s2.st_mtime) | (flag&((1<<29)|(1u<<31)))); if(ret<0) was_error= 1; } } if(was_error) ret= -1; else { mask= ~((1 << 17) | (1 << 18) | (1 << 22) | (1 << 23)); if(xorriso->do_aaip & 32) mask|= 1 << 22; ret= (((*result) & mask)==0); } ex:; if(split_parts!=NULL) Splitparts_destroy(&split_parts, split_count, 0); Xorriso_local_getfacl(xorriso, disk_adr, &a1_acl, 1 << 15); Xorriso_local_getfacl(xorriso, disk_adr, &d1_acl, 1 << 15); if(a2_acl != NULL) free(a2_acl); if(d2_acl != NULL) free(d2_acl); if(attrlist1 != NULL) free(attrlist1); if(attrlist2 != NULL) free(attrlist2); Xorriso_free_meM(part_path); Xorriso_free_meM(a); return(ret); } int Xorriso_pfx_disk_path(struct XorrisO *xorriso, char *iso_path, char *iso_prefix, char *disk_prefix, char disk_path[SfileadrL], int flag) { int ret; char *adrc= NULL; Xorriso_alloc_meM(adrc, char, SfileadrL); if(strncmp(iso_path, iso_prefix, strlen(iso_prefix))!=0) {ret= -1; goto ex;} if(strlen(disk_prefix) + strlen(iso_path) - strlen(iso_prefix)+1 >= SfileadrL) {ret= -1; goto ex;} if(iso_path[strlen(iso_prefix)] == '/') strcpy(adrc, iso_path + strlen(iso_prefix) + 1); else strcpy(adrc, iso_path + strlen(iso_prefix)); ret= Xorriso_make_abs_adr(xorriso, disk_prefix, adrc, disk_path, 4 | 8); if(ret <= 0) goto ex; ret= 1; ex:; Xorriso_free_meM(adrc); return(ret); } /* @param boss_iter Opaque handle to be forwarded to actions in ISO image Set to NULL if calling this function from outside ISO world @param flag bit0= update rather than compare bit1= find[ix] is in recursion bit2= update_merge : do not delete but mark visited and found @return <=0 error, 1= ok , 2= iso_path was deleted 3=ok, do not dive into directory (e.g. because it is a split file) */ int Xorriso_find_compare(struct XorrisO *xorriso, void *boss_iter, void *node, char *iso_path, char *iso_prefix, char *disk_prefix, int flag) { int ret, result, uret, follow_links, deleted= 0; char *disk_path= NULL; Xorriso_alloc_meM(disk_path, char, SfileadrL); ret= Xorriso_pfx_disk_path(xorriso, iso_path, iso_prefix, disk_prefix, disk_path, 0); if(ret <= 0) goto ex; /* compare exclusions against disk_path resp. leaf name */ if(xorriso->disk_excl_mode&8) ret= Xorriso_path_is_excluded(xorriso, disk_path, !(flag&2)); else ret= 0; if(ret<0) goto ex; if(ret>0) {ret= 3; goto ex;} follow_links= (xorriso->do_follow_links || (xorriso->do_follow_param && !(flag&2))) <<28; ret= Xorriso_compare_2_files(xorriso, disk_path, iso_path, "", &result, 2 | follow_links | ((!!(flag & 4)) << 26) | ((!(flag&2))<<27) | (((unsigned)(flag&1))<<31)); /* was once: | ((!(flag&1))<<29) */ if(retfind_compare_result) xorriso->find_compare_result= ret; if(flag&1) { if(ret<0) if(Xorriso_eval_problem_status(xorriso, ret, 1|2)<0) goto ex; if(ret > 0) result= 0; uret= Xorriso_update_interpreter(xorriso, boss_iter, node, result, disk_path, iso_path, ((flag & 2) << 1) | ((flag & 4) >> 1)); if(uret<=0) ret= 0; if(uret==2) deleted= 1; } if(ret<0) goto ex; if(deleted) {ret= 2; goto ex;} if(result&(1<<17)) {ret= 3; goto ex;} ex:; Xorriso_free_meM(disk_path); return(ret); } /* @param boss_iter Opaque handle to be forwarded to actions in ISO image Set to NULL if calling this function from outside ISO world @param flag bit0= widen hardlink sibling: Do not call Xorriso_hardlink_update() Overwrite exactly if normal mode would not, else do nothing bit1= do not delete files which are not found under disk_path, but rather mark visited files and mark files which were found. bit2= -follow: this is not a command parameter @return <=0 error, 1= ok , 2= iso_rr_path node object has been deleted , 3= no action taken */ int Xorriso_update_interpreter(struct XorrisO *xorriso, void *boss_iter, void *node, int compare_result, char *disk_path, char *iso_rr_path, int flag) { int ret= 1, deleted= 0, is_split= 0, i, loop_count, late_hardlink_update= 0; struct stat stbuf; struct SplitparT *split_parts= NULL; int split_count= 0; char *part_path= NULL, *part_name; int partno, total_parts, new_total_parts, added_overwrote= 0; off_t offset, bytes, total_bytes, disk_size, first_bytes, du_size; if((compare_result&3)==3) { sprintf(xorriso->info_text, "Missing on disk and in ISO: disk_path "); Text_shellsafe(disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 1); xorriso->find_compare_result= -1; ret= 3; goto ex; } Xorriso_alloc_meM(part_path, char, SfileadrL); if((flag & 2) && !(compare_result & 2)) { ret= Xorriso_mark_update_merge(xorriso, iso_rr_path, node, !(compare_result & 1)); if(ret <= 0) goto ex; } if(compare_result == 0) {ret= 1; goto ex;} if(compare_result&((1<<11)|(1<<13))) { if(flag & 1) {ret= 3; goto ex;} /* cannot open regular disk file, early eof of disk file */ sprintf(xorriso->info_text, "Problems with reading disk file "); Text_shellsafe(disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 1); xorriso->find_compare_result= -1; ret= 1; goto ex; } xorriso->info_text[0]= 0; is_split= !!(compare_result & (1<<17)); if((!(xorriso->ino_behavior & 2)) && (compare_result & (2 | (3 << 21))) && !(flag & 1)) { if(compare_result & 2) { /* File is not yet in image */ late_hardlink_update= 1; } else { /* Hard link relation has changed resp. was not recorded. */ ret= Xorriso_hardlink_update(xorriso, &compare_result, disk_path, iso_rr_path, (flag & 4) | ((compare_result >> 21) & 2)); if(ret < 0) goto ex; if(ret == 2) {ret= 1; goto ex;} } } if(compare_result&(8|64)) { /* file type, minor+major with device file */ if(flag & 1) {ret= 3; goto ex;} ret= Xorriso_rmi(xorriso, boss_iter, (off_t) 0, iso_rr_path, 1); /* rm_r */ if(ret>0) { deleted= 1; ret= Xorriso_graft_in(xorriso, boss_iter, disk_path, iso_rr_path, (off_t) 0, (off_t) 0, 2|(flag&4)); if(ret <= 0) goto ex; if(flag & 2) { ret= Xorriso_mark_update_merge(xorriso, iso_rr_path, NULL, 1); if(ret <= 0) goto ex; } } sprintf(xorriso->info_text, "Deleted and re-added "); } else if(compare_result&(1)) { delete:; /* disk_adr not existing */ if(!(flag & 2)) { ret= Xorriso_rmi(xorriso, boss_iter, (off_t) 0, iso_rr_path, 1); deleted= 1; sprintf(xorriso->info_text, "Deleted "); } } else if(compare_result&(2|128|(1<<12)|(1<<14)|(1<<15))) { /* iso_adr not existing, size, cannot open iso file, early eof of iso file content bytes differ */ if(flag & 1) {ret= 3; goto ex;} overwrite:; if(is_split) { ret= Xorriso_identify_split(xorriso, iso_rr_path, NULL, &split_parts, &split_count, &stbuf, 0); if(ret<=0) {ret= -1; goto ex;} /* (should not happen) */ ret= lstat(disk_path, &stbuf); if(ret==-1) goto delete; disk_size= stbuf.st_size; Splitparts_get(split_parts, 0, &part_name, &partno, &total_parts, &offset, &first_bytes, &total_bytes, 0); new_total_parts= disk_size/first_bytes; if(disk_size % first_bytes) new_total_parts++; loop_count= split_count; /* If disk file grew over part limit and all parts are present: add new parts */ if(new_total_parts > total_parts && split_count == total_parts) loop_count= new_total_parts; for(i= 0; iSfileadrL) { Xorriso_much_too_long(xorriso, strlen(part_path)+160, 2); ret= 0; goto ex; } Splitpart__compose(part_path+strlen(iso_rr_path)+1, partno, new_total_parts, offset, first_bytes, disk_size, 0); ret= Xorriso_graft_in(xorriso, boss_iter, disk_path, part_path, offset, bytes, 2|(flag&4)|8|128); if(ret<=0) goto ex; } /* Copy file attributes to iso_rr_path, augment r-perms by x-perms */ ret= Xorriso_copy_properties(xorriso, disk_path, iso_rr_path, 2 | 4); if(ret<=0) goto ex; } else { ret= Xorriso_graft_in(xorriso, boss_iter, disk_path, iso_rr_path, (off_t) 0, (off_t) 0, 2|(flag&4)); if(ret>0 && !(compare_result&2)) deleted= 1; } if(late_hardlink_update) { /* Handle eventual hardlink siblings of newly created file */ ret= Xorriso_hardlink_update(xorriso, &compare_result, disk_path, iso_rr_path, 1 | (flag & 4)); if(ret < 0) goto ex; } if(flag & 2) { ret= Xorriso_mark_update_merge(xorriso, iso_rr_path, NULL, 1); if(ret <= 0) goto ex; } if(flag & 1) { sprintf(xorriso->info_text, "Widened hard link "); } else { sprintf(xorriso->info_text, "Added/overwrote "); added_overwrote= 1; } } else if(compare_result&(4|16|32|256|512|1024|(1<<19)|(1<<20)|(1<<22))) { /* access permissions, user id, group id, mtime, atime, ctime, ACL, xattr, dev_ino missing */ if(flag & 1) goto overwrite; if(is_split) { ret= Xorriso_identify_split(xorriso, iso_rr_path, NULL, &split_parts, &split_count, &stbuf, 0); if(ret<=0) {ret= -1; goto ex;} /* (should not happen) */ for(i= 0; iinfo_text, "Adjusted attributes of "); } else if(flag & 1) { goto overwrite; } else ret= 1; if(ret>0 && xorriso->info_text[0]) { Text_shellsafe(iso_rr_path, xorriso->info_text, 1); if(added_overwrote) { ret= Xorriso_iso_lstat(xorriso, iso_rr_path, &stbuf, 0); if(ret == 0 && S_ISREG(stbuf.st_mode)) { strcat(xorriso->info_text, " ("); Sfile_scale((double) stbuf.st_size, xorriso->info_text + strlen(xorriso->info_text), 5, 1e4, 1 | 2); strcat(xorriso->info_text, ")"); } else if (ret == 0 && S_ISDIR(stbuf.st_mode)) { ret= Xorriso_get_dus(xorriso, iso_rr_path, &du_size, (off_t) 0, 0); if(ret > 0 && du_size > 0) { strcat(xorriso->info_text, " ("); Sfile_scale((double) du_size, xorriso->info_text + strlen(xorriso->info_text), 5, 1e4, 1 | 2); strcat(xorriso->info_text, ")"); } } } Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0); } ret= 1; ex:; if(split_parts!=NULL) Splitparts_destroy(&split_parts, split_count, 0); Xorriso_free_meM(part_path); if(ret<=0) return(ret); if(deleted) return(2); return(ret); } libisoburn-1.5.4/xorriso/findjob.c0000644000175700017510000006630213701321754014120 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2016 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of classes FindjoB, ExprnodE, ExprtesT which perform tree searches in libisofs or in POSIX filesystem */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" /* ----------------------- Exprtest ----------------------- */ int Exprtest_new( struct ExprtesT **ftest, struct FindjoB *boss, int flag) { struct ExprtesT *f; *ftest= f= TSOB_FELD(struct ExprtesT,1); if(f==NULL) return(-1); f->boss= boss; f->invert= 0; f->test_type= -1; f->arg1= NULL; f->arg2= NULL; return(1); } int Exprtest_destroy(struct ExprtesT **ftest, int flag) { struct ExprtesT *f; f= *ftest; if(f==NULL) return(0); if(f->test_type == 1 || f->test_type == 13 || f->test_type == 16) { if(f->arg1 != NULL) free(f->arg1); if(f->arg2 != NULL) { regfree(f->arg2); free(f->arg2); } } else if(f->test_type == 9) { /* arg1 is not an allocated value */; } else { if(f->arg1 != NULL) free(f->arg1); if(f->arg2 != NULL) free(f->arg2); } free((char *) f); *ftest= NULL; return(1); } /* ----------------------- Nttpfnode ----------------------- */ int Exprnode_new(struct ExprnodE **fnode, struct FindjoB *job, struct ExprnodE *up, char *origin, int flag) /* bit0= set invert-property bit1= set use_shortcuts */ { struct ExprnodE *n; int ret,i; *fnode= n= TSOB_FELD(struct ExprnodE,1); if(n == NULL) return(-1); for(i= 0; i < (int) sizeof(n->origin); i++) n->origin[i]= 0; strncpy(n->origin, origin, sizeof(n->origin) - 1); n->up= up; n->invert= (flag & 1); n->assoc= 0; n->use_shortcuts= !!(flag & 2); n->left= NULL; n->left_op= -1; n->right= NULL; n->right_op= -1; n->sub= NULL; n->is_if_then_else= 0; n->true_branch= NULL; n->false_branch= NULL; n->test= NULL; n->own_value= -1; n->composed_value= -1; ret= Exprtest_new(&(n->test), job, 0); if(ret<=0){ Exprnode_destroy(fnode, 0); return(-1); } return(1); } int Exprnode_destroy(struct ExprnodE **fnode, int flag) { if(*fnode == NULL) return(0); Exprnode_destroy(&((*fnode)->right),0); Exprnode_destroy(&((*fnode)->sub),0); Exprnode_destroy(&((*fnode)->true_branch),0); Exprnode_destroy(&((*fnode)->false_branch),0); Exprtest_destroy(&((*fnode)->test),0); free((char *) *fnode); *fnode= NULL; return(1); } int Exprnode_set_is_if(struct ExprnodE *fnode, int value, int flag) { fnode->is_if_then_else= value; return(1); } int Exprnode_is_if(struct ExprnodE *fnode, int flag) { return(fnode->is_if_then_else); } int Exprnode_set_branch(struct ExprnodE *fnode, struct ExprnodE *target, int flag) /* bit0= false_branch (else true_branch) */ { struct ExprnodE **branch; if(flag&1) branch= &(fnode->false_branch); else branch= &(fnode->true_branch); Exprnode_destroy(branch,0); (*branch)= target; return(1); } int Exprnode_get_branch(struct ExprnodE *fnode, struct ExprnodE **branch, int flag) /* bit0= false_branch (else true_branch) */ { if(flag&1) (*branch)= fnode->false_branch; else (*branch)= fnode->true_branch; return(1); } int Exprnode_is_defined(struct ExprnodE *fnode, int flag) { struct ExprtesT *ftest; if(fnode==NULL) return(0); if(fnode->sub!=NULL) return(1); ftest= fnode->test; if(ftest==NULL) return(0); if(ftest->test_type>=0) return(1); return(0); } int Exprnode_own_value(struct XorrisO *xorriso, struct ExprnodE *fnode, void *node, char *name, char *path, struct stat *boss_stbuf, struct stat *stbuf, int flag) /* flag: return: (also from Exprtest_match() and Exprnode_tree_value() ) <0 = error 0 = does not match 1 = does match 2 = immediate decision : does not match 3 = immediate decision : does match */ { int ret; if(fnode==NULL) return(1); if(fnode->sub!=NULL) { ret= Exprnode_tree_value(xorriso, fnode->sub, -1, node, name, path, boss_stbuf, stbuf, 0); } else { ret= Exprtest_match(xorriso, fnode->test, node, name, path, boss_stbuf, stbuf, 0); } if(ret<0) return(ret); if(ret>1) return(ret); if(fnode->invert) ret= !ret; return(ret); } int Exprnode_op(int value1, int value2, int op, int flag) { int ret; if(op==0) ret= value1 || value2 ; else ret= value1 && value2 ; return(ret); } int Exprnode_tree_value(struct XorrisO *xorriso, struct ExprnodE *fnode, int left_value, void *node, char *name, char *path, struct stat *boss_stbuf, struct stat *stbuf, int flag) /* bit0-7= testmode: 0=head , 1=filename return: (also from Nntpftest_match() and Nntpfnode_own_value() ) <0 = error 0 = does not match 1 = does match 2 = immediate decision : does not match 3 = immediate decision : does match */ { int value= 1,ret; if(fnode==NULL) return(1); if(!Exprnode_is_defined(fnode,0)) return(1); if(fnode->use_shortcuts && fnode->left!=NULL){ fnode->composed_value= left_value; if(fnode->left_op==0) {/* OR */ if(left_value!=0) goto ex; } else { /* AND */ if(left_value==0) goto ex; } } fnode->composed_value= fnode->own_value= Exprnode_own_value(xorriso, fnode, node, name, path, boss_stbuf, stbuf, 0); if(fnode->own_value < 0 || fnode->own_value > 1) return(fnode->own_value); if(fnode->assoc == 0){ /* left associative */ if(fnode->left != NULL && left_value >= 0) fnode->composed_value= Exprnode_op(left_value, fnode->own_value, fnode->left_op, 0); /* compute right value */ /* is the right value relevant ? */ if(fnode->right!=NULL){ if(fnode->use_shortcuts){ if(fnode->right_op==0) {/* OR */ if(fnode->composed_value!=0) goto ex; } else { /* AND */ if(fnode->composed_value==0) goto ex; } } value= Exprnode_tree_value(xorriso, fnode->right,fnode->composed_value, node, name, path, boss_stbuf, stbuf, 0); if(value<0 || value>1) return(value); fnode->composed_value= value; } }else{ /* right associative */ if(fnode->right!=NULL){ /* is the right value relevant ? */ if(fnode->use_shortcuts){ if(fnode->right_op==0) {/* OR */ if(fnode->composed_value!=0) goto ex; } else { /* AND */ if(fnode->composed_value==0) goto ex; } } value= Exprnode_tree_value(xorriso, fnode->right,fnode->own_value, node, name, path, boss_stbuf, stbuf, 0); if(value<0||value>1) return(value); } else value= fnode->own_value; fnode->composed_value= value; if(fnode->left!=NULL && left_value>=0) fnode->composed_value= Exprnode_op(left_value,fnode->composed_value,fnode->left_op,0); } ex: ret= fnode->composed_value; if(fnode->is_if_then_else) { /* The if-condition is evaluated. Now follow the chosen branch */ struct ExprnodE *branch; if(ret>0) branch= fnode->true_branch; else branch= fnode->false_branch; if(branch!=NULL) { ret= Exprnode_tree_value(xorriso, branch, -1, node, name, path, boss_stbuf, stbuf, 0); if(ret<0) return(ret); if(ret>1) return(ret); } fnode->composed_value= ret; } return(fnode->composed_value); } /* --------------------- Findjob -------------------- */ int Findjob_new(struct FindjoB **o, char *start_path, int flag) { struct FindjoB *m; int ret; m= *o= TSOB_FELD(struct FindjoB,1); if(m==NULL) return(-1); m->start_path= NULL; m->test_tree= NULL; m->cursor= NULL; m->invert= 0; m->use_shortcuts= 1; m->action= 0; /* print */ m->prune= 0; m->use_pattern= 1; m->target= NULL; /* a mere pointer, not managed memory */ m->text_2= NULL; /* a mere pointer, not managed memory */ m->user= 0; m->group= 0; m->type= 0; m->date= 0; m->start_path= strdup(start_path); if(m->start_path==NULL) goto failed; m->found_path= NULL; m->estim_upper_size= 0; m->estim_lower_size= 0; m->subjob= NULL; m->errmsg[0]= 0; m->errn= 0; m->match_count= 0; m->depth= 0; ret= Exprnode_new(&(m->test_tree), m, NULL, "-find", (m->use_shortcuts)<<1); if(ret<=0) goto failed; m->cursor= m->test_tree; return(1); failed:; Findjob_destroy(o, 0); return(-1); } int Findjob_destroy(struct FindjoB **o, int flag) { struct FindjoB *m; m= *o; if(m==NULL) return(0); if(m->test_tree != NULL) Exprnode_destroy(&(m->test_tree), 0); if(m->start_path != NULL) free(m->start_path); if(m->found_path != NULL) free(m->found_path); free((char *) *o); *o= NULL; return(1); } int Findjob_set_start_path(struct FindjoB *o, char *start_path, int flag) { if(o->start_path!=NULL) free(o->start_path); if(start_path!=NULL) { o->start_path= strdup(start_path); if(o->start_path==NULL) return(-1); } else o->start_path= NULL; return(1); } int Findjob_get_start_path(struct FindjoB *o, char **start_path, int flag) { *start_path= o->start_path; return(1); } int Findjob_cursor_complete( struct FindjoB *job, int flag) { int ret; if(job==NULL) return(0); ret= Exprnode_is_defined(job->cursor,0); return(ret); } int Findjob_is_restrictive(struct FindjoB *job, int flag) { if(job == NULL) return(0); if(job->test_tree == NULL) return(0); if(!Exprnode_is_defined(job->test_tree, 0)) return(0); return(1); } int Findjob_new_node(struct FindjoB *job, struct ExprnodE **fnode, char *origin, int flag) /* bit0= open new branch bit1= with bit0 : do not register as sub-node of job->cursor */ { int ret; struct ExprnodE *f; ret= Exprnode_new(fnode,job,NULL,origin, job->invert|((job->use_shortcuts)<<1)); if(ret<=0) return(ret); f= *fnode; if(flag&1) { f->up= job->cursor; if(job->cursor!=NULL && !(flag&2)) { if(job->cursor->sub!=NULL) { /* This would become a memory leak */ job->errn= -2; sprintf(job->errmsg, "Program error while parsing -job : sub branch overwrite"); Exprnode_destroy(fnode, 0); return(0); } else job->cursor->sub= f; } } else { if(job->cursor != NULL) f->up= job->cursor->up; f->left= job->cursor; if(job->cursor!=NULL) job->cursor->right= f; } job->invert= 0; return(1); } /* If an operator is expected : use -and @param flag bit0= prepare for a pseudo-test: if an operator is expected, do nothing and return 2 bit1= use -or rather than -and */ int Findjob_default_and(struct FindjoB *o, int flag) { int ret; if(Findjob_cursor_complete(o, 0)) { if(flag & 1) return(2); if(flag & 2) { ret= Findjob_or(o, 0); } else { ret= Findjob_and(o, 0); } if(ret <= 0) return(ret); } return(1); } int Findjob_open_bracket(struct FindjoB *job, int flag) { int ret; struct ExprnodE *fnode; ret= Findjob_default_and(job, 0); if(ret <= 0) return(ret); ret= Findjob_new_node(job, &fnode, "-sub", 1); if(ret <= 0) return(ret); job->cursor= fnode; return(1); } int Findjob_close_bracket(struct FindjoB *job, int flag) { if(!Findjob_cursor_complete(job, 0)) { job->errn= -3; sprintf(job->errmsg, "Unary operator or expression expected, closing-bracket found"); return(0); } if(job->cursor->up==NULL){ job->errn= -1; sprintf(job->errmsg, "No bracket open when encountering closing bracket."); return(0); } job->cursor= job->cursor->up; return(1); } int Findjob_not(struct FindjoB *job, int flag) { int ret; ret= Findjob_default_and(job, 0); if(ret <= 0) return(ret); job->cursor->invert= !job->cursor->invert; return(1); } int Findjob_and(struct FindjoB *job, int flag) { int ret; struct ExprnodE *fnode; if(!Findjob_cursor_complete(job, 0)) { job->errn= -3; sprintf(job->errmsg, "Unary operator or expression expected, binary operator found"); return(0); } ret= Findjob_new_node(job, &fnode, "-and", 0); if(ret<=0) return(ret); job->cursor->right_op= 1; job->cursor->assoc= 1; /* compute right side first */ fnode->left_op= 1; fnode->assoc= 0; /* compute left side first */ job->cursor= fnode; return(1); } int Findjob_or(struct FindjoB *job, int flag) { int ret; struct ExprnodE *fnode; if(!Findjob_cursor_complete(job, 0)) { job->errn= -3; sprintf(job->errmsg, "Unary operator or expression expected, binary operator found"); return(0); } ret= Findjob_new_node(job, &fnode, "-or", 0); if(ret<=0) return(ret); job->cursor->right= fnode; job->cursor->right_op= 0; /* if existing : compute left side first */ job->cursor->assoc= (job->cursor->left == NULL); fnode->left= job->cursor; fnode->left_op= 0; fnode->assoc= 0; /* no right side yet : compute left side first */ job->cursor= fnode; return(1); } int Findjob_if(struct FindjoB *job, int flag) { int ret; struct ExprnodE *fnode; ret= Findjob_default_and(job, 0); if(ret <= 0) return(ret); ret= Findjob_new_node(job, &fnode, "-if", 1); if(ret<=0) return(ret); Exprnode_set_is_if(fnode,1,0); job->cursor= fnode; return(1); } int Findjob_then(struct FindjoB *job, int flag) { int ret; struct ExprnodE *fnode,*branch= NULL; if(! Findjob_cursor_complete(job,0)) { job->errn= -3; sprintf(job->errmsg, "Unary operator or expression expected, -then-operator found"); return(0); } /* Finding the -if that matches this -then Do not go up one node but look for the leftmost one. If everything is right we are at level of the -if node */ while(job->cursor->left!=NULL) job->cursor= job->cursor->left; Exprnode_get_branch(job->cursor, &branch, 0); if(!Exprnode_is_if(job->cursor, 0) || branch != NULL) { job->errn= -5; sprintf(job->errmsg, "-then-operator found outside its proper range."); return(0); } ret= Findjob_new_node(job, &fnode, "-then", 1|2); if(ret <= 0) return(ret); Exprnode_set_branch(job->cursor, fnode, 0); job->cursor= fnode; return(1); } int Findjob_else(struct FindjoB *job, int flag) { int ret; struct ExprnodE *fnode, *true_branch, *false_branch; if(! Findjob_cursor_complete(job, 0)) { job->errn= -3; sprintf(job->errmsg, "Unary operator or expression expected, -else-operator found"); return(0); } if(job->cursor->up == NULL) goto improper_range; job->cursor= job->cursor->up; Exprnode_get_branch(job->cursor, &true_branch, 0); Exprnode_get_branch(job->cursor, &false_branch, 1); if(!Exprnode_is_if(job->cursor, 0) || true_branch == NULL || false_branch != NULL) { improper_range:; job->errn= -5; sprintf(job->errmsg, "-else-operator found outside its proper range."); return(0); } ret= Findjob_new_node(job, &fnode, "-else", 1 | 2); if(ret <= 0) return(ret); Exprnode_set_branch(job->cursor, fnode, 1); job->cursor= fnode; return(1); } int Findjob_elseif(struct FindjoB *job, int flag) { int ret; struct ExprnodE *true_branch, *false_branch; if(!Findjob_cursor_complete(job, 0)) { job->errn= -3; sprintf(job->errmsg, "Unary operator or expression expected, -elseif-operator found"); return(0); } if(job->cursor->up == NULL) goto improper_range; job->cursor= job->cursor->up; Exprnode_get_branch(job->cursor, &true_branch, 0); Exprnode_get_branch(job->cursor, &false_branch, 1); if(!Exprnode_is_if(job->cursor, 0) || true_branch==NULL || false_branch!=NULL) { improper_range:; job->errn= -5; sprintf(job->errmsg, "-elseif-operator found outside its proper range."); return(0); } job->cursor= job->cursor->up; /* -elseif is equivalent to the three-step sequence : -endif -or -if ( -endif has already been performed by following job->cursor->up ) */ ret= Findjob_or(job, 0); if(ret <= 0) return(0); ret= Findjob_if(job, 0); if(ret <= 0) return(0); return(1); } int Findjob_endif(struct FindjoB *job, int flag) { struct ExprnodE *true_branch; if(!Findjob_cursor_complete(job,0)) { job->errn= -3; sprintf(job->errmsg, "Unary operator or expression expected, -endif found"); return(0); } if(job->cursor->up==NULL) goto improper_range; /* test whether parent node is -if */ job->cursor= job->cursor->up; Exprnode_get_branch(job->cursor, &true_branch, 0); if(!Exprnode_is_if(job->cursor,0) || true_branch == NULL) { improper_range:; job->errn= -5; sprintf(job->errmsg, "-endif-mark found outside its proper range."); return(0); } /* go to grand parent node */ job->cursor= job->cursor->up; return(1); } /* @param flag bit0-1: 0= -name , 1= -wholename , 2= -disk_name , 3= -disk_path */ int Findjob_set_name_expr(struct FindjoB *o, char *name_expr, int flag) { char *regexpr= NULL; regex_t *name_re; struct ExprtesT *t; int ret; regexpr= TSOB_FELD(char, 2*SfileadrL+2); if(regexpr == NULL) {ret= -1; goto ex;} if(strlen(name_expr)>=SfileadrL) {ret= 0; goto ex;}; ret= Findjob_default_and(o, 0); if(ret <= 0) goto ex; t= o->cursor->test; t->test_type= 1; if ((flag & 3) == 1) t->test_type= 13; else if((flag & 3) == 2) t->test_type= 16; else if((flag & 3) == 3) t->test_type= 20; t->arg1= strdup(name_expr); if(t->arg1 == NULL) {ret= -1; goto ex;}; if((flag & 3) == 3) {ret= 1; goto ex;} name_re= (regex_t *) calloc(1, sizeof(regex_t)); if(name_re == NULL) {ret= -1; goto ex;}; Xorriso__bourne_to_reg(name_expr, regexpr, 0); if(regcomp(name_re, regexpr, 0) != 0) { free((char *) name_re); {ret= 0; goto ex;}; } t->arg2= name_re; ret= 1; ex:; Xorriso_free_meM(regexpr); return(ret); } int Findjob_set_file_type(struct FindjoB *o, char file_type, int flag) { static char known[]= {"bcdpf-lsmeX"}; struct ExprtesT *t; int ret; ret= Findjob_default_and(o, 0); if(ret <= 0) return(ret); if(file_type != 0) if(strchr(known, file_type) == NULL) return(0); t= o->cursor->test; t->test_type= 2; t->arg1= calloc(1, 1); if(t->arg1 == NULL) return(-1); *((char *) t->arg1)= file_type; return(1); } /* @param value -1= only without property, 1= only with property @param flag bit0= pseudo-test: if no operator is open, do nothing and return 2 */ int Findjob_set_prop_filter(struct FindjoB *o, int test_type, int value, int flag) { struct ExprtesT *t; int ret; ret= Findjob_default_and(o, flag & 1); if(ret <= 0 || ret == 2) return(ret); t= o->cursor->test; t->test_type= test_type; if(value < 0) t->invert= !t->invert; return(1); } /* @param value -1= only undamaged files, 1= only damaged files */ int Findjob_set_damage_filter(struct FindjoB *o, int value, int flag) { int ret; ret= Findjob_set_prop_filter(o, 3, value, 0); return(ret); } int Findjob_set_num_filter(struct FindjoB *o, int test_type, int num1, int num2, int flag) { struct ExprtesT *t; int ret; ret= Findjob_default_and(o, 0); if(ret <= 0) return(ret); t= o->cursor->test; t->test_type= test_type; t->arg1= calloc(sizeof(int), 1); t->arg2= calloc(sizeof(int), 1); if(t->arg1 == NULL || t->arg2 == NULL) return(-1); *((int *) t->arg1)= num1; *((int *) t->arg2)= num2; return(1); } int Findjob_set_lba_range(struct FindjoB *o, int start_lba, int count, int flag) { int ret, end_lba; if(start_lba > 0) end_lba= start_lba + count - 1; else end_lba= start_lba - count + 1; ret= Findjob_set_num_filter(o, 4, start_lba, end_lba, 0); return(ret); } int Findjob_set_test_hidden(struct FindjoB *o, int mode, int flag) { struct ExprtesT *t; int ret; ret= Findjob_default_and(o, 0); if(ret <= 0) return(ret); t= o->cursor->test; t->test_type= 17; t->arg1= calloc(sizeof(int), 1); if(t->arg1 == NULL) return(-1); *((int *) t->arg1)= mode; return(1); } /* @param value -1= files without ACL, 1= only files with ACL */ int Findjob_set_acl_filter(struct FindjoB *o, int value, int flag) { int ret; ret= Findjob_set_prop_filter(o, 5, value, 0); return(ret); } /* @param value -1= files without xattr, 1= only files with xattr @param flag bit0=-has_any_xattr rather than -has_xattr */ int Findjob_set_xattr_filter(struct FindjoB *o, int value, int flag) { int ret; ret= Findjob_set_prop_filter(o, (flag & 1 ? 14 : 6), value, 0); return(ret); } /* @param value -1= files without aaip, 1= only files with aaip */ int Findjob_set_aaip_filter(struct FindjoB *o, int value, int flag) { int ret; ret= Findjob_set_prop_filter(o, 7, value, 0); return(ret); } /* @param value -1= files without filter, 1= files with filter */ int Findjob_set_filter_filter(struct FindjoB *o, int value, int flag) { int ret; ret= Findjob_set_prop_filter(o, 8, value, 0); return(ret); } int Findjob_set_crtp_filter(struct FindjoB *o, char *creator, char *hfs_type, int flag) { struct ExprtesT *t; int ret; ret= Findjob_default_and(o, 0); if(ret <= 0) return(ret); t= o->cursor->test; t->test_type= 18; t->arg1= calloc(1, strlen(creator) + 1); t->arg2= calloc(1, strlen(hfs_type) + 1); if(t->arg1 == NULL || t->arg2 == NULL) return(-1); strcpy(t->arg1, creator); strcpy(t->arg2, hfs_type); return(1); } int Findjob_set_bless_filter(struct XorrisO *xorriso, struct FindjoB *o, char *blessing, int flag) { struct ExprtesT *t; int ret; ret= Findjob_default_and(o, 0); if(ret <= 0) return(ret); t= o->cursor->test; t->test_type= 19; t->arg1= calloc(1, sizeof(int)); if(t->arg1 == NULL) return(-1); ret= Xorriso_hfsplus_bless(xorriso, "", NULL, blessing, 4 | 8); if(ret <= 0) return(ret); *((int *) t->arg1)= ret - 1; return(1); } int Findjob_set_wanted_node(struct FindjoB *o, void *wanted_node, int flag) { struct ExprtesT *t; int ret; ret= Findjob_default_and(o, 0); if(ret <= 0) return(ret); t= o->cursor->test; t->test_type= 9; t->arg1= wanted_node; return(1); } int Findjob_set_commit_filter_2(struct FindjoB *o, int flag) { int ret; ret= Findjob_default_and(o, 0); if(ret <= 0) return(ret); o->cursor->test->test_type= 10; return(1); } int Findjob_set_arg1(struct FindjoB *o, int test_type, char *arg1, int flag) { struct ExprtesT *t; int ret, hflag= 0; if(test_type == 23) hflag= 2; /* prepend -or rather than -and */ ret= Findjob_default_and(o, hflag); if(ret <= 0) return(ret); t= o->cursor->test; t->test_type= test_type; t->arg1= strdup(arg1); if(t->arg1 == NULL) return(-1); return(1); } /* @param value -1= true, 1= false @param flag bit0= pseudo-test: if no operator is open, do nothing and return 2 */ int Findjob_set_false(struct FindjoB *o, int value, int flag) { int ret; ret= Findjob_set_prop_filter(o, 0, value, flag & 1); return(ret); } int Findjob_set_prune(struct FindjoB *o, int flag) { int ret; ret= Findjob_set_prop_filter(o, 12, 0, 0); return(ret); } int Findjob_set_found_path(struct FindjoB *o, char *path, int flag) { if(o->found_path != NULL) free(o->found_path); if(path != NULL) { o->found_path= strdup(path); if(o->found_path == NULL) return(-1); } else o->found_path= NULL; return(1); } int Findjob_get_found_path(struct FindjoB *o, char **path, int flag) { *path= o->found_path; return(1); } int Findjob_get_last_data_file_block(struct FindjoB *o, uint32_t *lba, int flag) { *lba= o->last_data_file_block; return(1); } int Findjob_get_action(struct FindjoB *o, int flag) { return(o->action); } /* @return <0 error, >=0 see above struct FindjoB.action */ int Findjob_get_action_parms(struct FindjoB *o, char **target, char **text_2, uid_t *user, gid_t *group, mode_t *mode_and, mode_t *mode_or, int *type, time_t *date, struct FindjoB **subjob, int flag) { *target= o->target; *text_2= o->text_2; *user= o->user; *group= o->group; *mode_and= o->mode_and; *mode_or= o->mode_or; *type= o->type; *date= o->date; *subjob= o->subjob; return(o->action); } int Findjob_test_2(struct XorrisO *xorriso, struct FindjoB *o, void *node, char *name, char *path, struct stat *boss_stbuf, struct stat *stbuf, int flag) { int ret; ret= Exprnode_tree_value(xorriso, o->test_tree, -1, node, name, path, boss_stbuf, stbuf, 0); if(ret == 3) ret= 1; else if(ret == 2) ret= 0; return(ret); } int Findjob_set_action_target(struct FindjoB *o, int action, char *target, int flag) { o->action= action; o->target= target; return(1); } int Findjob_set_action_type(struct FindjoB *o, int action, int type, int flag) { o->action= action; o->type= type; return(1); } int Findjob_set_action_text_2(struct FindjoB *o, int action, char *target, char* text_2, int flag) { o->action= action; o->target= target; o->text_2= text_2; return(1); } /* @param flag bit0= recursive */ int Findjob_set_action_chown(struct FindjoB *o, uid_t user,int flag) { int ret; if(flag&1) { o->action= 0; Findjob_destroy(&(o->subjob), 0); ret= Findjob_new(&(o->subjob), "", 0); if(ret<=0) return(-1); Findjob_set_action_chown(o->subjob, user, 0); o->action= 9; } else { o->action= 4; o->user= user; } return(1); } /* @param flag bit0= recursive */ int Findjob_set_action_chgrp(struct FindjoB *o, gid_t group, int flag) { int ret; if(flag&1) { o->action= 0; Findjob_destroy(&(o->subjob), 0); ret= Findjob_new(&(o->subjob), "", 0); if(ret<=0) return(-1); Findjob_set_action_chgrp(o->subjob, group, 0); o->action= 10; } else { o->action= 5; o->group= group; } return(1); } /* @param flag bit0= recursive */ int Findjob_set_action_chmod(struct FindjoB *o, mode_t mode_and, mode_t mode_or, int flag) { int ret; if(flag&1) { o->action= 0; Findjob_destroy(&(o->subjob), 0); ret= Findjob_new(&(o->subjob), "", 0); if(ret<=0) return(-1); Findjob_set_action_chmod(o->subjob, mode_and, mode_or, 0); o->action= 11; } else { o->action= 6; o->mode_and= mode_and; o->mode_or= mode_or; } return(1); } /* @param flag bit0= recursive */ int Findjob_set_action_ad(struct FindjoB *o, int type, time_t date, int flag) { int ret; if(flag&1) { o->action= 0; Findjob_destroy(&(o->subjob), 0); ret= Findjob_new(&(o->subjob), "", 0); if(ret<=0) return(-1); Findjob_set_action_ad(o->subjob, type, date, 0); o->action= 12; } else { o->action= 7; o->type= type; o->date= date; } return(1); } int Findjob_set_action_subjob(struct FindjoB *o, int action, struct FindjoB *subjob, int flag) { o->action= action; Findjob_destroy(&(o->subjob), 0); o->subjob= subjob; return(1); } int Findjob_set_action_found_path(struct FindjoB *o, int flag) { o->action= 23; Findjob_set_found_path(o, NULL, 0); return(1); } libisoburn-1.5.4/xorriso/xorriso-tcltk.10000644000175700017510000001075114005266163015244 00000000000000.\" Hey, EMACS: -*- nroff -*- .\" .\" IMPORTANT NOTE: .\" .\" The original of this file is kept in xorriso/xorriso-tcltk.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 XORRISO-TCLTK 1 "Version 1.5.4, Jan 30, 2021" .\" 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 insert n+1 empty lines .\" for manpage-specific macros, see man(7) .nh .SH NAME xorriso\-tcltk \- Educational GUI frontend for xorriso .SH SYNOPSIS .B xorriso-tcltk [ options ] .br .SH DESCRIPTION .PP \fBxorriso\-tcltk\fR demonstrates xorriso use cases by a collection of GUI components. .br .PP It creates a window with buttons, editable text fields, and list boxes. For exploration simply start \fBxorriso\-tcltk\fR without any options. .br .PP Click on the "Help" button at the upper right edge to get an overview help text in a separate window. It explains the three main parts of the GUI window and it gives examples for a few main use cases of xorriso. .br .PP Click by the rightmost mouse button on any button, list box, or text field, to get a specific help text in another window. .br .PP \fBxorriso\fR is a program which copies file objects from POSIX compliant filesystems into Rock Ridge enhanced ISO 9660 filesystems and performs session\-wise manipulation of such filesystems. It can load the management information of existing ISO images and it writes the session results to optical media or to filesystem objects. .br Vice versa \fBxorriso\fR is able to copy file objects out of ISO 9660 filesystems. .SS .br .SH OPTIONS .br .PP Normally, no program options are needed when \fBxorriso\-tcltk\fR gets started. Some of the options are for demonstration of program development. This man page lists only those options which may be helpful for end users. .PP .TP \fB--help\fR Print a help text with the complete list of start options and exit. .TP \fB--no_extract\fR Do not allow extraction of files from ISO filesystem to hard disk. This is not revokable during the program run. .TP \fB--geometry\fR {+|-}X{+|-}Y Set the position of the main window on the screen. +0X is the left edge, \-0X is the right edge, +0Y is the upper edge, \-0Y is the lower edge. .TP \fB--click_to_focus\fR Chooses that input fields and list boxes get the keyboard focus only when being clicked by the mouse. This is the default. .TP \fB--auto_focus\fR Chooses that the keyboard focus is where the mouse pointer is. .SH EXAMPLES Just run \fBxorriso\-tcltk\fR in a shell terminal without any further arguments .SH FILES .SS .B Startup files: .br When starting xorriso, its normal startup files get read and their text lines get executed as commands. See section FILES in the man page of xorriso or chapter Files in the info document of xorriso. .SH SEE ALSO .TP .BR xorriso(1) .SH BUGS To report bugs, request help, or suggest enhancements for \fBxorriso\fR or \fBxorriso\-tcltk\fR, please send electronic mail to the public list . If more privacy is desired, mail to . .br Please describe what you expect the program to do, the program arguments, GUI components, or dialog commands by which you tried to achieve it, the messages of \fBxorriso\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 .br for libburnia\-project.org .SH COPYRIGHT Copyright (c) 2011 \- 2021 Thomas Schmitt .br Permission is granted to distribute this text freely. It shall only be modified in sync with the technical properties of xorriso\-tcltk. If you make use of the license to derive modified versions of xorriso\-tcltk then you are entitled to modify this text under that same license. .SH CREDITS \fBxorriso\fR is in part based on work by Vreixo Formoso who provides libisofs together with Mario Danic who also leads the libburnia team. Thanks to Andy Polyakov who invented emulated growing, to Derek Foreman and Ben Jansens who once founded libburn. .br Compliments towards Joerg Schilling whose cdrtools served me for ten years. libisoburn-1.5.4/xorriso/parse_exec.c0000644000175700017510000030646113762644655014645 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of functions which deal with parsing and interpretation of command input. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" #ifdef Xorriso_fetch_with_msg_queueS #include #endif /* @param flag bit0= do not warn of wildcards bit1= these are disk_paths */ int Xorriso_end_idx(struct XorrisO *xorriso, int argc, char **argv, int idx, int flag) { int i, warned= 0; for(i= idx; ilist_delimiter)==0) break; if(!((flag&1) || warned)) warned= Xorriso_warn_of_wildcards(xorriso, argv[i], flag&2); } return(i); } /* Returns a vector of strings which belong to an open ended arg list. If expansion is enabled, the vector might be allocated, else it is a pointer into the argv input vector. Thus the release of that memory is an expert task to be done by this function only. Use bit8 for that. With bit8 parameter argc MUST be the same value as with the call which might have allocated memory. @param xorriso The environment object @param argc Length of argv @param argv The vector with arguments, eventual list_delimiter ("--") and then eventual unrelated words @param idx Start index in argv of the argument list @param optc Length of the effective possibly expanded option vector @param optv The option vector. Maybe a pointer into argv or maybe an own allocated vector. @param flag bit0= do not warn of wildcards bit1= these are disk_paths bit2= never expand wildcards bit3= do not expand last argument bit4= ignore last argument bit5= demand exactly one match bit6= with bit5 allow 0 matches if pattern is a constant bit7= silently tolerate empty argument list bit8= free the eventually allocated sub_vector bit9= always expand wildcards bit10= do not add unresolved pattern to optv */ int Xorriso_opt_args(struct XorrisO *xorriso, char *cmd, int argc, char **argv, int idx, int *end_idx, int *optc, char ***optv, int flag) { int i, do_expand, nump, was_empty= 0, filec= 0, ret; char **filev= NULL, **patterns= NULL; off_t mem= 0; if(flag&2) do_expand= (xorriso->do_disk_pattern==1 && !(flag&4)) || (flag & 512); else do_expand= (xorriso->do_iso_rr_pattern==1 && !(flag&4)) || (flag & 512); if(flag&256) { if(argv == NULL || *optv < argv || (*optv >= argv + argc && argc > 0)) Sfile_destroy_argv(optc, optv, 0); return(1); } if(idx>=argc) { *end_idx= argc; *optc= 0; *optv= NULL; sprintf(xorriso->info_text, "%s : Not enough arguments given", cmd); if((flag & 128)) return(1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } *end_idx= Xorriso_end_idx(xorriso, argc, argv, idx, ((flag&1) || do_expand) | (flag&2)); if(*end_idx<0) return(*end_idx); if((flag&16) && (*end_idx)>idx) (*end_idx)--; *optc= *end_idx - idx; *optv= NULL; if(*optc<=0 || !do_expand) { copy_args:; if(*optc > 0) { Xorriso_alloc_meM(*optv, char *, *optc); for(i= 0; i < *optc; i++) { Xorriso_alloc_meM((*optv)[i], char, strlen(argv[idx + i]) + 1); strcpy((*optv)[i], argv[idx + i]); } } return(1); } patterns= calloc(*optc, sizeof(char *)); if(patterns==NULL) { no_memory:; sprintf(xorriso->info_text, "%s : Cannot allocate enough memory for pattern expansion", cmd); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } nump= 0; if(flag&8) { was_empty= 1; mem+= strlen(argv[idx + *optc - 1])+1+sizeof(char *); } for(i= 0; i<*optc-!!(flag&8); i++) { if(argv[i + idx][0]==0) { was_empty++; mem+= sizeof(char *); /* as upper limit for size of an empty string */ continue; } patterns[nump++]= argv[i + idx]; } if(nump<=0) { /* Only empty texts. May the caller get happy with them. */ free(patterns); goto copy_args; } if(flag&2) ret= Xorriso_expand_disk_pattern(xorriso, nump, patterns, was_empty, &filec, &filev, &mem, ((flag >> 5) & 3) | ((!!(flag & 1024)) << 3)); else ret= Xorriso_expand_pattern(xorriso, nump, patterns, was_empty, &filec, &filev, &mem, ((flag >> 5) & 3) | ((!!(flag & 1024)) << 3)); if(ret<=0) {ret= 0; goto ex;} for(i= 0; iinfo_text, "Pattern expansion yields %d items:", filec); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); l= 0; xorriso->info_text[0]= 0; for(i= 0; iinfo_text); if(l>0 && l+1+strlen(filev[i])>60) { Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); xorriso->info_text[0]= 0; l= 0; } sprintf(xorriso->info_text+l, " %s", filev[i]); } l= strlen(xorriso->info_text); if(l>0) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); } #endif /* Xorriso_verbous_pattern_expansioN */ ret= 1; ex:; if(patterns!=NULL) free((char *) patterns); if(ret<=0) { Sfile_destroy_argv(&filec, &filev, 0); } else { *optc= filec; *optv= filev; } return(ret); } /* @param flag bit0= get eternal problem status */ int Xorriso_get_problem_status(struct XorrisO *xorriso, char severity[80], int flag) { if(flag & 1) { strcpy(severity, xorriso->eternal_problem_status_text); return(xorriso->eternal_problem_status); } else { strcpy(severity, xorriso->problem_status_text); return(xorriso->problem_status); } } /* @param flag bit0= set eternal problem status to severity, and set problem status to ALL */ int Xorriso_set_problem_status(struct XorrisO *xorriso, char *severity, int flag) { char *sev_text= "ALL"; int sev, ret; #ifdef Xorriso_fetch_with_msg_queueS int locked= 0, uret; static int complaints= 0, complaint_limit= 5; #endif if(severity[0] && strlen(severity) < sizeof(xorriso->problem_status_text)) sev_text= severity; ret= Xorriso__text_to_sev(sev_text, &sev, 0); if(ret<=0) return(0); #ifdef Xorriso_fetch_with_msg_queueS ret= pthread_mutex_lock(&(xorriso->problem_status_lock)); if(ret != 0) { /* Cannot report failure through the failing message output system */ complaints++; if(complaints < complaint_limit) fprintf(stderr, "xorriso : pthread_mutex_lock() for problem_status returns %d\n", ret); } else locked= 1; #endif /* Xorriso_fetch_with_msg_queueS */ if(flag & 1) { strcpy(xorriso->problem_status_text, "ALL"); Xorriso__text_to_sev(xorriso->problem_status_text, &(xorriso->problem_status), 0); } else { xorriso->problem_status= sev; strcpy(xorriso->problem_status_text, sev_text); } if(sev > xorriso->eternal_problem_status || (flag & 1)) { xorriso->eternal_problem_status= sev; strcpy(xorriso->eternal_problem_status_text, sev_text); } #ifdef Xorriso_fetch_with_msg_queueS if(locked) { uret= pthread_mutex_unlock(&(xorriso->problem_status_lock)); if(uret != 0) { /* Cannot report failure through the failing message output system */ complaints++; if(complaints < complaint_limit) fprintf(stderr, "xorriso : pthread_mutex_unlock() for problem_status returns %d\n", uret); } } #endif /* Xorriso_fetch_with_msg_queueS */ return(1); } /** @param flag bit0= do not issue own event messages bit1= take xorriso->request_to_abort as reason for abort @return Gives the advice: 2= pardon was given, go on 1= no problem, go on 0= function failed but xorriso would not abort, go on <0= do abort -1 = due to problem_status -2 = due to xorriso->request_to_abort */ int Xorriso_eval_problem_status(struct XorrisO *xorriso, int ret, int flag) { static int sev= 0; if(sev==0) Xorriso__text_to_sev("SORRY", &sev, 0); if((flag&2) && xorriso->request_to_abort) return(-2); Xorriso_process_msg_queues(xorriso, 0); if(ret>0 && xorriso->problem_status <= 0) return(1); if(xorriso->problem_status < xorriso->abort_on_severity && xorriso->problem_status > 0) { if(xorriso->problem_status >= sev && !(flag&1)) { sprintf(xorriso->info_text, "xorriso : NOTE : Tolerated problem event of severity '%s'\n", xorriso->problem_status_text); Xorriso_info(xorriso, 0);/* submit not as problem event */ } ret= 2; } else if(xorriso->problem_status > 0) { sprintf(xorriso->info_text, "xorriso : aborting : -abort_on '%s' encountered '%s'\n", xorriso->abort_on_text, xorriso->problem_status_text); if(!(flag&1)) Xorriso_info(xorriso, 0);/* submit not as problem event */ ret= -1; } else if(ret>0) ret= 1; else ret= 2; return(ret); } /* @param flag bit0= a non-existing target of multiple sources is a directory bit1= all paths except the last one are disk_paths bit2= the last path is a disk_path @return <=0 is error, 1= leaf file object, 2= directory */ int Xorriso_cpmv_args(struct XorrisO *xorriso, char *cmd, int argc, char **argv, int *idx, int *optc, char ***optv, char eff_dest[SfileadrL], int flag) { int destc= 0, is_dir=0, end_idx, ret, i; char **destv= NULL; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, (xorriso->do_iso_rr_pattern==1)|(flag&2)); if(end_idx - *idx < 2) { sprintf(xorriso->info_text, "%s: not enough arguments", cmd); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } ret= Xorriso_opt_args(xorriso, cmd, argc, argv, *idx, &end_idx, optc, optv, 1 | (flag&2) | 16); /* ignore last argument */ if(ret<=0) goto ex; /* demand one match, or 0 with a constant */ ret= Xorriso_opt_args(xorriso, cmd, argc, argv, end_idx, &end_idx, &destc, &destv, 1 | ((flag&4)>>1) | 32 | 64); if(ret<=0) goto ex; /* Evaluate target address */ if(flag&4) ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, destv[0], eff_dest, 2|4|16); else ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, destv[0], eff_dest, 1); if(ret<0) {ret= 0; goto ex;} if(ret==2 || ((flag&1) && *optc > 1 && ret==0)) { is_dir= 1; } else if(*optc > 1) { if(flag & 2) for(i= 0; i<*optc; i++) Xorriso_msgs_submit(xorriso, 0, (*optv)[i], 0, "ERRFILE", 0); sprintf(xorriso->info_text, "%s: more than one origin given, destination is a non-directory: ", cmd); Text_shellsafe(destv[0], xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } if(ret==0) { /* compute complete eff_dest */ ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, destv[0], eff_dest, 2 | (flag&4)); if(ret<0) {ret= 0; goto ex;} } ret= 1+is_dir; ex:; Xorriso_opt_args(xorriso, cmd, argc, argv, *idx, &end_idx, &destc, &destv, 256); (*idx)= end_idx; return(ret); } /* @param flag bit0= with adr_mode sbsector: adr_value is possibly 16 too high */ int Xorriso_decode_load_adr(struct XorrisO *xorriso, char *cmd, char *adr_mode, char *adr_value, int *entity_code, char entity_id[81], int flag) { double num; int l; if(strcmp(adr_mode, "auto")==0) *entity_code= 0; else if(strcmp(adr_mode, "session")==0) *entity_code= 1; else if(strcmp(adr_mode, "track")==0) *entity_code= 2; else if(strcmp(adr_mode, "lba")==0 || strcmp(adr_mode, "sbsector")==0) *entity_code= 3 | ((flag&1) << 16); else if(strcmp(adr_mode, "volid")==0) *entity_code= 4; else { sprintf(xorriso->info_text, "%s: unknown address mode '%s'", cmd, adr_mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } l= strlen(adr_value); if(l==0) *entity_code= 0; if(*entity_code>=1 && *entity_code<= 3) { num= Scanf_io_size(adr_value, 0); if(*entity_code==3 && (adr_value[l-1]<'0' || adr_value[l-1]>'9')) num/= 2048.0; sprintf(entity_id, "%.f", num); } else { if(strlen(adr_value)>80) { sprintf(xorriso->info_text, "%s: address value too long (80 < %d)", cmd, (int) strlen(adr_value)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } strcpy(entity_id, adr_value); } return(1); } int Xorriso_check_thing_len(struct XorrisO *xorriso, char *name, int size, char *cmd, char *thing, int flag) { if((int) strlen(name) >= size) { sprintf(xorriso->info_text, "%s too long with option %s (%d > %d)", thing, cmd, (int) strlen(name), size - 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } return(1); } int Xorriso_check_name_len(struct XorrisO *xorriso, char *name, int size, char *cmd, int flag) { return Xorriso_check_thing_len(xorriso, name, size, cmd, "Name", flag); } /* @return <0 error , >=0 number of skipped dashes */ int Xorriso_normalize_command(struct XorrisO *xorriso, char *original_cmd, int argno, char *cmd_data, int sizeof_cmd_data, char **cmd, int flag) { int was_dashed= 0; char *dash_pt; if((int) strlen(original_cmd) >= sizeof_cmd_data) { if(argno>=0) sprintf(xorriso->info_text, "Oversized argument #%d (length %d)\n", argno, (int) strlen(original_cmd)); else sprintf(xorriso->info_text, "Oversized option (length %d)\n", (int) strlen(original_cmd)); return(-1); } strcpy(cmd_data, original_cmd); *cmd= cmd_data; if(strcmp(*cmd, xorriso->list_delimiter)==0) return(1); while((*cmd)[0]=='-') { if((*cmd)[1]==0) break; was_dashed++; (*cmd)++; } for(dash_pt= *cmd; *dash_pt!=0; dash_pt++) if(*dash_pt=='-') *dash_pt= '_'; return(was_dashed); } /* @param flag bit0= do not warn of unknown option @return <=0 error, 1=count is valid, 2=dashed unknown, 3=undashed unknown */ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv, int *count, int flag) { int ret, was_dashed= 0, i, cmd_data_size= 2 * SfileadrL; char *cmd, *cmd_data= NULL; static char arg0_commands[][40]= { "ban_stdio_write","close_filter_list","commit", "device_links","devices","end", "for_backup", "help", "list_arg_sorting","list_formats","list_speeds", "no_rc","print_size","pvd_info","pwd","pwdi","pwdx", "read_mkisofsrc","rollback","rollback_end", "tell_media_space","toc","version", "" }; static char arg1_commands[][40]= { "abort_on","acl","add_plainly","application_id","application_use", "auto_charset","abstract_file", "backslash_codes","blank","biblio_file", "calm_drive","cd","cdi","cdx","changes_pending","charset", "close","close_damaged", "commit_eject","compliance","copyright_file", "dev","dialog","disk_dev_ino","disk_pattern","displacement", "drive_access","dummy","dvd_obs","early_stdio_test","ecma119_map","eject", "extract_boot_images", "iso_nowtime","iso_rr_pattern","file_name_limit","follow","format","fs", "gid","grow_blindly","hardlinks", "hfsplus","history","indev","in_charset","joliet","joliet_map", "list_delimiter","list_extras","list_profiles","local_charset", "mark","md5","mount_opts","modesty_on_drive", "not_leaf","not_list","not_mgt", "options_from_file","osirrox","outdev","out_charset","overwrite", "pacifier","padding","path_list","pathspecs","pkt_output", "preparer_id","print","print_info","print_mark","prompt", "prog","prog_help","publisher","quoted_not_list","quoted_path_list", "read_fs","read_speed","reassure","report_about", "report_el_torito","report_system_area","rockridge", "rom_toc_scan","rr_reloc_dir","scsi_dev_family","scsi_log", "session_log","sh_style_result","signal_handling","sleep", "speed","split_size","status","status_history_max", "stdio_sync","stream_recording","system_id","temp_mem_limit","toc_of", "uid","unregister_filter","use_immed_bit","use_readline", "volid","volset_id", "write_type","xattr","zisofs", "" }; static char arg2_commands[][40]= { "assert_volid","boot_image","clone","compare","compare_r","drive_class", "data_cache_size", "errfile_log","error_behavior","extract","extract_single", "jigdo","lns","lnsi","load","logfile", "map","map_single","move","msg_op","page","return_with", "scdbackup_tag","update","update_r","volume_date", "" }; static char arg3_commands[][40]= { "append_partition", "truncate_overwritable", "" }; static char arg4_commands[][40]= { "cut_out","extract_cut","mount","mount_cmd","named_pipe_loop", "paste_in","session_string", "" }; static char argn_commands[][40]= { "add","alter_date","alter_date_r","as", "check_md5","check_md5_r","check_media","check_media_defaults", "chgrp","chgrpi","chgrp_r","chgrp_ri","chmod","chmodi", "chmod_r","chmod_ri","chown","chowni","chown_r","chown_ri", "compare_l","concat","cp_clone","cp_rax","cp_rx","cpr","cpri","cpax","cpx", "du","dui","dus","dusi","dux","dusx","external_filter","extract_l", "file_size_limit","find","findi","finds","findx", "getfacl","getfacli","getfacl_r","getfacl_ri", "getfattr","getfattri","getfattr_r","getfattr_ri","hide", "launch_frontend","ls","lsi","lsl","lsli","lsd","lsdi","lsdl","lsdli", "lsx","lslx","lsdx","lsdlx","map_l","mv","mvi","mkdir","mkdiri", "not_paths","rm","rmi","rm_r","rm_ri","rmdir","rmdiri", "update_l","update_li","update_lx","update_lxi", "setfacl","setfacli","setfacl_list","setfacl_listi", "setfacl_r","setfacl_ri","setfattr","setfattri", "setfattr_list","setfattr_listi","setfattr_r","setfattr_ri", "set_filter","set_filter_r","show_stream","show_stream_r", "" }; Xorriso_alloc_meM(cmd_data, char, cmd_data_size); *count= 0; if(argc<=0) {ret= -1; goto ex;} ret= Xorriso_normalize_command(xorriso, argv[0], -1, cmd_data, cmd_data_size, &cmd, 0); if(ret<0) goto ex; was_dashed= (ret>0); if(cmd[0]=='#' || cmd[0]==0 || strcmp(cmd, xorriso->list_delimiter) == 0) { /* ignore: comment line , empty option , orphaned list delimiter */ {ret= 1; goto ex;} } for(i=0; arg0_commands[i][0]!=0; i++) if(strcmp(arg0_commands[i], cmd)==0) {ret= 1; goto ex;} *count= 1; for(i=0; arg1_commands[i][0]!=0; i++) if(strcmp(arg1_commands[i], cmd)==0) {ret= 1; goto ex;} *count= 2; for(i=0; arg2_commands[i][0]!=0; i++) if(strcmp(arg2_commands[i], cmd)==0) {ret= 1; goto ex;} *count= 3; for(i=0; arg3_commands[i][0]!=0; i++) if(strcmp(arg3_commands[i], cmd)==0) {ret= 1; goto ex;} *count= 4; for(i=0; arg4_commands[i][0]!=0; i++) if(strcmp(arg4_commands[i], cmd)==0) {ret= 1; goto ex;} *count= 0; for(i=0; argn_commands[i][0]!=0; i++) if(strcmp(argn_commands[i], cmd)==0) { ret= Xorriso_end_idx(xorriso, argc, argv, 1, 1); if(ret<1) goto ex; *count= ret-1; {ret= 1; goto ex;} } if(!(flag&1)) { sprintf(xorriso->info_text, "Unknown option : '%s'", argv[0]); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } ret= 2 + !was_dashed; ex: Xorriso_free_meM(cmd_data); return(ret); } /* @param flag bit0= list sorting order rather than looking for argv[idx] */ int Xorriso_cmd_sorting_rank(struct XorrisO *xorriso, int argc, char **argv, int idx, int flag) { int ret, i, cmd_data_size= 2 * SfileadrL; char *cmd, *cmd_data= NULL; static char *commands[]= { "* Execution order of program arguments with option -x:", "x", "* Support for frontend programs via stdin and stdout (1):", "prog", "prog_help", "* Exception processing:", "abort_on", "return_with", "report_about", "signal_handling", "error_behavior", "* Scripting, dialog and program control features (1):", "no_rc", "help", "version", "list_extras", "list_arg_sorting", "temp_mem_limit", "backslash_codes", "errfile_log", "session_log", "scsi_log", "options_from_file", "list_delimiter", "print", "print_info", "print_mark", "prompt", "sleep", "sh_style_result", "* Influencing opening of drives:", "drive_access","drive_class","early_stdio_test", "* Drive and media related inquiry actions (1):", "devices", "device_links", "mount_opts", "mount_cmd", "session_string", "* Influencing the behavior of image loading:", "read_speed", "load", "displacement", "read_fs", "assert_volid", "in_charset", "auto_charset", "hardlinks", "acl", "xattr", "md5", "for_backup", "ecma119_map", "joliet_map", "disk_dev_ino", "rom_toc_scan", "calm_drive", "ban_stdio_write", "data_cache_size", "scsi_dev_family", "iso_nowtime", "* Character sets:", "charset", "local_charset", "* Acquiring source and target drive:", "dev", "indev", "outdev", "* Drive and media related inquiry actions (2):", "list_profiles", "list_formats", "list_speeds", "toc", "toc_of", "pvd_info", "report_system_area", "report_el_torito", "* Settings for file insertion:", "file_name_limit", "file_size_limit", "not_mgt", "not_paths", "not_leaf", "not_list", "quoted_not_list", "follow", "pathspecs", "overwrite", "split_size", "* Navigation in ISO image and disk filesystem (1):", "cd", "cdx", "pwd", "pwdx", "* Inserting files into ISO image:", "disk_pattern", "add_plainly", "mkdir", "lns", "add", "path_list", "quoted_path_list", "map", "map_single", "map_l", "update", "update_r", "update_l", "update_li", "update_lx", "update_lxi", "cut_out", "cpr", "clone", "cp_clone", "* Navigation in ISO image and disk filesystem (2):", "ls", "lsd", "lsl", "lsdl", "lsx", "lsdx", "lslx", "lsdlx", "getfacl", "getfacl_r", "getfattr", "getfattr_r", "du", "dus", "dux", "dusx", "findx", "compare", "compare_r", "compare_l", "show_stream", "show_stream_r", "* File manipulations:", "iso_rr_pattern", "rm", "rm_r", "rmdir", "move", "mv", "chown", "chown_r", "chgrp", "chgrp_r", "chmod", "chmod_r", "setfacl", "setfacl_r", "setfacl_list", "setfattr", "setfattr_r", "setfattr_list", "alter_date", "alter_date_r", "hide", "* Filters for data file content:", "external_filter", "unregister_filter", "close_filter_list", "set_filter", "set_filter_r", "* Tree traversal command -find:", "find", "* osirrox ISO-to-disk restore options:", "osirrox", "extract", "extract_single", "extract_l", "extract_cut", "extract_boot_images", "cpx", "cpax", "cp_rx", "cp_rax", "paste_in", "concat", "mount", "* Settings for result writing:", "rockridge", "joliet", "hfsplus","compliance", "rr_reloc_dir", "volid", "volset_id", "publisher", "application_id", "system_id", "volume_date", "copyright_file", "abstract_file", "biblio_file", "preparer_id", "application_use", "out_charset", "read_mkisofsrc", "uid", "gid", "zisofs", "speed", "stream_recording", "dvd_obs", "modesty_on_drive", "use_immed_bit", "stdio_sync", "dummy", "fs", "close", "padding", "write_type", "grow_blindly", "pacifier", "scdbackup_tag", "* Bootable ISO images:", "boot_image", "append_partition", "* Jigdo Template Extraction:", "jigdo", "* Command compatibility emulations:", "as", "* Scripting, dialog and program control features (2):", "history", "status_history_max", "status", "* Drive and media related inquiry actions (3):", "print_size", "tell_media_space", "* Writing the result, drive control:", "format", "blank", "truncate_overwritable", "close_damaged", "rollback", "changes_pending", "commit", "commit_eject", "eject", "* Evaluation of readability and recovery:", "check_media_defaults", "check_media", "check_md5", "check_md5_r", "* Support for frontend programs via stdin and stdout (2):", "pkt_output", "logfile", "mark", "msg_op", "* Dialog mode control:", "dialog", "page", "use_readline", "reassure", "* Support for frontend programs via stdin and stdout (3):", "launch_frontend", "named_pipe_loop", "* Scripting, dialog and program control features (3):", "rollback_end", "end", "" }; if(flag & 1) { for(i= 0; commands[i][0] !=0; i++) { if(commands[i][0] == '*') sprintf(xorriso->result_line, "#%s\n", commands[i] + 1); else sprintf(xorriso->result_line, "-%s\n", commands[i]); Xorriso_result(xorriso, 0); } ret= 1; goto ex; } if(argc <= 0) {ret= -1; goto ex;} Xorriso_alloc_meM(cmd_data, char, cmd_data_size); ret= Xorriso_normalize_command(xorriso, argv[idx], -1, cmd_data, cmd_data_size, &cmd, 0); if(ret < 0) goto ex; if(cmd[0] == '#' || cmd[0] == 0 || strcmp(cmd, xorriso->list_delimiter) == 0) { /* Move to end: comment line , empty option , orphaned list delimiter */ ret= 0x7fffffff; goto ex; } for(i= 0; commands[i][0] !=0; i++) { if(commands[i][0] == '*') /* headline in command list */ continue; if(strcmp(commands[i], cmd) != 0) continue; ret= i + 1; goto ex; } ret= 1; ex: Xorriso_free_meM(cmd_data); return(ret); } int Xorriso__cmp_cmd_rank(const void *a, const void *b) { int ra, rb; ra= ((int *) a)[1]; rb= ((int *) b)[1]; if(ra < rb) return(-1); if(ra > rb) return(1); ra= ((int *) a)[2]; rb= ((int *) b)[2]; if(ra < rb) return(-1); if(ra > rb) return(1); return(0); } /* @param flag bit0= print command sequence rather than executing it bit1= these are command line arguments (for xorriso->argument_emulation) */ int Xorriso_exec_args_sorted(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int cmd_count= 0, ret, i, arg_count, *idx_rank= NULL, cmd_idx; /* Count commands and allocate index-rank array */ for(i= *idx; i < argc; i++) { ret= Xorriso_count_args(xorriso, argc - i, argv + i, &arg_count, 1); if(ret <= 0) goto ex; if(ret != 1) continue; cmd_count++; i+= arg_count; } if(cmd_count <= 0) {ret= 1; goto ex;} Xorriso_alloc_meM(idx_rank, int, 3 * cmd_count); /* Fill index-rank array and sort */ cmd_count= 0; for(i= *idx; i < argc; i++) { ret= Xorriso_count_args(xorriso, argc - i, argv + i, &arg_count, 1); if(ret <= 0) goto ex; if(ret != 1) continue; idx_rank[3 * cmd_count]= i; ret= Xorriso_cmd_sorting_rank(xorriso, argc, argv, i, 0); if(ret < 0) goto ex; idx_rank[3 * cmd_count + 1]= ret; idx_rank[3 * cmd_count + 2]= cmd_count; cmd_count++; i+= arg_count; } qsort(idx_rank, cmd_count, 3 * sizeof(int), Xorriso__cmp_cmd_rank); /* Execute or print indice from index-rank array */ if(flag & 1) { sprintf(xorriso->result_line, "Automatically determined command sequence:\n"); Xorriso_result(xorriso, 0); xorriso->result_line[0]= 0; } for(i= 0; i < cmd_count; i++) { cmd_idx= idx_rank[3 * i]; if(flag & 1) { if(strlen(xorriso->result_line) + 1 + strlen(argv[cmd_idx]) > 78) { strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); xorriso->result_line[0]= 0; } sprintf(xorriso->result_line + strlen(xorriso->result_line), " %s", argv[cmd_idx]); } else { ret= Xorriso_interpreter(xorriso, argc, argv, &cmd_idx, 4 | (flag & 2)); if(ret <= 0 || ret == 3) goto ex; } } if(flag & 1) { if(strlen(xorriso->result_line) > 0) { strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); } } else *idx= argc; ret= 1; ex: Xorriso_free_meM(idx_rank); return(ret); } /* @param flag bit0= recursion bit1= these are command line arguments (for xorriso->argument_emulation) bit2= Only execute the one command argv[*idx] and advance *idx to the next command if successful. Then return. */ int Xorriso_interpreter(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) /* return: <=0 error , 1 = success , 2 = problem event ignored , 3 = end program run */ { int ret, was_dashed, end_ret, num1, num2, cmd_data_size= 2 * SfileadrL; int mem_idx, arg_count, i; char *cmd, *original_cmd, *cmd_data= NULL, *arg1, *arg2, *arg3, *arg4; Xorriso_alloc_meM(cmd_data, char, cmd_data_size); if(xorriso==NULL) {ret= 0; goto ex;} if(xorriso->is_dialog) { xorriso->result_line_counter= xorriso->result_page_counter= 0; if(xorriso->result_page_length<0) xorriso->result_page_length= -xorriso->result_page_length; } next_command:; if(flag&2) { ret= 1; if(xorriso->argument_emulation==1) ret= Xorriso_as_genisofs(xorriso, argc, argv, idx, 0); else if(xorriso->argument_emulation==2) ret= Xorriso_as_cdrskin(xorriso, argc, argv, idx, 0); if(xorriso->argument_emulation>0) { xorriso->argument_emulation= 0; if(ret<=0) goto eval_any_problems; if((*idx)>=argc) {ret= 1; goto ex;} } if((xorriso->arrange_args || (flag & 8)) && !(flag & (4 | 16))) { ret= Xorriso_exec_args_sorted(xorriso, argc, argv, idx, 0); goto ex; } } ret= Xorriso_count_args(xorriso, argc - *idx, argv + *idx, &arg_count, 1); if((ret == 1 || ret == 2) && strcmp(argv[*idx], xorriso->list_delimiter) != 0) { sprintf(xorriso->info_text, "Command: %s", argv[*idx]); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); for(i= 1; i <= arg_count && *idx + i < argc; i++) { sprintf(xorriso->info_text, "Parameter: %s", argv[*idx + i]); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); } if(*idx + arg_count >= argc) { sprintf(xorriso->info_text, "Missing arguments: %d", *idx + arg_count + 1 - argc); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); } } xorriso->prepended_wd= 0; xorriso->request_to_abort= xorriso->request_not_to_ask= 0; Xorriso_set_problem_status(xorriso, "", 0); if((*idx)add_plainly==3 && cmd[0] && !xorriso->is_dialog) { (*idx)++; goto add_plain_argument; } was_dashed= 0; ret= Xorriso_normalize_command(xorriso, original_cmd, -1, cmd_data, cmd_data_size, &cmd, 0); if(ret<0) goto eval_any_problems; was_dashed= ret; (*idx)++; if((*idx)10); } else if(strcmp(cmd,"append_partition")==0) { (*idx)+= 3; ret= Xorriso_option_append_partition(xorriso, arg1, arg2, arg3, 0); } else if(strcmp(cmd,"application_id")==0) { (*idx)++; ret= Xorriso_option_application_id(xorriso, arg1, 0); } else if(strcmp(cmd,"application_use") == 0) { (*idx)++; ret= Xorriso_option_application_use(xorriso, arg1, 0); } else if(strcmp(cmd,"as")==0) { ret= Xorriso_option_as(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd,"assert_volid")==0) { (*idx)+= 2; ret= Xorriso_option_assert_volid(xorriso, arg1, arg2, 0); } else if(strcmp(cmd,"auto_charset")==0) { (*idx)++; ret= Xorriso_option_auto_charset(xorriso, arg1, 0); } else if(strcmp(cmd,"backslash_codes")==0) { (*idx)++; ret= Xorriso_option_backslash_codes(xorriso, arg1, 0); } else if(strcmp(cmd,"ban_stdio_write")==0) { ret= Xorriso_option_ban_stdio_write(xorriso, 0); } else if(strcmp(cmd,"biblio_file")==0) { (*idx)++; Xorriso_option_biblio_file(xorriso, arg1, 0); } else if(strcmp(cmd,"blank")==0) { (*idx)++; ret= Xorriso_option_blank(xorriso, arg1, 0); } else if(strcmp(cmd,"boot_image")==0) { (*idx)+= 2; ret= Xorriso_option_boot_image(xorriso, arg1, arg2, 0); } else if(strcmp(cmd,"calm_drive")==0) { (*idx)++; ret= Xorriso_option_calm_drive(xorriso, arg1, 0); } else if(strcmp(cmd,"cd")==0 || strcmp(cmd,"cdi")==0) { (*idx)++; ret= Xorriso_option_cdi(xorriso, arg1, 0); } else if(strcmp(cmd,"cdx")==0) { (*idx)++; ret= Xorriso_option_cdx(xorriso, arg1, 0); } else if(strcmp(cmd, "changes_pending")==0) { (*idx)++; ret= Xorriso_option_changes_pending(xorriso, arg1, 0); } else if(strcmp(cmd,"charset")==0) { (*idx)++; ret= Xorriso_option_charset(xorriso, arg1, 3); } else if(strcmp(cmd,"check_md5")==0) { ret= Xorriso_option_check_md5(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd,"check_md5_r")==0) { ret= Xorriso_option_check_md5(xorriso, argc, argv, idx, 8); } else if(strcmp(cmd,"check_media")==0) { ret= Xorriso_option_check_media(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd,"check_media_defaults")==0) { ret= Xorriso_option_check_media_defaults(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd,"chgrp")==0 || strcmp(cmd,"chgrpi")==0) { (*idx)+= 1; ret= Xorriso_option_chgrpi(xorriso, arg1, argc, argv, idx, 0); } else if(strcmp(cmd,"chgrp_r")==0 || strcmp(cmd,"chgrp_ri")==0) { (*idx)+= 1; ret= Xorriso_option_chgrpi(xorriso, arg1, argc, argv, idx, 1); } else if(strcmp(cmd,"chmod")==0 || strcmp(cmd,"chmodi")==0) { (*idx)+= 1; ret= Xorriso_option_chmodi(xorriso, arg1, argc, argv, idx, 0); } else if(strcmp(cmd,"chmod_r")==0 || strcmp(cmd,"chmod_ri")==0) { (*idx)+= 1; ret= Xorriso_option_chmodi(xorriso, arg1, argc, argv, idx, 1); } else if(strcmp(cmd,"chown_r")==0 || strcmp(cmd,"chown_ri")==0) { (*idx)+= 1; ret= Xorriso_option_chowni(xorriso, arg1, argc, argv, idx, 1); } else if(strcmp(cmd,"chown")==0 || strcmp(cmd,"chowni")==0) { (*idx)+= 1; ret= Xorriso_option_chowni(xorriso, arg1, argc, argv, idx, 0); } else if(strcmp(cmd,"clone")==0) { (*idx)+= 2; ret= Xorriso_option_clone(xorriso, arg1, arg2, 1); } else if(strcmp(cmd,"close")==0) { (*idx)++; ret= Xorriso_option_close(xorriso, arg1, 0); } else if(strcmp(cmd,"close_damaged")==0) { (*idx)++; ret= Xorriso_option_close_damaged(xorriso, arg1, 0); } else if(strcmp(cmd,"close_filter_list")==0) { ret= Xorriso_option_close_filter_list(xorriso, 0); } else if(strcmp(cmd,"commit")==0) { ret= Xorriso_option_commit(xorriso, 0); } else if(strcmp(cmd,"commit_eject")==0) { (*idx)++; ret= Xorriso_option_commit_eject(xorriso, arg1, 0); } else if(strcmp(cmd,"compare")==0) { (*idx)+= 2; ret= Xorriso_option_compare(xorriso, arg1, arg2, 1); } else if(strcmp(cmd,"compare_l")==0) { ret= Xorriso_option_map_l(xorriso, argc, argv, idx, 1<<8); } else if(strcmp(cmd,"compare_r")==0) { (*idx)+= 2; ret= Xorriso_option_compare(xorriso, arg1, arg2, 1|8); } else if(strcmp(cmd,"compliance")==0) { (*idx)++; Xorriso_option_compliance(xorriso, arg1, 0); } else if(strcmp(cmd,"concat") == 0) { ret= Xorriso_option_concat(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd,"copyright_file")==0) { (*idx)++; Xorriso_option_copyright_file(xorriso, arg1, 0); } else if(strcmp(cmd,"cp_clone") == 0) { ret= Xorriso_option_cp_clone(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd,"cp_rx")==0 || strcmp(cmd,"cp_rax")==0) { ret= Xorriso_option_cpx(xorriso, argc, argv, idx, 1|((strcmp(cmd,"cp_rax")==0)<<1)); } else if(strcmp(cmd,"cpr")==0 || strcmp(cmd,"cpri")==0) { ret= Xorriso_option_cpri(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd,"cpx")==0 || strcmp(cmd,"cpax")==0) { ret= Xorriso_option_cpx(xorriso, argc, argv, idx, (strcmp(cmd,"cpax")==0)<<1); } else if(strcmp(cmd,"cut_out")==0) { (*idx)+= 4; if((*idx)>argc) { sprintf(xorriso->info_text, "-cut_out: Not enough arguments. Needed are: disk_path start count so_rr_path"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; } else ret= Xorriso_option_cut_out(xorriso, arg1, arg2, argv[(*idx)-2], argv[(*idx)-1], 0); } else if(strcmp(cmd,"data_cache_size")==0) { (*idx)+= 2; ret= Xorriso_option_data_cache_size(xorriso, arg1, arg2, 0); } else if(strcmp(cmd,"dev")==0) { (*idx)++; ret= Xorriso_option_dev(xorriso, arg1, 3); } else if(strcmp(cmd,"device_links")==0) { ret= Xorriso_option_devices(xorriso, 1); } else if(strcmp(cmd,"devices")==0) { ret= Xorriso_option_devices(xorriso, 0); } else if(strcmp(cmd,"dialog")==0) { (*idx)++; ret= Xorriso_option_dialog(xorriso, arg1, 0); } else if(strcmp(cmd,"disk_dev_ino")==0) { (*idx)++; ret= Xorriso_option_disk_dev_ino(xorriso, arg1, 0); } else if(strcmp(cmd,"displacement")==0) { (*idx)++; ret= Xorriso_option_displacement(xorriso, arg1, 0); } else if(strcmp(cmd,"disk_pattern")==0) { (*idx)++; ret= Xorriso_option_disk_pattern(xorriso, arg1, 0); } else if(strcmp(cmd,"drive_access")==0) { (*idx)++; ret= Xorriso_option_drive_access(xorriso, arg1, 0); } else if(strcmp(cmd,"drive_class")==0) { (*idx)+= 2; ret= Xorriso_option_drive_class(xorriso, arg1, arg2, 0); } else if(strcmp(cmd,"du")==0 || strcmp(cmd,"dui")==0 || strcmp(cmd,"dus")==0 || strcmp(cmd,"dusi")==0) { ret= Xorriso_option_lsi(xorriso, argc, argv, idx, (cmd[2]!='s')|4); } else if(strcmp(cmd,"dummy")==0) { (*idx)++; ret= Xorriso_option_dummy(xorriso, arg1, 0); } else if(strcmp(cmd,"dvd_obs")==0) { (*idx)++; ret= Xorriso_option_dvd_obs(xorriso, arg1, 0); } else if(strcmp(cmd,"dux")==0 || strcmp(cmd,"dusx")==0) { ret= Xorriso_option_lsx(xorriso, argc, argv, idx, (cmd[2]!='s')|4); } else if(strcmp(cmd,"early_stdio_test")==0) { (*idx)++; ret= Xorriso_option_early_stdio_test(xorriso, arg1, 0); } else if(strcmp(cmd,"ecma119_map")==0) { (*idx)++; ret= Xorriso_option_ecma119_map(xorriso, arg1, 0); } else if(strcmp(cmd,"eject")==0) { (*idx)++; ret= Xorriso_option_eject(xorriso, arg1, 0); } else if(strcmp(cmd,"end")==0) { end_ret= Xorriso_option_end(xorriso, 0); ret= Xorriso_eval_problem_status(xorriso, ret, 0); if(ret<0) goto ex; if(end_ret!=2) {ret= 3; goto ex;} } else if(strcmp(cmd,"errfile_log")==0) { (*idx)+= 2; ret= Xorriso_option_errfile_log(xorriso, arg1, arg2, 0); } else if(strcmp(cmd,"error_behavior")==0) { (*idx)+= 2; ret= Xorriso_option_error_behavior(xorriso, arg1, arg2, 0); } else if(strcmp(cmd,"external_filter")==0) { ret= Xorriso_option_external_filter(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd,"extract")==0) { (*idx)+= 2; ret= Xorriso_option_extract(xorriso, arg1, arg2, 0); } else if(strcmp(cmd,"extract_boot_images")==0) { (*idx)+= 1; if((*idx)>argc) { sprintf(xorriso->info_text, "-extract_boot_images: Empty disk_path cannot be used as target directory"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; } else { ret= Xorriso_option_extract_boot_images(xorriso, arg1, 0); } } else if(strcmp(cmd,"extract_cut")==0) { (*idx)+= 4; if((*idx)>argc) { sprintf(xorriso->info_text, "-extract_cut: Not enough arguments. Needed are: disk_path start count iso_rr_path"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; } else ret= Xorriso_option_extract_cut(xorriso, arg1, arg2, argv[(*idx)-2], argv[(*idx)-1], 0); } else if(strcmp(cmd,"extract_l")==0) { ret= Xorriso_option_map_l(xorriso, argc, argv, idx, 3<<8); } else if(strcmp(cmd,"extract_single")==0) { (*idx)+= 2; ret= Xorriso_option_extract(xorriso, arg1, arg2, 32); } else if(strcmp(cmd,"file_name_limit")==0) { (*idx)++; ret= Xorriso_option_file_name_limit(xorriso, arg1, 0); } else if(strcmp(cmd,"file_size_limit")==0) { ret= Xorriso_option_file_size_limit(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd,"find")==0 || strcmp(cmd,"findi")==0) { ret= Xorriso_option_find(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd,"findx")==0) { ret= Xorriso_option_find(xorriso, argc, argv, idx, 1); } else if(strcmp(cmd,"follow")==0) { (*idx)++; ret= Xorriso_option_follow(xorriso, arg1, 0); } else if(strcmp(cmd,"for_backup")==0) { Xorriso_option_hardlinks(xorriso, "on", 0); Xorriso_option_acl(xorriso, "on", 0); Xorriso_option_xattr(xorriso, "any", 0); Xorriso_option_md5(xorriso, "on", 0); ret= 1; } else if(strcmp(cmd,"format")==0) { (*idx)++; ret= Xorriso_option_blank(xorriso, arg1, 1); } else if(strcmp(cmd,"fs")==0) { (*idx)++; ret= Xorriso_option_fs(xorriso, arg1, 0); } else if(strcmp(cmd,"getfacl")==0 || strcmp(cmd,"getfacli")==0) { ret= Xorriso_option_getfacli(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd,"getfacl_r")==0 || strcmp(cmd,"getfacl_ri")==0) { ret= Xorriso_option_getfacli(xorriso, argc, argv, idx, 1); } else if(strcmp(cmd,"getfattr")==0 || strcmp(cmd,"getfattri")==0) { ret= Xorriso_option_getfacli(xorriso, argc, argv, idx, 2); } else if(strcmp(cmd,"getfattr_r")==0 || strcmp(cmd,"getfattr_ri")==0) { ret= Xorriso_option_getfacli(xorriso, argc, argv, idx, 1 | 2); } else if(strcmp(cmd,"gid")==0) { (*idx)++; ret= Xorriso_option_gid(xorriso,arg1,0); } else if(strcmp(cmd,"grow_blindly")==0) { (*idx)++; ret= Xorriso_option_grow_blindly(xorriso,arg1,0); } else if(strcmp(cmd,"hardlinks")==0) { (*idx)++; ret= Xorriso_option_hardlinks(xorriso, arg1, 0); } else if(strcmp(cmd,"hfsplus")==0) { (*idx)++; ret= Xorriso_option_hfsplus(xorriso, arg1, 0); } else if(strcmp(cmd,"help")==0) { Xorriso_option_help(xorriso,0); } else if(strcmp(cmd,"hide")==0) { (*idx)+= 1; ret= Xorriso_option_hide(xorriso, arg1, argc, argv, idx, 1); } else if(strcmp(cmd,"history")==0) { /* add to readline history */ (*idx)++; ret= Xorriso_option_history(xorriso, arg1, 0); } else if(strcmp(cmd,"indev")==0) { (*idx)++; ret= Xorriso_option_dev(xorriso, arg1, 1); } else if(strcmp(cmd,"in_charset")==0) { (*idx)++; ret= Xorriso_option_charset(xorriso, arg1, 1); } else if(strcmp(cmd,"iso_nowtime")==0) { (*idx)++; ret= Xorriso_option_iso_nowtime(xorriso, arg1, 0); } else if(strcmp(cmd,"iso_rr_pattern")==0) { (*idx)++; ret= Xorriso_option_iso_rr_pattern(xorriso, arg1, 0); } else if(strcmp(cmd,"jigdo")==0) { (*idx)+= 2; ret= Xorriso_option_jigdo(xorriso, arg1, arg2, 0); } else if(strcmp(cmd,"joliet")==0) { (*idx)++; ret= Xorriso_option_joliet(xorriso, arg1, 0); } else if(strcmp(cmd,"joliet_map")==0) { (*idx)++; ret= Xorriso_option_joliet_map(xorriso, arg1, 0); } else if(strcmp(cmd, "launch_frontend") == 0) { ret= Xorriso_option_launch_frontend(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd, "list_arg_sorting") == 0) { ret= Xorriso_option_list_arg_sorting(xorriso, 0); } else if(strcmp(cmd, "list_delimiter") == 0) { (*idx)++; ret= Xorriso_option_list_delimiter(xorriso, arg1, 0); } else if(strcmp(cmd, "list_extras") == 0) { (*idx)++; ret= Xorriso_option_list_extras(xorriso, arg1, 0); } else if(strcmp(cmd,"list_formats")==0) { ret= Xorriso_option_list_formats(xorriso, 0); } else if(strcmp(cmd,"list_profiles")==0) { (*idx)++; ret= Xorriso_option_list_profiles(xorriso, arg1, 0); } else if(strcmp(cmd,"list_speeds")==0) { ret= Xorriso_option_list_speeds(xorriso, 0); } else if(strcmp(cmd, "lns") == 0 || strcmp(cmd, "lnsi") == 0) { (*idx)+= 2; ret= Xorriso_option_lnsi(xorriso, arg1, arg2, 0); } else if(strcmp(cmd,"load")==0) { (*idx)+= 2; ret= Xorriso_option_load(xorriso, arg1, arg2, 0); } else if(strcmp(cmd,"local_charset")==0) { (*idx)++; ret= Xorriso_option_charset(xorriso, arg1, 4); } else if(strcmp(cmd,"logfile")==0) { (*idx)+= 2; ret= Xorriso_option_logfile(xorriso, arg1, arg2, 0); } else if(strcmp(cmd,"ls")==0 || strcmp(cmd,"lsi")==0 || strcmp(cmd,"lsl")==0 || strcmp(cmd,"lsli")==0) { ret= Xorriso_option_lsi(xorriso, argc, argv, idx, (cmd[2]=='l')); } else if(strcmp(cmd,"lsd")==0 || strcmp(cmd,"lsdi")==0 || strcmp(cmd,"lsdl")==0 || strcmp(cmd,"lsdli")==0) { ret= Xorriso_option_lsi(xorriso, argc, argv, idx, (cmd[3]=='l')|8); } else if(strcmp(cmd,"lsdx")==0 || strcmp(cmd,"lsdlx")==0) { ret= Xorriso_option_lsx(xorriso, argc, argv, idx, (cmd[3]=='l')|8); } else if(strcmp(cmd,"lsx")==0 || strcmp(cmd,"lslx")==0) { ret= Xorriso_option_lsx(xorriso, argc, argv, idx, (cmd[2]=='l')); } else if(strcmp(cmd,"map")==0) { (*idx)+= 2; ret= Xorriso_option_map(xorriso, arg1, arg2, 0); } else if(strcmp(cmd,"map_l")==0) { ret= Xorriso_option_map_l(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd,"map_single")==0) { (*idx)+= 2; ret= Xorriso_option_map(xorriso, arg1, arg2, 32); } else if(strcmp(cmd,"mark")==0) { (*idx)++; ret= Xorriso_option_mark(xorriso, arg1, 0); } else if(strcmp(cmd, "md5")==0) { (*idx)++; ret= Xorriso_option_md5(xorriso, arg1, 0); } else if(strcmp(cmd,"mkdir")==0 || strcmp(cmd,"mkdiri")==0) { ret= Xorriso_option_mkdiri(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd, "modesty_on_drive")==0) { (*idx)++; ret= Xorriso_option_modesty_on_drive(xorriso, arg1, 0); } else if(strcmp(cmd, "mount") == 0 || strcmp(cmd, "mount_cmd") == 0) { (*idx)+= 4; if((*idx)>argc) { sprintf(xorriso->info_text, "-%s: Not enough arguments. Needed are: device entity id command", cmd); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; } else ret= Xorriso_option_mount(xorriso, arg1, arg2, argv[(*idx)-2], argv[(*idx)-1], (strcmp(cmd, "mount_cmd") == 0)); } else if(strcmp(cmd, "mount_opts")==0) { (*idx)++; ret= Xorriso_option_mount_opts(xorriso, arg1, 0); } else if(strcmp(cmd, "move")==0) { (*idx)+= 2; ret= Xorriso_option_move(xorriso, arg1, arg2, 0); } else if(strcmp(cmd,"msg_op") == 0) { (*idx)+= 2; ret= Xorriso_option_msg_op(xorriso, arg1, arg2, 0); } else if(strcmp(cmd,"mv")==0 || strcmp(cmd,"mvi")==0) { ret= Xorriso_option_mvi(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd,"named_pipe_loop")==0) { if((*idx) + 3 < argc) arg4= argv[(*idx) + 3]; else arg4= ""; (*idx)+= 4; ret= Xorriso_option_named_pipe_loop(xorriso, arg1, arg2, arg3, arg4, 0); if(ret == 3) goto ex; } else if(strcmp(cmd,"no_rc")==0) { ret= Xorriso_option_no_rc(xorriso, 0); } else if(strcmp(cmd,"not_leaf")==0) { (*idx)++; ret= Xorriso_option_not_leaf(xorriso, arg1, 0); } else if(strcmp(cmd,"not_list")==0) { (*idx)++; ret= Xorriso_option_not_list(xorriso, arg1, 0); } else if(strcmp(cmd,"not_mgt")==0) { (*idx)++; ret= Xorriso_option_not_mgt(xorriso, arg1, 0); } else if(strcmp(cmd,"not_paths")==0) { ret= Xorriso_option_not_paths(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd,"options_from_file")==0) { (*idx)++; ret= Xorriso_option_options_from_file(xorriso,arg1,0); if(ret==3) goto ex; } else if(strcmp(cmd,"osirrox")==0) { (*idx)++; ret= Xorriso_option_osirrox(xorriso,arg1,0); } else if(strcmp(cmd,"outdev")==0) { (*idx)++; ret= Xorriso_option_dev(xorriso, arg1, 2); } else if(strcmp(cmd,"out_charset")==0) { (*idx)++; ret= Xorriso_option_charset(xorriso, arg1, 2); } else if(strcmp(cmd,"overwrite")==0) { (*idx)++; ret= Xorriso_option_overwrite(xorriso,arg1,0); } else if(strcmp(cmd,"pacifier")==0) { (*idx)++; ret= Xorriso_option_pacifier(xorriso, arg1, 0); } else if(strcmp(cmd,"padding")==0) { (*idx)++; ret= Xorriso_option_padding(xorriso, arg1, 0); } else if(strcmp(cmd,"page")==0) { (*idx)+= 2; num1= num2= 0; sscanf(arg1,"%d",&num1); sscanf(arg2,"%d",&num2); if(num1<0) num1= 0; if(arg1[0]==0) num1= 16; if(num2<=0) num2= 80; ret= Xorriso_option_page(xorriso, num1, num2, 0); } else if(strcmp(cmd,"paste_in")==0) { (*idx)+= 4; if((*idx)>argc) { sprintf(xorriso->info_text, "-paste_in: Not enough arguments. Needed are: disk_path start count so_rr_path"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; } else ret= Xorriso_option_paste_in(xorriso, arg1, arg2, argv[(*idx)-2], argv[(*idx)-1], 0); } else if(strcmp(cmd,"path-list")==0 || strcmp(cmd,"path_list")==0) { (*idx)++; ret= Xorriso_option_path_list(xorriso, arg1, 0); } else if(strcmp(cmd,"pathspecs")==0) { (*idx)++; ret= Xorriso_option_pathspecs(xorriso, arg1, 0); } else if(strcmp(cmd,"pkt_output")==0) { (*idx)++; ret= Xorriso_option_pkt_output(xorriso, arg1, 0); } else if(strcmp(cmd,"preparer_id")==0) { (*idx)++; ret= Xorriso_option_preparer_id(xorriso, arg1, 0); } else if(strcmp(cmd,"print")==0) { (*idx)++; ret= Xorriso_option_print(xorriso, arg1, 0); } else if(strcmp(cmd,"print_info")==0) { (*idx)++; ret= Xorriso_option_print(xorriso, arg1, 1); } else if(strcmp(cmd,"print_mark")==0) { (*idx)++; ret= Xorriso_option_print(xorriso, arg1, 2); } else if(strcmp(cmd,"print_size")==0) { Xorriso_option_print_size(xorriso, 0); } else if(strcmp(cmd,"prompt")==0) { (*idx)++; ret= Xorriso_option_prompt(xorriso, arg1, 0); } else if(strcmp(cmd,"prog")==0) { (*idx)++; ret= Xorriso_option_prog(xorriso, arg1, 0); } else if(strcmp(cmd,"publisher")==0) { (*idx)++; Xorriso_option_publisher(xorriso, arg1, 0); } else if(strcmp(cmd,"pvd_info")==0) { Xorriso_option_pvd_info(xorriso, 0); } else if(strcmp(cmd,"pwd")==0 || strcmp(cmd,"pwdi")==0) { Xorriso_option_pwdi(xorriso, 0); } else if(strcmp(cmd,"pwdx")==0) { Xorriso_option_pwdx(xorriso, 0); } else if(strcmp(cmd,"quoted_not_list")==0) { (*idx)++; ret= Xorriso_option_not_list(xorriso, arg1, 1); } else if(strcmp(cmd,"quoted_path_list")==0) { (*idx)++; ret= Xorriso_option_path_list(xorriso, arg1, 1); } else if(strcmp(cmd,"read_fs")==0) { (*idx)++; ret= Xorriso_option_read_fs(xorriso, arg1, 0); } else if(strcmp(cmd,"read_mkisofsrc")==0) { ret= Xorriso_option_read_mkisofsrc(xorriso, 0); } else if(strcmp(cmd,"read_speed")==0) { (*idx)++; ret= Xorriso_option_speed(xorriso, arg1, 1); } else if(strcmp(cmd,"reassure")==0) { (*idx)++; ret= Xorriso_option_reassure(xorriso, arg1, 0); } else if(strcmp(cmd,"report_about")==0) { (*idx)++; ret= Xorriso_option_report_about(xorriso, arg1, 0); } else if(strcmp(cmd,"report_el_torito")==0) { (*idx)++; ret= Xorriso_option_report_el_torito(xorriso, arg1, 0); } else if(strcmp(cmd,"report_system_area")==0) { (*idx)++; ret= Xorriso_option_report_system_area(xorriso, arg1, 0); } else if(strcmp(cmd,"return_with")==0) { (*idx)+= 2; num2= 0; sscanf(arg2,"%d",&num2); ret= Xorriso_option_return_with(xorriso, arg1, num2, 0); } else if(strcmp(cmd,"rm")==0 || strcmp(cmd,"rmi")==0) { ret= Xorriso_option_rmi(xorriso, argc, argv, idx, 0); } else if(strcmp(cmd,"rm_r")==0 || strcmp(cmd,"rm_ri")==0) { ret= Xorriso_option_rmi(xorriso, argc, argv, idx, 1); } else if(strcmp(cmd,"rmdir")==0 || strcmp(cmd,"rmdiri")==0) { ret= Xorriso_option_rmi(xorriso, argc, argv, idx, 2); } else if(strcmp(cmd, "rockridge") == 0) { (*idx)++; ret= Xorriso_option_rockridge(xorriso, arg1, 0); } else if(strcmp(cmd,"rollback")==0) { ret= Xorriso_option_rollback(xorriso, 0); } else if(strcmp(cmd,"rollback_end")==0) { end_ret= Xorriso_option_end(xorriso, 1); ret= Xorriso_eval_problem_status(xorriso, ret, 0); if(ret<0) goto ex; if(end_ret!=2) {ret= 3; goto ex;} } else if(strcmp(cmd,"rom_toc_scan")==0) { (*idx)++; Xorriso_option_rom_toc_scan(xorriso, arg1, 0); } else if(strcmp(cmd,"rr_reloc_dir")==0) { (*idx)++; Xorriso_option_rr_reloc_dir(xorriso, arg1, 0); } else if(strcmp(cmd,"scdbackup_tag")==0) { (*idx)+= 2; ret= Xorriso_option_scdbackup_tag(xorriso, arg1, arg2, 0); } else if(strcmp(cmd, "scsi_dev_family") == 0) { (*idx)++; ret= Xorriso_option_scsi_dev_family(xorriso, arg1, 0); } else if(strcmp(cmd, "scsi_log") == 0) { (*idx)++; ret= Xorriso_option_scsi_log(xorriso, arg1, 0); } else if(strcmp(cmd,"session_log")==0) { (*idx)++; ret= Xorriso_option_session_log(xorriso, arg1, 0); } else if(strcmp(cmd, "session_string") == 0) { (*idx)+= 4; if((*idx)>argc) { sprintf(xorriso->info_text, "-%s: Not enough arguments. Needed are: device entity id command", cmd); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; } else ret= Xorriso_option_mount(xorriso, arg1, arg2, argv[(*idx)-2], argv[(*idx)-1], 2); } else if(strcmp(cmd,"setfacl")==0 || strcmp(cmd,"setfacli")==0) { (*idx)+= 1; ret= Xorriso_option_setfacli(xorriso, arg1, argc, argv, idx, 0); } else if(strcmp(cmd,"setfacl_list")==0 || strcmp(cmd,"setfacl_listi")==0) { (*idx)+= 1; ret= Xorriso_option_setfacl_listi(xorriso, arg1, 0); } else if(strcmp(cmd,"setfacl_r")==0 || strcmp(cmd,"setfacl_ri")==0) { (*idx)+= 1; ret= Xorriso_option_setfacli(xorriso, arg1, argc, argv, idx, 1); } else if(strcmp(cmd,"setfattr")==0 || strcmp(cmd,"setfattri")==0) { (*idx)+= 2; ret= Xorriso_option_setfattri(xorriso, arg1, arg2, argc, argv, idx, 0); } else if(strcmp(cmd,"setfattr_list")==0 || strcmp(cmd,"setfattr_listi")==0) { (*idx)+= 1; ret= Xorriso_option_setfattr_listi(xorriso, arg1, 0); } else if(strcmp(cmd,"setfattr_r")==0 || strcmp(cmd,"setfattr_ri")==0) { (*idx)+= 2; ret= Xorriso_option_setfattri(xorriso, arg1, arg2, argc, argv, idx, 1); } else if(strcmp(cmd,"set_filter")==0 || strcmp(cmd,"set_filter_r")==0) { (*idx)+= 1; ret= Xorriso_option_set_filter(xorriso, arg1, argc, argv, idx, strcmp(cmd,"set_filter_r")==0); } else if(strcmp(cmd,"show_stream")==0 || strcmp(cmd,"show_stream_r")==0) { ret= Xorriso_option_set_filter(xorriso, "", argc, argv, idx, (strcmp(cmd,"show_stream_r")==0) | 2 | 4); } else if(strcmp(cmd,"sh_style_result")==0) { (*idx)++; ret= Xorriso_option_sh_style_result(xorriso, arg1, 0); } else if(strcmp(cmd,"signal_handling")==0) { (*idx)++; ret= Xorriso_option_signal_handling(xorriso, arg1, 0); } else if(strcmp(cmd,"sleep")==0) { (*idx)++; ret= Xorriso_option_sleep(xorriso, arg1, 0); } else if(strcmp(cmd,"speed")==0) { (*idx)++; ret= Xorriso_option_speed(xorriso, arg1, 0); } else if(strcmp(cmd,"split_size")==0) { (*idx)++; ret= Xorriso_option_split_size(xorriso, arg1, 0); } else if(strcmp(cmd,"status")==0) { (*idx)++; ret= Xorriso_option_status(xorriso, arg1, 0); } else if(strcmp(cmd,"status_history_max")==0) { (*idx)++; sscanf(arg1,"%d",&num1); ret= Xorriso_option_status_history_max(xorriso, num1, 0); } else if(strcmp(cmd,"stdio_sync")==0) { (*idx)++; ret= Xorriso_option_stdio_sync(xorriso, arg1, 0); } else if(strcmp(cmd,"stream_recording")==0) { (*idx)++; ret= Xorriso_option_stream_recording(xorriso, arg1, 0); } else if(strcmp(cmd,"system_id")==0) { (*idx)++; ret= Xorriso_option_system_id(xorriso, arg1, 0); } else if(strcmp(cmd,"tell_media_space")==0) { Xorriso_option_tell_media_space(xorriso, 0); } else if(strcmp(cmd,"temp_mem_limit")==0) { (*idx)++; ret= Xorriso_option_temp_mem_limit(xorriso, arg1, 0); } else if(strcmp(cmd,"test")==0) { /* This option does not exist. */ /* install temporary test code here */; if (0) { /* Test setup for for Xorriso_push_outlists() et.al. */ /* Test setup for Xorriso_parse_line */ int stack_handle = -1, line_count= 0; struct Xorriso_lsT *result_list, *info_list; int Xorriso_process_msg_lists(struct XorrisO *xorriso, struct Xorriso_lsT *result_list, struct Xorriso_lsT *info_list, int *line_count, int flag); (*idx)++; if(strcmp(arg1, "push") == 0) { ret= Xorriso_push_outlists(xorriso, &stack_handle, 3); fprintf(stderr, "xorriso -test: push = %d, handle = %d\n", ret, stack_handle); } else if(strcmp(arg1, "pull") == 0) { ret= Xorriso_pull_outlists(xorriso, -1, &result_list, &info_list, 0); fprintf(stderr, "xorriso -test: pull = %d\n", ret); if(ret > 0) { ret= Xorriso_process_msg_lists(xorriso, result_list, info_list, &line_count, 0); fprintf(stderr, "xorriso -test: Xorriso_process_msg_lists() = %d, line_count = %d\n", ret, line_count); } } else if(strcmp(arg1, "fetch") == 0) { ret= Xorriso_fetch_outlists(xorriso, -1, &result_list, &info_list, 0); fprintf(stderr, "xorriso -test: fetch = %d\n", ret); if(ret > 0) { ret= Xorriso_process_msg_lists(xorriso, result_list, info_list, &line_count, 0); fprintf(stderr, "xorriso -test: Xorriso_process_msg_lists() = %d, line_count = %d\n", ret, line_count); } } else if(strcmp(arg1, "peek") == 0) { ret= Xorriso_peek_outlists(xorriso, -1, 0, 0); fprintf(stderr, "xorriso -test: peek = %d\n", ret); } else if(strcmp(arg1, "sleep_peek") == 0) { usleep(1000000); ret= Xorriso_peek_outlists(xorriso, -1, 0, 0); fprintf(stderr, "xorriso -test: sleep_peek = %d\n", ret); } else if(strcmp(arg1, "peek_loop") == 0) { ret= Xorriso_peek_outlists(xorriso, -1, 3, 4); fprintf(stderr, "xorriso -test: peek_loop = %d\n", ret); } else if(strcmp(arg1, "start") == 0) { ret= Xorriso_start_msg_watcher(xorriso, NULL, NULL, NULL, NULL, 0); fprintf(stderr, "xorriso -test: Xorriso_start_msg_watcher() = %d\n", ret); } else if(strcmp(arg1, "stop") == 0) { ret= Xorriso_stop_msg_watcher(xorriso, 0); fprintf(stderr, "xorriso -test: Xorriso_stop_msg_watcher() = %d\n", ret); } else if(strcmp(arg1, "help") == 0) { fprintf(stderr, "-test [mode] [arguments]\n"); fprintf(stderr, " push\n"); fprintf(stderr, " perform Xorriso_push_outlists()\n"); fprintf(stderr, " pull\n"); fprintf(stderr, " perform Xorriso_pull_outlists() and show messages\n"); fprintf(stderr, " fetch\n"); fprintf(stderr, " perform Xorriso_fetch_outlists() and show\n"); fprintf(stderr, " peek\n"); fprintf(stderr, " perform Xorriso_peek_outlists()\n"); fprintf(stderr, " sleep_peek\n"); fprintf(stderr, " sleep 1 s and perform Xorriso_peek_outlists()\n"); fprintf(stderr, " peek_loop\n"); fprintf(stderr, " wait for up to 3s in Xorriso_peek_outlists()\n"); fprintf(stderr, " for return value 0 or -1\n"); fprintf(stderr, " start\n"); fprintf(stderr, " perform Xorriso_start_msg_watcher()\n"); fprintf(stderr, " stop\n"); fprintf(stderr, " perform Xorriso_stop_msg_watcher()\n"); } else { fprintf(stderr, "xorriso -test: unknown mode: %s\n", arg1); } ret= 0; } } else if(strcmp(cmd,"toc")==0) { Xorriso_option_toc(xorriso, 0); } else if(strcmp(cmd,"toc_of")==0) { (*idx)++; Xorriso_option_toc_of(xorriso, arg1, 0); } else if(strcmp(cmd,"truncate_overwritable")==0) { (*idx)+= 3; ret= Xorriso_option_truncate_overwritable(xorriso, arg1, arg2, arg3, 0); } else if(strcmp(cmd,"uid")==0) { (*idx)++; ret= Xorriso_option_uid(xorriso,arg1,0); } else if(strcmp(cmd,"unregister_filter")==0) { (*idx)++; ret= Xorriso_option_unregister_filter(xorriso, arg1, 0); } else if(strcmp(cmd,"update")==0) { (*idx)+= 2; ret= Xorriso_option_update(xorriso, arg1, arg2, 1); } else if(strcmp(cmd,"update_l") == 0 || strcmp(cmd,"update_lx") == 0) { ret= Xorriso_option_map_l(xorriso, argc, argv, idx, 2<<8); } else if(strcmp(cmd,"update_li") == 0) { ret= Xorriso_option_map_l(xorriso, argc, argv, idx, 5 << 8); } else if(strcmp(cmd,"update_lxi") == 0) { ret= Xorriso_option_map_l(xorriso, argc, argv, idx, 4 << 8); } else if(strcmp(cmd,"update_r")==0) { (*idx)+= 2; ret= Xorriso_option_update(xorriso, arg1, arg2, 1|8); } else if(strcmp(cmd,"use_immed_bit")==0) { (*idx)++; ret= Xorriso_option_use_immed_bit(xorriso, arg1, 0); } else if(strcmp(cmd,"use_readline")==0) { (*idx)++; ret= Xorriso_option_use_readline(xorriso, arg1, 0); } else if(strcmp(cmd,"version")==0){ ret= Xorriso_option_version(xorriso, 0); } else if(strcmp(cmd,"volset_id")==0) { (*idx)++; ret= Xorriso_option_volset_id(xorriso, arg1, 0); } else if(strcmp(cmd,"volid")==0) { (*idx)++; ret= Xorriso_option_volid(xorriso,arg1,0); } else if(strcmp(cmd,"volume_date")==0) { (*idx)+= 2; ret= Xorriso_option_volume_date(xorriso, arg1, arg2, 0); } else if(strcmp(cmd,"write_type")==0) { (*idx)++; ret= Xorriso_option_write_type(xorriso, arg1, 0); } else if(strcmp(cmd, "x") == 0) { /* only in effect in Xorriso_prescan_args() */; } else if(strcmp(cmd,"xattr")==0) { (*idx)++; ret= Xorriso_option_xattr(xorriso, arg1, 0); } else if(strcmp(cmd,"zisofs")==0) { (*idx)++; ret= Xorriso_option_zisofs(xorriso, arg1, 0); } else if(strcmp(cmd, xorriso->list_delimiter)==0){ /* tis ok */; } else if(was_dashed) { if(xorriso->add_plainly>1) goto add_plain_argument; unknown_option:; sprintf(xorriso->info_text, "Not a known command: '%s'\n", original_cmd); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto eval_any_problems;} } else { if(xorriso->add_plainly<=0) goto unknown_option; add_plain_argument:; mem_idx= *idx; (*idx)--; ret= Xorriso_option_add(xorriso, (*idx)+1, argv, idx, 0); (*idx)= mem_idx; } eval_any_problems: ret= Xorriso_eval_problem_status(xorriso, ret, 0); if(ret<0) goto ex; if(*idx < argc && !(flag & 4)) goto next_command; ex:; fflush(stdout); Xorriso_free_meM(cmd_data); return(ret); } int Xorriso_parse_line(struct XorrisO *xorriso, char *line, char *prefix, char *separators, int max_words, int *argc, char ***argv, int flag) { int ret, bsl_mode; char *to_parse, *progname= ""; if(xorriso == NULL && (flag & (32 | 64))) { ret= -2; goto ex; } *argc= 0; *argv= NULL; to_parse= line; if((flag & 1) || xorriso == NULL) bsl_mode= (flag >> 1) & 3; else bsl_mode= xorriso->bsl_interpretation & 3; if(prefix[0]) { if(strncmp(line, prefix, strlen(prefix)) == 0) { to_parse= line + strlen(prefix); } else { ret= 2; goto ex; } } if(xorriso != NULL) progname= xorriso->progname; ret= Sfile_sep_make_argv(progname, to_parse, separators, max_words, argc, argv, (!(flag & 32)) | 4 | (bsl_mode << 5)); if(ret < 0) { if(xorriso != NULL) Xorriso_msgs_submit(xorriso, 0, "Severe lack of resources during command line parsing", 0, "FATAL", 0); ret= -1; goto ex; } if(ret == 0) { if((flag & 64) && xorriso != NULL) { sprintf(xorriso->info_text, "Incomplete quotation in %s line: %s", (flag & 32) ? "command" : "parsed", to_parse); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } goto ex; } ret= 1; ex:; if(ret <= 0) Sfile_sep_make_argv("", "", "", 0, argc, argv, 2); /* release memory */ return(ret); } void Xorriso__dispose_words(int *argc, char ***argv) { Sfile_make_argv("", "", argc, argv, 2); /* release memory */ } int Xorriso_execute_option(struct XorrisO *xorriso, char *line, int flag) /* bit0-bit15 are forwarded to Xorriso_interpreter bit16= no pageing of info lines bit17= print === bar even if xorriso->found<0 */ { int ret,argc= 0, idx= 1; char **argv= NULL; double tdiff; struct timeval tv; gettimeofday(&tv, NULL); Xorriso_reset_counters(xorriso,0); xorriso->idle_time= 0.0; tdiff= tv.tv_sec+(1.e-6*(double) tv.tv_usec); ret= Xorriso_parse_line(xorriso, line, "", "", 0, &argc, &argv, 32 | 64); if(ret <= 0) goto ex; if(argc<2) {ret= 1; goto ex;} if(argv[1][0]=='#') {ret= 1; goto ex;} ret= Xorriso_interpreter(xorriso, argc, argv, &idx, flag&0xffff); if(ret<0) goto ex; gettimeofday(&tv, NULL); tdiff= tv.tv_sec+(1.e-6*(double) tv.tv_usec)-tdiff-xorriso->idle_time; if(tdiff<0.001) tdiff= 0.001; if(xorriso->error_count>0) { sprintf(xorriso->info_text, "----------------------------- %7.f errors encountered\n", xorriso->error_count); Xorriso_info(xorriso,!(flag&(1<<16))); } /* ??? >>> print elapsed time tdiff ? */; if((flag&(1<<17)) && !xorriso->bar_is_fresh) { sprintf(xorriso->info_text,"============================\n"); Xorriso_info(xorriso,0); xorriso->bar_is_fresh= 1; } Xorriso_reset_counters(xorriso,0); ex:; Sfile_make_argv("", "", &argc, &argv, 2); /* release memory */ return(ret); } int Xorriso_dialog(struct XorrisO *xorriso, int flag) { int ret, line_size= 2 * SfileadrL; char *line= NULL; Xorriso_alloc_meM(line, char, line_size); if(!xorriso->dialog) {ret= 1; goto ex;} if(xorriso->abort_on_is_default) Xorriso_option_abort_on(xorriso, "NEVER", 0); xorriso->is_dialog= 1; while(1) { if(xorriso->pending_option[0]!=0) { Xorriso_mark(xorriso,0); strcpy(line,xorriso->pending_option); xorriso->pending_option[0]= 0; } else { if(!xorriso->bar_is_fresh) { sprintf(xorriso->info_text,"============================\n"); Xorriso_info(xorriso,0); xorriso->bar_is_fresh= 1; } sprintf(xorriso->info_text,"enter option and arguments :\n"); Xorriso_info(xorriso,0); Xorriso_mark(xorriso,0); ret= Xorriso_dialog_input(xorriso,line, line_size, 4); if(ret<=0) break; } sprintf(xorriso->info_text, "==============================================================\n"); Xorriso_info(xorriso,0); ret= Xorriso_execute_option(xorriso,line,1<<17); if(ret<0) goto ex; if(ret==3) goto ex; xorriso->did_something_useful= 1; xorriso->no_volset_present= 0; /* Re-enable "No ISO image present." */ } ret= 1; ex:; xorriso->is_dialog= 0; Xorriso_free_meM(line); return(ret); } /* @return 1=replaced , 2=not replaced , <=0 = error */ int Xorriso_replace_arg_by_bsl(struct XorrisO *xorriso, char **arg, char **argpt, int flag) { int ret, eaten, l; if(!(xorriso->bsl_interpretation & 16)) return(2); l= strlen(*argpt); Xorriso_free_meM(*arg); Xorriso_alloc_meM(*arg, char, l + 1); strcpy(*arg, *argpt); *argpt= *arg; ret= Sfile_bsl_interpreter(*arg, l, &eaten, 0); ex:; return(ret); } int Xorriso_prescan_args(struct XorrisO *xorriso, int argc, char **argv, int flag) /* bit0= do not interpret argv[1] bit1= complain about inknown arguments */ /* return: <0 error 0 end program 1 ok, go on */ { int i, ret, was_dashed, num2, arg_count; int advice, mem_add_plainly, error_seen= 0, mem_bsl; int was_report_about= 0, was_abort_on= 0, was_return_with= 0; int was_signal_handling= 0, was_scsi_log= 0, cmd_data_size= 5 * SfileadrL; char *cmd, *original_cmd, *cmd_data= NULL, *arg1, *arg2; char *arg1_data= NULL, *arg2_data= NULL; char mem_list_delimiter[81]; strcpy(mem_list_delimiter, xorriso->list_delimiter); mem_add_plainly= xorriso->add_plainly; mem_bsl= xorriso->bsl_interpretation; Xorriso_alloc_meM(cmd_data, char, cmd_data_size); for(i=1+(flag&1);i1) xorriso->did_something_useful= 1; if(i==1 && argc==2) { if(strcmp(cmd,"prog_help")==0) { i++; Xorriso_option_prog_help(xorriso,arg1,0); xorriso->did_something_useful= 1; {ret= 0; goto ex;} } else if(strcmp(cmd,"help")==0) { if(xorriso->argument_emulation == 1) { Xorriso_genisofs_help(xorriso, 0); } else if(xorriso->argument_emulation == 2) { Xorriso_cdrskin_help(xorriso, 0); } else { Xorriso_option_help(xorriso,0); } xorriso->did_something_useful= 1; {ret= 0; goto ex;} } } else if(i==1 && strcmp(cmd,"no_rc")==0) { ret= Xorriso_option_no_rc(xorriso, 0); if(ret<=0) error_seen= 1; {ret= 1; goto ex;} } else if(xorriso->argument_emulation == 1) { /* mkisofs emulation */ if(xorriso->dev_fd_1 < 0) goto protect_stdout; {ret= 1; goto ex;} } else if(xorriso->argument_emulation == 2) { /* cdrecord emulation */ if(xorriso->dev_fd_1 < 0) if(Xorriso_cdrskin_uses_stdout(xorriso, argc - 1 - (flag & 1), argv + 1 + (flag & 1), 0)) goto protect_stdout; {ret= 1; goto ex;} } else if((strcmp(cmd,"dev")==0 || strcmp(cmd,"outdev")==0 || strcmp(cmd,"indev")==0) && (strcmp(arg1,"stdio:/dev/fd/1")==0 || strcmp(arg1,"-")==0) && xorriso->dev_fd_1<0) { /* Detach fd 1 from externally perceived stdout and attach it to stderr. Keep dev_fd_1 connected to external stdout. dev_fd_1 is to be used when "stdio:/dev/fd/1" is interpreted as drive address. */ protect_stdout:; ret= Xorriso_protect_stdout(xorriso, 0); if(ret == 1) { sprintf(xorriso->info_text, "Encountered - or stdio:/dev/fd/1 as possible write target."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); sprintf(xorriso->info_text, "Redirecting nearly all text message output to stderr."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); sprintf(xorriso->info_text, "Disabling use of libreadline."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); } if(xorriso->argument_emulation >= 1 && xorriso->argument_emulation <=2) {ret= 1; goto ex;} } else if(strcmp(cmd,"abort_on")==0 && was_dashed == 1) { i++; if(!was_abort_on) Xorriso_option_abort_on(xorriso, arg1, 0); was_abort_on= 1; } else if(strcmp(cmd,"report_about")==0 && was_dashed == 1) { i++; if(!was_report_about) Xorriso_option_report_about(xorriso, arg1, 0); was_report_about= 1; } else if(strcmp(cmd,"return_with")==0 && was_dashed == 1) { i+= 2; num2= 0; sscanf(arg2,"%d",&num2); if(!was_return_with) Xorriso_option_return_with(xorriso, arg1, num2, 0); was_return_with= 1; } else if(strcmp(cmd,"as")==0 && was_dashed == 1) { ret= Xorriso_count_args(xorriso, argc - i, argv + i, &arg_count, 1); if(ret == 1) { i+= arg_count; if((strcmp(arg1, "cdrecord")==0 || strcmp(arg1, "wodim")==0 || strcmp(arg1, "cdrskin")==0 || strcmp(arg1, "xorrecord")==0) && xorriso->dev_fd_1 < 0) if(Xorriso_cdrskin_uses_stdout(xorriso, arg_count - 1, argv + i - arg_count + 2, 0)) goto protect_stdout; } if(was_dashed == 1) { if((strcmp(arg1, "mkisofs")==0 || strcmp(arg1, "genisoimage")==0 || strcmp(arg1, "genisofs")==0 || strcmp(arg1, "xorrisofs")==0) && xorriso->dev_fd_1 < 0) goto protect_stdout; } } else if(strcmp(cmd, "list_delimiter") == 0) { /* Needed for interpreting other args. Gets reset after prescan. */ i++; ret= Xorriso_option_list_delimiter(xorriso, arg1, 0); if(ret <= 0) error_seen= 1; } else if(strcmp(cmd, "add_plainly") == 0) { i++; ret= Xorriso_option_add_plainly(xorriso, arg1, 0); if(ret <= 0) error_seen= 1; if(xorriso->add_plainly == 3) { /* All further arguments count as pathspecs */ {ret= 1; goto ex;} } } else if(strcmp(cmd, "scsi_log") == 0 && was_dashed == 1) { i++; if(!was_scsi_log) Xorriso_option_scsi_log(xorriso, arg1, 0); was_scsi_log= 1; } else if(strcmp(cmd, "signal_handling") == 0 && was_dashed == 1) { i++; if(!was_signal_handling) Xorriso_option_signal_handling(xorriso, arg1, 1); /* no install */ was_signal_handling= 1; } else if(strcmp(original_cmd, "-x") == 0) { xorriso->arrange_args= 1; } else if(strcmp(cmd, "backslash_codes") == 0) { i++; ret= Xorriso_option_backslash_codes(xorriso, arg1, 0); if(ret <= 0) error_seen= 1; } else { ret= Xorriso_count_args(xorriso, argc - i, argv + i, &arg_count, 1); if(ret == 1) { i+= arg_count; } else if((flag & 2) && ((was_dashed && xorriso->add_plainly <= 1) || xorriso->add_plainly <= 0)) { sprintf(xorriso->info_text, "Not a known command: '%s'\n", original_cmd); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); error_seen= 1; } } } ret= 1; ex:; strcpy(xorriso->list_delimiter, mem_list_delimiter); xorriso->add_plainly= mem_add_plainly; xorriso->bsl_interpretation= mem_bsl; Xorriso_free_meM(arg1_data); Xorriso_free_meM(arg2_data); Xorriso_free_meM(cmd_data); if(error_seen && ret > 0) { advice= Xorriso_eval_problem_status(xorriso, 0, 0); if(advice < 0) ret= -1; } return(ret); } int Xorriso_read_as_mkisofsrc(struct XorrisO *xorriso, char *path, int flag) { int ret, linecount= 0; FILE *fp= NULL; char *sret, *line= NULL, *cpt, *wpt; Xorriso_alloc_meM(line, char, SfileadrL); ret= Xorriso_afile_fopen(xorriso, path, "rb", &fp, 1 | 2); if(ret <= 0) {ret= 0; goto ex;} while(1) { sret= Sfile_fgets_n(line, SfileadrL - 1, fp, 0); if(sret == NULL) { if(ferror(fp)) {ret= 0; goto ex;} break; } linecount++; /* Interpret line */ if(line[0] == 0 || line[0] == '#') continue; cpt= strchr(line, '='); if(cpt == NULL) { /* >>> ??? complain ? abort reading ? */; continue; } *cpt= 0; /* Names are not case sensitive */ for(wpt= line; wpt < cpt; wpt++) if(*wpt >= 'a' && *wpt <= 'z') *wpt= toupper(*wpt); /* Remove trailing whitespace from name */ for(wpt= cpt - 1; wpt >= line ; wpt--) if(*wpt == ' ' || *wpt == '\t') *wpt= 0; else break; /* Remove trailing whitespace from value */ for(wpt= cpt + 1 + strlen(cpt + 1) - 1; wpt >= cpt; wpt--) if(*wpt == ' ' || *wpt == '\t') *wpt= 0; else break; /* Remove leading whitespace from value */ for(cpt++; *cpt == ' ' || *cpt == '\t'; cpt++); if(strcmp(line, "APPI") == 0) { ret= Xorriso_option_application_id(xorriso, cpt, 0); } else if(strcmp(line, "COPY") == 0) { ret= Xorriso_option_copyright_file(xorriso, cpt, 0); } else if(strcmp(line, "ABST") == 0) { ret= Xorriso_option_abstract_file(xorriso, cpt, 0); } else if(strcmp(line, "BIBL") == 0) { ret= Xorriso_option_biblio_file(xorriso, cpt, 0); } else if(strcmp(line, "PREP") == 0) { /* Not planned to be implemented. Preparer is xorriso. */ ret= 1; } else if(strcmp(line, "PUBL") == 0) { ret= Xorriso_option_publisher(xorriso, cpt, 0); } else if(strcmp(line, "SYSI") == 0) { ret= Xorriso_option_system_id(xorriso, cpt, 0); } else if(strcmp(line, "VOLI") == 0) { ret= Xorriso_option_volid(xorriso, cpt, 1); } else if(strcmp(line, "VOLS") == 0) { ret= Xorriso_option_volset_id(xorriso, cpt, 0); } else if(strcmp(line, "HFS_TYPE") == 0) { /* Not planned to be implemented */ ret= 1; } else if(strcmp(line, "HFS_CREATOR") == 0) { /* Not planned to be implemented */ ret= 1; } else { /* >>> ??? complain ? abort reading ? */; } if(ret <= 0) goto ex; } xorriso->mkisofsrc_done= 1; ret= 1; ex: if(fp != NULL) fclose(fp); Xorriso_free_meM(line); return(ret); } /* ./.mkisofsrc , getenv("MKISOFSRC") , $HOME/.mkisofsrc , $(basename $0)/.mkisofsrc */ int Xorriso_read_mkisofsrc(struct XorrisO *xorriso, int flag) { char *path= NULL, *cpt; int ret; Xorriso_alloc_meM(path, char, SfileadrL); ret= Xorriso_read_as_mkisofsrc(xorriso, "./.mkisofsrc", 0); if(ret > 0) goto ex; cpt= getenv("MKISOFSRC"); if(cpt != NULL) { strncpy(path, cpt, SfileadrL - 1); path[SfileadrL - 1]= 0; ret= Xorriso_read_as_mkisofsrc(xorriso, path, 0); if(ret > 0) goto ex; } cpt= getenv("HOME"); if(cpt != NULL) { strncpy(path, cpt, SfileadrL - 1 - 11); path[SfileadrL - 1 - 11]= 0; strcat(path, "/.mkisofsrc"); ret= Xorriso_read_as_mkisofsrc(xorriso, path, 0); if(ret > 0) goto ex; } strcpy(path, xorriso->progname); cpt= strrchr(path, '/'); if(cpt != NULL) { strcpy(cpt + 1, ".mkisofsrc"); ret= Xorriso_read_as_mkisofsrc(xorriso, path, 0); if(ret > 0) goto ex; } /* no .mkisofsrc file found */ ret= 2; ex:; Xorriso_free_meM(path); return(ret); } /* https://reproducible-builds.org/specs/source-date-epoch/ and reproducible-builds@lists.alioth.debian.org in august 2016 */ int Xorriso_source_date_epoch(struct XorrisO *xorriso, int flag) { /* num_text must be able to take the sprintf output of "%.f". num_text + 12 must be able to take "%d" with a 64 bit int. */ char *sec_text, num_text[40]; double dsec= -1.0; time_t tsec; struct tm *gmt; sec_text= getenv("SOURCE_DATE_EPOCH"); if(sec_text == NULL) return(2); sscanf(sec_text, "%lf", &dsec); sprintf(num_text, "%.f", dsec); tsec= dsec; if(dsec < 0 || ((double) tsec) != dsec || strcmp(sec_text, num_text) != 0) { malformed:; Xorriso_msgs_submit(xorriso, 0, "Malformed environment variable SOURCE_DATE_EPOCH encountered", 0, "SORRY", 0); Xorriso_msgs_submit(xorriso, 0, "Unset SOURCE_DATE_EPOCH before starting xorriso or see https://reproducible-builds.org/specs/source-date-epoch/", 0, "HINT", 0); return(0); } gmt= gmtime(&tsec); if(gmt == NULL) goto malformed; sprintf(num_text, "%4.4d", 1900 + gmt->tm_year); sprintf(num_text + 4, "%2.2d", gmt->tm_mon + 1); sprintf(num_text + 6, "%2.2d", gmt->tm_mday); sprintf(num_text + 8, "%2.2d", gmt->tm_hour); sprintf(num_text + 10, "%2.2d", gmt->tm_min); sprintf(num_text + 12, "%2.2d", gmt->tm_sec); strcpy(num_text + 14, "00"); strcpy(xorriso->vol_uuid, num_text); xorriso->gpt_guid_mode= 2; /* Disk GUID from vol_uuid */ strcpy(xorriso->all_file_dates, "set_to_mtime"); xorriso->do_override_now_time= 1; xorriso->now_time_override= tsec; Xorriso_set_libisofs_now(xorriso, 0); sprintf(xorriso->info_text, "Environment variable SOURCE_DATE_EPOCH encountered with value %s", sec_text); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); sprintf(xorriso->info_text, "SOURCE_DATE_EPOCH : -volume_date uuid %s", xorriso->vol_uuid); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); sprintf(xorriso->info_text, "SOURCE_DATE_EPOCH : -volume_date all_file_dates %s", xorriso->all_file_dates); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); sprintf(xorriso->info_text, "SOURCE_DATE_EPOCH : -boot_image any gpt_disk_guid=volume_date_uuid"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); sprintf(xorriso->info_text, "SOURCE_DATE_EPOCH : -iso_nowtime =%.f", (double) tsec); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); return(1); } int Xorriso_read_rc(struct XorrisO *xorriso, int flag) { int ret,i,was_failure= 0,fret; /* Interpret environment variable SOURCE_DATE_EPOCH */ ret= Xorriso_source_date_epoch(xorriso, 0); ret= Xorriso_eval_problem_status(xorriso, ret, 0); if(ret < 0) return(0); if(xorriso->no_rc) return(1); i= xorriso->rc_filename_count-1; Sfile_home_adr_s(".xorrisorc", xorriso->rc_filenames[i], sizeof(xorriso->rc_filenames[i]),0); for(i=0;irc_filename_count;i++) { ret= Sfile_type(xorriso->rc_filenames[i],1|8); if(ret!=1) continue; ret= Xorriso_option_options_from_file(xorriso,xorriso->rc_filenames[i],0); if(ret>1) return(ret); if(ret==1) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1); if(fret>=0) continue; return(ret); } if(xorriso->argument_emulation == 1 && !xorriso->mkisofsrc_done) { ret= Xorriso_read_mkisofsrc(xorriso, 0); if(ret <= 0) was_failure= 1; } return(!was_failure); } int Xorriso_make_return_value(struct XorrisO *xorriso, int flag) { int exit_value= 0; if(xorriso->eternal_problem_status >= xorriso->return_with_severity) exit_value= xorriso->return_with_value; if(exit_value) { sprintf(xorriso->info_text, "-return_with %s %d triggered by problem severity %s", xorriso->return_with_text, exit_value, xorriso->eternal_problem_status_text); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } return(exit_value); } int Xorriso_program_arg_bsl(struct XorrisO *xorriso, int argc, char ***argv, int flag) { int i, ret, eaten, bsl_mem, params_to_come= 0, cmd_data_size= 5 * SfileadrL; int next_is_backslash_codes= 0, next_is_list_delimiter= 0; char **new_argv= NULL, *cmd, *cmd_data= NULL; char mem_list_delimiter[81]; strcpy(mem_list_delimiter, xorriso->list_delimiter); bsl_mem= xorriso->bsl_interpretation; if(argc <= 0) return(0); Xorriso_alloc_meM(cmd_data, char, cmd_data_size); new_argv= (char **) Smem_malloC(argc * sizeof(char *)); if(new_argv == NULL) {ret= -1; goto ex;} for(i= 0; i < argc; i++) { new_argv[i]= strdup((*argv)[i]); if(new_argv[i] == NULL) {ret= -1; goto ex;} if(i == 0) continue; if(xorriso->bsl_interpretation & 16) { ret= Sfile_bsl_interpreter(new_argv[i], strlen(new_argv[i]), &eaten, 0); if(ret <= 0) goto ex; } if(params_to_come == 0) { ret= Xorriso_normalize_command(xorriso, new_argv[i], i, cmd_data, cmd_data_size, &cmd, 0); if(ret < 0) goto ex; if(strcmp(cmd, "backslash_codes") == 0) { params_to_come= 1; next_is_backslash_codes= 1; } else if(strcmp(cmd, "list_delimiter") == 0) { params_to_come= 1; next_is_list_delimiter= 1; } else { ret= Xorriso_count_args(xorriso, argc - i, *argv + i, ¶ms_to_come, 1); if(ret <= 0) goto ex; if(ret != 1) params_to_come= 0; } } else { params_to_come--; if(next_is_backslash_codes) { next_is_backslash_codes= 0; ret= Xorriso_option_backslash_codes(xorriso, new_argv[i], 0); if(ret <= 0) goto ex; } else if(next_is_list_delimiter) { next_is_list_delimiter= 0; ret= Xorriso_option_list_delimiter(xorriso, new_argv[i], 0); if(ret <= 0) goto ex; } } } ret= 1; ex:; Xorriso_free_meM(cmd_data); strcpy(xorriso->list_delimiter, mem_list_delimiter); xorriso->bsl_interpretation= bsl_mem; if(ret <= 0) { if(new_argv != NULL) free((char *) new_argv); } else *argv= new_argv; return(ret); } /* @param flag bit0= prepend wd only if name does not begin by '/' bit1= normalize image path bit2= prepend wd (automatically done if wd[0]!=0) bit3= (with bit1) this is an address in the disk world */ int Xorriso_make_abs_adr(struct XorrisO *xorriso, char *wd, char *name, char adr[], int flag) { char *norm_adr= NULL; int ret; Xorriso_alloc_meM(norm_adr, char, SfileadrL); if((wd[0]!=0 || (flag&4)) && !((flag&1) && name[0]=='/')) { if(strlen(wd)+1>=SfileadrL) goto much_too_long; strcpy(adr, wd); if(name[0]) if(Sfile_add_to_path(adr, name, 0)<=0) { much_too_long:; Xorriso_much_too_long(xorriso, (int) (strlen(adr)+strlen(name)+1), 2); {ret= 0; goto ex;} } } else { if(strlen(name)+1>=SfileadrL) goto much_too_long; strcpy(adr, name); } if(flag&2) { ret= Xorriso_normalize_img_path(xorriso, "", adr, norm_adr, 1|2|((flag&8)>>1)); if(ret<=0) goto ex; if(norm_adr[0]==0) strcpy(norm_adr, "/"); strcpy(adr, norm_adr); } ret= 1; ex:; Xorriso_free_meM(norm_adr); return(ret); } /* @param flag bit0= do not complain in case of error, but set info_text */ int Xorriso_convert_datestring(struct XorrisO *xorriso, char *cmd, char *time_type, char *timestring, int *t_type, time_t *t, int flag) { int ret; *t_type= 0; if(strcmp(time_type, "a")==0) (*t_type)|= 1; else if(strcmp(time_type, "a-c")==0) (*t_type)|= 1 | 256; else if(strcmp(time_type, "m")==0) (*t_type)|= 4; else if(strcmp(time_type, "m-c")==0) (*t_type)|= 4 | 256; else if(strcmp(time_type, "b")==0) (*t_type)|= 5; else if(strcmp(time_type, "b-c")==0) (*t_type)|= 5 | 256; else if(strcmp(time_type, "c")==0) (*t_type)|= 2 | 256; else { sprintf(xorriso->info_text, "%s: Unrecognized type '%s'", cmd, time_type); if(!(flag & 1)) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } ret= Decode_timestring(timestring, t, 0); if(ret<=0) { sprintf(xorriso->info_text, "%s: Cannot decode timestring '%s'", cmd, timestring); if(!(flag & 1)) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } sprintf(xorriso->info_text, "Understanding timestring '%s' as: %s", timestring, ctime(t)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); return(1); } /* @param flag bit1= do not report memory usage as DEBUG */ int Xorriso_check_temp_mem_limit(struct XorrisO *xorriso, off_t mem, int flag) { char mem_text[80], limit_text[80]; Sfile_scale((double) mem, mem_text,5,1e4,0); if(!(flag&2)) { sprintf(xorriso->info_text, "Temporary memory needed for result sorting : %s", mem_text); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); } if(mem > xorriso->temp_mem_limit) { Sfile_scale((double) xorriso->temp_mem_limit,limit_text,5,1e4,1); sprintf(xorriso->info_text, "Cannot sort. List of matching files exceeds -temp_mem_limit (%s > %s)", mem_text, limit_text); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); return(0); } return(1); } int Xorriso_wait_child_end(struct XorrisO *xorriso, pid_t child_pid, int *status, int flag) { int ret; do { /* try to read and print the reply */; ret= waitpid(child_pid, status, WNOHANG); if(ret == -1) { if(errno != EINTR) return(0); } else if(ret == 0) { continue; } else { break; } } while(1); /* >>> interpret *status */; return(1); } int Xorriso_make_argv_with_null(struct XorrisO *xorriso, int in_argc, char **in_argv, int *argc, char ***argv, int flag) { int i, ret= 0; *argv= NULL; Xorriso_alloc_meM(*argv, char *, in_argc + 1); for(i= 0; i < in_argc; i++) { Xorriso_alloc_meM((*argv)[i], char, strlen(in_argv[i]) + 1); strcpy((*argv)[i], in_argv[i]); *argc= i + 1; } (*argv)[in_argc]= NULL; ret= 1; ex:; if(ret <= 0) Sfile_destroy_argv(argc, argv, 0); return(ret); } /* @param flag bit0= use env_path to find the desired program bit1= use in_argv rather than parsing cmd to words bit2= -reserved- bit3= demand absolute cmd path return: <=0 : error 1 : done */ int Xorriso_execv(struct XorrisO *xorriso, char *cmd, int in_argc, char **in_argv, char *env_path, int *stdin_pipe, int *stdout_pipe, pid_t *forked_pid, int *status, int flag) { int ret, argc= 0, has_slash; char **argv= NULL, *pathlist= NULL, *cpt, *npt, *prog= NULL; pid_t child_pid; struct stat stbuf; Xorriso_alloc_meM(prog, char, 5 * SfileadrL); wait3(NULL,WNOHANG,NULL); /* just to remove any old dead child */ if(flag & 2) { ret= Xorriso_make_argv_with_null(xorriso, in_argc, in_argv, &argc, &argv, 0); } else { ret= Sfile_make_argv("", cmd, &argc, &argv, 1|4|128); } if(ret <= 0) goto ex; if(argc < 1) {ret= 0; goto ex;} strcpy(prog, argv[0]); has_slash= (strchr(argv[0], '/') != NULL); if((flag & 8) && !has_slash) { sprintf(xorriso->info_text, "External program path contains no '/': "); Text_shellsafe(argv[0], xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if((flag & 1) && !has_slash) { if(env_path == NULL) env_path= "/bin:/sbin"; else if(env_path[0] == 0) env_path= "/bin:/sbin"; if(Sregex_string(&pathlist, env_path, 0) <= 0) {ret= -1; goto ex;} for(cpt= npt= pathlist; npt != NULL; cpt= npt + 1) { npt= strchr(cpt, ':'); if(npt != NULL) *npt= 0; if(strlen(cpt) + strlen(argv[0]) + 1 >= SfileadrL) {ret= -1; goto ex;} sprintf(prog, "%s/%s", cpt, argv[0]); ret= stat(prog, &stbuf); if(ret != -1) break; prog[0]= 0; } if(prog[0] == 0) { sprintf(xorriso->info_text, "Cannot find external program "); Text_shellsafe(argv[0], xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } child_pid= fork(); if(child_pid==-1) {ret= -1; goto ex;} if(child_pid==0) { /* this is the child process */ sprintf(xorriso->info_text, "Executing external program "); Text_shellsafe(prog, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); Xorriso_destroy(&xorriso, 0); /* reduce memory foot print */ if(stdin_pipe != NULL) { close(0); if(dup2(stdin_pipe[0], 0) == -1) { perror("dup2(,0)"); exit(1); } close(stdin_pipe[1]); /* unused */ } if(stdout_pipe != NULL) { close(1); if(dup2(stdout_pipe[1], 1) == -1) { perror("dup2(,1)"); exit(1); } close(stdout_pipe[0]); /* unused */ } execv(prog, argv); /* should never come back */ fprintf(stderr,"--- execution of shell command failed:\n"); fprintf(stderr," %s\n",cmd); exit(127); } /* this is the original process waiting for child to exit */ if(stdin_pipe != NULL) close(stdin_pipe[0]); /* unused */ if(stdout_pipe != NULL) close(stdout_pipe[1]); /* unused */ if(stdin_pipe != NULL || stdout_pipe != NULL) { /* Pipes need to be fed by the caller who later calls Xorriso_wait_child_end with *forked_pid as child_pid. */ *forked_pid= child_pid; {ret= 1; goto ex;} } ret= Xorriso_wait_child_end(xorriso, child_pid, status, 0); if(ret <= 0) goto ex; ret= 1; ex: Sfile_make_argv("", "", &argc, &argv, 2); Sregex_string(&pathlist, NULL, 0); Xorriso_free_meM(prog); return(ret); } /* @param flag bit0= use env_path to find the desired program bit1= use in_argv rather than parsing cmd to words bit2= "r" rather than "w" bit3= demand absolute cmd path bit4= override any restriction on external filters */ int Xorriso_pipe_open(struct XorrisO *xorriso, char *purpose, char *cmd, int in_argc, char **in_argv, char *env_path, int *fd, pid_t *forked_pid, int flag) { int fp_pipe[2], *stdin_pipe= NULL, *stdout_pipe= NULL, status, ret; *fd= -1; if(!(flag & 16)) { ret= Xorriso_external_filter_banned(xorriso, purpose, 0); if(ret) return(0); } if(pipe(fp_pipe) != 0) { sprintf(xorriso->info_text, "Cannot create pipe(2) object"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FATAL", 0); return(0); } if(flag & 4) { stdout_pipe= fp_pipe; *fd= fp_pipe[0]; } else { stdin_pipe= fp_pipe; *fd= fp_pipe[1]; } ret= Xorriso_execv(xorriso, cmd, in_argc, in_argv, env_path, stdin_pipe, stdout_pipe, forked_pid, &status, flag & 11); return(ret); } /* @param flag bit0= path is a command parameter */ int Xorriso_path_is_excluded(struct XorrisO *xorriso, char *path, int flag) { int ret; if(!(xorriso->disk_excl_mode&1)) /* exclusion is off */ return(0); if((flag&1) && !(xorriso->disk_excl_mode&2)) /* params are exempted */ return(0); ret= Exclusions_match(xorriso->disk_exclusions, path, !!(xorriso->disk_excl_mode&4)); if(ret<0) { sprintf(xorriso->info_text, "Error during disk file exclusion decision"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); } if(ret>0 && (flag&1)) { sprintf(xorriso->info_text, "Disk path parameter excluded by %s : ", (ret==1 ? "-not_paths" : "-not_leaf")); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } return(ret); } int Xorriso_path_is_hidden(struct XorrisO *xorriso, char *path, int flag) { int ret, hide_attrs= 0; ret= Exclusions_match(xorriso->iso_rr_hidings, path, 0); if(ret < 0) { failure:; sprintf(xorriso->info_text, "Error during disk file hiding decision"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); return(-1); } if(ret > 0) hide_attrs|= 1; ret= Exclusions_match(xorriso->joliet_hidings, path, 0); if(ret < 0) goto failure; if(ret > 0) hide_attrs|= 2; ret= Exclusions_match(xorriso->hfsplus_hidings, path, 0); if(ret < 0) goto failure; if(ret > 0) hide_attrs|= 4; return(hide_attrs); } /* Normalize ACL and sort apart "access" ACL from "default" ACL. */ int Xorriso_normalize_acl_text(struct XorrisO *xorriso, char *in_text, char **access_acl_text, char **default_acl_text, int flag) { int ret, access_count= 0, default_count= 0, pass, is_default, line_len; int was_error= 0, line_count= 0, perms; char *acl_text= NULL, *cpt, *npt, *access_wpt= NULL, *default_wpt= NULL; char *dpt= NULL, *ddpt= NULL, **wpt, *ppt; if(in_text[0] == 0 || strcmp(in_text, "clear") == 0 || strcmp(in_text, "--remove-all") == 0) { *access_acl_text= *default_acl_text= NULL; return(1); } else if (strcmp(in_text, "--remove-default") == 0) { /* >>> protect Access-ACL and delete Default-ACL */; /* <<< */ return(0); } acl_text= strdup(in_text); if(acl_text == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); {ret= -1; goto ex;} } /* From comma to newline */ for(cpt= strchr(acl_text, ','); cpt != NULL; cpt= strchr(cpt + 1, ',')) *cpt= '\n'; /* Normalize to long text form and sort apart "access" ACL from "default" ACL */; for(pass= 0; pass < 2; pass++) { line_count= 0; for(cpt= acl_text; cpt != NULL; cpt= npt) { line_count++; npt= strchr(cpt, '\n'); if(npt != NULL) npt++; if(*cpt == '#' || *cpt == '\n' || *cpt == 0) continue; is_default= 0; wpt= &access_wpt; if(*cpt == 'd') { is_default= 1; if(pass == 1) wpt= &default_wpt; cpt= strchr(cpt, ':'); if(cpt == NULL) { was_error= line_count; continue; } cpt++; } line_len= 0; dpt= strchr(cpt, ':'); if(dpt != NULL) ddpt= strchr(dpt + 1, ':'); if(dpt == NULL || ddpt == NULL) { was_error= line_count; continue; } if(*cpt == 'u') { if(pass == 0) { line_len+= 5; line_len+= ddpt - dpt; } else { strcpy(*wpt, "user:"); strncpy(*wpt + 5, dpt + 1, ddpt - dpt); (*wpt)+= 5 + (ddpt - dpt); } } else if(*cpt == 'g') { if(pass == 0) { line_len+= 6 + (ddpt - dpt); } else { strcpy(*wpt, "group:"); strncpy(*wpt + 6, dpt + 1, ddpt - dpt); (*wpt)+= 6 + (ddpt - dpt); } } else if(*cpt == 'o') { if(pass == 0) { if(ddpt - dpt > 1) { was_error= line_count; continue; } line_len+= 6 + (ddpt - dpt); } else { strcpy(*wpt, "other:"); strncpy(*wpt + 6, dpt + 1, ddpt - dpt); (*wpt)+= 6 + (ddpt - dpt); } } else if(*cpt == 'm') { if(pass == 0) { if(ddpt - dpt > 1) { was_error= line_count; continue; } line_len+= 5 + (ddpt - dpt); } else { strcpy(*wpt, "mask:"); strncpy(*wpt + 5, dpt + 1, ddpt - dpt); (*wpt)+= 5 + (ddpt - dpt); } } else { /* Unknown tag type */ was_error= line_count; continue; } /* Examine permissions at ddpt + 1 */; perms= 0; for(ppt= ddpt + 1; *ppt != 0 && *ppt != '\n'; ppt++) { if(*ppt == 'r') perms|= 4; else if(*ppt == 'w') perms|= 2; else if(*ppt == 'x') perms|= 1; else if(*ppt == '-' || *ppt == ' ' || *ppt == '\t') ; else if(*ppt == '#') break; else { was_error= line_count; break; } } if(pass == 0) { line_len+= 4; } else { sprintf(*wpt, "%c%c%c\n", perms & 4 ? 'r' : '-', perms & 2 ? 'w' : '-', perms & 1 ? 'x' : '-'); (*wpt)+= 4; } if(pass == 0) { if(is_default) default_count+= line_len; else access_count+= line_len; } } if(pass == 0) { *access_acl_text= calloc(access_count + 1, 1); *default_acl_text= calloc(default_count + 1, 1); if(*access_acl_text == NULL || *default_acl_text == NULL) { Xorriso_no_malloc_memory(xorriso, access_acl_text, 0); {ret= -1; goto ex;} } access_wpt= *access_acl_text; default_wpt= *default_acl_text; } else { *access_wpt= 0; *default_wpt= 0; } } ret= 1; ex:; if(acl_text != NULL) free(acl_text); if(was_error) { sprintf(xorriso->info_text, "Malformed ACL entries encountered. Last one in line number %d.", was_error); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(ret); } libisoburn-1.5.4/xorriso/text_io.c0000644000175700017510000044450213756463026014173 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of text i/o functions. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include /* O_BINARY is needed for Cygwin but undefined elsewhere */ #ifndef O_BINARY #define O_BINARY 0 #endif /* for -charset */ #include #include #include #ifdef Xorriso_with_readlinE #ifdef Xorriso_with_old_readlinE #include #include #else /* Xorriso_with_old_readlinE */ #include #include #endif /* ! Xorriso_with_old_readlinE */ #define Xorriso_with_line_editoR yes #endif /* Xorriso_with_readlinE */ #ifdef Xorriso_with_editlinE #include #define Xorriso_with_line_editoR yes #endif /* Xorriso_with_editlinE */ #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" int Xorriso_protect_stdout(struct XorrisO *xorriso, int flag) { if(xorriso->dev_fd_1>=0) return(2); xorriso->dev_fd_1= dup(1); close(1); dup2(2,1); return(1); } #ifdef Xorriso_with_editlinE /* These have to be global and shared by all XorrisOs which might be active. */ static EditLine *editline_handle= NULL; static History *editline_history= NULL; static int editline_is_initialized= 0; char *Xorriso__editline_prompt(EditLine *el_handle) { return ""; } void Xorriso_init_editline(struct XorrisO *xorriso, int flag) { HistEvent ev; /* >>> Need mutex */ if(editline_is_initialized != 0) return; editline_is_initialized= -1; /* Invalid */ editline_handle= el_init(xorriso->progname, stdin, stdout, stderr); if(editline_handle == NULL) return; el_set(editline_handle, EL_EDITOR, "emacs"); el_set(editline_handle, EL_PROMPT, &Xorriso__editline_prompt); editline_history= history_init(); if(editline_history == NULL) return; history(editline_history, &ev, H_SETSIZE, 1000); el_set(editline_handle, EL_HIST, history, editline_history); editline_is_initialized= 1; /* Valid now */ return; } int Xorriso__shutdown_editline(int flag) { if(editline_history != NULL) history_end(editline_history); editline_history= NULL; if(editline_handle != NULL) el_end(editline_handle); editline_handle= NULL; editline_is_initialized= 0; return(1); } #endif /* Xorriso_with_editlinE */ #ifdef Xorriso_with_readlinE /* http://lists.gnu.org/archive/html/bug-readline/2014-06/msg00005.html */ const char *Xorriso__readline_license(int flag) { #ifdef RL_VERSION_MAJOR #if RL_VERSION_MAJOR > 5 return("GPLv3+"); #endif #endif return("GPLv2+"); } #endif /* Xorriso_with_readlinE */ #ifdef Xorriso_with_line_editoR char *Xorriso_emul_readline(struct XorrisO *xorriso, int flag) { #ifdef Xorriso_with_editlinE const char *cpt; int count= 0; char *retpt; /* >>> Need mutex */ Xorriso_init_editline(xorriso, 0); if(editline_is_initialized < 0) { /* >>> fallback */; } cpt= el_gets(editline_handle, &count); if(count == -1 || cpt == NULL) return(NULL); retpt= calloc(1, count + 1); if(retpt == NULL) return(NULL); memcpy(retpt, cpt, count); retpt[count]= 0; return(retpt); #else #ifdef Xorriso_with_readlinE char *cpt; cpt= readline(""); return(cpt); #else return(NULL); #endif /* ! Xorriso_with_readlinE */ #endif /* ! Xorriso_with_editlinE */ } void Xorriso_emul_add_history(struct XorrisO *xorriso, char *line, int flag) { #ifdef Xorriso_with_editlinE HistEvent ev; /* >>> Need mutex */ Xorriso_init_editline(xorriso, 0); if(editline_is_initialized < 0) return; history(editline_history, &ev, H_ENTER, line); #else #ifdef Xorriso_with_readlinE add_history(line); #else /* ??? How to raise protest ? */; #endif /* ! Xorriso_with_readlinE */ #endif /* ! Xorriso_with_editlinE */ } /* @param flag bit1= do only report to fp */ int Xorriso_status_history(struct XorrisO *xorriso, char *filter, FILE *fp, int flag) { #ifdef Xorriso_with_editlinE int ret, l; HistEvent ev; int hc, i, was_end= 0; char *str= NULL; /* >>> Need mutex */ Xorriso_init_editline(xorriso, 0); if(editline_is_initialized < 0) {ret= 0; goto ex;} Xorriso_alloc_meM(str, char, SfileadrL); ret= history(editline_history, &ev, H_LAST); for(hc= 0; ret != -1; hc++) { ret= history(editline_history, &ev, H_PREV); was_end = (strcmp(ev.str, "-end") == 0); } if(was_end) hc--; if(hc >= xorriso->status_history_max) i= hc - xorriso->status_history_max; else i= 0; ret= history(editline_history, &ev, H_LAST); for(; i < hc && ret != -1; i++) { /* Eat newline at line end */ strncpy(str, ev.str, SfileadrL - 1); str[SfileadrL - 1]= 0; l= strlen(str); if(l > 0) if(str[l - 1] == '\n') str[l - 1]= 0; sprintf(xorriso->result_line, "-history "); Text_shellsafe(str, xorriso->result_line, 1); strcat(xorriso->result_line, "\n"); Xorriso_status_result(xorriso, filter, fp, flag & 2); ret= history(editline_history, &ev, H_PREV); } ret= 1; ex:; Xorriso_free_meM(str); return(ret); #else #ifdef Xorriso_with_readlinE HIST_ENTRY **hl; int hc, i; hl= history_list(); if(hl != NULL) { for(hc= 0; hl[hc] != NULL; hc++); if(hc > 0) if(strcmp(hl[hc-1]->line, "-end") == 0) hc--; if(hc >= xorriso->status_history_max) i= hc - xorriso->status_history_max; else i= 0; for(; i < hc; i++) { sprintf(xorriso->result_line, "-history "); Text_shellsafe(hl[i]->line, xorriso->result_line, 1); strcat(xorriso->result_line, "\n"); Xorriso_status_result(xorriso, filter, fp, flag & 2); } } return(1); #else /* Xorriso_with_readlinE */ return(0); #endif /* ! Xorriso_with_readlinE */ #endif /* ! Xorriso_with_editlinE */ } #endif /* Xorriso_with_line_editoR */ int Xorriso_dialog_input(struct XorrisO *xorriso, char line[], int linesize, int flag) /* bit0= do not write to history bit1= do not read input (but eventually write to history) bit2= do not write to history line which begin with "-history:" or "-history " bit3= enforce single line dialog mode bit4= do not read from xorriso->buffered_dialog bit5= write to history in any case (if it is enabled at compile time) */ { char **argv= NULL, *linept, *why_append= ""; int ret, argc= 0, base_length= 0, l, append_line; #ifdef Xorriso_with_line_editoR static char last_input[SfileadrL]= {""}; int no_history= 0; char *cpt= NULL; #endif /* Xorriso_with_line_editoR */ double tdiff; struct timeval tv; struct Xorriso_lsT *next_lst; gettimeofday(&tv, NULL); tdiff= tv.tv_sec+(1.e-6*(double) tv.tv_usec); fflush(stdout); linept= line; #ifdef Xorriso_with_line_editoR no_history= (flag & 1) || xorriso->use_stdin; #endif get_single:; if(xorriso->buffered_dialog != NULL && !(flag & (16 | 2))) { /* Consume next buffered line */ next_lst= Xorriso_lst_get_next(xorriso->buffered_dialog, 0); strcpy(line, Xorriso_lst_get_text(xorriso->buffered_dialog, 0)); Xorriso_lst_destroy(&(xorriso->buffered_dialog), 0); xorriso->buffered_dialog= next_lst; goto process_single; } #ifdef Xorriso_with_line_editoR if(xorriso->use_stdin || xorriso->dev_fd_1>=0 || xorriso->tolerate_stdin_eof) { if(flag&2) { if(flag & 32) goto put_into_history; {ret= 1; goto ex;} } if(Sfile_fgets_n(linept,linesize - base_length - 1, stdin, (xorriso->dialog == 2)) == NULL) { if(xorriso->tolerate_stdin_eof) {ret= -2; goto ex;} /* need a very dramatic end */ kill(getpid(),SIGHUP); {ret= -1; goto ex;} } goto process_single; } if(flag&2) { cpt= NULL; } else { cpt= Xorriso_emul_readline(xorriso, 0); if(cpt==NULL) { /* need a very dramatic end */ kill(getpid(),SIGHUP); {ret= -1; goto ex;} } l= strlen(cpt); if(l >= linesize - base_length - 1) { strncpy(linept, cpt, linesize - 1); line[linesize - 1]= 0; sprintf(xorriso->info_text,"Input line too long !"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); goto new_empty; } else strcpy(linept, cpt); } #else /* Xorriso_with_line_editoR */ if(flag&2) {ret= 1; goto ex;} if(Sfile_fgets_n(linept, linesize - base_length - 1, stdin, (xorriso->dialog == 2)) == NULL) { if(xorriso->tolerate_stdin_eof) {ret= -2; goto ex;} /* need a very dramatic end */ kill(getpid(),SIGHUP); {ret= -1; goto ex;} } #endif /* ! Xorriso_with_line_editoR */ process_single:; if(xorriso->dialog == 2 && !(flag & 8)) { append_line= 0; if(linept != line && strcmp(linept, "@@@") == 0) { sprintf(xorriso->info_text, "Incomplete input line cleared by %s", linept); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE",0); new_empty:; line[0]= 0; linept= line; sprintf(xorriso->info_text, "-------------------------------------\n"); Xorriso_info(xorriso,0); sprintf(xorriso->info_text, "Enter new text for empty input line :\n"); Xorriso_info(xorriso,0); goto get_single; } l= strlen(line); ret= Sfile_make_argv("", line, &argc, &argv, 16); if(ret < 0) goto ex; if(ret == 0 && !append_line) { /* append a newline character */ if(l >= linesize - 1) { sprintf(xorriso->info_text,"Input line too long !"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); goto new_empty; } line[l]= '\n'; line[l + 1]= 0; append_line= 1; why_append= "Quoted newline char"; } if(l > 0 && !append_line) if(line[l - 1] == '\\') { line[l - 1]= 0; append_line= 1; why_append= "Trailing backslash "; } if(append_line) { base_length= strlen(line); linept= line + base_length; sprintf(xorriso->info_text, "---------------------------------------------------------------\n"); Xorriso_info(xorriso,0); sprintf(xorriso->info_text, "%s : Enter rest of line (or @@@ to clear it) :\n", why_append); Xorriso_info(xorriso,0); goto get_single; } } #ifdef Xorriso_with_line_editoR put_into_history:; if((flag & 32) || (line[0]!=0 && strcmp(last_input,line)!=0 && !no_history)) { if(!((flag&4) && (strncmp(line,"-history:",9)==0 || strncmp(line,"-history ",9)==0))) { Xorriso_emul_add_history(xorriso, line, 0); strncpy(last_input,line,sizeof(last_input)-1); last_input[sizeof(last_input)-1]= 0; } } #endif /* Xorriso_with_line_editoR */ ret= 1; ex:; #ifdef Xorriso_with_line_editoR if(cpt!=NULL) free(cpt); #endif gettimeofday(&tv, NULL); xorriso->idle_time+= tv.tv_sec+(1.e-6*(double) tv.tv_usec)-tdiff; return(ret); } int Xorriso_request_confirmation(struct XorrisO *xorriso, int flag) /* bit0= important operation going on: demand confirmation of abort, only abort on @@@ bit1= mark '@' and '@@' by return 4 bit2= accept: i|n= ignore | do not remove , r|y= retry | remove , q|x= abort bit3= @@@ = 'done reading' rather than 'abort' bit4= in non-dialog mode return 6 rather than 1 */ /* return: <=0 error 1= go on | do not remove existing file 2= abort 3= redo request for confirmation 4= see flag bit1 (5= skip volume) 6= retry failed operation | remove existing file */ { int ret; char *line= NULL, *cpt, *previous_line= NULL; char *abort_req_text,*abort_really_text; Xorriso_alloc_meM(line, char, SfileadrL); Xorriso_alloc_meM(previous_line, char, SfileadrL); if(!xorriso->dialog) { if(flag&16) {ret= 6; goto ex;} {ret= 1; goto ex;} } if(flag&8) { abort_req_text= "request to end"; abort_really_text= "done reading"; } else { abort_req_text= "request to abort"; abort_really_text= "abort this command"; } ret= Xorriso_dialog_input(xorriso,line, SfileadrL, 1); xorriso->result_line_counter= 0; xorriso->result_page_counter++; if(ret<=0) if(xorriso->result_page_length>0) xorriso->result_page_length= -xorriso->result_page_length; cpt= line; if(strcmp(cpt,"@@@")==0 || strcmp(cpt,"x")==0 || strcmp(cpt,"X")==0 || strcmp(cpt,"q")==0 || strcmp(cpt,"Q")==0) { if(flag&1) { strcpy(previous_line,cpt); sprintf(xorriso->info_text, "... [%s = %s registered. Really %s ? (y/n) ] ...\n", cpt,abort_req_text,abort_really_text); Xorriso_info(xorriso,0); ret= Xorriso_dialog_input(xorriso,line, SfileadrL, 1); if(ret<=0) goto ex; cpt= line; if(strcmp(cpt,previous_line)==0 || ((*cpt=='Y' || *cpt=='y' || *cpt=='j' || *cpt=='J' || *cpt=='1') && *(cpt+1)==0)) { xorriso->request_to_abort= 1; sprintf(xorriso->info_text, "------- ( %s confirmed )\n",abort_req_text); Xorriso_info(xorriso,0); {ret= 2; goto ex;} } sprintf(xorriso->info_text, "....... ( %s revoked )\n",abort_req_text); Xorriso_info(xorriso,0); {ret= 3; goto ex;} } xorriso->request_to_abort= 1; sprintf(xorriso->info_text, "----------- [%s = request to abort registered. Operation ends ] ------------\n", cpt); Xorriso_info(xorriso,0); {ret= 2; goto ex;} } else if(*cpt=='@') { if(strcmp(cpt,"@@")==0) { goto klammer_affe; } else if(strcmp(cpt,"@")==0) { klammer_affe:; if(xorriso->result_page_length>0) xorriso->result_page_length= -xorriso->result_page_length; if(flag&1) { sprintf(xorriso->info_text, "... [@ = prompt suppression registered. Prompting disabled temporarily ] ...\n"); Xorriso_info(xorriso,0); } } else { Xorriso_dialog_input(xorriso,cpt,strlen(line)+1,2); /* write to history */ sprintf(xorriso->info_text, "--- Unrecognized input beginning with @. Please enter something else.\n"); Xorriso_info(xorriso,0); {ret= 3; goto ex;} } if(flag&2) {ret= 4; goto ex;} if(flag&1) {ret= 3; goto ex;} {ret= 1; goto ex;} } else if(flag&4) { if(strcmp(cpt,"i")==0 || strcmp(cpt,"I")==0 || strcmp(cpt,"n")==0 || strcmp(cpt,"N")==0 || *cpt==0) { {ret= 1; goto ex;} } else if(strcmp(cpt,"r")==0 || strcmp(cpt,"R")==0 || strcmp(cpt,"y")==0 || strcmp(cpt,"Y")==0) { {ret= 6; goto ex;} } else { /* >>> unknown input */ sprintf(xorriso->info_text, "--- Please enter one of : empty line, i,n, r,y, q,x, @, @@@\n"); Xorriso_info(xorriso,0); {ret= 3; goto ex;} } } else if(*cpt!=0 && !(flag&1)) { Xorriso_dialog_input(xorriso,cpt,strlen(line)+1,2); /* write to history */ strcpy(xorriso->pending_option,cpt); xorriso->request_to_abort= 1; sprintf(xorriso->info_text, "-------------- [ Input of option registered. Operation ends ] ---------------\n"); Xorriso_info(xorriso,0); {ret= 2; goto ex;} } else if(*cpt!=0) { Xorriso_dialog_input(xorriso,cpt,strlen(line)+1,2); /* write to history */ sprintf(xorriso->info_text, "--- Please enter one of : empty line, @, @@@\n"); Xorriso_info(xorriso,0); {ret= 3; goto ex;} } ret= 1; ex:; Xorriso_free_meM(line); Xorriso_free_meM(previous_line); return(ret); } /* @param flag bit0= quoted multiline mode bit1= release allocated memory and return 1 bit2= with bit0: warn of empty text arguments bit3= deliver as single quoted text including all whitespace and without any backslash interpretation @return -1=out of memory , 0=line format error , 1=ok, go on , 2=done */ int Xorriso_read_lines(struct XorrisO *xorriso, FILE *fp, int *linecount, int *argc, char ***argv, int flag) { char *line= NULL, *linept, *fgot; int l, base_length, append_line, ret, mem_linecount, i; Sfile_make_argv("", line, argc, argv, 2); if(flag & 2) {ret= 1; goto ex;} Xorriso_alloc_meM(line, char, 5 * SfileadrL + 2); mem_linecount= *linecount; linept= line; base_length= 0; while(1) { fgot= Sfile_fgets_n(linept, SfileadrL - base_length - 1, fp, !!(flag & (1 | 8))); if(fgot == NULL) { if(ferror(fp)) {ret= 0; goto ex;} if(linept != line) { sprintf(xorriso->info_text,"Open quotation mark at end of input"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } {ret= 2; goto ex;} } l= strlen(line); (*linecount)++; append_line= 0; if(flag & 1) { /* check whether the line is incomplete yet */ ret= Sfile_make_argv("", line, argc, argv, 16); if(ret < 0) goto ex; if(ret == 0 && !append_line) { line[l]= '\n'; line[l + 1]= 0; append_line= 1; } if(l > 0 && !append_line) if(line[l - 1] == '\\') { line[l - 1]= 0; append_line= 1; } } if(l >= SfileadrL) { sprintf(xorriso->info_text,"Input line too long !"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } if(!append_line) break; base_length= strlen(line); linept= line + base_length; } if((flag & 1) && !(flag & 8)) { ret= Sfile_make_argv("", line, argc, argv, 1 | ((xorriso->bsl_interpretation & 3) << 5)); if(ret < 0) goto ex; if(flag & 4) for(i= 0; i < *argc; i++) { if((*argv)[i][0] == 0) { sprintf(xorriso->info_text, "Empty text as quoted argument in "); } else if(strlen((*argv)[i]) >= SfileadrL) { (*argv)[i][SfileadrL - 1]= 0; sprintf(xorriso->info_text, "Input text too long and now truncated in"); } else continue; if(mem_linecount + 1 < *linecount) sprintf(xorriso->info_text + strlen(xorriso->info_text), "lines %d to %d", mem_linecount + 1, *linecount); else sprintf(xorriso->info_text + strlen(xorriso->info_text), "line %d", mem_linecount + 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } } else { (*argv)= Smem_malloC(sizeof(char *)); if(*argv == NULL) {ret= -1; goto ex;} (*argv)[0]= strdup(line); if((*argv)[0] == NULL) { free(*argv); (*argv)= NULL; {ret= -1; goto ex;} } *argc= 1; } ret= 1; ex:; Xorriso_free_meM(line); return(ret); } int Xorriso_predict_linecount(struct XorrisO *xorriso, char *line, int *linecount, int flag) { int width,l; char *spt,*ept; *linecount= 0; spt= line; width= xorriso->result_page_width; while(1) { ept= strchr(spt,'\n'); if(ept==NULL) l= strlen(spt); else l= ept-spt; l+= xorriso->result_open_line_len; if(ept!=NULL && l==0) (*linecount)++; else { (*linecount)+= l/width; if(ept==NULL) { xorriso->result_open_line_len= l%width; break; } (*linecount)+= !!(l%width); } xorriso->result_open_line_len= 0; spt= ept+1; } return(1); } int Xorriso_pager(struct XorrisO *xorriso, char *line, int flag) /* bit1= mark '@' by return 4 */ /* return: <=0 error , 1=go on , 2=abort , 4=see flag bit1*/ { int ret,linecount; char *info_text= NULL; if(xorriso->result_page_length<=0 || xorriso->request_not_to_ask || xorriso->dialog == 0) {ret= 1; goto ex;} Xorriso_predict_linecount(xorriso,line,&linecount,0); if(xorriso->result_line_counter+linecount>xorriso->result_page_length) { ask_for_page:; if(info_text == NULL) Xorriso_alloc_meM(info_text, char, 10*SfileadrL); strcpy(info_text,xorriso->info_text); sprintf(xorriso->info_text,"\n"); Xorriso_info(xorriso,0); sprintf(xorriso->info_text, ".... [Press Enter to continue. @,Enter avoids further stops. @@@ aborts] ....\n"); Xorriso_info(xorriso,0); ret= Xorriso_request_confirmation(xorriso,flag&2); strcpy(xorriso->info_text,info_text); if(ret<=0) goto ex; if(ret==2) {ret= 2; goto ex;} if(ret==3) goto ask_for_page; } xorriso->result_line_counter+= linecount; ret= 1; ex:; Xorriso_free_meM(info_text); return(ret); } /* @param flag bit0= no error message in case of failure */ static int Xorriso_obtain_lock(struct XorrisO *xorriso, pthread_mutex_t *lock_handle, char *purpose, int flag) { int ret; static int complaints= 0, complaint_limit= 5; ret= pthread_mutex_lock(lock_handle); if(ret != 0) { if(flag & 1) return(-1); /* Cannot report failure through the failing message output system */ complaints++; if(complaints <= complaint_limit) fprintf(stderr, "xorriso : pthread_mutex_lock() for %s returns %d\n", purpose, ret); return(-1); } return(1); } /* @param flag bit0= no error message in case of failure */ static int Xorriso_release_lock(struct XorrisO *xorriso, pthread_mutex_t *lock_handle, char *purpose, int flag) { int ret; static int complaints= 0, complaint_limit= 5; ret= pthread_mutex_unlock(lock_handle); if(ret != 0) { if(flag & 1) return(0); /* Cannot report failure through the failing message output system */ complaints++; if(complaints <= complaint_limit) fprintf(stderr, "xorriso : pthread_mutex_unlock() for %s returns %d\n", purpose, ret); return(0); } return(1); } static int Xorriso_lock_outlists(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_obtain_lock(xorriso, &(xorriso->result_msglists_lock), "outlists", 0); return(ret); } static int Xorriso_unlock_outlists(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_release_lock(xorriso, &(xorriso->result_msglists_lock), "outlists", 0); return(ret); } static int Xorriso_write_to_msglist(struct XorrisO *xorriso, struct Xorriso_lsT **xorriso_msglist, char *text, int flag) { int ret, locked= 0; struct Xorriso_lsT *msglist; ret= Xorriso_lock_outlists(xorriso, 0); if(ret <= 0) goto ex; locked= 1; msglist= *xorriso_msglist; ret= Xorriso_lst_append_binary(&msglist, text, strlen(text) + 1, 0); if(ret <= 0) { ret= -1; goto ex; } if(*xorriso_msglist == NULL) *xorriso_msglist= msglist; ret= 1; ex:; if(locked) Xorriso_unlock_outlists(xorriso, 0); return(ret); } int Xorriso_write_to_channel(struct XorrisO *xorriso, char *in_text, int channel_no, int flag) /* bit0= eventually backslash encode linefeeds bit1= text is the name of the log file for the given channel bit2= text is the name of the consolidated packet log file for all channels bit3= text is the name of the stderr redirection file bit15= with bit1 to bit3: close depicted log file */ { char *rpt, *npt, *text= NULL, *line= NULL; int ret= 1, info_redirected= 0, result_redirected= 0, l; char prefix[16]; FILE *logfile_fp, *pktlog_fp; static int num_channels= 4; static char channel_prefixes[4][4]= {".","R","I","M"}; int Xorriso_sieve_filter_msg(struct XorrisO *xorriso, char *msg, int flag); #ifdef Xorriso_fetch_with_msg_queueS static int complaints= 0, complaint_limit= 5; int locked= 0, uret; #endif text= in_text; /* might change due to backslash encoding */ if(channel_no<0 || channel_no>=num_channels) {ret= -1; goto ex;} #ifdef Xorriso_fetch_with_msg_queueS ret= pthread_mutex_lock(&(xorriso->write_to_channel_lock)); if(ret != 0) { /* Cannot report failure through the failing message output system */ complaints++; if(complaints <= complaint_limit) fprintf(stderr, "xorriso : pthread_mutex_lock() for write_to_channel returns %d\n", ret); /* Intentionally not aborting here */; } else locked= 1; #endif /* Xorriso_fetch_with_msg_queueS */ /* Logfiles */ logfile_fp= xorriso->logfile_fp[channel_no]; pktlog_fp= xorriso->pktlog_fp; if((flag&2) && logfile_fp!=NULL) { fprintf(logfile_fp, "! end ! end ! end ! end ! end ! end ! end ! end xorriso log : %s : %s\n", channel_prefixes[channel_no],Sfile_datestr(time(0),1|2|256)); fclose(logfile_fp); xorriso->logfile_fp[channel_no]= logfile_fp= NULL; } if((flag&4) && pktlog_fp!=NULL) { fprintf(pktlog_fp, "I:1:! end ! end ! end ! end ! end ! end ! end ! end xorriso log : %s : %s\n", channel_prefixes[channel_no],Sfile_datestr(time(0),1|2|256)); fclose(pktlog_fp); xorriso->pktlog_fp= pktlog_fp= NULL; } if((flag & 8) && xorriso->stderr_fp != NULL) { fclose(xorriso->stderr_fp); xorriso->stderr_fp= NULL; } if(flag&(1<<15)) {ret= 1; goto ex;} if((flag&2)) { xorriso->logfile_fp[channel_no]= logfile_fp= fopen(text,"a"); if(logfile_fp==NULL) {ret= 0; goto ex;} fprintf(logfile_fp, "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! xorriso log : %s : %s\n", channel_prefixes[channel_no],Sfile_datestr(time(0),1|2|256)); fflush(logfile_fp); } if((flag&4)) { xorriso->pktlog_fp= pktlog_fp= fopen(text,"a"); if(pktlog_fp==NULL) {ret= 0; goto ex;} fprintf(pktlog_fp, "I:1:!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! xorriso log : . : %s\n", Sfile_datestr(time(0),1|2|256)); fflush(pktlog_fp); } if(flag & 8) { ret= truncate(text, (off_t) 0); if(ret == -1 && errno != ENOENT) {ret= 0; goto ex;} xorriso->stderr_fp= fopen(text, "a"); if(xorriso->stderr_fp == NULL) {ret= 0; goto ex;} } if(flag & (2 | 4 | 8)) {ret= 1; goto ex;} /* Eventually perform backslash encoding of non-printable characters */ if(((xorriso->bsl_interpretation & 32) && channel_no == 1) || ((xorriso->bsl_interpretation & 64) && channel_no == 2)) { ret= Sfile_bsl_encoder(&text, text, strlen(text), 1 | 2 | 4); if(ret <= 0) {ret= -1; goto ex;} } /* Pick interesting words for the Xorriso_sieve API */ Xorriso_sieve_filter_msg(xorriso, text, (channel_no > 0 ? channel_no - 1 : 0)); /* Eventually perform message redirection */ if(xorriso->msglist_stackfill > 0) { if(xorriso->msglist_flags[xorriso->msglist_stackfill - 1] & 1) result_redirected= 1; if(xorriso->msglist_flags[xorriso->msglist_stackfill - 1] & 2) info_redirected= 1; } /* Non-redirected output */ if(!xorriso->packet_output) { if(channel_no==1 || channel_no==3) { if(result_redirected) { ret= Xorriso_write_to_msglist(xorriso, &(xorriso->result_msglists[xorriso->msglist_stackfill - 1]), text, 0); if(ret <= 0) { ret= -1; goto ex; } } else { printf("%s",text); fflush(stdout); } } if(channel_no==2 || channel_no==3) { if(info_redirected) { ret= Xorriso_write_to_msglist(xorriso, &(xorriso->info_msglists[xorriso->msglist_stackfill - 1]), text, 0); if(ret <= 0) { ret= -1; goto ex; } } else { if(xorriso->stderr_fp != NULL) { fprintf(xorriso->stderr_fp, "%s", text); fflush(xorriso->stderr_fp); } else fprintf(stderr, "%s", text); } } if(logfile_fp!=NULL) { fprintf(logfile_fp,"%s",text); fflush(logfile_fp); } if(pktlog_fp==NULL) {ret= 1; goto ex;} } rpt= text; sprintf(prefix,"%s:x: ",channel_prefixes[channel_no]); while(*rpt!=0) { npt= strchr(rpt,'\n'); if(npt==NULL) prefix[2]= '0'; else prefix[2]= '1'; if(!result_redirected) { if(xorriso->packet_output) { ret= fwrite(prefix,5,1,stdout); if(ret<=0) {ret= 0; goto ex;} } } if(pktlog_fp!=NULL) { ret= fwrite(prefix,5,1,pktlog_fp); if(ret<=0) {ret= 0; goto ex;} } if(npt==NULL) { if(xorriso->packet_output) { if(result_redirected) { l= strlen(rpt); Xorriso_alloc_meM(line, char, 5 + l + 1 + 1); memcpy(line, prefix, 5); memcpy(line + 5, rpt, l); line[5 + l] = '\n'; line[5 + l + 1] = 0; ret= Xorriso_write_to_msglist(xorriso, &(xorriso->result_msglists[xorriso->msglist_stackfill - 1]), line, 0); Xorriso_free_meM(line); line= NULL; if(ret <= 0) { ret= -1; goto ex; } } else { ret= fwrite(rpt,strlen(rpt),1,stdout); if(ret<=0) {ret= 0; goto ex;} ret= fwrite("\n",1,1,stdout); if(ret<=0) {ret= 0; goto ex;} } } if(pktlog_fp!=NULL) { ret= fwrite(rpt,strlen(rpt),1,pktlog_fp); if(ret<=0) {ret= 0; goto ex;} ret= fwrite("\n",1,1,pktlog_fp); if(ret<=0) {ret= 0; goto ex;} } break; } else { if(xorriso->packet_output) { if(result_redirected) { l= npt + 1 - rpt; Xorriso_alloc_meM(line, char, 5 + l + 1); memcpy(line, prefix, 5); memcpy(line + 5, rpt, l); line[5 + l] = 0; ret= Xorriso_write_to_msglist(xorriso, &(xorriso->result_msglists[xorriso->msglist_stackfill - 1]), line, 0); Xorriso_free_meM(line); line= NULL; if(ret <= 0) { ret= -1; goto ex; } } else { ret= fwrite(rpt,npt+1-rpt,1,stdout); if(ret<=0) {ret= 0; goto ex;} } } if(pktlog_fp!=NULL) { ret= fwrite(rpt,npt+1-rpt,1,pktlog_fp); if(ret<=0) {ret= 0; goto ex;} } } rpt= npt+1; } if(xorriso->packet_output) fflush(stdout); if(pktlog_fp!=NULL) fflush(pktlog_fp); ret= 1; ex: if(text != in_text && text != NULL) free(text); Xorriso_free_meM(line); #ifdef Xorriso_fetch_with_msg_queueS if(locked) { uret= pthread_mutex_unlock(&(xorriso->write_to_channel_lock)); if(uret != 0) { /* Cannot report failure through the failing message output system */ complaints++; if(complaints <= complaint_limit) fprintf(stderr, "xorriso : pthread_mutex_unlock() for write_to_channel returns %d\n", uret); } } #endif /* Xorriso_fetch_with_msg_queueS */ return(ret); } int Xorriso_push_outlists(struct XorrisO *xorriso, int *stack_handle, int flag) { int ret, locked= 0; ret= Xorriso_lock_outlists(xorriso, 0); if(ret <= 0) goto ex; locked= 1; if(xorriso->msglist_stackfill + 1 >= Xorriso_max_outlist_stacK) { Xorriso_unlock_outlists(xorriso, 0); locked= 0; Xorriso_msgs_submit(xorriso, 0, "Overflow of message output redirection stack", 0, "FATAL", 0); ret= -1; goto ex; } if((flag & 3) == 0) flag|= 3; xorriso->msglist_stackfill++; xorriso->result_msglists[xorriso->msglist_stackfill - 1]= NULL; xorriso->info_msglists[xorriso->msglist_stackfill - 1]= NULL; xorriso->msglist_flags[xorriso->msglist_stackfill - 1]= flag & 3; *stack_handle= xorriso->msglist_stackfill - 1; ret= 1; ex:; if(locked) Xorriso_unlock_outlists(xorriso, 0); return(ret); return(1); } int Xorriso_fetch_outlists(struct XorrisO *xorriso, int stack_handle, struct Xorriso_lsT **result_list, struct Xorriso_lsT **info_list, int flag) { int ret, locked= 0; #ifdef Xorriso_fetch_with_msg_queueS ret= Xorriso_process_msg_queues(xorriso, 0); if(ret <= 0) goto ex; #endif /* Xorriso_fetch_with_msg_queueS */ if((flag & 3) == 0) flag|= 3; ret= Xorriso_lock_outlists(xorriso, 0); if(ret <= 0) goto ex; locked= 1; if(stack_handle == -1) stack_handle= xorriso->msglist_stackfill - 1; if(stack_handle < 0 || stack_handle >= xorriso->msglist_stackfill) { Xorriso_unlock_outlists(xorriso, 0); locked= 0; Xorriso_msgs_submit(xorriso, 0, "Program error: Wrong message output redirection stack handle", 0, "FATAL", 0); ret= -1; goto ex; } if(flag & 1) { *result_list= xorriso->result_msglists[stack_handle]; xorriso->result_msglists[stack_handle]= NULL; } if(flag & 2) { *info_list= xorriso->info_msglists[stack_handle]; xorriso->info_msglists[stack_handle]= NULL; } ret= 1; ex:; if(locked) Xorriso_unlock_outlists(xorriso, 0); return(ret); } int Xorriso_peek_outlists(struct XorrisO *xorriso, int stack_handle, int timeout, int flag) { int ret, locked= 0, yes= 0; static int u_wait= 19000; time_t start_time; if((flag & 3) == 0) flag|= 3; if(stack_handle == -1) stack_handle= xorriso->msglist_stackfill - 1; start_time= time(NULL); try_again:; ret= Xorriso_obtain_lock(xorriso, &(xorriso->msgw_fetch_lock), "message watcher fetch operation", 0); if(ret <= 0) {yes= -2; goto ex;} locked= 1; yes= 0; if(stack_handle < 0 || stack_handle >= xorriso->msglist_stackfill) {yes= -1; goto ex;} if(flag & 1) yes|= (xorriso->result_msglists[stack_handle] != NULL); if(flag & 2) yes|= (xorriso->info_msglists[stack_handle] != NULL); if(xorriso->msg_watcher_state == 2 && xorriso->msgw_msg_pending) yes|= 2; ret= Xorriso_release_lock(xorriso, &(xorriso->msgw_fetch_lock), "message watcher fetch operation", 0); if(ret <= 0) {yes= -2; goto ex;} locked= 0; if(yes && (flag & 4)) { usleep(u_wait); if(time(NULL) <= start_time + timeout) goto try_again; } ex:; if(locked) { ret= Xorriso_release_lock(xorriso, &(xorriso->msgw_fetch_lock), "message watcher fetch operation", 0); if(ret <= 0 && yes >= 0) yes= -2; } return(yes); } int Xorriso_pull_outlists(struct XorrisO *xorriso, int stack_handle, struct Xorriso_lsT **result_list, struct Xorriso_lsT **info_list, int flag) { int i, ret, locked= 0; ret= Xorriso_lock_outlists(xorriso, 0); if(ret <= 0) goto ex; locked= 1; if(stack_handle == -1) stack_handle= xorriso->msglist_stackfill - 1; if(stack_handle < 0 || stack_handle >= xorriso->msglist_stackfill) { Xorriso_unlock_outlists(xorriso, 0); locked= 0; Xorriso_msgs_submit(xorriso, 0, "Program error: Wrong message output redirection stack handle", 0, "FATAL", 0); ret= -1; goto ex; } /* Concatenate all redirections above stack_handle */ *result_list= NULL; *info_list= NULL; for(i = stack_handle; i < xorriso->msglist_stackfill; i++) { if(*result_list == NULL) *result_list= xorriso->result_msglists[i]; else Xorriso_lst_concat(*result_list, xorriso->result_msglists[i], 0); if(*info_list == NULL) *info_list= xorriso->info_msglists[i]; else Xorriso_lst_concat(*info_list, xorriso->info_msglists[i], 0); } xorriso->msglist_stackfill= stack_handle; ret= 1; ex:; if(locked) Xorriso_unlock_outlists(xorriso, 0); return(ret); } int Xorriso_info_handler_stderr(void *handle, char *text) { struct XorrisO *xorriso; xorriso= (struct XorrisO *) handle; if(xorriso->stderr_fp != NULL) { fprintf(xorriso->stderr_fp, "%s", text); fflush(xorriso->stderr_fp); } else { fprintf(stderr, "%s", text); fflush(stderr); } return(1); } int Xorriso_result_handler_stdout(void *handle, char *text) { printf("%s", text); fflush(stdout); return(1); } int Xorriso_result_handler_pkt(void *handle, char *text) { int nl= -1, ret, l; struct XorrisO *xorriso; xorriso= (struct XorrisO *) handle; if(!xorriso->packet_output) return Xorriso_result_handler_stdout(handle, text); /* Interpret pkt_output */ l= strlen(text); if(l >= 5) { if(strchr("RIM", text[0]) != NULL && text[1] == ':' && strchr("01", text[2]) != NULL && text[3] == ':' && text[4] == ' ') nl= (text[2] == '1'); } if(nl < 0) /* Not pkt_output format */ return Xorriso_result_handler_stdout(handle, text); if(nl == 0) { /* Suppress newline */ if(text[l - 1] == '\n') l--; } if(text[0] == 'R') { ret= fwrite(text + 5, l - 5, 1, stdout); } else { ret= fwrite(text + 5, l - 5, 1, xorriso->stderr_fp != NULL ? xorriso->stderr_fp : stderr); } if(ret <= 0) return(0); return(1); } int Xorriso_process_msg_lists(struct XorrisO *xorriso, struct Xorriso_lsT *result_list, struct Xorriso_lsT *info_list, int *line_count, int flag) { struct Xorriso_lsT *lpt; int ret; int (*handler)(void *handle, char *text); void *handle; handler= xorriso->msgw_result_handler; handle= xorriso->msgw_result_handle; if(handler == NULL) { handler= Xorriso_result_handler_pkt; handle= xorriso; } for(lpt= result_list; lpt != NULL; lpt= lpt->next) { (*line_count)++; ret= (*handler)(handle, Xorriso_lst_get_text(lpt, 0)); if(ret < 0) return(-1); } handler= xorriso->msgw_info_handler; handle= xorriso->msgw_info_handle; if(handler == NULL) { handler= Xorriso_info_handler_stderr; handle= xorriso; } for(lpt= info_list; lpt != NULL; lpt= lpt->next) { (*line_count)++; ret= (*handler)(handle, Xorriso_lst_get_text(lpt, 0)); if(ret < 0) return(-1); } return(1); } static void *Xorriso_msg_watcher(void *state_pt) { struct XorrisO *xorriso; int ret, u_wait= 25000, line_count, sleep_thresh= 20, lock_failure= 0; struct Xorriso_lsT *result_list= NULL, *info_list= NULL; static int debug_sev= 0; xorriso= (struct XorrisO *) state_pt; if(debug_sev == 0) Xorriso__text_to_sev("DEBUG", &debug_sev, 0); xorriso->msg_watcher_state= 2; if(xorriso->msgw_info_handler != NULL && debug_sev < xorriso->report_about_severity && debug_sev < xorriso->abort_on_severity) (*xorriso->msgw_info_handler)(xorriso, "xorriso : DEBUG : Concurrent message watcher started\n"); while(1) { line_count= 0; /* Watch out for end request in xorriso */ if(xorriso->msg_watcher_state == 3) break; ret= Xorriso_obtain_lock(xorriso, &(xorriso->msgw_fetch_lock), "message watcher fetch operation", 1); if(ret <= 0) { lock_failure= 1; break; } xorriso->msgw_msg_pending= 1; ret= Xorriso_fetch_outlists(xorriso, -1, &result_list, &info_list, 3); if(ret > 0) { /* Process fetched lines */ xorriso->msgw_msg_pending= 2; Xorriso_release_lock(xorriso, &(xorriso->msgw_fetch_lock), "message watcher fetch operation", 1); ret= Xorriso_process_msg_lists(xorriso, result_list, info_list, &line_count, 0); xorriso->msgw_msg_pending= 0; Xorriso_lst_destroy_all(&result_list, 0); Xorriso_lst_destroy_all(&info_list, 0); if(ret < 0) break; } else { xorriso->msgw_msg_pending= 0; Xorriso_release_lock(xorriso, &(xorriso->msgw_fetch_lock), "message watcher fetch operation", 1); } xorriso->msgw_msg_pending= 0; if(ret < 0) break; if(line_count < sleep_thresh) usleep(u_wait); } if(xorriso->msgw_info_handler != NULL && debug_sev < xorriso->report_about_severity && debug_sev < xorriso->abort_on_severity && !lock_failure) (*xorriso->msgw_info_handler)(xorriso, "xorriso : DEBUG : Concurrent message watcher ended\n"); xorriso->msg_watcher_state= 0; return(NULL); } int Xorriso_start_msg_watcher(struct XorrisO *xorriso, int (*result_handler)(void *handle, char *text), void *result_handle, int (*info_handler)(void *handle, char *text), void *info_handle, int flag) { int ret, u_wait= 1000, locked= 0, pushed= 0, uret, line_count= 0; struct Xorriso_lsT *result_list= NULL, *info_list= NULL; pthread_attr_t attr; pthread_attr_t *attr_pt = NULL; pthread_t thread; ret= pthread_mutex_lock(&(xorriso->msg_watcher_lock)); if(ret != 0) { Xorriso_msgs_submit(xorriso, 0, "Cannot acquire mutex lock for managing concurrent message watcher", ret, "FATAL", 0); ret= -1; goto ex; } locked= 1; /* Check for running watcher */ if(xorriso->msg_watcher_state > 0) { sprintf(xorriso->info_text, "There is already a concurrent message watcher running"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= 0; goto ex; } ret= Xorriso_push_outlists(xorriso, &(xorriso->msgw_stack_handle), 3); if(ret <= 0) goto ex; pushed= 1; /* Register watcher */ xorriso->msgw_result_handler= result_handler; xorriso->msgw_result_handle= result_handle; xorriso->msgw_info_handler= info_handler; xorriso->msgw_info_handle= info_handle; xorriso->msg_watcher_state= 1; /* Start thread */ pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); attr_pt= &attr; ret= pthread_create(&thread, attr_pt, Xorriso_msg_watcher, xorriso); if(ret != 0) { sprintf(xorriso->info_text, "Cannot create thread for concurrent message watcher"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= 0; goto ex; } /* Wait until watcher has indicated start */ while(xorriso->msg_watcher_state == 1) { /* >>> have a timeout ? */; usleep(u_wait); } ret= 1; ex:; if(ret <= 0 && pushed) { uret= Xorriso_pull_outlists(xorriso, xorriso->msgw_stack_handle, &result_list, &info_list, 0); if(uret > 0) { xorriso->msgw_result_handler= NULL; xorriso->msgw_info_handler= NULL; Xorriso_process_msg_lists(xorriso, result_list, info_list, &line_count, 0); Xorriso_lst_destroy_all(&result_list, 0); Xorriso_lst_destroy_all(&info_list, 0); } } if(locked) { uret= pthread_mutex_unlock(&(xorriso->msg_watcher_lock)); if(uret != 0) { Xorriso_msgs_submit(xorriso, 0, "Cannot release mutex lock for managing concurrent message watcher", uret, "FATAL", 0); ret= -1; } } return(ret); } /* @param flag bit0= do not complain loudly if no wather is active */ int Xorriso_stop_msg_watcher(struct XorrisO *xorriso, int flag) { int ret, u_wait= 1000, locked= 0, uret, line_count= 0; struct Xorriso_lsT *result_list= NULL, *info_list= NULL; if((flag & 1) && xorriso->msg_watcher_state != 2) /* Roughly tolerate non-running watcher */ {ret= 0; goto ex;} ret= pthread_mutex_lock(&(xorriso->msg_watcher_lock)); if(ret != 0) { Xorriso_msgs_submit(xorriso, 0, "Cannot acquire mutex lock for managing concurrent message watcher", ret, "FATAL", 0); ret= -1; goto ex; } locked= 1; /* Check for running watcher */ if(xorriso->msg_watcher_state != 2) { sprintf(xorriso->info_text, "There is no concurrent message watcher running"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "SORRY", 0); ret= 0; goto ex; } /* Inform watcher of desire to stop it */ xorriso->msg_watcher_state= 3; /* Wait until watcher has indicated its end */ while(xorriso->msg_watcher_state != 0) { /* >>> have a timeout ? */; usleep(u_wait); } ret= Xorriso_obtain_lock(xorriso, &(xorriso->msgw_fetch_lock), "message watcher fetch operation", 1); if(ret <= 0) { Xorriso_msgs_submit(xorriso, 0, "Cannot obtain mutex lock for managing concurrent message watcher", ret, "FATAL", 0); ret= -1; goto ex; } xorriso->msgw_msg_pending= 1; ret= Xorriso_pull_outlists(xorriso, xorriso->msgw_stack_handle, &result_list, &info_list, 0); if(ret > 0) { xorriso->msgw_msg_pending= 2; Xorriso_release_lock(xorriso, &(xorriso->msgw_fetch_lock), "message watcher fetch operation", 1); Xorriso_process_msg_lists(xorriso, result_list, info_list, &line_count, 0); xorriso->msgw_msg_pending= 0; Xorriso_lst_destroy_all(&result_list, 0); Xorriso_lst_destroy_all(&info_list, 0); } else { xorriso->msgw_msg_pending= 0; Xorriso_release_lock(xorriso, &(xorriso->msgw_fetch_lock), "message watcher fetch operation", 1); } xorriso->msgw_result_handler= NULL; xorriso->msgw_info_handler= NULL; ret= 1; ex:; if(locked) { uret= pthread_mutex_unlock(&(xorriso->msg_watcher_lock)); if(uret != 0) { Xorriso_msgs_submit(xorriso, 0, "Cannot release mutex lock for managing concurrent message watcher", uret, "FATAL", 0); ret= -1; } } return(ret); } /* -------------------------- Xorriso_msg_sievE -------------------------- */ struct Xorriso_msg_filteR { char *name; char *prefix; char *separators; int channels; /* What to watch: bit0=result , bit1=info , bit2=mark */ int num_words; int *word_idx; int last_word_line_end; /* Oldest result gets discarded when new surpassed threshold */ int max_results; struct Xorriso_lsT *results; /* Serialized tuples of num_words */ int num_results; int num_delivered; struct Xorriso_lsT *next_to_deliver; struct Xorriso_msg_filteR *prev; struct Xorriso_msg_filteR *next; }; int Xorriso_msg_filter_destroy(struct Xorriso_msg_filteR **o, int flag); int Xorriso_msg_filter_new(struct Xorriso_msg_filteR **o, char *name, struct Xorriso_msg_filteR *prev, struct Xorriso_msg_filteR *next, int flag) { struct Xorriso_msg_filteR *m; m= (*o)= TSOB_FELD(struct Xorriso_msg_filteR, 1); if((*o) == NULL) return(-1); m->name= NULL; m->prefix= NULL; m->separators= NULL; m->channels= 7; m->num_words= 0; m->word_idx= NULL; m->last_word_line_end= flag & 1; m->max_results= 1; m->results= NULL; m->num_results= 0; m->num_delivered= 0; m->next_to_deliver= NULL; m->name= strdup(name); if(m->name == NULL) goto failure; m->prev= prev; if(prev != NULL) prev->next= m; m->next= next; if(next != NULL) next->prev= m; return(1); failure: Xorriso_msg_filter_destroy(o, 0); return(-1); } int Xorriso_msg_filter_destroy(struct Xorriso_msg_filteR **o, int flag) { struct Xorriso_msg_filteR *m; if((*o)==NULL) return(0); m= *o; if(m->name != NULL) free(m->name); if(m->prefix != NULL) free(m->prefix); if(m->separators != NULL) free(m->separators); if(m->word_idx != NULL) free((char *) m->word_idx); if(m->results != NULL) Xorriso_lst_destroy_all(&(m->results), 0); if(m->prev != NULL) m->prev->next= m->next; if(m->next != NULL) m->next->prev= m->prev; free(*o); *o= NULL; return(1); } int Xorriso_msg_filter_set_words(struct Xorriso_msg_filteR *m, int num_words, int *word_idx, int flag) { int i; if(m->word_idx != NULL) free(m->word_idx); m->num_words= 0; if(num_words <= 0) return(1); m->word_idx= TSOB_FELD(int, num_words); if(m->word_idx == NULL) return(-1); for(i= 0; i < num_words; i++) m->word_idx[i]= word_idx[i]; m->num_words= num_words; return(1); } struct Xorriso_msg_sievE { int num_filters; struct Xorriso_msg_filteR *first_filter; }; int Xorriso_msg_sieve_new(struct Xorriso_msg_sievE **o, int flag) { struct Xorriso_msg_sievE *m; m= (*o)= TSOB_FELD(struct Xorriso_msg_sievE, 1); if((*o) == NULL) return(-1); m->num_filters= 0; m->first_filter= NULL; return(1); } int Xorriso_msg_sieve_destroy(struct Xorriso_msg_sievE **o, int flag) { struct Xorriso_msg_sievE *m; struct Xorriso_msg_filteR *f, *next_f= NULL; if((*o) == NULL) return(0); m= *o; for(f= m->first_filter; f != NULL; f= next_f) { next_f= f->next; Xorriso_msg_filter_destroy(&f, 0); } free(*o); *o= NULL; return(1); } /* API */ int Xorriso_sieve_add_filter(struct XorrisO *xorriso, char *name, int channels, char *prefix, char *separators, int num_words, int *word_idx, int max_results, int flag) { int ret; struct Xorriso_msg_sievE *sieve= NULL; struct Xorriso_msg_filteR *filter; if(xorriso->msg_sieve == NULL) { ret= Xorriso_msg_sieve_new(&sieve, 0); if(ret <= 0) goto no_mem; xorriso->msg_sieve= sieve; } else sieve= xorriso->msg_sieve; ret= Xorriso_msg_filter_new(&filter, name, NULL, sieve->first_filter, flag & 1); if(ret <= 0) goto no_mem; sieve->first_filter= filter; ret= Xorriso_msg_filter_set_words(filter, num_words, word_idx, 0); if(ret <= 0) goto no_mem; if(prefix != NULL) filter->prefix= strdup(prefix); if(separators != NULL) filter->separators= strdup(separators); filter->channels= channels; filter->max_results= max_results; (sieve->num_filters)++; return(1); no_mem:; Xorriso_msg_sieve_destroy(&sieve, 0); Xorriso_no_malloc_memory(xorriso, NULL, 0); return(-1); } /* API */ int Xorriso_sieve_dispose(struct XorrisO *xorriso, int flag) { Xorriso_msg_sieve_destroy(&(xorriso->msg_sieve), 0); return(1); } /* API */ int Xorriso_sieve_clear_results(struct XorrisO *xorriso, int flag) { struct Xorriso_msg_filteR *f; if(xorriso->msg_sieve == NULL) return(1); for(f= xorriso->msg_sieve->first_filter; f != NULL; f= f->next) { f->num_results= 0; f->num_delivered= 0; if(f->results != NULL) Xorriso_lst_destroy_all(&(f->results), 0); f->next_to_deliver= NULL; } return(1); } /* API */ /* @param flag bit0= Reset reading to first matching result bit1= Only inquire number of available results. Do not allocate memory. bit2= If *argv is not NULL, then free it before attaching new memory. bit3= Do not read recorded data but rather list all filter names */ int Xorriso_sieve_get_result(struct XorrisO *xorriso, char *name, int *argc, char ***argv, int *available, int flag) { struct Xorriso_msg_filteR *f; struct Xorriso_lsT *lst; int i; if(flag & 4) Xorriso__dispose_words(argc, argv); *argc= 0; *argv= NULL; if(xorriso->msg_sieve == NULL) return(0); if(flag & 8) { if(xorriso->msg_sieve->num_filters <= 0) return(0); *argv= calloc(xorriso->msg_sieve->num_filters, sizeof(char *)); if(*argv == NULL) goto no_mem; *argc= xorriso->msg_sieve->num_filters; for(i= 0; i < *argc; i++) (*argv)[i]= NULL; i= 0; for(f= xorriso->msg_sieve->first_filter; f != NULL; f= f->next) { (*argv)[*argc - i - 1]= strdup(f->name); if((*argv)[*argc - i - 1] == NULL) goto no_mem; i++; } *argc= i; return(1); } for(f= xorriso->msg_sieve->first_filter; f != NULL; f= f->next) { if(strcmp(f->name, name) != 0) continue; *available= f->num_results - f->num_delivered; if(*available <= 0) return(0); if(flag & 2) return(1); if(flag & 1) { f->num_delivered= 0; f->next_to_deliver= NULL; } if(f->next_to_deliver == NULL) { f->next_to_deliver= f->results; for(i= 0; i < f->num_words * f->num_delivered; i++) if(f->next_to_deliver != NULL) f->next_to_deliver= Xorriso_lst_get_next(f->next_to_deliver, 0); } if(f->next_to_deliver == NULL) { /* Should not happen */ goto unexpected_null; } if(f->num_words <= 0) return(1); *argv= calloc(f->num_words, sizeof(char *)); if(*argv == NULL) goto no_mem; *argc= f->num_words; for(i= 0; i < *argc; i++) (*argv)[i]= NULL; lst= f->next_to_deliver; for(i= 0; i < *argc; i++) { if(lst != NULL) { (*argv)[i]= strdup(Xorriso_lst_get_text(lst, 0)); if((*argv)[i] == NULL) goto no_mem; } else { /* should not happen */ unexpected_null:; Xorriso_msgs_submit(xorriso, 0, "Program error: Unexpected NULL pointer in message sieve.", 0, "WARNING", 0); if(*argv != NULL) Xorriso__dispose_words(argc, argv); *available= 0; return(-2); } lst= Xorriso_lst_get_next(lst, 0); } f->next_to_deliver= lst; (f->num_delivered)++; (*available)--; return(1); } return(-2); no_mem: if(*argv != NULL) Xorriso__dispose_words(argc, argv); Xorriso_no_malloc_memory(xorriso, NULL, 0); return(-1); } int Xorriso_sieve_big(struct XorrisO *xorriso, int flag) { struct Xorriso_sieve_big_filteR { char *name; int channels; char *prefix; char *separators; int num_words; int word_idx[6]; int max_results; int flag; }; static struct Xorriso_sieve_big_filteR filters[] = { {"-changes_pending", 3, "-changes_pending", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 0}, {"? -dev", 3, "? -dev", "", 4, { 0, 1, 3, 4, -1, -1}, 10, 0}, {"?? -dev", 3, "?? -dev", "", 4, { 0, 1, 3, 4, -1, -1}, 90, 0}, {"Abstract File:", 3, "Abstract File: ", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 1}, {"After commit :", 3, "After commit :", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 0}, {"App Id :", 3, "App Id : ", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 1}, {"Biblio File :", 3, "Biblio File : ", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 1}, {"Build timestamp :", 3, "Build timestamp : ", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 1}, {"CopyrightFile:", 3, "CopyrightFile: ", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 1}, {"Creation Time:", 3, "Creation Time: ", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 1}, {"DVD obs 64 kB:", 3, "DVD obs 64 kB:", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 0}, {"Drive access :", 3, "Drive access : ", ": ", 2, { 0, 1, -1, -1, -1, -1}, 2, 0}, {"Drive current:", 3, "Drive current:", "", 2, { 0, 1, -1, -1, -1, -1}, 2, 0}, {"Drive id :", 3, "Drive id :", "", 1, { 0, -1, -1, -1, -1, -1}, 2, 0}, {"Drive type :", 3, "Drive type :", "", 3, { 1, 3, 5, -1, -1, -1}, 2, 0}, {"Eff. Time :", 3, "Eff. Time : ", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 1}, {"Expir. Time :", 3, "Expir. Time : ", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 1}, {"Ext. filters :", 3, "Ext. filters : ", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 1}, {"File damaged :", 3, "File damaged :", "", 4, { 0, 2, 4, 6, -1, -1}, 10000, 0}, {"File data lba:", 3, "File data lba:", "", 5, { 0, 2, 4, 6, 8, -1}, 10000, 0}, {"Format idx :", 3, "Format idx ", ",: ", 4, { 0, 1, 2, 3, -1, -1}, 100, 1}, {"Format status:", 3, "Format status:", ", ", 2, { 0, 1, -1, -1, -1, -1}, 1, 1}, {"ISO session :", 3, "ISO session :", "", 4, { 0, 2, 4, 6, -1, -1}, 10000, 1}, {"Image size :", 3, "Image size :", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 0}, {"Jigdo files :", 3, "Jigdo files :", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 0}, {"Local ACL :", 3, "Local ACL :", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 0}, {"Local xattr :", 3, "Local xattr :", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 0}, {"MD5 MISMATCH:", 3, "MD5 MISMATCH:", "", 1, { 0, -1, -1, -1, -1, -1}, 10000, 0}, {"MD5 tag range:", 3, "MD5 tag range:", "", 3, { 0, 2, 4, -1, -1, -1}, 10000, 1}, {"Media blocks :", 3, "Media blocks :", "", 3, { 0, 3, 6, -1, -1, -1}, 2, 0}, {"Media current:", 3, "Media current: ", "", 1, { 0, -1, -1, -1, -1, -1}, 2, 1}, {"Media id :", 3, "Media id :", "", 1, { 0, -1, -1, -1, -1, -1}, 2, 0}, {"Media nwa :", 3, "Media nwa :", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 0}, {"Media product:", 3, "Media product:", "", 2, { 0, 2, -1, -1, -1, -1}, 2, 1}, {"Media region :", 3, "Media region :", "", 3, { 0, 2, 4, -1, -1, -1}, 10000, 1}, {"Media space :", 3, "Media space :", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 0}, {"Media status :", 3, "Media status : ", "", 1, { 0, -1, -1, -1, -1, -1}, 2, 1}, {"Media summary:", 3, "Media summary:", "", 4, { 0, 2, 5, 7, -1, -1}, 2, 0}, {"Modif. Time :", 3, "Modif. Time : ", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 1}, {"PVD address :", 3, "PVD address :", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 0}, {"Preparer Id :", 3, "Preparer Id : ", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 1}, {"Profile :", 3, "Profile :", "", 2, { 0, 1, -1, -1, -1, -1}, 256, 1}, {"Publisher Id :", 3, "Publisher Id : ", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 1}, {"Readline :", 3, "Readline :", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 0}, {"Size lower :", 3, "Size lower :", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 0}, {"Size upper :", 3, "Size upper :", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 0}, {"System Id :", 3, "System Id : ", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 1}, {"Version timestamp :", 3, "Version timestamp :", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 0}, {"Volume Id :", 3, "Volume Id : ", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 1}, {"Volume Set Id:", 3, "Volume Set Id: ", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 1}, {"Volume id :", 3, "Volume id :", "", 1, { 0, -1, -1, -1, -1, -1}, 2, 0}, {"Write speed :", 3, "Write speed :", "", 2, { 0, 2, -1, -1, -1, -1}, 100, 0}, {"Write speed H:", 3, "Write speed H:", "", 2, { 0, 2, -1, -1, -1, -1}, 1, 0}, {"Write speed L:", 3, "Write speed L:", "", 2, { 0, 2, -1, -1, -1, -1}, 1, 0}, {"Write speed h:", 3, "Write speed h:", "", 2, { 0, 2, -1, -1, -1, -1}, 1, 0}, {"Write speed l:", 3, "Write speed l:", "", 2, { 0, 2, -1, -1, -1, -1}, 1, 0}, {"libburn in use :", 3, "libburn in use :", "", 2, { 0, 1, -1, -1, -1, -1}, 1, 1}, {"libburn OS adapter:", 3, "libburn OS adapter: ", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 1}, {"libisoburn in use :", 3, "libisoburn in use :", "", 2, { 0, 1, -1, -1, -1, -1}, 1, 1}, {"libisofs in use :", 3, "libisofs in use :", "", 2, { 0, 1, -1, -1, -1, -1}, 1, 1}, {"libjte in use :", 3, "libjte in use :", "", 2, { 0, 1, -1, -1, -1, -1}, 1, 1}, {"xorriso version :", 3, "xorriso version :", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 0}, {"zisofs :", 3, "zisofs :", "", 1, { 0, -1, -1, -1, -1, -1}, 1, 0}, {"@", 0, "@", "", 0, {-1, -1, -1, -1, -1, -1}, 0, 0} }; struct Xorriso_sieve_big_filteR *f; int ret, i; for(i= 0; ; i++) { f= &(filters[i]); if(strcmp(f->name, "@") == 0) break; ret= Xorriso_sieve_add_filter(xorriso, f->name, f->channels, f->prefix, f->separators, f->num_words, f->word_idx, f->max_results, f->flag); if(ret <= 0) goto failure; } return(1); failure: Xorriso_sieve_dispose(xorriso, 0); return(-1); } /* Check for matching filter and eventually extract words. To be called by Xorriso_result, Xorriso_info, Xorriso_mark, and alike. Thus no own message output is allowed here ! @param flag bit0-1= channel: 0= result channel 1= info channel 2= mark channel */ int Xorriso_sieve_filter_msg(struct XorrisO *xorriso, char *msg, int flag) { int channel, ret, argc= 0, i, max_words, l, widx, skip; char **argv= NULL, *prefix_storage= NULL, *prefix, *cpt, *to_parse= NULL; struct Xorriso_msg_filteR *f; struct Xorriso_lsT *lst, *prev_lst, *next_lst; if(xorriso->msg_sieve == NULL || xorriso->msg_sieve_disabled) return(1); channel= flag & 3; for(f= xorriso->msg_sieve->first_filter; f != NULL; f= f->next) { if(!(f->channels & (1 << channel))) continue; prefix= f->prefix; if(prefix[0] == '?') { skip= 0; for(cpt= prefix; *cpt; cpt++) if(*cpt == '?') skip++; else break; l= strlen(prefix); if(strlen(msg) >= (unsigned int) l) { if(l - skip == 0 || strncmp(prefix + skip, msg + skip, l - skip) == 0) { Xorriso_free_meM(prefix_storage); prefix_storage= NULL; Xorriso_alloc_meM(prefix_storage, char, l + 1); strncpy(prefix_storage, msg, l); prefix_storage[l]= 0; prefix= prefix_storage; } } } if(prefix[0]) if(strncmp(prefix, msg, strlen(prefix)) != 0) continue; if (to_parse != NULL) free(to_parse); to_parse= strdup(msg); if(to_parse == NULL) goto no_mem; l= strlen(to_parse); if(l > 0) if(to_parse[l - 1] == '\n') to_parse[l - 1]= 0; max_words= 0; if(f->last_word_line_end) if(f->num_words > 0) /* Let last word take rest of line */ max_words= f->word_idx[f->num_words - 1]; if(max_words <= 0 && f->last_word_line_end) { /* Copy rest of line as single word because Xorriso_parse_line understands max_words == 0 as unlimited number of words. But here it is desired to get the rest of line already in argv[0]. */ max_words= 0; argv= calloc(1, sizeof(char *)); if(argv == NULL) goto no_mem; argc= 1; argv[0]= strdup(to_parse + strlen(prefix)); if(argv[0] == NULL) goto no_mem; ret= 1; } else { ret= Xorriso_parse_line(xorriso, to_parse, prefix, f->separators, max_words, &argc, &argv, 0); } if(ret < 0) goto ex; if(ret == 0) continue; if(f->last_word_line_end && argc > max_words) { l= strlen(argv[max_words]); if(l > 0) if(argv[max_words][l - 1] == '\n') argv[max_words][l - 1]= 0; } if(f->max_results > 0 && f->num_results >= f->max_results) { /* Dispose surplus results */ for(i= 0; i < f->num_words; i++) { if(f->results != NULL) { next_lst= f->results->next; Xorriso_lst_destroy(&(f->results), 0); f->results= next_lst; } } if(f->num_delivered > 0) (f->num_delivered)--; if(f->num_delivered == 0) f->next_to_deliver= NULL; f->num_results--; } if(f->results == NULL) { prev_lst= NULL; } else { for(prev_lst= f->results; prev_lst->next != NULL; prev_lst= prev_lst->next); } for(i= 0; i < f->num_words; i++) { widx= f->word_idx[i]; if(widx >= argc || widx < 0) ret= Xorriso_lst_new(&lst, "", prev_lst, 0); else if(argv[widx] == NULL) ret= Xorriso_lst_new(&lst, "", prev_lst, 0); else ret= Xorriso_lst_new(&lst, argv[widx], prev_lst, 0); if(ret <= 0) goto no_mem; if(prev_lst == NULL) f->results= lst; prev_lst= lst; } (f->num_results)++; Xorriso__dispose_words(&argc, &argv); } ret= 1; ex: if(to_parse != NULL) free(to_parse); Xorriso_free_meM(prefix_storage); Xorriso__dispose_words(&argc, &argv); return(ret); no_mem:; Xorriso_no_malloc_memory(xorriso, NULL, 1); /* reports to stderr */ ret= -1; goto ex; } /* ^^^^^^^^^^^^^^^^^^^^^^^^^^ Xorriso_msg_sievE ^^^^^^^^^^^^^^^^^^^^^^^^^^ */ int Xorriso_result(struct XorrisO *xorriso, int flag) /* bit0= no considerations or computations or dialog. Just put out. */ { int ret, redirected= 0; if(flag&1) goto put_it_out; if(xorriso->request_to_abort) return(1); if(xorriso->msglist_stackfill > 0) if(xorriso->msglist_flags[xorriso->msglist_stackfill - 1] & 1) redirected= 1; if(xorriso->result_page_length>0 && !redirected) { ret= Xorriso_pager(xorriso,xorriso->result_line,2); if(ret<=0) return(ret); if(ret==2) return(1); if(xorriso->request_to_abort) return(1); } put_it_out:; xorriso->bar_is_fresh= 0; ret= Xorriso_write_to_channel(xorriso, xorriso->result_line, 1,0); return(ret); } int Xorriso_info(struct XorrisO *xorriso, int flag) /* bit0= use pager (as with result) bit1= permission to suppress output bit2= insist in showing output */ { int ret; static int note_sev= 0; if(flag&2) if(xorriso->request_to_abort) return(1); if(note_sev==0) Xorriso__text_to_sev("NOTE", ¬e_sev, 0); if(note_sevreport_about_severity && note_sevabort_on_severity && !(flag&4)) return(1); if(flag&1) { ret= Xorriso_pager(xorriso,xorriso->info_text,2); if(ret<=0) return(ret); if(ret==2) return(1); if(flag&2) if(xorriso->request_to_abort) return(1); } xorriso->bar_is_fresh= 0; ret=Xorriso_write_to_channel(xorriso, xorriso->info_text, 2, 0); return(ret); } int Xorriso_mark(struct XorrisO *xorriso, int flag) { int ret= 1,r_ret,i_ret; if(xorriso->mark_text[0]==0) return(1); if(xorriso->packet_output) ret=Xorriso_write_to_channel(xorriso, xorriso->mark_text, 3, 0); else { sprintf(xorriso->result_line,"%s\n",xorriso->mark_text); r_ret= Xorriso_result(xorriso,1); strcpy(xorriso->info_text,xorriso->result_line); i_ret= Xorriso_info(xorriso,0); if(r_ret==0 || i_ret==0) ret= 0; } return(ret); } int Xorriso_restxt(struct XorrisO *xorriso, char *text) { int ret; strncpy(xorriso->result_line,text,sizeof(xorriso->result_line)-1); xorriso->result_line[sizeof(xorriso->result_line)-1]= 0; ret= Xorriso_result(xorriso,0); return(ret); } /* @param flag bit0-7= purpose 0= ERRFILE 1= mark line (only to be put out if enabled) */ int Xorriso_process_errfile(struct XorrisO *xorriso, int error_code, char msg_text[], int os_errno, int flag) { char ttx[41]; int purpose; if(strlen(msg_text)>SfileadrL) return(-1); purpose= flag&255; if(purpose==1 && !(xorriso->errfile_mode&1)) return(2); if(xorriso->errfile_fp!=NULL) { if(purpose==1) fprintf(xorriso->errfile_fp, "----------------- %s %s\n", msg_text, Ftimetxt(time(0), ttx, 1)); else fprintf(xorriso->errfile_fp, "%s\n", msg_text); fflush(xorriso->errfile_fp); return(1); } if(xorriso->errfile_log[0]==0) return(1); if(strcmp(xorriso->errfile_log, "-")==0 || strcmp(xorriso->errfile_log, "-R")==0) { if(purpose==1) sprintf(xorriso->result_line, "----------------- %s %s\n", msg_text, Ftimetxt(time(0), ttx, 1)); else sprintf(xorriso->result_line, "%s\n", msg_text); Xorriso_result(xorriso, 1); return(1); } if(strcmp(xorriso->errfile_log, "-I") == 0 && xorriso->info_text != msg_text) { /* (Beware of stepping on own foot) */ if(purpose==1) sprintf(xorriso->info_text, "ERRFILE_MARK=%s %s\n", msg_text, Ftimetxt(time(0), ttx, 1)); else sprintf(xorriso->info_text, "ERRFILE=%s\n", msg_text); Xorriso_info(xorriso, 0); return(1); } return(2); } #ifdef Xorriso_fetch_with_msg_queueS /* Important: This function must stay thread-safe with all use of xorriso. */ #else /* Note: It is ok to submit xorriso->info_text as msg_text here. */ #endif /* flag: bit0= for Xorriso_info() : use pager (as with result) bit1= for Xorriso_info() : permission to suppress output bit2..5= name prefix 0="xorriso" 1="libisofs" 2="libburn" 3="libisoburn" else: "" bit6= append carriage return rather than line feed (if not os_errno) bit7= perform Xorriso_process_msg_queues() first bit8= do not prepend name prefix and severity */ int Xorriso_msgs_submit(struct XorrisO *xorriso, int error_code, char msg_text[], int os_errno, char severity[], int flag) { int ret, lt, li, sev, i; char *sev_text= "FATAL", prefix[80], *text= NULL; static char pfx_list[20][16]= { "xorriso : ", "libisofs: ", "libburn : ", "libisoburn: ", "", "", "", "", "", "", "", "", "", "", "", "" }; if(flag&128) Xorriso_process_msg_queues(xorriso, 0); if(strcmp(severity, "ERRFILE")==0) Xorriso_process_errfile(xorriso, error_code, msg_text, os_errno, 0); /* Set problem status */ ret= Xorriso__text_to_sev(severity, &sev, 0); if(ret<=0) Xorriso__text_to_sev(sev_text, &sev, 0); else sev_text= severity; if(xorriso->problem_statusreport_about_severity && sevabort_on_severity) {ret= 2; goto ex;} lt= strlen(msg_text); if(!(flag & 256)) { sprintf(prefix,"%s%s : ", pfx_list[(flag>>2)&15], sev_text); li= strlen(prefix); } else { prefix[0]= 0; li= 0; } if(lt > ((int) sizeof(xorriso->info_text)) - li - 2) lt= sizeof(xorriso->info_text)-li-2; #ifdef Xorriso_fetch_with_msg_queueS Xorriso_alloc_meM(text, char, sizeof(xorriso->info_text)); #else /* Xorriso_fetch_with_msg_queueS */ text= xorriso->info_text; #endif /* ! Xorriso_fetch_with_msg_queueS */ if(msg_text == text) { if(li > 0) { for(i= lt; i>=0; i--) msg_text[i+li]= msg_text[i]; for(i=0; i 0) strcpy(text, prefix); strncpy(text + li, msg_text, lt); } if((flag&64) && os_errno<=0) text[li+lt]= '\r'; else text[li+lt]= '\n'; text[li+lt+1]= 0; if(os_errno>0) sprintf(text + strlen(text) - 1, " : %s\n", strerror(os_errno)); #ifdef Xorriso_fetch_with_msg_queueS Xorriso_write_to_channel(xorriso, text, 2, 0); #else /* Xorriso_fetch_with_msg_queueS */ Xorriso_info(xorriso,4|(flag&3)); #endif /* ! Xorriso_fetch_with_msg_queueS */ ex:; #ifdef Xorriso_fetch_with_msg_queueS Xorriso_free_meM(text); #endif /* ! Xorriso_fetch_with_msg_queueS */ return(ret); } /* To be used with isoburn_set_msgs_submit() */ int Xorriso_msgs_submit_void(void *xorriso, int error_code, char msg_text[], int os_errno, char severity[], int flag) { int ret; ret= Xorriso_msgs_submit((struct XorrisO *) xorriso, error_code, msg_text, os_errno, severity, flag); return(ret); } /** @return -1= abort , 0= no , 1= yes */ int Xorriso_reassure(struct XorrisO *xorriso, char *cmd, char *which_will, int flag) { int ret; if(!xorriso->do_reassure) return(1); sprintf(xorriso->info_text, "Really perform %s which will %s ? (y/n)\n", cmd, which_will); Xorriso_info(xorriso, 4); do { ret= Xorriso_request_confirmation(xorriso, 2|4|16); } while(ret==3); if(ret==6 || ret==4) { sprintf(xorriso->info_text, "%s confirmed", cmd); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(1); } if(ret==2) { sprintf(xorriso->info_text, "%s aborted", cmd); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(-1); } sprintf(xorriso->info_text, "%s revoked", cmd); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(0); } int Xorriso_write_session_log(struct XorrisO *xorriso, int flag) { FILE *fp= NULL; char *sfe= NULL, timetext[40], *rpt, *wpt; int ret; if(xorriso->session_logfile[0]==0) {ret= 2; goto ex;} Xorriso_alloc_meM(sfe, char, 5 * SfileadrL); fp= fopen(xorriso->session_logfile, "a"); if(fp==0) { sprintf(xorriso->info_text, "-session_log: Cannot open file %s", Text_shellsafe(xorriso->session_logfile, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } wpt= sfe; for(rpt= xorriso->volid; *rpt!=0; rpt++) { if(*rpt=='\n') { *(wpt++)= '\\'; *(wpt++)= 'n'; } else *(wpt++)= *rpt; } *wpt= 0; fprintf(fp, "%s %d %d %s\n", Ftimetxt(time(0), timetext, 2), xorriso->session_lba, xorriso->session_blocks, sfe); fclose(fp); ret= 1; ex:; Xorriso_free_meM(sfe); return(ret); } int Xorriso_status_filter(struct XorrisO *xorriso, char *filter, char *line, int flag) { if(filter!=NULL) if(filter[0]=='-') if(strncmp(filter, line, strlen(filter))!=0) return(0); return(1); } int Xorriso_status_result(struct XorrisO *xorriso, char *filter, FILE *fp, int flag) /* bit1= do only report to fp */ { int ret; ret= Xorriso_status_filter(xorriso, filter, xorriso->result_line, 0); if(ret <= 0) return(2); if(!(flag&2)) Xorriso_result(xorriso,0); if(fp!=NULL) { ret= fwrite(xorriso->result_line,strlen(xorriso->result_line),1,fp); if(ret<=0) return(ret); } return(1); } /* bit0= do only report non-default settings bit1= do only report to fp */ int Xorriso_boot_status_sysarea(struct XorrisO *xorriso, char *filter, FILE *fp, int flag) { char *line, *form= "any", *spec= "system_area="; int sa_type; line= xorriso->result_line; sa_type= (xorriso->system_area_options & 0xfc) >> 2; if(sa_type != 0) return(2); if (xorriso->system_area_disk_path[0] == 0 && (flag & 1)) return(2); if(xorriso->system_area_options & 1) { form= "grub"; if(xorriso->system_area_options & (1 << 14)) spec= "grub2_mbr="; } else if(xorriso->system_area_options & 2) { form= "isolinux"; } if(xorriso->system_area_options & (1 << 14)) { form= "grub"; spec= "grub2_mbr="; } sprintf(line, "-boot_image %s %s", form, spec); Text_shellsafe(xorriso->system_area_disk_path, line, 1); strcat(line, "\n"); Xorriso_status_result(xorriso, filter, fp, flag & 2); return(1); } static char *Xorriso__speedname(int speed) { static char name[64]; if(speed > 0) { sprintf(name, "%dkB/s", speed); return(name); } else if(speed == 0) { return("max"); } else if(speed == -1) { return("min"); } else if(speed == -2) { return("none"); } sprintf(name, "%d", speed); return(name); } int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag) /* bit0= do only report non-default settings bit1= do only report to fp bit2= report current -resume status even if bit0 is set, but only if valid bit3= report readline history bit4= report -resume options indirectly as -options_from_file:${resume_state_file}_pos */ { int is_default, no_defaults, i, ret, adr_mode, do_single, behavior; int show_indev= 1, show_outdev= 1, show_dev= 0; int do_drive_access, did_drive_access; int part_table_implicit= 0; char *line, *sfe= NULL, mode[80], *form, *treatment; char *in_pt, *out_pt, *nl_charset, *local_charset, *mode_pt; char *dev_filter= NULL, *xorriso_id= NULL; static char channel_prefixes[4][4]= {".","R","I","M"}; static char load_names[][20]= {"auto", "session", "track", "lba", "volid"}; static int max_load_mode= 4; static char scsi_family[8][8]= {"default", "sr", "scd", "st", "sg", "", "", ""}; struct Xorriso_lsT *paths, *leafs, *s, *plst, *vlst; Xorriso_alloc_meM(sfe, char, 5 * SfileadrL + 80); Xorriso_alloc_meM(xorriso_id, char, 129); no_defaults= flag&1; line= xorriso->result_line; if(xorriso->no_rc) { sprintf(line,"-no_rc\n"); Xorriso_status_result(xorriso,filter,fp,flag&2); } is_default= strcmp(xorriso->list_delimiter, "--") == 0; sprintf(line,"-list_delimiter %s\n", xorriso->list_delimiter); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= 0; if(xorriso->dialog == 2) sprintf(line,"-dialog on\n"); else if(xorriso->dialog == 1) sprintf(line,"-dialog single_line\n"); else { sprintf(line,"-dialog off\n"); is_default= 1; } if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->result_page_length==0 && xorriso->result_page_width==80); sprintf(line,"-page %d %d\n", (xorriso->result_page_length>=0?xorriso->result_page_length :-xorriso->result_page_length), xorriso->result_page_width); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->use_stdin==0); sprintf(line,"-use_readline %s\n", (xorriso->use_stdin?"off":"on")); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->sh_style_result == 0); sprintf(line, "-sh_style_result %s\n", xorriso->sh_style_result ? "on" : "off"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->bsl_interpretation == 0); strcpy(line, "-backslash_codes "); if(xorriso->bsl_interpretation == 0) strcat(line, "off"); else if(xorriso->bsl_interpretation == (3 | 16 | 32 | 64)) strcat(line, "on"); else { if((xorriso->bsl_interpretation & 3) == 1) strcat(line, "in_double_quotes"); else if((xorriso->bsl_interpretation & 3) == 2) strcat(line, "in_quotes"); else if((xorriso->bsl_interpretation & 3) == 3) strcat(line, "with_quoted_input"); if(xorriso->bsl_interpretation & 16) { if(strlen(line) > 17) strcat(line, ":"); strcat(line, "with_program_arguments"); } if((xorriso->bsl_interpretation & (32 | 64)) == (32 | 64)) { if(strlen(line) > 17) strcat(line, ":"); strcat(line, "encode_output"); } else { if(xorriso->bsl_interpretation & 32) { if(strlen(line) > 17) strcat(line, ":"); strcat(line, "encode_results"); } if(xorriso->bsl_interpretation & 64) { if(strlen(line) > 17) strcat(line, ":"); strcat(line, "encode_infos"); } } } strcat(line, "\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= !xorriso->packet_output; sprintf(line,"-pkt_output %s\n",(xorriso->packet_output?"on":"off")); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); for(i=0;i<4;i++) { is_default= (xorriso->logfile[i][0] == 0); sprintf(line,"-logfile %s %s\n", channel_prefixes[i],Text_shellsafe(xorriso->logfile[i],sfe,0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); } is_default= (xorriso->errfile_log[0]==0); sprintf(line,"-errfile_log %s\n",Text_shellsafe(xorriso->errfile_log,sfe,0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); if(xorriso->check_media_default == NULL) { is_default= 1; sprintf(line, "-check_media_defaults reset=now %s\n", xorriso->list_delimiter); } else { ret= Xorriso_check_media_list_job(xorriso, xorriso->check_media_default, line, no_defaults); is_default= (ret == 2); strcat(line, "\n"); } if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); behavior= Xorriso__get_signal_behavior(0); is_default= (behavior == 1); treatment= "on"; if(behavior == 0) treatment= "off"; else if(behavior == 2) treatment= "sig_dfl"; else if(behavior == 3) treatment= "sig_ign"; sprintf(line,"-signal_handling %s\n", treatment); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->img_read_error_mode==2); treatment= "best_effort"; if(xorriso->img_read_error_mode==1) treatment= "failure"; else if(xorriso->img_read_error_mode==2) treatment= "fatal"; sprintf(line,"-error_behavior image_loading %s\n", treatment); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->extract_error_mode == 1); treatment= "keep"; if(xorriso->extract_error_mode == 0) treatment= "best_effort"; else if(xorriso->extract_error_mode == 2) treatment= "delete"; sprintf(line,"-error_behavior file_extraction %s\n", treatment); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->mark_text[0]==0); sprintf(line,"-mark %s\n",Text_shellsafe(xorriso->mark_text,sfe,0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->temp_mem_limit==16*1024*1024); if((xorriso->temp_mem_limit/1024/1024)*1024*1024==xorriso->temp_mem_limit) sprintf(line,"-temp_mem_limit %dm\n", xorriso->temp_mem_limit/1024/1024); else sprintf(line,"-temp_mem_limit %dk\n", xorriso->temp_mem_limit/1024); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); sprintf(line,"-prog %s\n",Text_shellsafe(xorriso->progname,sfe,0)); Xorriso_status_result(xorriso,filter,fp,flag&2); if(xorriso->ban_stdio_write) { sprintf(line,"-ban_stdio_write\n"); Xorriso_status_result(xorriso,filter,fp,flag&2); } is_default= ((xorriso->early_stdio_test & 14) == 0); sprintf(line, "-early_stdio_test %s\n", xorriso->early_stdio_test & 6 ? xorriso->early_stdio_test & 8 ? "appendable_wo" : "on" : "off"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= ((xorriso->cache_default & 3) == 3); sprintf(line, "-data_cache_size "); if(xorriso->cache_default & 1) sprintf(line + strlen(line), "default "); else sprintf(line + strlen(line), "%d ", xorriso->cache_num_tiles); if(xorriso->cache_default & 2) sprintf(line + strlen(line), "default\n"); else sprintf(line + strlen(line), "%d\n", xorriso->cache_tile_blocks); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->allow_restore==0 && xorriso->do_concat_split==1 && xorriso->do_auto_chmod==0 && xorriso->drives_exclusive == 1); mode_pt= "off"; if(xorriso->allow_restore == -2) mode_pt= "blocked"; else if(xorriso->allow_restore == -1) mode_pt= "banned"; else if(xorriso->allow_restore == 1) mode_pt= "on"; else if(xorriso->allow_restore == 2) mode_pt= "device_files"; if(xorriso->allow_restore == -1) sprintf(line,"-osirrox %s\n", mode_pt); else sprintf(line,"-osirrox %s:%s:%s:%s:%s\n", mode_pt, xorriso->do_concat_split ? "concat_split_on" : "concat_split_off", xorriso->do_auto_chmod ? "auto_chmod_on" : "auto_chmod_off", xorriso->do_restore_sort_lba ? "sort_lba_on" : "sort_lba_off", xorriso->drives_exclusive ? "o_excl_on" : "o_excl_off"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default = ((xorriso->do_strict_acl & 1) == 0 && (xorriso->do_md5 & (64 | 128)) == 0 && xorriso->sparse_min_gap == 0); sprintf(line,"-osirrox %s:%s:sparse=", (xorriso->do_strict_acl & 1) ? "strict_acl_on" : "strict_acl_off", (xorriso->do_md5 & 64) ? (xorriso->do_md5 & 128) ? "check_md5_force" : "check_md5_on" : "check_md5_off"); if(xorriso->sparse_min_gap <= 0) strcat(line, "off"); else Sfile_off_t_text(line + strlen(line), xorriso->sparse_min_gap, 0); strcat(line, "\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); is_default= (xorriso->mount_opts_flag == 0); sprintf(line,"-mount_opts %s\n", xorriso->mount_opts_flag & 1 ? "shared" : "exclusive"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); Xorriso_boot_image_status(xorriso, filter, fp, flag & 3); Xorriso_boot_status_sysarea(xorriso, filter, fp, flag & 3); is_default= (xorriso->partition_offset == 0); sprintf(line,"-boot_image any partition_offset=%lu\n", (unsigned long int) xorriso->partition_offset); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->partition_secs_per_head == 0); sprintf(line,"-boot_image any partition_sec_hd=%lu\n", (unsigned long int) xorriso->partition_secs_per_head); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->partition_heads_per_cyl == 0); sprintf(line,"-boot_image any partition_hd_cyl=%lu\n", (unsigned long int) xorriso->partition_heads_per_cyl); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); ret= (xorriso->system_area_options & 0x300) >> 8; is_default= (ret == 0); sprintf(line,"-boot_image any partition_cyl_align=%s\n", ret == 0 ? "auto" : ret == 1 ? "on" : ret == 3 ? "all" : "off"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); if((xorriso->system_area_disk_path[0] || !part_table_implicit) && (xorriso->partition_offset == 0 || (xorriso->system_area_options & 2))) { is_default= ((xorriso->system_area_options & 3) == 0); sprintf(line,"-boot_image %s partition_table=%s\n", xorriso->system_area_options & 2 ? "isolinux" : "grub", xorriso->system_area_options & 3 ? "on" : "off"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); } is_default= ((xorriso->system_area_options & (1 << 15)) == 0); sprintf(line, "-boot_image any mbr_force_bootable=%s\n", (xorriso->system_area_options & (1 << 15)) ? "on" : "off"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->appended_as_gpt == 0 && xorriso->appended_as_apm == 0); if(is_default) { sprintf(line, "-boot_image any appended_part_as=mbr\n"); if(!no_defaults) Xorriso_status_result(xorriso,filter,fp,flag&2); } else { if(xorriso->appended_as_gpt) { sprintf(line, "-boot_image any appended_part_as=gpt\n"); Xorriso_status_result(xorriso,filter,fp,flag&2); } if(xorriso->appended_as_apm) { sprintf(line, "-boot_image any appended_part_as=apm\n"); Xorriso_status_result(xorriso,filter,fp,flag&2); } } is_default= (xorriso->part_like_isohybrid == 0); sprintf(line, "-boot_image any part_like_isohybrid=%s\n", xorriso->part_like_isohybrid ? "on" : "off"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->iso_mbr_part_type == -1); sprintf(line, "-boot_image any iso_mbr_part_type="); if(xorriso->iso_mbr_part_flag & 1) { Xorriso__format_guid(xorriso->iso_gpt_type_guid, line + strlen(line), 0); strcat(line, "\n"); } else if(xorriso->iso_mbr_part_type == -1) { sprintf(line + strlen(line), "default\n"); } else { sprintf(line + strlen(line), "0x%-2.2x\n", (unsigned int) xorriso->iso_mbr_part_type); } if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->gpt_guid_mode == 0); sprintf(line, "-boot_image any gpt_disk_guid=%s", xorriso->gpt_guid_mode == 0 ? "random" : xorriso->gpt_guid_mode == 2 ? "volume_date_uuid" : ""); if(xorriso->gpt_guid_mode == 1) for(i= 0; i < 16; i++) sprintf(line + strlen(line), "%-2.2x", (unsigned int) xorriso->gpt_guid[i]); strcat(line, "\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); ret= ((xorriso->system_area_options & 0x3cfc) == 0x400); is_default= (ret == 0); sprintf(line, "-boot_image any chrp_boot_part=%s\n", ret == 1 ? "on" : "off"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); is_default= (xorriso->prep_partition[0] == 0); sprintf(line,"-boot_image any prep_boot_part=%s\n", Text_shellsafe(xorriso->prep_partition, sfe, 0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); is_default= (xorriso->efi_boot_partition[0] == 0); sprintf(line,"-boot_image any efi_boot_part=%s\n", Text_shellsafe(xorriso->efi_boot_partition, sfe, 0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); #ifdef Xorriso_with_isohybriD if(strcmp(form, "isolinux") == 0) { static char modes[4][6]= {"off", "auto", "on", "force"}; is_default= (xorriso->boot_image_isohybrid == 1); sprintf(line,"-boot_image isolinux isohybrid=%s\n", modes[xorriso->boot_image_isohybrid & 3]); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); } #endif /* Xorriso_with_isohybriD */ is_default= 1; for(i= 0; i < 8; i++) if(xorriso->hfsp_serial_number[i]) is_default= 0; sprintf(line, "-boot_image any hfsplus_serial="); for(i= 0; i < 8; i++) sprintf(line + strlen(line), "%-2.2X", (unsigned int) xorriso->hfsp_serial_number[i]); strcat(line, "\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); is_default= (xorriso->hfsp_block_size == 0); sprintf(line, "-boot_image any hfsplus_block_size=%d\n", xorriso->hfsp_block_size); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); is_default= (xorriso->apm_block_size == 0); sprintf(line, "-boot_image any apm_block_size=%d\n", xorriso->apm_block_size); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); sprintf(line,"-cd "); if(filter != NULL) if(strncmp(filter, "-cdi", 4) == 0) sprintf(line,"-cdi "); sprintf(line + strlen(line),"%s\n", (xorriso->wdi[0] ? Text_shellsafe(xorriso->wdi,sfe,0) : "'/'")); Xorriso_status_result(xorriso,filter,fp,flag&2); sprintf(line,"-cdx %s\n", (xorriso->wdx[0] ? Text_shellsafe(xorriso->wdx,sfe,0) : "'/'")); Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->split_size==0); strcpy(line,"-split_size "); if(xorriso->split_size % (1024*1024) || xorriso->split_size==0) { Sfile_off_t_text(line+strlen(line), xorriso->split_size, 0); } else { Sfile_off_t_text(line+strlen(line), xorriso->split_size / (1024*1024), 0); strcat(line, "m"); } strcat(line, "\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->add_plainly==0); sprintf(line,"-add_plainly %s\n", (xorriso->add_plainly == 1 ? "unknown" : xorriso->add_plainly == 2 ? "dashed" : xorriso->add_plainly == 3 ? "any" : "none")); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); ret= Exclusions_get_descrs(xorriso->disk_exclusions, &paths, &leafs, 0); if(ret>0) { for(; paths!=NULL; paths= paths->next) { sprintf(line, "-not_paths %s %s\n", Text_shellsafe(paths->text, sfe, 0), xorriso->list_delimiter); Xorriso_status_result(xorriso,filter,fp,flag&2); } for(; leafs!=NULL; leafs= leafs->next) { sprintf(line,"-not_leaf %s\n", Text_shellsafe(leafs->text, sfe, 0)); Xorriso_status_result(xorriso,filter,fp,flag&2); } } is_default= (xorriso->file_name_limit == 255); sprintf(line, "-file_name_limit %d\n", xorriso->file_name_limit); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->file_size_limit == Xorriso_default_file_size_limiT); if(xorriso->file_size_limit <= 0) sprintf(line, "-file_size_limit off %s\n", xorriso->list_delimiter); else sprintf(line, "-file_size_limit %.f %s\n", (double) xorriso->file_size_limit, xorriso->list_delimiter); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->disk_excl_mode==1); sprintf(line, "-not_mgt %s:%s:%s:%s\n", (xorriso->disk_excl_mode&1 ? "on" : "off"), (xorriso->disk_excl_mode&2 ? "param_on" : "param_off"), (xorriso->disk_excl_mode&4 ? "subtree_on" : "subtree_off"), (xorriso->disk_excl_mode&8 ? "ignore_on" : "ignore_off")); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->do_override_now_time == 0); if(xorriso->do_override_now_time) sprintf(line, "-iso_nowtime =%.f\n", (double) xorriso->now_time_override); else sprintf(line, "-iso_nowtime dynamic\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); is_default= (xorriso->do_iso_rr_pattern==1); sprintf(line,"-iso_rr_pattern %s\n", (xorriso->do_iso_rr_pattern == 1 ? "on" : (xorriso->do_iso_rr_pattern == 2 ? "ls" : "off"))); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->do_disk_pattern==2); sprintf(line,"-disk_pattern %s\n", (xorriso->do_disk_pattern == 1 ? "on" : (xorriso->do_disk_pattern == 2 ? "ls" : "off"))); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= xorriso->volid_default; sprintf(line,"-volid %s\n",Text_shellsafe(xorriso->volid,sfe,0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); if(is_default && xorriso->loaded_volid[0] && strcmp(xorriso->loaded_volid, xorriso->volid)!=0 && !no_defaults) { sprintf(line,"# loaded image effective -volid %s\n", Text_shellsafe(xorriso->loaded_volid,sfe,0)); Xorriso_status_result(xorriso,filter,fp,flag&2); } Xorriso_preparer_string(xorriso, xorriso_id, 0); is_default= (strcmp(xorriso->preparer_id, xorriso_id) == 0); sprintf(line,"-preparer_id %s\n",Text_shellsafe(xorriso->preparer_id,sfe,0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->publisher[0]==0); sprintf(line,"-publisher %s\n",Text_shellsafe(xorriso->publisher,sfe,0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->application_id[0]==0); sprintf(line,"-application_id %s\n", Text_shellsafe(xorriso->application_id,sfe,0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->system_id[0]==0); sprintf(line,"-system_id %s\n", Text_shellsafe(xorriso->system_id,sfe,0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->volset_id[0]==0); sprintf(line,"-volset_id %s\n", Text_shellsafe(xorriso->volset_id,sfe,0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->vol_creation_time == 0); sprintf(line,"-volume_date c %s\n", is_default ? "default" : Ftimetxt(xorriso->vol_creation_time, sfe, 2)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->vol_modification_time == 0); sprintf(line,"-volume_date m %s\n", xorriso->vol_uuid[0] ? "overridden" : is_default ? "default" : Ftimetxt(xorriso->vol_modification_time, sfe, 2)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->vol_expiration_time == 0); sprintf(line,"-volume_date x %s\n", is_default ? "default" : Ftimetxt(xorriso->vol_expiration_time, sfe, 2)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->vol_effective_time == 0); sprintf(line,"-volume_date f %s\n", is_default ? "default" : Ftimetxt(xorriso->vol_effective_time, sfe, 2)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->vol_uuid[0] == 0); sprintf(line,"-volume_date uuid %s\n", Text_shellsafe(xorriso->vol_uuid,sfe,0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->all_file_dates[0] == 0); sprintf(line,"-volume_date all_file_dates %s\n", Text_shellsafe(xorriso->all_file_dates,sfe,0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->copyright_file[0] == 0); sprintf(line,"-copyright_file %s\n", Text_shellsafe(xorriso->copyright_file,sfe,0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->biblio_file[0]==0); sprintf(line,"-biblio_file %s\n",Text_shellsafe(xorriso->biblio_file,sfe,0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->abstract_file[0]==0); sprintf(line,"-abstract_file %s\n", Text_shellsafe(xorriso->abstract_file,sfe,0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (strcmp(xorriso->application_use, " ") == 0); sprintf(line, "-application_use %s\n", Text_shellsafe(xorriso->application_use, sfe, 0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->do_joliet==0); sprintf(line,"-joliet %s\n", (xorriso->do_joliet == 1 ? "on" : "off")); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->do_rockridge == 1); sprintf(line, "-rockridge %s\n", (xorriso->do_rockridge == 1 ? "on" : "off")); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->do_hfsplus == 0); sprintf(line,"-hfsplus %s\n", (xorriso->do_hfsplus == 1 ? "on" : "off")); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); Xorriso_lst_get_last(xorriso->jigdo_params, &plst, 0); Xorriso_lst_get_last(xorriso->jigdo_values, &vlst, 0); if(plst == NULL || vlst == NULL) { is_default= 1; sprintf(line,"-jigdo clear 'all'\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); } while(plst != NULL && vlst != NULL) { sprintf(line,"-jigdo %s %s\n", Xorriso_lst_get_text(plst, 0), Text_shellsafe(Xorriso_lst_get_text(vlst, 0), sfe, 0)); Xorriso_status_result(xorriso, filter, fp, flag & 2); plst= Xorriso_lst_get_prev(plst, 0); vlst= Xorriso_lst_get_prev(vlst, 0); } if(xorriso->do_global_uid) { sprintf(line,"-uid %lu\n", (unsigned long) xorriso->global_uid); Xorriso_status_result(xorriso,filter,fp,flag&2); } if(xorriso->do_global_gid) { sprintf(line,"-gid %lu\n", (unsigned long) xorriso->global_gid); Xorriso_status_result(xorriso,filter,fp,flag&2); } Xorriso_status_extf(xorriso, filter, fp, flag & 2); Xorriso_status_zisofs(xorriso, filter, fp, flag & 3); is_default= !xorriso->allow_graft_points; sprintf(line,"-pathspecs %s\n", (xorriso->allow_graft_points & 2) ? "as_mkisofs" : xorriso->allow_graft_points ? "on" : "off"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->do_follow_pattern && (!xorriso->do_follow_param) && xorriso->do_follow_mount && (!xorriso->do_follow_links) && xorriso->follow_link_limit==100 && (!xorriso->do_follow_concat)); mode[0]= 0; if(xorriso->do_follow_pattern && !(xorriso->do_follow_links && xorriso->do_follow_mount)) strcat(mode,":pattern"); if(xorriso->do_follow_param && !(xorriso->do_follow_links)) strcat(mode,":param"); if(xorriso->do_follow_links) strcat(mode,":link"); if(xorriso->do_follow_concat) strcat(mode,":concat"); if(xorriso->do_follow_mount) strcat(mode,":mount"); if(mode[0]==0) strcpy(mode, ":off"); sprintf(mode+strlen(mode), ":limit=%d", xorriso->follow_link_limit); sprintf(line,"-follow %s\n", mode+1); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->do_overwrite==2); sprintf(line,"-overwrite %s\n",(xorriso->do_overwrite == 1 ? "on" : (xorriso->do_overwrite == 2 ? "nondir" : "off"))); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= !xorriso->do_reassure; sprintf(line,"-reassure %s\n",(xorriso->do_reassure == 1 ? "on" : (xorriso->do_reassure == 2 ? "tree" : "off"))); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->read_speed == -2); sprintf(line,"-read_speed %s\n", Xorriso__speedname(xorriso->read_speed)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->read_speed_force <= 0); sprintf(line,"-read_speed soft_force:%s\n", xorriso->read_speed_force <= 0 ? "0" : Xorriso__speedname(xorriso->read_speed_force)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->read_speed_corr == 250000); sprintf(line,"-read_speed soft_corr:%d\n", xorriso->read_speed_corr); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= !(xorriso->auto_close || xorriso->do_close); sprintf(line,"-close %s\n",xorriso->auto_close ? "as_needed" : xorriso->do_close ? "on" : "off"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->do_tao == 0); sprintf(line,"-write_type %s\n", xorriso->do_tao == 0 ? "auto" : xorriso->do_tao > 0 ? "tao" : "sao/dao"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= !xorriso->do_dummy; sprintf(line,"-dummy %s\n",(xorriso->do_dummy ? "on" : "off")); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->write_speed==0); sprintf(line,"-speed %s\n", Xorriso__speedname(xorriso->write_speed)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->do_stream_recording==0); strcpy(mode, "off"); if(xorriso->do_stream_recording == 1) strcpy(mode, "full"); if(xorriso->do_stream_recording == 2) strcpy(mode, "data"); else if(xorriso->do_stream_recording == 32) strcpy(mode, "on"); else if(xorriso->do_stream_recording >= 16) sprintf(mode, "%ds", xorriso->do_stream_recording); sprintf(line,"-stream_recording %s\n", mode); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->modesty_on_drive == 0 && xorriso->min_buffer_usec == 5000 && xorriso->max_buffer_usec == 25000 && xorriso->buffer_timeout_sec == 120 && xorriso->min_buffer_percent == 90 && xorriso->max_buffer_percent == 95); if(xorriso->modesty_on_drive == 0) strcpy(mode, "off"); else if(xorriso->modesty_on_drive == 1) strcpy(mode, "on"); else sprintf(mode, "%d", xorriso->modesty_on_drive); sprintf(mode + strlen(mode), ":min_percent=%d", xorriso->min_buffer_percent); sprintf(mode + strlen(mode), ":max_percent=%d", xorriso->max_buffer_percent); if(xorriso->buffer_timeout_sec >= 0) sprintf(mode + strlen(mode), ":timeout_sec=%d", xorriso->buffer_timeout_sec); if(xorriso->min_buffer_usec >= 0) sprintf(mode + strlen(mode), ":min_usec=%d", xorriso->min_buffer_usec); if(xorriso->max_buffer_usec >= 0) sprintf(mode + strlen(mode), ":max_usec=%d", xorriso->max_buffer_usec); sprintf(line,"-modesty_on_drive %s\n", mode); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->dvd_obs == 0); strcpy(mode, "default"); if(xorriso->dvd_obs == 32768 || xorriso->dvd_obs == 65536) sprintf(mode, "%dk", xorriso->dvd_obs / 1024); sprintf(line,"-dvd_obs %s\n", mode); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->use_immed_bit == 0); strcpy(line, "-use_immed_bit "); if(xorriso->use_immed_bit == 0) { strcat(line, "default"); if(xorriso->use_immed_bit_default > 0) strcat(line, "/on"); else if(xorriso->use_immed_bit_default < 0) strcat(line, "/off"); strcat(line, "\n"); } else if(xorriso->use_immed_bit > 0) { strcat(line, "on\n"); } else if(xorriso->use_immed_bit < 0) { strcat(line, "off\n"); } if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->stdio_sync == 0); strcpy(line, "-stdio_sync "); if(xorriso->stdio_sync == -1) strcat(line, "off"); else if(xorriso->stdio_sync == 0) strcat(line, "on"); else if(xorriso->stdio_sync == 1) strcat(line, "end"); else if(xorriso->stdio_sync % 512) { Sfile_off_t_text(line+strlen(line), (off_t) (xorriso->stdio_sync * 2048), 0); } else { Sfile_off_t_text(line+strlen(line), (off_t) (xorriso->stdio_sync / 512), 0); strcat(line, "m"); } strcat(line, "\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->fs==4*512); if((xorriso->fs/512)*512==xorriso->fs) sprintf(line,"-fs %dm\n", xorriso->fs/512); else sprintf(line,"-fs %dk\n", xorriso->fs*2); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->padding==300*1024); sprintf(line,"-padding %dk\n", xorriso->padding/1024); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->do_padding_by_libisofs == 0); sprintf(line,"-padding %s\n", xorriso->do_padding_by_libisofs ? "included" : "appended"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (strcmp(xorriso->report_about_text,"UPDATE")==0); sprintf(line,"-report_about %s\n",xorriso->report_about_text); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->scsi_log == 0); sprintf(line,"-scsi_log %s\n", xorriso->scsi_log ? "on" : "off"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->session_logfile[0]==0); sprintf(line,"-session_log %s\n", Text_shellsafe(xorriso->session_logfile,sfe,0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->pacifier_style==0); sprintf(line,"-pacifier '%s'\n", xorriso->pacifier_style==1 ? "mkisofs" : xorriso->pacifier_style==2 ? "cdrecord" : "xorriso"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->pacifier_interval == 1.0); sprintf(line,"-pacifier interval=%f\n", xorriso->pacifier_interval); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (strcmp(xorriso->return_with_text,"SORRY")==0 && xorriso->return_with_value==32); sprintf(line,"-return_with %s %d\n", xorriso->return_with_text, xorriso->return_with_value); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= 0; sprintf(line,"-abort_on %s\n",xorriso->abort_on_text); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); if(xorriso->status_history_max!=Xorriso_status_history_maX || !no_defaults) { sprintf(line,"-status_history_max %d\n",xorriso->status_history_max); Xorriso_status_result(xorriso,filter,fp,flag&2); } #ifdef Xorriso_with_line_editoR if((flag & 8) && xorriso->status_history_max > 0 && !xorriso->use_stdin) Xorriso_status_history(xorriso, filter, fp, flag & 2); #endif /* Xorriso_with_line_editoR */ is_default= (xorriso->toc_emulation_flag == 0); sprintf(line,"-rom_toc_scan %s:%s:%s\n", xorriso->toc_emulation_flag & 4 ? "force" : xorriso->toc_emulation_flag & 1 ? "on" : "off", xorriso->toc_emulation_flag & 2 ? "emul_off" : "emul_on", xorriso->toc_emulation_flag & 8 ? "emul_wide" : "emul_narrow"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); is_default= (xorriso->displacement == 0); sprintf(line, "-displacement %s%lu\n", xorriso->displacement_sign < 0 ? "-" : "", (unsigned long) xorriso->displacement); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); adr_mode= xorriso->image_start_mode & 0xffff; if(adr_mode>=0 && adr_mode<=max_load_mode) { is_default= (adr_mode==0); sprintf(line,"-load %s ", load_names[adr_mode]); if(adr_mode==0) sprintf(line+strlen(line),"''\n"); else if(adr_mode>=1 && adr_mode<=3) sprintf(line+strlen(line),"%s\n", xorriso->image_start_value); else sprintf(line+strlen(line),"%s\n", Text_shellsafe(xorriso->image_start_value, sfe, 0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); } is_default= (xorriso->read_fs == 0); sprintf(line, "-read_fs %s\n", xorriso->read_fs == 0 ? "any" : xorriso->read_fs == 1 ? "norock" : xorriso->read_fs == 2 ? "nojoliet" : "ecma119"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); is_default= (xorriso->do_calm_drive & 1); sprintf(line,"-calm_drive %s\n", xorriso->do_calm_drive & 1 ? "on" : "off"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->grow_blindly_msc2<0); sprintf(sfe, "%d", xorriso->grow_blindly_msc2); sprintf(line,"-grow_blindly %s\n", xorriso->grow_blindly_msc2 < 0 ? "off" : sfe); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); Xorriso_get_local_charset(xorriso, &local_charset, 0); nl_charset= nl_langinfo(CODESET); is_default= (strcmp(local_charset, nl_charset) == 0); sprintf(line, "-local_charset %s\n", Text_shellsafe(local_charset, sfe, 0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); is_default= (xorriso->out_charset == NULL && xorriso->in_charset == NULL); in_pt= ""; if(xorriso->in_charset != NULL) in_pt= xorriso->in_charset; out_pt= ""; if(xorriso->out_charset != NULL) out_pt= xorriso->out_charset; do_single= 0; ret= Xorriso_status_filter(xorriso, filter, "-in_charset", 0); if(ret <= 0) ret= Xorriso_status_filter(xorriso, filter, "-out_charset", 0); if(ret > 0) do_single= 1; if(strcmp(in_pt, out_pt) == 0 && !do_single) { sprintf(line, "-charset %s\n", Text_shellsafe(in_pt, sfe, 0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); } else { sprintf(line, "-in_charset %s\n", Text_shellsafe(in_pt, sfe, 0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); sprintf(line, "-out_charset %s\n", Text_shellsafe(out_pt, sfe, 0)); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); } is_default= ((xorriso->do_aaip & (256 | 512)) == 0); sprintf(line,"-auto_charset %s\n", (xorriso->do_aaip & 256 ? "on" : "off")); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= ((xorriso->ino_behavior & 31) == 7); switch (xorriso->ino_behavior & 15) { case 0: form= "on"; break; case 8: form= "without_update"; break; default: form= "off"; } sprintf(line,"-hardlinks %s:%s:%s\n", form, xorriso->ino_behavior & 32 ? "no_lsl_count" : "lsl_count", xorriso->ino_behavior & 16 ? "cheap_sorted_extract" : "normal_extract"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= ((xorriso->do_aaip & (1 | 4)) == 0); sprintf(line,"-acl %s\n", (xorriso->do_aaip & 1 ? "on" : "off")); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= ((xorriso->do_aaip & (2 | 8)) == 0); sprintf(line,"-xattr %s\n", (xorriso->do_aaip & 4 ? xorriso->do_aaip & 1024 ? "any" : "user" : "off")); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= ((xorriso->do_aaip & (16 | 32 | 64)) == 0); sprintf(line,"-disk_dev_ino %s\n", (xorriso->do_aaip & 16 ? (xorriso->do_aaip & 128 ? "ino_only" : "on" ) : "off")); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= ((xorriso->do_md5 & 31) == 0); sprintf(line, "-md5 "); if(xorriso->do_md5 & 1) { if((xorriso->do_md5 & 8) == 8) { strcat(line, "all"); } else { strcat(line, "on"); if(xorriso->do_md5 & 8) strcat(line, ":stability_check_on"); } if(xorriso->do_md5 & 32) strcat(line, ":load_check_off"); strcat(line, "\n"); } else strcat(line, "off\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->ecma119_map == 1); sprintf(line, "-ecma119_map "); if(xorriso->ecma119_map == 0) strcat(line, "unmapped\n"); else if(xorriso->ecma119_map == 2) strcat(line, "uppercase\n"); else if(xorriso->ecma119_map == 3) strcat(line, "lowercase\n"); else strcat(line, "stripped\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->joliet_map == 1); sprintf(line, "-joliet_map "); if(xorriso->joliet_map == 0) strcat(line, "unmapped\n"); else strcat(line, "stripped\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->scdbackup_tag_name[0] == 0 && xorriso->scdbackup_tag_listname[0] == 0); sprintf(line, "-scdbackup_tag "); Text_shellsafe(xorriso->scdbackup_tag_listname, line, 1); strcat(line, " "); Text_shellsafe(xorriso->scdbackup_tag_name, line, 1); strcat(line, "\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (Xorriso_get_relax_text(xorriso, sfe, 0) == 2); sprintf(line,"-compliance %s\n", sfe); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->rr_reloc_dir[0] == 0); sprintf(line, "-rr_reloc_dir "); Text_shellsafe(xorriso->rr_reloc_dir, line, 1); strcat(line, "\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (xorriso->assert_volid[0] == 0); sprintf(line, "-assert_volid "); Text_shellsafe(xorriso->assert_volid, line, 1); strcat(line, " "); Text_shellsafe(xorriso->assert_volid_sev, line, 1); strcat(line, "\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= 1; if(xorriso->drive_blacklist != NULL || xorriso->drive_whitelist != NULL || xorriso->drive_greylist == NULL) is_default= 0; if(xorriso->drive_greylist != NULL) { if(strcmp(Xorriso_get_pattern(xorriso, xorriso->drive_greylist, 0, 0), "/dev") != 0) is_default= 0; if(Xorriso_get_pattern(xorriso, xorriso->drive_greylist, 1, 0) != NULL) is_default= 0; } if(!(is_default && no_defaults)) { for(s= xorriso->drive_blacklist; s != NULL; s= Xorriso_lst_get_next(s, 0)) { sprintf(line, "-drive_class 'banned' %s\n", Text_shellsafe(Xorriso_lst_get_text(s, 0), sfe, 0)); Xorriso_status_result(xorriso,filter,fp,flag&2); } for(s= xorriso->drive_greylist; s != NULL; s= Xorriso_lst_get_next(s, 0)) { sprintf(line, "-drive_class 'caution' %s\n", Text_shellsafe(Xorriso_lst_get_text(s, 0), sfe, 0)); Xorriso_status_result(xorriso,filter,fp,flag&2); } for(s= xorriso->drive_whitelist; s != NULL; s= Xorriso_lst_get_next(s, 0)) { sprintf(line, "-drive_class 'harmless' %s\n", Text_shellsafe(Xorriso_lst_get_text(s, 0), sfe, 0)); Xorriso_status_result(xorriso,filter,fp,flag&2); } } is_default= (xorriso->drives_exclusive == 1 && xorriso->drives_access == 1); sprintf(line, "-drive_access %s:%s\n", xorriso->drives_exclusive ? "exclusive" : "shared", xorriso->drives_access == 0 ? "readonly" : "unrestricted"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso, filter, fp, flag & 2); is_default= (xorriso->linux_scsi_dev_family == 0); sprintf(line, "-scsi_dev_family %s\n", scsi_family[xorriso->linux_scsi_dev_family & 7]); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); do_single= do_drive_access= 0; dev_filter= filter; if(dev_filter != NULL) { show_dev= Xorriso_status_filter(xorriso, filter, "-dev", 0); if(show_dev > 0) dev_filter= NULL; } if(dev_filter != NULL) { show_indev= Xorriso_status_filter(xorriso, filter, "-indev", 0); show_outdev= Xorriso_status_filter(xorriso, filter, "-outdev", 0); if(show_outdev > 0 || show_indev > 0) do_single= 1; } if((xorriso->drives_exclusive != xorriso->indev_is_exclusive || xorriso->drives_access != xorriso->indev_access) && xorriso->indev[0]) { do_single= 1; do_drive_access|= 1; } if((xorriso->drives_exclusive != xorriso->outdev_is_exclusive || xorriso->drives_access != xorriso->outdev_access) && xorriso->outdev[0]) { do_single= 1; do_drive_access|= 2; } if(strcmp(xorriso->indev, xorriso->outdev) == 0 && !do_single) { sprintf(line,"-dev %s\n", Text_shellsafe(xorriso->indev,sfe,0)); Xorriso_status_result(xorriso, dev_filter, fp, flag & 2); } else { did_drive_access= 0; if((do_drive_access & 1) && xorriso->indev[0] && show_indev) { sprintf(line,"-drive_access %s:%s\n", xorriso->indev_is_exclusive ? "exclusive" : "shared", xorriso->indev_access == 0 ? "readonly" : "unrestricted"); Xorriso_status_result(xorriso, NULL, fp, flag & 2); did_drive_access= 1; } sprintf(line,"-indev %s\n", Text_shellsafe(xorriso->indev,sfe,0)); Xorriso_status_result(xorriso, dev_filter, fp, flag & 2); if(did_drive_access) { sprintf(line,"-drive_access %s:%s\n", xorriso->drives_exclusive ? "exclusive" : "shared", xorriso->drives_access == 0 ? "readonly" : "unrestricted"); Xorriso_status_result(xorriso, NULL, fp, flag & 2); } did_drive_access= 0; if((do_drive_access & 2) && xorriso->outdev[0] && show_outdev) { sprintf(line,"-drive_access %s:%s\n", xorriso->outdev_is_exclusive ? "exclusive" : "shared", xorriso->outdev_access == 0 ? "readonly" : "unrestricted"); Xorriso_status_result(xorriso, NULL, fp, flag & 2); did_drive_access= 1; } sprintf(line,"-outdev %s\n", Text_shellsafe(xorriso->outdev,sfe,0)); Xorriso_status_result(xorriso, dev_filter, fp, flag & 2); if(did_drive_access) { sprintf(line,"-drive_access %s:%s\n", xorriso->drives_exclusive ? "exclusive" : "shared", xorriso->drives_access == 0 ? "readonly" : "unrestricted"); Xorriso_status_result(xorriso, NULL, fp, flag & 2); } } ret= 1; ex:; Xorriso_free_meM(sfe); Xorriso_free_meM(xorriso_id); return(ret); } int Xorriso_pacifier_reset(struct XorrisO *xorriso, int flag) { xorriso->start_time= Sfile_microtime(0); xorriso->last_update_time= xorriso->start_time; xorriso->pacifier_count= 0; xorriso->pacifier_prev_count= 0; xorriso->pacifier_total= 0; xorriso->pacifier_byte_count= 0; return(1); } /* This call is to be issued by long running workers in short intervals. It will check whether enough time has elapsed since the last pacifier message and eventually issue an update message. @param what_done A sparse description of the action, preferably in past tense. E.g. "done" , "files added". @param count The number of objects processed so far. Is ignored if <=0. @param todo The number of objects to be done in total. Is ignored if <=0. @param current_object A string telling the object currently processed. Ignored if "". @param flag bit0= report unconditionally, no time check bit1= report count <=0 (no thank you for being patient then) bit2= report xorriso->pacifier_byte_count bit3= report speed bit4= with bit3: count is in blocks, else in bytes bit5= with bit3: report total speed bit6= report with carriage return rather than line feed bit7= with bit5: speed unit for outdev rather than indev */ int Xorriso_pacifier_callback(struct XorrisO *xorriso, char *what_done, off_t count, off_t todo, char *current_object, int flag) { double current_time, since, interval_time, speed, speed_factor; char count_text[80], byte_text[80], profile_name[80], *speed_unit; int ret, profile_number, short_sec; off_t amount; current_time= Sfile_microtime(0); interval_time= current_time - xorriso->last_update_time; if(interval_time < xorriso->pacifier_interval && !(flag&1)) return(1); xorriso->last_update_time= Sfile_microtime(0); since= current_time - xorriso->start_time; if((flag & 1) && since < 1.0 && xorriso->pacifier_interval >= 1.0) since= 1.0; if((flag & 1) && since < 0.1) since= 0.1; byte_text[0]= 0; if(flag&4) { strcat(byte_text, " ("); Sfile_scale((double) xorriso->pacifier_byte_count, byte_text+strlen(byte_text), 7, 1e5, 0); strcat(byte_text, ")"); } short_sec= 0; if(count<=0.0 && !(flag&2)) { if(since < 2) return(2); sprintf(xorriso->info_text, "Thank you for being patient for"); } else if(todo<=0.0) { if(count<10000000) sprintf(count_text, "%7.f", (double) count); else Sfile_scale((double) count, count_text, 7, 1e5, 1); sprintf(xorriso->info_text, "%s %s%s in", count_text, what_done, byte_text); short_sec= (flag & 64); } else { sprintf(xorriso->info_text, "%.f of %.f %s%s in", (double) count, (double) todo, what_done, byte_text); short_sec= (flag & (8 | 64)); } if(xorriso->pacifier_interval < 1.0) { sprintf(xorriso->info_text + strlen(xorriso->info_text), " %.1f", since); } else { sprintf(xorriso->info_text + strlen(xorriso->info_text), " %.f", since); } sprintf(xorriso->info_text + strlen(xorriso->info_text), " %s", short_sec ? "s" : "seconds"); speed= -1.0; if(flag & 4) amount= xorriso->pacifier_byte_count; else amount= count; if((flag & 8)) { if(flag & 32) { if(since > 0) speed= amount / since; } else if(amount >= xorriso->pacifier_prev_count) { if(interval_time > 0) speed= (amount - xorriso->pacifier_prev_count) / interval_time; } } if(speed >= 0.0) { if(flag & 16) speed*= 2048.0; ret= Xorriso_get_profile(xorriso, &profile_number, profile_name, (flag >> 6) & 2); speed_factor= 1385000; speed_unit= "D"; if(ret == 2) { speed_factor= 150.0*1024; speed_unit= "C"; } else if(ret == 3) { speed_factor= 4495625; speed_unit= "B"; } sprintf(xorriso->info_text+strlen(xorriso->info_text), " %s %.1fx%s", (flag & 32 ? "=" : ","), speed / speed_factor, speed_unit); } xorriso->pacifier_prev_count= amount; if(current_object[0]!=0) sprintf(xorriso->info_text+strlen(xorriso->info_text), ", now at %s", current_object); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", (flag&64)); return(1); } int Xorriso_reset_counters(struct XorrisO *xorriso, int flag) { xorriso->error_count= 0; xorriso->insert_count= 0; xorriso->insert_bytes= 0; Xorriso_pacifier_reset(xorriso, 0); return(1); } /* @param flag bit0= to stderr rather than Xorriso_msgs_submit */ int Xorriso_no_malloc_memory(struct XorrisO *xorriso, char **to_free, int flag) { if(to_free!=NULL) if(*to_free!=NULL) { /* Eventual memory sacrifice to get on going */ free(*to_free); *to_free= NULL; } sprintf(xorriso->info_text, "Out of virtual memory"); if(flag & 1) { fprintf(stderr, "%s", xorriso->info_text); /* (No need to first check for problem status worse than ABORT) */ Xorriso_set_problem_status(xorriso, "ABORT", 0); } else Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "ABORT", 0); return(1); } /* @param flag bit0=path is in source filesystem , bit1= unconditionally */ int Xorriso_much_too_long(struct XorrisO *xorriso, int len, int flag) { if(len>=SfileadrL || (flag&2)) { sprintf(xorriso->info_text, "Path given for file in %s is much too long (%d)", ((flag&1) ? "local filesystem" : "ISO image"), len); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } int Xorriso_no_findjob(struct XorrisO *xorriso, char *cmd, int flag) { sprintf(xorriso->info_text, "%s: cannot create find job object", cmd); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); return(1); } int Xorriso_report_md5_outcome(struct XorrisO *xorriso, char *severity, int flag) { int has_md5; has_md5= Xorriso_image_has_md5(xorriso, 0); if(xorriso->find_check_md5_result & 1) { sprintf(xorriso->result_line, "Mismatch detected between file contents and MD5 checksums.\n"); } else if(xorriso->find_check_md5_result & 8) { sprintf(xorriso->result_line, "File contents and their MD5 checksums match.\n"); } else { sprintf(xorriso->result_line, "Not a single file with MD5 checksum was found."); if(has_md5 <= 0) strcat(xorriso->result_line, " (There is no MD5 checksum array loaded.)\n"); else strcat(xorriso->result_line, "\n"); } Xorriso_result(xorriso,0); if(xorriso->find_check_md5_result & 2) { sprintf(xorriso->result_line, "Encountered errors other than non-match during MD5 checking.\n"); Xorriso_result(xorriso,0); } if((xorriso->find_check_md5_result & 4) && has_md5) { sprintf(xorriso->result_line, "There were data files which have no MD5 and thus could not be checked.\n"); Xorriso_result(xorriso,0); } if((xorriso->find_check_md5_result & 3) && strcmp(severity, "ALL") != 0) { sprintf(xorriso->info_text, "Event triggered by MD5 comparison mismatch"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, severity, 0); } return(1); } /* @param flag bit0= do not issue prompt messages on info channel bit1= use line rather than asking at dialog input */ int Xorriso_msg_op_parse(struct XorrisO *xorriso, char *line, char *prefix, char *separators, int max_words, int pflag, int input_lines, int flag) { int ret, i, l, pargc= 0, bsl_mem; char *pline= NULL, **pargv= NULL, *parse_line, *text= NULL, *text_pt; Xorriso_alloc_meM(pline, char, SfileadrL); if(!(flag & 1)) { if(input_lines > 1) sprintf(xorriso->info_text, "-msg_op parse: Enter %d lines of text\n", input_lines); else sprintf(xorriso->info_text, "-msg_op parse: Enter text line\n"); Xorriso_info(xorriso, 0); } if(flag & 2) { parse_line= line; } else { pline[0]= 0; for(i= 0; i < input_lines; i++) { l= strlen(pline); ret= Xorriso_dialog_input(xorriso, pline + l, SfileadrL - l - 1, 8 | 1); if(ret <= 0) goto ex; if(i < input_lines - 1) strcat(pline, "\n"); } parse_line= pline; } ret= Xorriso_parse_line(xorriso, parse_line, prefix, separators, max_words, &pargc, &pargv, pflag); /* Temporarily disable backslash encoding of result channel */ bsl_mem= xorriso->bsl_interpretation; xorriso->bsl_interpretation&= ~32; xorriso->msg_sieve_disabled= 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); if(ret == 1) { sprintf(xorriso->result_line, "%d\n", pargc); Xorriso_result(xorriso, 1); for(i= 0; i < pargc; i++) { text_pt= pargv[i]; if (bsl_mem & 32) { ret= Sfile_bsl_encoder(&text, pargv[i], strlen(pargv[i]), 4); if(ret > 0) text_pt= text; } ret= Sfile_count_char(text_pt, '\n') + 1; sprintf(xorriso->result_line, "%d\n", ret); Xorriso_result(xorriso, 1); Sfile_str(xorriso->result_line, text_pt, 0); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 1); Xorriso_free_meM(text); text= NULL; } } else { sprintf(xorriso->result_line, "0\n"); Xorriso_result(xorriso, 1); } xorriso->bsl_interpretation= bsl_mem; ret= 1; ex:; Xorriso__dispose_words(&pargc, &pargv); Xorriso_free_meM(text); Xorriso_free_meM(pline); return ret; } /* @param flag bit0= do not issue prompt messages on info channel */ int Xorriso_msg_op_parse_bulk(struct XorrisO *xorriso, char *prefix, char *separators, int max_words, int pflag, int bulk_lines, int flag) { int ret, input_lines, i, j, l; char line[80]; struct Xorriso_lsT *input_list= NULL, *input_end= NULL, *new_lst, *lst; char *pline= NULL; if(!(flag & 1)) { sprintf(xorriso->info_text, "Enter %d groups of lines. Each group begins by a line which tells the\n", bulk_lines); Xorriso_info(xorriso, 0); sprintf(xorriso->info_text, "number of following lines in the group. Then come the announced lines\n"); Xorriso_info(xorriso, 0); sprintf(xorriso->info_text, "Do this blindly. No further prompt will appear. Best be a computer.\n"); Xorriso_info(xorriso, 0); } Xorriso_alloc_meM(pline, char, SfileadrL); for(i= 0; i < bulk_lines; i++) { ret= Xorriso_dialog_input(xorriso, line, sizeof(line), 8 | 1); if(ret <= 0) goto ex; input_lines= -1; sscanf(line, "%d", &input_lines); pline[0]= 0; for(j= 0; j < input_lines; j++) { l= strlen(pline); ret= Xorriso_dialog_input(xorriso, pline + l, SfileadrL - l - 1, 8 | 1); if(ret <= 0) goto ex; if(j < input_lines - 1) strcat(pline, "\n"); } ret= Xorriso_lst_new(&new_lst, pline, input_end, 0); if(ret <= 0) goto ex; if(input_list == NULL) input_list= new_lst; input_end= new_lst; } for(lst= input_list; lst != NULL; lst= Xorriso_lst_get_next(lst, 0)) { ret= Xorriso_msg_op_parse(xorriso, Xorriso_lst_get_text(lst, 0), prefix, separators, max_words, pflag, input_lines, 1 | 2); if(ret <= 0) goto ex; } ret= 1; ex:; Xorriso_lst_destroy_all(&input_list, 0); Xorriso_free_meM(pline); return(1); } int Xorriso_launch_frontend(struct XorrisO *xorriso, int argc, char **argv, char *cmd_pipe_adr, char *reply_pipe_adr, int flag) { int command_pipe[2], reply_pipe[2], ret, i, cpid, is_banned= 0; char **exec_argv= NULL, *sfe= NULL, *adrpt; struct stat stbuf; Xorriso_alloc_meM(sfe, char, 5 * SfileadrL); for(i= 0; i < 2; i++) command_pipe[i]= reply_pipe[i]= -1; #ifndef Xorriso_allow_launch_frontenD /* To be controlled by: configure --enable-external-filters */ sprintf(xorriso->info_text, "-launch_frontend : Banned at compile time."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); sprintf(xorriso->info_text, "This may be changed at compile time by ./configure option --enable-external-filters"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); is_banned= 1; #endif /* ! Xorriso_allow_launch_frontenD */ #ifndef Xorriso_allow_launch_frontend_suiD /* To be controlled by: configure --enable-external-filters-setuid */ if(getuid() != geteuid()) { sprintf(xorriso->info_text, "-set_filter: UID and EUID differ. Will not run external programs."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); sprintf(xorriso->info_text, "This may be changed at compile time by ./configure option --enable-external-filters-setuid"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); is_banned= 1; } #endif /* ! Xorriso_allow_launch_frontend_suiD */ if(is_banned) {ret= 0; goto ex;} if(argc > 0) { if(strchr(argv[0], '/') == NULL) { sprintf(xorriso->info_text, "-launch_frontend : Command path does not contain a '/'-character"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } /* Add a NULL pointer for execv() */ Xorriso_alloc_meM(exec_argv, char *, argc + 1); for(i= 0; i < argc; i++) exec_argv[i]= argv[i]; exec_argv[argc]= NULL; } else if(cmd_pipe_adr[0] == 0 || reply_pipe_adr[0] == 0) {ret= 0; goto ex;} if(cmd_pipe_adr[0] && reply_pipe_adr[0]) { /* Create named pipes if needed */ for(i= 0; i < 2; i++) { if(i == 0) adrpt= cmd_pipe_adr; else adrpt= reply_pipe_adr; ret= stat(adrpt, &stbuf); if(ret == -1) { ret= mknod(adrpt, S_IFIFO | S_IRWXU | S_IRWXG | S_IRWXO | S_IRWXO, (dev_t) 0); if(ret == -1) { sprintf(xorriso->info_text, "-launch_frontend: Cannot create named pipe %s", Text_shellsafe(adrpt, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= 0; goto ex; } } } } else { ret= pipe(command_pipe); if (ret == -1) { no_pipe_open: sprintf(xorriso->info_text, "-launch_frontend: Failed to create a nameless pipe object"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= 0; goto ex; } ret= pipe(reply_pipe); if (ret == -1) goto no_pipe_open; } if(argc > 0) { cpid = fork(); if (cpid == -1) { sprintf(xorriso->info_text, "-launch_frontend: Failed to create a child process"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= 0; goto ex; } } else cpid= -1; /* Dummy child id */ if (cpid != 0) { /* Parent becomes the xorriso slave */ xorriso->use_stdin= 1; if(cmd_pipe_adr[0] && reply_pipe_adr[0]) { command_pipe[0]= open(cmd_pipe_adr, O_RDONLY | O_BINARY); if(command_pipe[0] == -1) { sprintf(xorriso->info_text, "-launch_frontend: Failed to open named command pipe %s", Text_shellsafe(cmd_pipe_adr, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= 0; goto ex; } reply_pipe[1]= open(reply_pipe_adr, O_WRONLY | O_APPEND | O_BINARY); if(reply_pipe[1] == -1) { sprintf(xorriso->info_text, "-launch_frontend: Failed to open named reply pipe %s", Text_shellsafe(reply_pipe_adr, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= 0; goto ex; } } else { /* Close unused pipe ends */ close(command_pipe[1]); close(reply_pipe[0]); } close(0); close(1); close(2); ret= dup2(command_pipe[0], 0); if(ret == -1) { no_dup:; sprintf(xorriso->info_text, "-launch_frontend: Failed to connect pipe to xorriso standard i/o channels"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= -1; goto ex; } ret= dup2(reply_pipe[1], 1); if(ret == -1) goto no_dup; ret= dup2(reply_pipe[1], 2); if(ret == -1) goto no_dup; ret= 1; goto ex; } /* Child becomes the frontend program */ /* Close unused pipe ends */; if(cmd_pipe_adr[0] && reply_pipe_adr[0]) { command_pipe[1]= open(cmd_pipe_adr, O_WRONLY | O_APPEND | O_BINARY); if(command_pipe[1] == -1) { fprintf(stderr, "xorriso: -launch_frontend: Failed to open named command pipe '%s'\n", cmd_pipe_adr); perror("xorriso: -launch_frontend"); exit(1); } reply_pipe[0]= open(reply_pipe_adr, O_RDONLY | O_BINARY); if(reply_pipe[0] == -1) { fprintf(stderr, "xorriso: -launch_frontend: Failed to open named reply pipe '%s'\n", reply_pipe_adr); exit(1); } } else { close(command_pipe[0]); close(reply_pipe[1]); } close(0); close(1); ret= dup2(command_pipe[1], 1); if(ret == -1) { perror("xorriso: -launch_frontend: Error on redirecting standard output for frontend"); exit(1); } ret= dup2(reply_pipe[0], 0); if(ret == -1) { perror("xorriso: -launch_frontend: Error on redirecting standard input for frontend"); exit(1); } execv(exec_argv[0], exec_argv); fprintf(stderr, "xorriso: -launch_frontend: Failure to start program '%s'\n", exec_argv[0]); perror("xorriso: -launch_frontend"); exit(1); ex:; Xorriso_free_meM(exec_argv); Xorriso_free_meM(sfe); return(ret); } int Xorriso_open_named_pipe(struct XorrisO *xorriso, char fd_names[3][20], int mem_fds[], char *pipe_paths[], int pipe_fds[], int i, int flag) { if(mem_fds[i] == -1) return(2); pipe_fds[i]= open(pipe_paths[i], (i == 0 ? O_RDONLY : O_WRONLY) | O_BINARY); if(pipe_fds[i] == -1) { sprintf(xorriso->info_text, "-named_pipe_loop: Failed to open %s pipe ", fd_names[i]); Text_shellsafe(pipe_paths[i], xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE",0); return(0); } close(i); dup2(pipe_fds[i], i); return(1); } /* Usage example via bash: in=/u/test/xorriso_stdin out=/u/test/xorriso_stdout mknod "$in" p mknod "$out" p xorriso -abort_on NEVER \ -named_pipe_loop cleanup:buffered "$in" "$out" - & # Send command and receive result xorriso_cmd() { echo "$@" >/u/test/xorriso_stdin cat tolerate_stdin_eof) { sprintf(xorriso->info_text, "Already in -named_pipe_loop. Ignoring further -named_pipe_loop command."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "SORRY", 0); return(0); /* intentionally not goto ex */ } Xorriso_alloc_meM(line, char, SfileadrL); /* Memorize stdin, stdout, and stderr. Close originals. */ for(i= 0; i < 3; i++ ) { if(pipe_paths[i][0] == 0 || strcmp(pipe_paths[i], "-") == 0) continue; if(stat(pipe_paths[i], &stbuf) == -1) { sprintf(xorriso->info_text, "-named_pipe_loop: Cannot determine properties of file "); Text_shellsafe(pipe_paths[i], xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= 0; goto ex; } if(!S_ISFIFO(stbuf.st_mode)) { sprintf(xorriso->info_text, "-named_pipe_loop: File is not a named pipe: "); Text_shellsafe(pipe_paths[i], xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } mem_fds[i]= dup(i); if(mem_fds[i] == -1) { sprintf(xorriso->info_text, "-named_pipe_loop: Cannot duplicate original %s", fd_names[i]); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= 0; goto ex; } } pipes_are_valid= 1; while(1) { /* Open input pipe */ ret= Xorriso_open_named_pipe(xorriso, fd_names, mem_fds, pipe_paths, pipe_fds, 0, 0); if(ret <= 0) goto ex; /* As long as the input connection exists */ xorriso->tolerate_stdin_eof= 1; first_line= 1; if(flag & 2) { filling_buffer= 8 | 16; /* single line, no reading from buffered_dialog */ prev_lst= NULL; mem_used= 0; } while(1) { /* Fetch input line */ if((flag & 2) && xorriso->buffered_dialog == NULL && !filling_buffer) { ret= -2; /* EOF */ } else { ret= Xorriso_dialog_input(xorriso, line, SfileadrL, 1 | filling_buffer); } if((flag & 2) && filling_buffer) { /* Fetch and buffer lines before opening output pipes */ if(ret > 0) { /* Check for excessive memory consumption */; mem_needed= strlen(line) + 8 + sizeof(struct Xorriso_lsT); if(mem_used + mem_needed > xorriso->temp_mem_limit) { Sfile_scale((double) (mem_used + mem_needed), mem_text, 5, 1e4, 0); Sfile_scale((double) xorriso->temp_mem_limit, limit_text, 5, 1e4, 0); sprintf(xorriso->info_text, "-named_pipe_loop: List of buffered input lines exceeds -temp_mem_limit (%s > %s)", mem_text, limit_text); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= -1; goto ex; } mem_used+= mem_needed; lst_ret= Xorriso_lst_new(&prev_lst, line, prev_lst, 0); if(lst_ret <= 0) { Xorriso_msgs_submit(xorriso, 0, "-named_pipe_loop: Cannot buffer all input lines", 0, "FATAL", 0); ret= -1; goto ex; } else { if(xorriso->buffered_dialog == NULL) xorriso->buffered_dialog= prev_lst; continue; } } filling_buffer= 0; /* start consuming buffer */ continue; } /* Open output pipes late to allow the sender to open them after the first (and usually only) input line was transmitted: echo ... >stdin_pipe res=$(cat 0) {ret= hret; goto ex;} } } /* Now evaluate outcome of Xorriso_dialog_input() */ if(ret == -2) /* EOF at stdin */ break; if(ret <= 0) /* Other error */ goto ex; /* Regular end of command */ if(strcmp(line, "end_named_pipe_loop") == 0) {ret= 1; goto ex;} /* Perform xorriso command */ ret= Xorriso_execute_option(xorriso, line, (1 << 16)); if(ret <= 0) goto ex; if(ret == 3) /* e.g. -end command */ goto ex; Xorriso_mark(xorriso,0); } /* Restore stdin, stdout and stderr */ for(i= 0; i < 3; i++) { if(mem_fds[i] != -1) { if(pipe_fds[i] != -1) close(pipe_fds[i]); pipe_fds[i]= -1; close(i); dup2(mem_fds[i], i); } } } ret= 1; ex:; xorriso->tolerate_stdin_eof= 0; if(flag & 2) Xorriso_lst_destroy_all(&(xorriso->buffered_dialog), 0); /* Close any open pipes. Restore stdin, stdout and stderr. */ for(i= 0; i < 3; i++) { if(pipe_fds[i] != -1) { if((flag & 1) && pipes_are_valid) { if(stat(pipe_paths[i], &stbuf) != -1) { if(S_ISFIFO(stbuf.st_mode)) { sprintf(xorriso->info_text, "Removing named pipe "); Text_shellsafe(pipe_paths[i], xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); unlink(pipe_paths[i]); } } } close(pipe_fds[i]); } if(mem_fds[i] != -1) { close(i); dup2(mem_fds[i], i); close(mem_fds[i]); } } Xorriso_free_meM(line); return(ret); } /* @param flag bit0= append to out_text rather than overwrite it bit1= length limit is 10 * SfileadrL rather than 5 * */ char *Xorriso_esc_filepath(struct XorrisO *xorriso, char *in_text, char *out_text, int flag) { int l, w=0, limit= 5 * SfileadrL; char *res; if(xorriso->sh_style_result == 0) { res= Text_shellsafe(in_text, out_text, flag); return(res); } if(flag&1) w= strlen(out_text); if(flag & 2) limit= 10 * SfileadrL; l= strlen(in_text); if(w + l >= limit) { strcpy(out_text, "'xorriso: TEXT MUCH TOO LONG ... "); return(out_text); } strcpy(out_text + w, in_text); return(out_text); } /* @param flag bit=add to existing info_text */ int Xorriso_set_info_text(struct XorrisO *xorriso, char *text, size_t trunc_len, int flag) { size_t offst= 0, maxl; maxl= sizeof(xorriso->info_text) - 1; if(flag & 1) offst= strlen(xorriso->info_text); if(offst >= maxl) return(0); maxl-= offst; if(maxl > trunc_len) maxl= trunc_len; strncpy(xorriso->info_text + offst, text, maxl + 1); if(strlen(text) > maxl) { strcpy(xorriso->info_text + offst + maxl - 12, "#[truncated]"); return(2); } return(1); } libisoburn-1.5.4/xorriso/emulators.c0000644000175700017510000031654113755276771014544 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of emulators for mkisofs and cdrecord. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" int Xorriso_cdrskin_uses_stdout(struct XorrisO *xorriso, int argc, char **argv, int flag) { int i; for(i= 0; i < argc; i++) { if(strcmp(argv[i], "dev=-") == 0 || strcmp(argv[i], "dev=stdio:/dev/fd/1") == 0 || strcmp(argv[i], "-dev=-") == 0 || strcmp(argv[i], "-dev=stdio:/dev/fd/1") == 0) return(1); } return(0); } int Xorriso_cdrskin_help(struct XorrisO *xorriso, int flag) { static char helptext[][80]= { "Usage: xorriso -as cdrecord [options|source_addresses]", "Note: This is not cdrecord. See xorriso -help, xorriso -version, man xorrecord", "Options:", "\t-version\tprint version information and exit emulation", "\t--devices\tprint list of available MMC drives and exit emulation", "\tdev=target\tpseudo-SCSI target to use as CD-Recorder", "\tdrive_scsi_dev_family=sr|scd|sg\t\tselect Linux device type", "\t--drive_not_exclusive\tdo not try to prevent use of busy drive", "\t-v\t\tincrement verbose level by one", "\t-V\t\tincrement SCSI command transport verbose level by one", "\t-checkdrive\tcheck if a driver for the drive is present", "\t-inq\t\tdo an inquiry for the drive", "\tspeed=#\t\tset speed of drive", "\tblank=type\tblank a CD-RW disc (see blank=help)", "\tfs=#\t\tSet fifo size to # (0 to disable, default is 4 MB)", "\t-eject\t\teject the disk after doing the work", "\t-dummy\t\tdo everything with laser turned off", "\t-msinfo\t\tretrieve multi-session info for mkisofs >= 1.10", "\t-toc\t\tretrieve and print TOC/PMA data", "\t-atip\t\tretrieve media state, print \"Is *erasable\"", "\t-multi\t\tgenerate a TOC that allows multi session", "\t--multi_if_possible\tapply -multi if the medium supports it", "\t-waiti\t\twait until input is available before opening SCSI", "\t-tao\t\tWrite disk in TAO mode.", "\t-dao\t\tWrite disk in SAO mode.", "\t-sao\t\tWrite disk in SAO mode.", "\ttsize=#\t\tannounces exact size of source data", "\tpadsize=#\tAmount of padding", "\t-data\t\tSubsequent tracks are CD-ROM data mode 1 (default)", "\t-isosize\tUse iso9660 file system size for next data track", "\t-pad\t\tpadsize=30k", "\t-nopad\t\tDo not pad", "\tminbuf=\t\tKeep drive buffer hungry", "\tmodesty_on_drive=\tLike minbuf=, but with more parameters", "\t-immed\t\tEquivalent to minbuf=75", "\t--grow_overwriteable_iso\temulate multi-session on DVD+RW, BD-RE", "\twrite_start_address=#\t\twrite to byte address on DVD+RW, BD-RE", "\tstream_recording=on|number\ttry to get full speed on DVD-RAM, BD", "\tuse_immed_bit=on|off|default\tcontrol use of Immed bit", "\tdvd_obs=default|32k|64k\t\tbytes per DVD/BD write operation", "\tstdio_sync=on|off|end|number\twhether to fsync output to \"stdio:\"", "\t--no_rc\t\tDo not execute xorriso startup files", "\t-help\t\tprint this text to stderr and exit emulation", "Actually this is the integrated ISO RockRidge filesystem manipulator xorriso", "lending its libburn capabilities to a very limited cdrecord emulation. Only", "a single data track can be burnt to blank, appendable or overwritable media.", "A much more elaborate cdrecord emulator is cdrskin from the libburn package.", "", #ifdef Xorriso_GNU_xorrisO "Report bugs to: bug-xorriso@gnu.org , or in private to: scdbackup@gmx.net .", "xorriso home page: ", "General help using GNU software: ", #else "Report any bugs to bug-xorriso@gnu.org or in private to scdbackup@gmx.net .", #endif "@End_of_helptexT@" }; int i; for(i= 0; strcmp(helptext[i], "@End_of_helptexT@")!=0; i++) { sprintf(xorriso->info_text, "%s\n", helptext[i]); Xorriso_info(xorriso,0); } return(1); } /* micro version of cdrskin */ int Xorriso_cdrskin(struct XorrisO *xorriso, char *whom, int argc, char **argv, int flag) { int ret, i, k, mem_do_close, aq_ret, eject_ret, msc1, msc2, hflag; int do_atip= 0, do_checkdrive= 0, do_eject= 0, do_scanbus= 0; int do_toc= 0, do_verbous= 0, do_version= 0, do_help= 0, do_waiti= 0; int do_multi= 0, do_msinfo= 0, do_grow= 0, do_isosize= 0, do_xa1= 0; int do_auto_close= 0; double write_start_address= -1.0, tsize= -1.0, mem_auto_close; char *track_source= NULL, *dev_adr= NULL, *cpt; char mem_report_about_text[80], *report_about= "SORRY", blank_mode[80]; char speed[80], *argpt; /* cdrecord 2.01 options which are not scheduled for implementation, yet */ static char ignored_partial_options[][41]= { "timeout=", "debug=", "kdebug=", "kd=", "driver=", "ts=", "pregap=", "defpregap=", "mcn=", "isrc=", "index=", "textfile=", "pktsize=", "cuefile=", "gracetime=", "assert_write_lba=", "fifo_start_at=", "dev_translation=", "fallback_program=", "tao_to_sao_tsize=", "direct_write_amount=", "msifile=", "" }; static char ignored_full_options[][41]= { "-d", "-silent", "-s", "-setdropts", "-prcap", "-reset", "-abort", "-overburn", "-ignsize", "-useinfo", "-fix", "-nofix", "-raw", "-raw96p", "-raw16", "-clone", "-text", "-cdi", "-preemp", "-nopreemp", "-copy", "-nocopy", "-scms", "-shorttrack", "-noshorttrack", "-packet", "-noclose", "-media-info", "-minfo", "-load", "-lock", "-raw96r", "-swab", "-force", "-format", "--adjust_speed_to_drive", "--allow_emulated_drives", "--allow_setuid", "--allow_untested_media", "--any_track", "--demand_a_drive", "--fifo_disable", "--fifo_start_empty", "--fill_up_media", "--list_ignored_options", "--no_rc", "--no_convert_fs_adr", "--prodvd_cli_compatible", "--single_track", "--tell_media_space", "" }; static char blank_help[][80]= { "Blanking options:", "\tall\t\tblank the entire disk", "\tdisc\t\tblank the entire disk", "\tdisk\t\tblank the entire disk", "\tfast\t\tminimally blank the entire disk", "\tminimal\t\tminimally blank the entire disk", "\tas_needed\tblank or format medium to make it ready for (re-)use", "\tdeformat\t\tblank a formatted DVD-RW", "\tdeformat_quickest\tminimally blank a formatted DVD-RW to DAO only", "\tformat_overwrite\tformat a DVD-RW to \"Restricted Overwrite\"", "@End_of_helptexT@" }; mem_do_close= xorriso->do_close; mem_auto_close= xorriso->auto_close; Xorriso_alloc_meM(track_source, char, SfileadrL); Xorriso_alloc_meM(dev_adr, char, SfileadrL); strcpy(mem_report_about_text, xorriso->report_about_text); track_source[0]= 0; dev_adr[0]= 0; blank_mode[0]= 0; speed[0]= 0; if(xorriso->in_drive_handle != NULL) { ret= Xorriso_option_dev(xorriso, "", 1|32); /* give up indev */ if(ret!=1) goto ex; } /* Assess plan, make settings */ for(i= 0; iinfo_text, "-as %s: ", whom); Text_shellsafe(argv[i], xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); argpt= argv[i]; if (strncmp(argpt, "--", 2) == 0 && strlen(argpt) > 3) argpt++; for(k=0;ignored_partial_options[k][0]!=0;k++) { if(argpt[0]=='-') if(strncmp(argpt+1,ignored_partial_options[k], strlen(ignored_partial_options[k]))==0) { argpt++; goto no_volunteer; } if(strncmp(argpt,ignored_partial_options[k], strlen(ignored_partial_options[k]))==0) goto no_volunteer; } for(k=0;ignored_full_options[k][0]!=0;k++) if(strcmp(argpt,ignored_full_options[k])==0) goto no_volunteer; if(0) { no_volunteer:; sprintf(xorriso->info_text, "-as %s: Ignored option ", whom); Text_shellsafe(argpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); continue; } if(strcmp(argpt, "-atip")==0) { do_atip= 1; } else if(strcmp(argpt, "-audio")==0) { sprintf(xorriso->info_text, "-as %s: Option -audio not supported.", whom); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } else if(strncmp(argpt, "-blank=", 7)==0 || strncmp(argpt, "blank=", 6)==0) { cpt= strchr(argpt, '=')+1; if(strcmp(cpt,"all")==0 || strcmp(cpt,"disc")==0 || strcmp(cpt,"disk")==0) { strcpy(blank_mode, "all"); } else if(strcmp(cpt,"fast")==0 || strcmp(cpt,"minimal")==0) { strcpy(blank_mode, "fast"); } else if(strcmp(cpt,"help")==0) { strcpy(blank_mode, "help"); } else if(strcmp(cpt,"deformat")==0 || strcmp(cpt,"deformat_sequential")==0 || strcmp(cpt,"deformat_quickest")==0 || strcmp(cpt,"deformat_sequential_quickest")==0) { strcpy(blank_mode, cpt); } else if(strcmp(cpt,"format_overwrite")==0) { strcpy(blank_mode, "format_overwrite"); } else if(strcmp(cpt,"as_needed")==0) { strcpy(blank_mode, "as_needed"); } else { sprintf(xorriso->info_text, "-as %s: blank=", whom); Text_shellsafe(cpt, xorriso->info_text, 1); strcat(xorriso->info_text, " not supported. See blank=help ."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } else if(strcmp(argpt, "-checkdrive")==0) { do_checkdrive= 1; } else if(strcmp(argpt, "-dao")==0) { xorriso->do_tao= -1; } else if(strcmp(argpt, "-data")==0) { /* ok */; } else if(strncmp(argpt, "-dev=", 5)==0 || strncmp(argpt, "dev=", 4)==0) { cpt= strchr(argpt, '=')+1; strcpy(dev_adr, cpt); } else if(strcmp(argv[i], "--devices")==0) { /* intentional: argv[i] */ do_scanbus= 2; } else if(strcmp(argv[i], "--drive_not_exclusive") == 0) { /* intentional */ Xorriso_option_drive_access(xorriso, "shared:unrestricted", 0); } else if(strncmp(argpt,"driveropts=", 11)==0 || strncmp(argpt,"-driveropts=", 12)==0) { if(strcmp(argpt+11, "help")==0) { fprintf(stderr,"Driver options:\n"); fprintf(stderr, "burnfree\tPrepare writer to use BURN-Free technology\n"); } } else if(strcmp(argpt, "-dummy")==0) { xorriso->do_dummy= 1; } else if(strncmp(argpt, "-dvd_obs=", 9)==0 || strncmp(argpt, "dvd_obs=", 8)==0) { cpt= strchr(argpt, '=') + 1; Xorriso_option_dvd_obs(xorriso, cpt, 0); } else if(strcmp(argpt, "-eject")==0) { do_eject= 1; } else if(strncmp(argpt, "-fs=", 4)==0 || strncmp(argpt, "fs=", 3)==0) { cpt= strchr(argpt, '=')+1; ret= Xorriso_option_fs(xorriso, cpt, 0); if(ret<=0) goto ex; } else if(strcmp(argv[i], "--grow_overwriteable_iso")==0 || strcmp(argv[i], "--grow_overwritable_iso")==0 || strcmp(argv[i], "--grow_overriteable_iso")==0 ) { /* (A history of typos) */ /* intentional: argv[i] */ do_grow= 1; } else if(strcmp(argpt, "-help")==0) { do_help= 1; } else if(strcmp(argpt, "-isosize")==0) { do_isosize= 1; } else if(strcmp(argpt, "-inq")==0) { do_checkdrive= 2; } else if(strcmp(argpt, "-mode2")==0) { Xorriso_msgs_submit(xorriso, 0, "Defaulting option -mode2 to option -data", 0, "NOTE", 0); } else if(strcmp(argpt, "-msinfo")==0) { do_msinfo= 1; } else if(strcmp(argpt, "-multi")==0) { do_multi= 1; do_auto_close= 0; } else if(strcmp(argv[i], "--multi_if_possible") == 0) { do_multi= 1; do_auto_close= 1; } else if(strcmp(argpt, "-nopad")==0) { xorriso->padding= 0; } else if(strcmp(argv[i], "--no_rc")==0) { /* intentional: argv[i] */ /* already performed in Xorriso_prescan_args */; } else if(strcmp(argpt, "-pad")==0) { xorriso->padding= 15*2048; } else if(strncmp(argpt, "-padsize=", 9)==0 || strncmp(argpt, "padsize=", 8)==0) { cpt= strchr(argpt, '=')+1; ret= Xorriso_option_padding(xorriso, cpt, 0); if(ret<=0) goto ex; } else if(strcmp(argpt, "-sao")==0) { xorriso->do_tao= -1; } else if(strcmp(argpt, "-scanbus")==0) { sprintf(xorriso->info_text, "-as %s: Option -scanbus not supported.", whom); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } else if(strncmp(argpt, "-speed=", 7)==0 || strncmp(argpt, "speed=", 6)==0) { cpt= strchr(argpt, '=')+1; strncpy(speed, cpt, 79); speed[79]= 0; } else if(strncmp(argpt, "-stream_recording=", 18)==0 || strncmp(argpt, "stream_recording=", 17)==0) { cpt= strchr(argpt, '=')+1; Xorriso_option_stream_recording(xorriso, cpt, 0); } else if(strncmp(argpt, "-use_immed_bit=", 15) == 0 || strncmp(argpt, "use_immed_bit=", 14) == 0) { cpt= strchr(argpt, '=') + 1; Xorriso_option_use_immed_bit(xorriso, cpt, 0); } else if(strcmp(argpt, "-immed") == 0) { Xorriso_option_modesty_on_drive(xorriso, "75", 0); } else if(strncmp(argpt, "-minbuf=", 8) == 0 || strncmp(argpt, "minbuf=", 7) == 0 || strncmp(argpt, "-modesty_on_drive=", 18) == 0 || strncmp(argpt, "modesty_on_drive=", 17) == 0) { cpt= strchr(argpt, '=') + 1; Xorriso_option_modesty_on_drive(xorriso, cpt, 0); } else if(strncmp(argpt, "-drive_scsi_dev_family=", 23) == 0 || strncmp(argpt, "drive_scsi_dev_family=", 22) == 0) { cpt= strchr(argpt, '=') + 1; Xorriso_option_scsi_dev_family(xorriso, cpt, 0); } else if(strncmp(argpt, "-stdio_sync=", 12)==0 || strncmp(argpt, "stdio_sync=", 11)==0) { cpt= strchr(argpt, '=') + 1; Xorriso_option_stdio_sync(xorriso, cpt, 0); } else if(strcmp(argpt, "-tao")==0) { xorriso->do_tao= 1; } else if(strcmp(argpt, "-toc")==0 || strcmp(argv[i], "--long_toc")==0) { /* intentional: argpt , argv[i] */ do_toc= 1; } else if(strncmp(argpt, "-tsize=", 7)==0 || strncmp(argpt, "tsize=", 6)==0) { cpt= strchr(argpt, '=')+1; tsize= Scanf_io_size(cpt, 1); if(tsize > 1024.0*1024.0*1024.0*1024.0*1024.0) { sprintf(xorriso->info_text, "-as %s: much too large: %s",whom, argpt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } else if(strcmp(argv[i], "-V")==0 || strcmp(argpt,"-Verbose")==0) { Xorriso_option_scsi_log(xorriso, "on", 0); } else if(strcmp(argv[i], "-v")==0 || strcmp(argpt,"-verbose")==0) { do_verbous++; } else if(strcmp(argv[i], "-vv")==0) { /* intentional: argv[i] */ do_verbous+= 2; } else if(strcmp(argv[i], "-vvv")==0) { /* intentional: argv[i] */ do_verbous+= 3; } else if(strcmp(argpt, "-version")==0) { do_version= 1; } else if(strcmp(argpt, "-waiti")==0) { do_waiti= 1; } else if(strncmp(argv[i], "write_start_address=", 20)==0) { /* intentional: argv[i] */ write_start_address= Scanf_io_size(argv[i]+20,0); } else if(strcmp(argpt, "-xa")==0) { Xorriso_msgs_submit(xorriso, 0, "Defaulting option -xa to option -data", 0, "NOTE", 0); } else if(strcmp(argpt, "-xa1")==0) { if(do_xa1 == 0) do_xa1= 1; } else if(strcmp(argv[i], "--xa1-ignore")==0) { /* intentional: argv[i] */ do_xa1= -1; } else if(strcmp(argpt, "-xa2")==0) { Xorriso_msgs_submit(xorriso, 0, "Defaulting option -xa2 to option -data", 0, "NOTE", 0); } else if(strcmp(argpt, "-xamix")==0) { Xorriso_msgs_submit(xorriso, 0, "Option -xamix not implemented and data not yet convertible to other modes", 0, "FATAL", 0); ret= 0; goto ex; } else if(argpt[0]=='-' && argpt[1]!=0) { sprintf(xorriso->info_text, "-as %s: Unknown option ", whom); Text_shellsafe(argv[i], xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } else { if(track_source[0]) { sprintf(xorriso->info_text, "-as %s: Surplus track source ", whom); Text_shellsafe(argv[i], xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); sprintf(xorriso->info_text, "First and only track source is "); Text_shellsafe(track_source, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= 0; goto ex; } if(Sfile_str(track_source, argv[i], 0)<=0) {ret= -1; goto ex;} } } /* Perform actions */ Xorriso_option_report_about(xorriso, "NOTE", 0); if(do_version) { sprintf(xorriso->result_line, "Cdrecord 2.01-Emulation Copyright (C) 2019 see libburnia-project.org xorriso\n"); Xorriso_result(xorriso, 1); Xorriso_option_version(xorriso, 0); } if(do_help) { Xorriso_cdrskin_help(xorriso, 0); } if(strcmp(blank_mode, "help")==0) { for(i= 0; strcmp(blank_help[i], "@End_of_helptexT@")!=0; i++) { sprintf(xorriso->info_text, "%s\n", blank_help[i]); Xorriso_info(xorriso,0); } } if(do_help || strcmp(blank_mode, "help") == 0 || do_version) { ret= 1; goto ex; } if(do_verbous<=0) report_about= "NOTE"; else if(do_verbous<=2) report_about= "UPDATE"; else if(do_verbous==3) report_about= "DEBUG"; else report_about= "ALL"; Xorriso_option_report_about(xorriso, report_about, 0); if(do_scanbus) { if(do_scanbus==1) /* >>> would need -scanbus compatible output and input format */; else Xorriso_option_devices(xorriso, 0); ret= 1; goto ex; } if(!(do_checkdrive || do_atip || do_toc || blank_mode[0] || track_source[0] || do_eject || do_msinfo)) { sprintf(xorriso->info_text, "-as cdrskin: No option specified, which would cause an action."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 1; goto ex; } if(do_waiti) { sprintf(xorriso->info_text, "xorriso: Option -waiti pauses program until input appears at stdin\n"); Xorriso_info(xorriso,0); sprintf(xorriso->result_line, "Waiting for data on stdin...\n"); Xorriso_result(xorriso, 1); for(ret= 0; ret==0; ) ret= Wait_for_input(0,1000000,0); if(ret<0 || feof(stdin)) { Xorriso_msgs_submit(xorriso, 0, "stdin produces exception rather than data", 0, "NOTE", 0); } sprintf(xorriso->info_text, "xorriso: Option -waiti pausing is done.\n"); } if(dev_adr[0]) { hflag= 2 | 64; /* ts B11201 no more: | 32 */ if(!do_grow) hflag|= 8; /* consider overwritables as blank */ ret= Xorriso_option_dev(xorriso, dev_adr, hflag); if(ret<=0) goto ex; } if(xorriso->out_drive_handle==NULL) { sprintf(xorriso->info_text, "-as %s: No output drive selected", whom); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(do_msinfo) { ret= Xorriso_msinfo(xorriso, &msc1, &msc2, 2 | !!do_grow); if(ret<=0) goto ex; sprintf(xorriso->result_line, "%d,%d\n", msc1, msc2); Xorriso_result(xorriso, 1); } if(speed[0]) { ret= Xorriso_option_speed(xorriso, speed, 0); if(ret<=0) goto ex; } if(do_checkdrive) { ret= Xorriso_atip(xorriso, 2-(do_checkdrive==2)); if(ret<=0) goto ex; } if(do_atip) { ret= Xorriso_atip(xorriso, 0); if(ret<=0) goto ex; } if(do_toc) { ret= Xorriso_option_toc(xorriso, 0); if(ret<=0) goto ex; } if(strcmp(blank_mode, "format_overwrite")==0) { ret= Xorriso_option_blank(xorriso, "fast", 1); if(ret<=0) goto ex; } else if(blank_mode[0]) { ret= Xorriso_option_blank(xorriso, blank_mode, 0); if(ret<=0) goto ex; } if(track_source[0]) { xorriso->do_close= !do_multi; xorriso->auto_close= do_auto_close; ret= Xorriso_burn_track(xorriso, (off_t) write_start_address, track_source, (off_t) tsize, (!!do_grow) | ((!!do_isosize) << 1) | ((do_xa1 == 1) << 2)); if(ret == 2) { ret= Xorriso_retry_burn_track(xorriso, (off_t) write_start_address, track_source, (off_t) tsize, (!!do_grow) | ((!!do_isosize) << 1) | ((do_xa1 == 1) << 2)); } aq_ret= Xorriso_reaquire_outdev(xorriso, 2*(ret>0)); if(ret<=0 && ret=0) { eject_ret= Xorriso_option_eject(xorriso, "out", 0); if(eject_retinfo_text, "-as %s: Job could not be performed properly.", whom); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } Xorriso_option_report_about(xorriso, mem_report_about_text, 0); xorriso->do_close= mem_do_close; xorriso->auto_close= mem_auto_close; Xorriso_free_meM(dev_adr); Xorriso_free_meM(track_source); return(ret); } /* This function shall know all options of mkisofs, genisoimage, xorrisofs, ... and the number of arguments which they expect and consume. */ int Xorriso_genisofs_count_args(struct XorrisO *xorriso, int argc, char **argv, int *count, int flag) { int i; char *cmd; static char partial_options[][41]= { "errctl=", "isolinux_mbr=", "--modification-date=", "" }; static char arg0_options[][41]= { "-allow-leading-dots", "-ldots", "-allow-lowercase", "-allow-multidot", "-cache-inodes", "-no-cache-inodes", "-eltorito-alt-boot", "-hard-disk-boot", "-no-emul-boot", "-no-boot", "-boot-info-table", "-check-oldnames", "-d", "-D", "-dvd-video", "-f", "-gui", "-graft-points", "-hide-joliet-trans-tbl", "-hide-rr-moved", "-J", "-joliet-long", "-l", "-L", "-max-iso9660-filenames", "-N", "-nobak", "-no-bak", "-no-limit-pathtables", "-force-rr", "-no-rr", "-no-split-symlink-components", "-no-split-symlink-fields", "-pad", "-no-pad", "-posix-H", "-posix-L", "-posix-P", "-print-size", "-quiet", "-R", "-r", "-relaxed-filenames", "-rrip110", "-rrip112", "-split-output", "-T", "-UDF", "-udf", "-udf-symlinks", "-no-udf-symlinks", "-U", "-no-iso-translate", "-v", "-XA", "-xa", "-z", "-hfs", "-no-hfs", "-apple", "-probe", "-no-desktop", "-mac-name", "-part", "-icon-position", "-chrp-t", "-hfs-unlock", "--cap", "--netatalk", "--double", "--ethershare", "--ushare", "--exchange", "--sgi", "--xinet", "--macbin", "--single", "--dave", "--sfm", "--osx-double", "--osx-hfs", "-debug", "-omit-period", "-disable-deep-relocation", "-joliet", "-full-iso9660-filenames", "-follow-links", "-help", "-transparent-compression", "-omit-version-number", "-rational-rock", "-rock", "-translation-table", "-untranslated-filenames", "-verbose", "-version", "-g", "-h", "-no-mac-files", "-chrp-boot", "--hardlinks", "--acl", "--xattr", "--xattr-any", "--md5", "--for_backup", "--protective-msdos-label", "--boot-catalog-hide", "--no-emul-toc", "--emul-toc", "-disallow_dir_id_ext", "--old-empty", "--old-root-no-md5", "--old-root-devno", "--old-root-no-ino", "--no_rc", "--norock", "-hfsplus", "-fat", "-chrp-boot-part", "-isohybrid-gpt-basdat", "-isohybrid-gpt-hfsplus", "-isohybrid-apm-hfsplus", "--grub2-boot-info", "-joliet-utf16", "-appended_part_as_gpt", "-appended_part_as_apm", "--mbr-force-bootable", "-part_like_isohybrid", "--zisofs-version-2", "--zisofs2-susp-z2", "--zisofs2-susp-zf", "" }; static char arg1_options[][41]= { "-abstract", "-A", "-appid", "--application_use", "-biblio", "-b", "-B", "-boot-load-seg", "-boot-load-size", "-C", "-c", "-check-session", "-copyright", "-dir-mode", "-eltorito-id", "-eltorito-selcrit", "-file-mode", "-G", "-gid", "-hide", "-hide-list", "-hidden", "-hidden-list", "-hide-joliet", "-hide-joliet-list", "-hide-hfsplus", "-hide-hfsplus-list", "-hide-udf", "-hide-udf-list", "-input-charset", "-output-charset", "-iso-level", "-jcharset", "-log-file", "-m", "-exclude-list", "-M", "-dev", "-new-dir-mode", "-o", "-p", "-preparer", "-path-list", "-publisher", "-root", "-old-root", "-s", "-sectype", "-sort", "-sparc-boot", "-sparc-label", "-stream-media-size", "-stream-file-name", "-sunx86-boot", "-sunx86-label", "-sysid", "-table-name", "-ucs-level", "-uid", "-V", "-volset", "-volset-size", "-volset-seqno", "-x", "-P", "-map", "-magic", "-hfs-creator", "-hfs-type", "-boot-hfs-file", "-auto", "-cluster-size", "-hide-hfs", "-hide-hfs-list", "-hfs-volid", "-root-info", "-prep-boot", "-input-hfs-charset", "-output-hfs-charset", "-hfs-bless", "-hfs-parms", "-eltorito-boot", "-generic-boot", "-eltorito-catalog", "-cdrecord-params", "-errctl", "-exclude", "-prev-session", "-output", "-use-fileversion", "-volid", "-old-exclude", "-alpha-boot", "-hppa-cmdline", "-hppa-kernel-32", "-hppa-kernel-64", "-hppa-bootloader", "-hppa-ramdisk", "-mips-boot", "-mipsel-boot", "-jigdo-jigdo", "-jigdo-template", "-jigdo-min-file-size", "-jigdo-force-md5", "-jigdo-force-checksum", "-md5-list", "-checksum-list", "-jigdo-exclude", "-jigdo-map", "-jigdo-template-compress", "-jigdo-checksum-algorithm", "-checksum_algorithm_iso", "-checksum_algorithm_template", "--stdio_sync", "--quoted_path_list", "--efi-boot", "--embedded-boot", "-isohybrid-mbr", "-e", "-partition_offset", "-partition_hd_cyl", "-partition_sec_hd", "-partition_cyl_align", "-untranslated_name_len", "-rr_reloc_dir", "-hfsplus-serial-no", "-prep-boot-part", "-efi-boot-part", "-hfsplus-block-size", "-apm-block-size", "--grub2-mbr", "--grub2-sparc-core", "--sort-weight-list", "--sort-weight-patterns", "-hppa-hdrversion", "-file_name_limit", "--set_all_file_dates", "--gpt_disk_guid", "-iso_mbr_part_type", "-eltorito-platform", "" }; static char arg2_options[][41]= { "-hfs-bless-by", "--scdbackup_tag", "--sort-weight", "" }; static char arg3_options[][41]= { "-append_partition", "-hfsplus-file-creator-type", "" }; static char final_options[][41]= { "-find", "" }; cmd= argv[0]; *count= 0; for(i=0; partial_options[i][0]!=0; i++) if(strncmp(partial_options[i], cmd, strlen(partial_options[i]))==0) return(1); for(i=0; arg0_options[i][0]!=0; i++) if(strcmp(arg0_options[i], cmd)==0) return(1); *count= 1; for(i=0; arg1_options[i][0]!=0; i++) if(strcmp(arg1_options[i], cmd)==0) return(1); *count= 2; for(i=0; arg2_options[i][0]!=0; i++) if(strcmp(arg2_options[i], cmd)==0) return(1); *count= 3; for(i=0; arg3_options[i][0]!=0; i++) if(strcmp(arg3_options[i], cmd)==0) return(1); *count= argc - 1; for(i=0; final_options[i][0]!=0; i++) if(strcmp(final_options[i], cmd)==0) return(1); *count= 0; return(0); } /* @param flag bit0= do not report eventual ignore decision */ int Xorriso_genisofs_ignore(struct XorrisO *xorriso, char *whom, char *argpt, int *i, int flag) { /* mkisofs 2.01 options which are not scheduled for implementation, yet */ static char ignored_arg0_options[][41]= { "-allow-leading-dots", "-ldots", "-allow-multidot", "-cache-inodes", "-check-oldnames", "-L", "-no-bak", "-no-cache-inodes", "-no-split-symlink-components", "-no-split-symlink-fields", "-nobak", "-force-rr", "-T", "-translation-table", "-no-iso-translate", "" }; static char ignored_arg1_options[][41]= { "-check-session", "-hide-hfs", "-hide-hfs-list", "-table-name", "-volset-seqno", "-volset-size", "-sort", "" }; int k; for(k=0;ignored_arg0_options[k][0]!=0;k++) if(strcmp(argpt,ignored_arg0_options[k])==0) goto no_volunteer; for(k=0;ignored_arg1_options[k][0]!=0;k++) if(strcmp(argpt,ignored_arg1_options[k])==0) { (*i)++; goto no_volunteer; } return(0); no_volunteer:; sprintf(xorriso->info_text, "-as %s: Ignored option ", whom); Text_shellsafe(argpt, xorriso->info_text, 1); if(!(flag & 1)) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(1); } int Xorriso_genisofs_add_boot(struct XorrisO *xorriso, int flag) { int ret; if(xorriso->boot_img_size_default && xorriso->boot_image_emul == 0) xorriso->boot_img_full_size= 1; ret= Xorriso_attach_boot_image(xorriso, 0); if(ret <= 0) xorriso->boot_image_bin_path[0]= 0; return(ret); } int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag) { static char helptext[][160]= { "Usage: xorriso -as mkisofs [options] file...", "Note: This is not mkisofs. See xorriso -help, xorriso -version, man xorrisofs", "Options:", " -f, -follow-links Follow symbolic links", " -graft-points Allow to use graft points for filenames", " -help Print option help", " -hfsplus Generate HFS+ filesystem", " -hfsplus-file-creator-type CREATOR TYPE iso_rr_path", " Attach creator and type to a File", " -hfs-bless FOLDER_NAME Name of Folder to be blessed", " -hfs-bless-by BLESS_TYPE ISO_RR_PATH", " Bless ISO_RR_PATH by BLESS_TYPE {p,i,s,9,x}", " -hfsplus-serial-no HEXSTRING", " HFS serial number: 16 characters [0-9a-fA-F]", " -hfsplus-block-size NUMBER Set HFS+ block size", " -apm-block-size NUMBER Set Apple Partition Map block size", " -hide GLOBFILE Hide ISO9660/RR file", " -hide-list FILE File with list of ISO9660/RR files to hide", " -hide-joliet GLOBFILE Hide Joliet file", " -hide-joliet-list FILE File with list of Joliet files to hide", " -hide-hfsplus GLOBFILE Hide HFS+ file", " -hide-hfsplus-list FILE File with list of HFS+ files to hide", " -input-charset CHARSET Local input charset for file name conversion", " -output-charset CHARSET Output charset for file name conversion", " -iso-level LEVEL Set ISO9660 conformance level (1..3) or 4 for ISO9660 version 2", " -disallow_dir_id_ext Do not allow dot in ISO directory names", " -J, -joliet Generate Joliet directory information", " -joliet-long Allow Joliet file names to be 103 Unicode characters", " -joliet-utf16 Encode Joliet names in UTF-16BE rather than UCS-2", " -U, -untranslated-filenames Allow Untranslated filenames (for HPUX & AIX - violates ISO9660).", " -untranslated_name_len LEN Allow up to LEN (1..96) name characters (heavily violates ISO9660).", " -allow-lowercase Allow lower case characters in addition to the current character set (violates ISO9660)", " -relaxed-filenames Allow 7 bit ASCII except lower case characters (violates ISO9660)", " -d, -omit-period Omit trailing periods from filenames (violates ISO9660)", " -l, -full-iso9660-filenames Allow full 31 character filenames for ISO9660 names", " -max-iso9660-filenames Allow 37 character filenames for ISO9660 names (violates ISO9660)", " -N, -omit-version-number Omit version number from ISO9660 filename (violates ISO9660)", " -D, -disable-deep-relocation", " Disable deep directory relocation (violates ISO9660)", " -hide-rr-moved Relocate deep directories to /.rr_moved", " -rr_reloc_dir NAME Set deep directory relocation target in root", " -uid uid Make the owner of all files this uid.", " -gid gid Make the group owner of all files this gid.", " -o FILE, -output FILE Set output file name", " -m GLOBFILE, -exclude GLOBFILE", " Exclude file name", " -x FILE, -old-exclude FILE Exclude file name", " -exclude-list FILE File with list of file names to exclude", " -pad Pad output by 300k (default)", " -no-pad Do not pad output", " -M FILE, -prev-session FILE Set path to previous session to merge", " -C PARAMS, -cdrecord-params PARAMS", " Magic paramters from cdrecord", " -dir-mode mode Make the mode of all directories this mode.", " -file-mode mode Make the mode of all plain files this mode.", " -path-list FILE File with list of pathnames to process", " --quoted_path_list FILE File with list of quoted pathnames to process", " -print-size Print estimated filesystem size and exit", " -quiet Run quietly", " -gui Switch behaviour for GUI", " -R, -rock Generate Rock Ridge directory information", " -r, -rational-rock Generate rationalized Rock Ridge directory information", " --norock Disable Rock Ridge. (Strongly discouraged !)", " -file_name_limit LEN Set truncation limit for Rock Ridge names", " --hardlinks Record eventual hard link relations of files", " --acl Record eventual ACLs of files", " --xattr Record eventual user space xattr of files", " --xattr-any Record xattr of any namespace, not only user.", " --md5 Compute and record MD5 checksums of data files", " --scdbackup_tag PATH NAME With --md5 record a scdbackup checksum tag", " --for_backup Use all options which improve backup fidelity", " -V ID, -volid ID Set Volume ID", " -volset ID Set Volume set ID", " -publisher PUB Set Volume publisher", " -A ID, -appid ID Set Application ID", " -sysid ID Set System ID", " -p PREP, -preparer PREP Set Volume preparer", " -abstract FILE Set Abstract filename", " -biblio FILE Set Bibliographic filename", " -copyright FILE Set Copyright filename", " --application_use CHAR|PATH Set content of Application Use field", " -jigdo-jigdo FILE Produce a jigdo .jigdo file as well as the .iso", " -jigdo-template FILE Produce a jigdo .template file as well as the .iso", " -jigdo-min-file-size SIZE Minimum size for a file to be listed in the jigdo file", " -jigdo-force-checksum PTRN Pattern(s) where files MUST match an externally-supplied checksum", " -jigdo-force-md5 PATTERN Outdated alias of -jigdo-force-checksum", " -jigdo-exclude PATTERN Pattern(s) to exclude from the jigdo file", " -jigdo-map PATTERN1=PATTERN2", " Pattern(s) to map paths (e.g. Debian=/mirror/debian)", " -checksum-list FILE File containing checksums of the files that should be checked", " -md5-list FILE Outdated alias of -checksum-list", " -jigdo-checksum-algorithm ALGORITHM", " Choose algorithm for file matching checksums: md5, sha256", " Expected in the -checksum-list FILE, written into .jigdo file.", " -jigdo-template-compress ALGORITHM", " Choose to use gzip or bzip2 compression for template data; default is gzip", " -checksum_algorithm_iso alg1,alg2,...", " Specify the checksum types desired for the output image (in .jigdo)", " -checksum_algorithm_template alg1,alg2,...", " Specify the checksum types desired for the output jigdo template", " -eltorito-platform Set El Torito platform id for the next boot entry", " -b FILE, -eltorito-boot FILE", " Set El Torito boot image name", " -eltorito-alt-boot Start specifying alternative El Torito boot parameters", " --efi-boot FILE Set El Torito EFI boot image name and type", " -e FILE Set EFI boot image name (more rawly)", " -c FILE, -eltorito-catalog FILE", " Set El Torito boot catalog name", " --boot-catalog-hide Hide boot catalog from ISO9660/RR and Joliet", " -boot-load-size # Set numbers of load sectors", " -hard-disk-boot Boot image is a hard disk image", " -no-emul-boot Boot image is 'no emulation' image", " -boot-info-table Patch boot image with info table", " --grub2-boot-info Patch boot image at byte 2548", " -eltorito-id ID Set El Torito Id String", " -eltorito-selcrit HEXBYTES Set El Torito Selection Criteria", " -isohybrid-gpt-basdat Mark El Torito boot image as Basic Data in GPT", " -isohybrid-gpt-hfsplus Mark El Torito boot image as HFS+ in GPT", " -isohybrid-apm-hfsplus Mark El Torito boot image as HFS+ in APM", " -part_like_isohybrid Mark in MBR, GPT, APM without -isohybrid-mbr", " -iso_mbr_part_type Set type byte or GUID of ISO partition in MBR", " or type GUID if a GPT ISO partition emerges.", " --gpt_disk_guid GUID Set GPT disk GUID or choose automatic GUID", " -G FILE, -generic-boot FILE Set generic boot image name", " --embedded-boot FILE Alias of -G", " --protective-msdos-label Patch System Area by partition table", " --mbr-force-bootable Enforce existence of bootable flag in MBR", " -partition_offset LBA Make image mountable by first partition, too", " -partition_sec_hd NUMBER Define number of sectors per head", " -partition_hd_cyl NUMBER Define number of heads per cylinder", " -partition_cyl_align MODE Control cylinder alignment: off, on, auto, all", " -mips-boot FILE Set mips boot image name (relative to image root)", " -mipsel-boot FILE Set mipsel boot image name (relative to image root)", " -B FILES, -sparc-boot FILES Set sparc boot image names", " -sparc-label label text Set sparc boot disk label", " -hppa-cmdline CMDLINE Set hppa boot command line", " -hppa-kernel-32 FILE Set hppa 32-bit image name (relative to image root)", " -hppa-kernel-64 FILE Set hppa 64-bit image name (relative to image root)", " -hppa-bootloader FILE Set hppa boot loader file name (relative to image root)", " -hppa-ramdisk FILE Set hppa ramdisk file name (relative to image root)", " -hppa-hdrversion NUMBER Set hppa PALO header version to 4 or 5", " -alpha-boot FILE Set alpha boot image name (relative to image root)", " --grub2-sparc-core FILE Set path of core file for disk label patching", " -efi-boot-part DISKFILE|--efi-boot-image", " Set data source for EFI System Partition", " -chrp-boot-part Mark ISO image size by MBR partition type 0x96", " -chrp-boot Alias of -chrp-boot-part", " -prep-boot-part DISKFILE Set data source for MBR partition type 0x41", " -append_partition NUMBER TYPE FILE", " Append FILE after image. TYPE is hex: 0x.. or", " a GUID to be used if -appended_part_as_gpt.", " -appended_part_as_gpt mark appended partitions in GPT instead of MBR.", " -appended_part_as_apm mark appended partitions in APM.", " --modification-date=YYYYMMDDhhmmsscc", " Override date of creation and modification", " --set_all_file_dates TIME Override mtime, atime, ctime in all files", " -isohybrid-mbr FILE Set SYSLINUX mbr/isohdp[fp]x*.bin for isohybrid", " --grub2-mbr FILE Set GRUB2 MBR for boot image address patching", #ifdef Xorriso_with_isohybriD " isolinux_mbr=on|auto|off Control eventual isohybrid MBR generation", #endif " --sort-weight NUMBER FILE Set LBA weight number to file or file tree", " --sort-weight-list DISKFILE Read list of NUMBER FILE pairs for --sort-weight", " --sort-weight-patterns DISKFILE --sort-weight-list with pattern expansion", " --stdio_sync on|off|number Control forced output to disk files", " --no-emul-toc Save 64 kB size on random access output files", " --emul-toc Multi-session history on such output files", " --old-empty Use old style block addresses for empty files", " -z, -transparent-compression", " Enable transparent compression of files", " --zisofs-version-2 Enable processing of zisofs version 2 files", " --zisofs2-susp-z2 Produce Z2 entries for zisofs version 2", " --zisofs2-susp-zf Produce ZF entries for zisofs version 2", " -root DIR Set root directory for all new files and directories", " -old-root DIR Set root directory in previous session that is searched for files", " --old-root-no-md5 Do not record and use MD5 with -old-root", " --old-root-no-ino Do not use disk inode numbers with -old-root", " --old-root-devno Use disk device numbers with -old-root", " -log-file LOG_FILE Re-direct messages to LOG_FILE", " --no_rc Do not execute startup files", " -v, -verbose Verbose", " -version Print the current version", "", #ifdef Xorriso_GNU_xorrisO "Report bugs to: bug-xorriso@gnu.org , or in private to: scdbackup@gmx.net .", "xorriso home page: ", "General help using GNU software: ", #else "Report any bugs to bug-xorriso@gnu.org or in private to scdbackup@gmx.net .", #endif "@End_of_helptexT@" }; char ra_text[80]; int i; strcpy(ra_text, xorriso->report_about_text); Xorriso_option_report_about(xorriso, "NOTE", 0); for(i= 0; strcmp(helptext[i], "@End_of_helptexT@")!=0; i++) { sprintf(xorriso->info_text, "%s\n", helptext[i]); Xorriso_info(xorriso, 1 | 2); } Xorriso_option_report_about(xorriso, ra_text, 0); return(1); } /* Perform hiding. Cumbersome: The paths and patterns apply to the disk address and not to the Rock Ridge address. Actually even the literal form of the mkisofs pathspec would matter (e.g. "./" versus ""). But xorriso normalizes disk_paths before further processing. Thus the literal form does not matter. @param hide_attrs bit0= hide in ISO/RR bit1= hide in Joliet bit2= hide in HFS+ bit3 to bit5 are reserved for future hidings */ int Xorriso_genisofs_hide(struct XorrisO *xorriso, char *whom, char *pattern, int hide_attrs, int flag) { int zero= 0, ret; char *argv[1]; if((hide_attrs & 63) == 0) return(2); if(strchr(pattern, '/') != NULL) { argv[0]= pattern; ret= Xorriso_option_not_paths(xorriso, 1, argv, &zero, 4 | ((hide_attrs & 63) << 8)); } else { ret= Xorriso_option_not_leaf(xorriso, pattern, hide_attrs & 63); } return(ret); } /* @param flag bit0= quoted list */ int Xorriso_genisofs_hide_list(struct XorrisO *xorriso, char *whom, char *adr, int hide_attrs, int flag) { int ret, linecount= 0, argc= 0, was_failure= 0, i, fret; char **argv= NULL, *id= ""; FILE *fp= NULL; if(adr[0]==0) { if (hide_attrs & 2) id = "joliet-"; else if (hide_attrs & 4) id = "hfsplus-"; sprintf(xorriso->info_text, "Empty file name given with -as %s -hide-%slist", whom, id); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); return(0); } ret= Xorriso_afile_fopen(xorriso, adr, "rb", &fp, 0); if(ret <= 0) return(0); while(1) { ret= Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 4 | (flag & 1) ); if(ret <= 0) goto ex; if(ret == 2) break; for(i= 0; i < argc; i++) { if(argv[i][0] == 0) continue; ret= Xorriso_genisofs_hide(xorriso, whom, argv[i], hide_attrs, 0); if(ret <= 0 || xorriso->request_to_abort) { was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; if(ret > 0) ret= 0; goto ex; } } } ret= 1; ex:; Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 2); if(fp != NULL && fp != stdin) fclose(fp); if(ret<=0) return(ret); return(!was_failure); } /* Strip surplus dash from known single-dash long options */ int Xorriso_genisofs_strip_dash(struct XorrisO *xorriso, char *arg_in, char **arg_out, int flag) { int ret, count; char *argv[1]; *arg_out= arg_in; if(strlen(arg_in) < 4) return(1); if(arg_in[0] != '-' || arg_in[1] != '-' || arg_in[2] == '-') return(1); argv[0]= arg_in + 1; ret= Xorriso_genisofs_count_args(xorriso, 1, argv, &count, 0); if(ret > 0) *arg_out= arg_in + 1; return(1); } /* Interprets a string of single-char options which have no parameters @param flag bit0=check whether string is ok bit1=this is pass 1 @return with flag bit0: 0=no , 1=yes, 2= with bit1: non-pass-1 options seen else : 1 = ok , <= 0 indicates error */ int Xorriso_genisofs_fused_options(struct XorrisO *xorriso, char *whom, char *opts, int *option_d, int *iso_level, int *lower_r, char ra_text[80], int flag) { int ret, non_pass1= 0; char *cpt; static char pass1_covered[]= {"fvz"}; static char covered[]= {"dDfJlNRrTUvz"}; if(flag & 1) { for(cpt= opts; *cpt != 0; cpt++) { if(strchr(covered, *cpt) == NULL) {ret= 0; goto ex;} if(flag & 2) if(strchr(pass1_covered, *cpt) == NULL) non_pass1= 1; } ret= 1 + non_pass1; goto ex; } for(cpt= opts; *cpt != 0; cpt++) { if(*cpt == 'd') { if(flag & 2) continue; Xorriso_relax_compliance(xorriso, "no_force_dots", 0); } else if(*cpt == 'D') { if(flag & 2) continue; *option_d= 1; } else if(*cpt == 'f') { if(!(flag & 2)) continue; ret= Xorriso_option_follow(xorriso, "on", 0); if(ret <= 0) goto ex; } else if(*cpt == 'J') { if(flag & 2) continue; xorriso->do_joliet= 1; } else if(*cpt == 'l') { if(flag & 2) continue; if(xorriso->iso_level <= 2) Xorriso_relax_compliance(xorriso, "iso_9660_level=2", 0); if(*iso_level <= 2) *iso_level= 2; } else if(*cpt == 'N') { if(flag & 2) continue; Xorriso_relax_compliance(xorriso, "omit_version", 0); } else if(*cpt == 'R') { if(flag & 2) continue; xorriso->do_rockridge= 1; } else if(*cpt == 'r') { if(flag & 2) continue; xorriso->do_rockridge= 1; *lower_r= 1; } else if(*cpt == 'T') { /* ignored */; } else if(*cpt == 'U') { if(flag & 2) continue; Xorriso_relax_compliance(xorriso, "no_force_dots:long_paths:long_names:omit_version:full_ascii:lowercase", 0); } else if(*cpt == 'v') { if(!(flag & 2)) continue; strcpy(ra_text, "UPDATE"); } else if(*cpt == 'z') { if(!(flag & 2)) continue; Xorriso_option_zisofs(xorriso, "by_magic=on", 0); } else { sprintf(xorriso->info_text, "-as %s: Unsupported option -%c", whom, *cpt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } ret= 1; ex:; return(ret); } /* Implementing mkisofs tendency to map single-path pathspecs to / */ int Xorriso_graftable_pathspec(struct XorrisO *xorriso, char *in_pathspec, char *pathspec, int flag) { int ret, l; char *esc_wdx= NULL, *eff_path= NULL, *ept; if((!xorriso->allow_graft_points) || Fileliste__target_source_limit(in_pathspec, '=', &ept, 0) <= 0) { Xorriso_alloc_meM(esc_wdx, char, SfileadrL); Xorriso_alloc_meM(eff_path, char, SfileadrL); strcpy(esc_wdx, xorriso->wdx); if(!xorriso->allow_graft_points) { ret= Fileliste__escape_source_path(esc_wdx, SfileadrL, 0); if(ret <= 0) { Xorriso_msgs_submit(xorriso, 0, "Escaped -cdx directory gets much too long", 0, "FAILURE", 0); ret= 0; goto ex; } } ret= Xorriso_normalize_img_path(xorriso, esc_wdx, in_pathspec, eff_path, 2|4); if(ret <= 0) {ret= 0; goto ex;} ret= Sfile_type(eff_path, 1 | ((xorriso->do_follow_param || xorriso->do_follow_links) << 2)); if(ret == 2) { strcpy(pathspec, "/="); } else { pathspec[0]= '/'; pathspec[1]= 0; ret= Sfile_leafname(eff_path, pathspec + 1, 0); if(ret>0) { if(!xorriso->allow_graft_points) { ret= Fileliste__escape_source_path(pathspec, SfileadrL, 0); if(ret <= 0) { Xorriso_msgs_submit(xorriso, 0, "Escaped leaf name gets much too long", 0, "FAILURE", 0); ret= 0; goto ex; } } strcat(pathspec, "="); } else pathspec[0]= 0; } l= strlen(pathspec); strcat(pathspec, eff_path); if(!xorriso->allow_graft_points) { ret= Fileliste__escape_source_path(pathspec + l, 2 * SfileadrL - l, 0); if(ret <= 0) { Xorriso_msgs_submit(xorriso, 0, "Escaped path gets much too long", 0, "FAILURE", 0); ret= 0; goto ex; } } } else { Sfile_str(pathspec, in_pathspec, 0); } ret= 1; ex:; Xorriso_free_meM(esc_wdx); Xorriso_free_meM(eff_path); return(ret); } int Xorriso_genisofs_path_pecul(struct XorrisO *xorriso, int *was_path, int with_emul_toc, int *allow_dir_id_ext, int *iso_level, int flag) { char *sfe= NULL; int ret; if(*was_path) { ret= 1; goto ex; } *was_path= 1; Xorriso_alloc_meM(sfe, char, 5*SfileadrL); /* Enforce odd mkisofs defaults on first pathspec */ xorriso->pacifier_style= 1; if(xorriso->allow_dir_id_ext_dflt && *allow_dir_id_ext < 0) *allow_dir_id_ext= 1; if(*allow_dir_id_ext == 1) { Xorriso_relax_compliance(xorriso, "allow_dir_id_ext", 0); *allow_dir_id_ext= 2; } if(xorriso->iso_level_is_default && *iso_level < 0) *iso_level= 1; if(*iso_level >= 1 && *iso_level <= 3) { sprintf(sfe, "iso_9660_level=%d", *iso_level); Xorriso_relax_compliance(xorriso, sfe, 0); iso_level= 0; } /* For the sake of compatibility give up emulated multi-session by default */ if(with_emul_toc == 0) xorriso->no_emul_toc|= 1; /* mkisofs records mtime in ECMA-119 and Joliet */ Xorriso_relax_compliance(xorriso, "rec_mtime", 0); /* mkisofs is substantially faster than xorriso by not fsyncing */ if(xorriso->stdio_sync_is_default) Xorriso_option_stdio_sync(xorriso, "off", 0); Xorriso_free_meM(sfe); ret= 1; ex:; return(ret); } int Xorriso_genisofs_platform(struct XorrisO *xorriso, char *id, int flag) { unsigned int u; char re_id[64]; if(strcmp(id, "x86") == 0) return(0); else if(strcmp(id, "PPC") == 0) return(1); else if(strcmp(id, "Mac") == 0) return(2); else if(strcmp(id, "efi") == 0) return(0xef); u= 0x100; if(strncmp(id, "0x", 2) == 0) { sscanf(id + 2, "%x", &u); } else { sscanf(id, "%u", &u); sprintf(re_id, "%u", u); if(strcmp(id, re_id) != 0) goto wrong_id; } if(u <= 0xff) return((int) u); wrong_id:; sprintf(xorriso->info_text, "Unrecognized El Torito Platform Id : '%.16s%s'", id, strlen(id) > 16 ? "..." : ""); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); sprintf(xorriso->info_text, "Recognizable are: x86, PPC, Mac, efi, [0...255], [0x00...0xff]"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); return(-1); } /* micro emulation of mkisofs */ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom, int argc, char **argv, int flag) { int ret, i, j, was_path= 0, was_other_option= 0, mem_graft_points, mem; int do_print_size= 0, fd, idx, iso_level= -1, palohdrversion; int was_failure= 0, fret, lower_r= 0, zero= 0; int dir_mode= -1, file_mode= -1, count, partition_number; int allow_dir_id_ext= -1; int root_seen= 0, do_md5_mem, option_d= 0, arg_count; mode_t mode_and, mode_or; int with_boot_image= 0, with_cat_path= 0, with_emul_toc= 0; int old_root_md5= 1, old_root_dev= 0, old_root_ino= 1, sort_file_pattern= 0; int *weight_list= NULL, weight_count= 0; int *delay_opt_list= NULL, delay_opt_count= 0; int mkisofs_b_platform_id= 0x00; char *sfe= NULL, *adr= NULL, ra_text[80], *pathspec= NULL, *sort_file= NULL; char *ept, *add_pt, *eff_path= NULL, *indev= NULL, msc[80], *cpt; char *old_root= NULL, *argpt, *hargv[1]; char *boot_path, partno_text[24], *iso_rr_pt, *disk_pt, *rpt, *wpt; char *rm_merge_args[3], *rr_reloc_dir_pt= NULL; char *sort_weight_args[4], *bless_args[6], *sa_path; struct stat stbuf; Xorriso_alloc_meM(sfe, char, 5*SfileadrL); Xorriso_alloc_meM(adr, char, SfileadrL+8); Xorriso_alloc_meM(pathspec, char, 2*SfileadrL); Xorriso_alloc_meM(eff_path, char, SfileadrL); Xorriso_alloc_meM(indev, char, SfileadrL+8); Xorriso_alloc_meM(old_root, char, SfileadrL); Xorriso_alloc_meM(sort_file, char, SfileadrL); for(i= 0; i= argc) goto not_enough_args; i+= 1; if(argv[i][0]) { sprintf(xorriso->info_text, "re-directing all messages to %s\n", argv[i]); Xorriso_info(xorriso, 0); } ret= Xorriso_write_to_channel(xorriso, argv[i], 2, 8 | ((argv[i][0] == 0) << 15)); if(ret <= 0) { sprintf(xorriso->info_text, "Cannot open logfile: %s", argv[i]); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno * (ret == 0), "SORRY", 0); was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret < 0) {ret= 0; goto ex;} } if(argv[i][0] == 0) { sprintf(xorriso->info_text, "Revoked stderr message redirection"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } } } strcpy(ra_text, xorriso->report_about_text); weight_list= TSOB_FELD(int, (argc / 3) + 1); if(weight_list == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); {ret= -1; goto ex;} } delay_opt_list= TSOB_FELD(int, argc + 1); if(delay_opt_list == NULL) { cpt= (char *) weight_list; Xorriso_no_malloc_memory(xorriso, &cpt, 0); {ret= -1; goto ex;} } if(xorriso->boot_image_cat_path[0]) with_cat_path= -1; adr[0]= indev[0]= msc[0]= old_root[0]= sort_file[0]= 0; for(i= 0; iresult_line, "mkisofs 2.01-Emulation Copyright (C) 2019 see libburnia-project.org xorriso\n" ); fd= xorriso->dev_fd_1; if(fd<0) fd= 1; ret= write(fd, xorriso->result_line, strlen(xorriso->result_line)); /* (result of write intentionally ignored) */ fsync(fd); Xorriso_option_version(xorriso, 0); } else if(strcmp(argpt, "-o")==0 || strcmp(argpt, "-output")==0) { if(i+1>=argc) goto not_enough_args; i++; adr[0]= 0; if(strcmp(argv[i],"-")!=0 && strncmp(argv[i], "stdio:", 6)!=0) strcpy(adr, "stdio:"); if(Sfile_str(adr+strlen(adr), argv[i], 0)<=0) {ret= -1; goto ex;} } else if(strcmp(argpt, "-M")==0 || strcmp(argpt, "-dev")==0 || strcmp(argpt, "-prev-session")==0) { if(i+1>=argc) goto not_enough_args; i++; if(strncmp(argv[i], "stdio:", 6)!=0) strcpy(indev, "stdio:"); if(Sfile_str(indev+strlen(indev), argv[i], 0)<=0) {ret= -1; goto ex;} } else if(strcmp(argpt, "-C")==0 || strcmp(argpt, "-cdrecord-params")==0) { if(i+1>=argc) goto not_enough_args; i++; strncpy(msc, argv[i], sizeof(msc)-1); msc[sizeof(msc)-1]= 0; } else if(strcmp(argpt, "-help")==0) { Xorriso_genisofs_help(xorriso, 0); } else if(strcmp(argpt, "-v")==0 || strcmp(argpt, "-verbose")==0) { ret= Xorriso_genisofs_fused_options(xorriso, whom, "v", &option_d, &iso_level, &lower_r, ra_text, 2); if(ret <= 0) goto problem_handler_1; } else if(strcmp(argpt, "-quiet")==0) { strcpy(ra_text, "SORRY"); } else if(strcmp(argpt, "-f")==0 || strcmp(argpt, "-follow-links")==0) { ret= Xorriso_genisofs_fused_options(xorriso, whom, "f", &option_d, &iso_level, &lower_r, ra_text, 2); if(ret <= 0) goto problem_handler_1; } else if(strcmp(argpt, "-iso-level")==0) { if(i+1>=argc) goto not_enough_args; i++; sscanf(argv[i], "%d", &iso_level); if(iso_level < 1 || iso_level > 4) { sprintf(xorriso->info_text, "-as %s: unsupported -iso-level '%s' (use one of: 1,2,3,4)", whom, argv[i]); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto problem_handler_1; } if(iso_level == 4) xorriso->do_iso1999= 1; else { sprintf(sfe, "iso_9660_level=%s", argv[i]); ret= Xorriso_relax_compliance(xorriso, sfe, 0); if(ret <= 0) goto problem_handler_1; } } else if(strcmp(argpt, "-input-charset")==0) { if(i+1>=argc) goto not_enough_args; i++; /* -local_charset */ if(strcmp(argv[i], "default") == 0) ret= Xorriso_option_charset(xorriso, "ISO-8859-1", 4); else ret= Xorriso_option_charset(xorriso, argv[i], 4); if(ret <= 0) goto problem_handler_1; } else if(strcmp(argpt, "-output-charset")==0) { if(i+1>=argc) goto not_enough_args; i++; /* -charset */ if(strcmp(argv[i], "default") == 0) ret= Xorriso_option_charset(xorriso, "ISO-8859-1", 3); else ret= Xorriso_option_charset(xorriso, argv[i], 3); if(ret <= 0) goto problem_handler_1; } else if(strcmp(argpt, "-hide") == 0 || strcmp(argpt, "-hide-list") == 0 || strcmp(argpt, "-hide-joliet") == 0 || strcmp(argpt, "-hide-joliet-list") == 0 || strcmp(argpt, "-hide-hfsplus") == 0 || strcmp(argpt, "-hide-hfsplus-list") == 0) { if(i+1>=argc) goto not_enough_args; i++; if(strcmp(argpt, "-hide") == 0) ret= Xorriso_genisofs_hide(xorriso, whom, argv[i], 1, 0); else if(strcmp(argpt, "-hide-list") == 0) ret= Xorriso_genisofs_hide_list(xorriso, whom, argv[i], 1, 0); else if(strcmp(argpt, "-hide-joliet") == 0) ret= Xorriso_genisofs_hide(xorriso, whom, argv[i], 2, 0); else if(strcmp(argpt, "-hide-joliet-list") == 0) ret= Xorriso_genisofs_hide_list(xorriso, whom, argv[i], 2, 0); else if(strcmp(argpt, "-hide-hfsplus") == 0) ret= Xorriso_genisofs_hide(xorriso, whom, argv[i], 4, 0); else if(strcmp(argpt, "-hide-hfsplus-list") == 0) ret= Xorriso_genisofs_hide_list(xorriso, whom, argv[i], 4, 0); if(ret <= 0) goto problem_handler_1; } else if(strcmp(argpt, "-root") == 0) { if(i+1>=argc) goto not_enough_args; i++; /* Always absolute */ strcpy(eff_path, "/"); if(Sfile_str(eff_path, argv[i], argv[i][0] != '/') <= 0) {ret= -1; goto ex;} strcpy(xorriso->wdi, eff_path); root_seen= 1; } else if(strcmp(argpt, "-old-root") == 0) { if(i+1>=argc) goto not_enough_args; i++; /* Always absolute */ strcpy(old_root, "/"); if(Sfile_str(old_root, argv[i], argv[i][0] != '/') <= 0) {ret= -1; goto ex;} } else if(strcmp(argpt, "--old-root-no-md5")==0) { old_root_md5= 0; } else if(strcmp(argpt, "--old-root-devno")==0) { old_root_dev= 1; } else if(strcmp(argpt, "--old-root-no-ino")==0) { old_root_ino= 0; } else if(strcmp(argpt, "-fat") == 0) { xorriso->do_fat= 1; } else if(strcmp(argpt, "-hfsplus") == 0) { /* Already with -indev */ xorriso->do_hfsplus= 1; } else if(strcmp(argpt, "--hardlinks")==0) { Xorriso_option_hardlinks(xorriso, "on", 0); } else if(strcmp(argpt, "--acl")==0) { Xorriso_option_acl(xorriso, "on", 0); } else if(strcmp(argpt, "--xattr")==0) { Xorriso_option_xattr(xorriso, "on", 0); } else if(strcmp(argpt, "--xattr-any")==0) { Xorriso_option_xattr(xorriso, "any", 0); } else if(strcmp(argpt, "--md5")==0) { Xorriso_option_md5(xorriso, "on", 0); } else if(strcmp(argpt, "--scdbackup_tag")==0) { if(i + 2 >= argc) goto not_enough_args; i+= 2; ret= Xorriso_option_scdbackup_tag(xorriso, argv[i-1], argv[i], 0); if(ret <= 0) goto problem_handler_1; } else if(strcmp(argpt, "--for_backup")==0) { Xorriso_option_hardlinks(xorriso, "on", 0); Xorriso_option_acl(xorriso, "on", 0); Xorriso_option_xattr(xorriso, "any", 0); Xorriso_option_md5(xorriso, "on", 0); } else if(strcmp(argpt, "-z")==0 || strcmp(argpt, "-transparent-compression")==0) { Xorriso_option_zisofs(xorriso, "by_magic=on", 0); } else if(strcmp(argpt, "--zisofs-version-2") == 0) { Xorriso_option_zisofs(xorriso, "by_magic=v2", 0); } else if(strcmp(argpt, "--zisofs2-susp-z2") == 0) { Xorriso_option_zisofs(xorriso, "susp_z2=on", 0); } else if(strcmp(argpt, "--zisofs2-susp-zf") == 0) { Xorriso_option_zisofs(xorriso, "susp_z2=off", 0); } else if(strcmp(argpt, "--stdio_sync")==0) { if(i+1>=argc) goto not_enough_args; i++; Xorriso_option_stdio_sync(xorriso, argv[i], 0); } else if(strcmp(argpt, "-disallow_dir_id_ext")==0) { allow_dir_id_ext= 0; } else if(strcmp(argpt, "--emul-toc")==0) { with_emul_toc= 1; xorriso->no_emul_toc&= ~1; } else if(strcmp(argpt, "--no-emul-toc")==0) { with_emul_toc= 0; xorriso->no_emul_toc|= 1; } else if(strcmp(argpt, "-log-file") == 0) { /* already handled before this loop */; i++; } else if(strcmp(argpt, "-gui") == 0) { xorriso->pacifier_interval= 0.25; } else if(strcmp(argpt, "-file_name_limit") == 0) { if(i+1>=argc) goto not_enough_args; i++; Xorriso_option_file_name_limit(xorriso, argv[i], 0); } else { if(argv[i][0] == '-') { ret= Xorriso_genisofs_fused_options(xorriso, whom, argv[i] + 1, &option_d, &iso_level, &lower_r, ra_text, 1 | 2); if(ret != 1) was_other_option= 1; } else { ret= 0; was_other_option= 1; } if(ret > 0) { Xorriso_genisofs_fused_options(xorriso, whom, argv[i] + 1, &option_d, &iso_level, &lower_r, ra_text, 2); if(ret <= 0) goto problem_handler_1; } else { hargv[0]= argpt; ret= Xorriso_genisofs_count_args(xorriso, argc - i, hargv, &count, 0); if(ret > 0) i+= count; /* skip eventual arguments of known option */ } } continue; /* regular bottom of loop */ problem_handler_1:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } Xorriso_option_report_about(xorriso, ra_text, 0); if(adr[0]) { if(strncmp(adr, "stdio:", 6)==0 && strncmp(adr, "stdio:/dev/fd/", 14)!=0) { ret= Sfile_type(adr+6, 1); if(ret==-1) { /* ok */; } else if(ret==2 || ret==3) { sprintf(xorriso->info_text, "-as %s: Cannot accept %s as target: -o %s", whom, (ret==3 ? "symbolic link" : "directory"), Text_shellsafe(adr+6, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } /* Regard overwritable as blank, truncate regular files on write start */ ret= Xorriso_option_dev(xorriso, adr, 2|8|16); if(ret<=0) goto ex; } if(was_other_option && xorriso->out_drive_handle==NULL) { ret= Xorriso_option_dev(xorriso, "-", 2|4); /* set outdev to stdout */ if(ret<=0) goto ex; } if(msc[0]) { cpt= strchr(msc, ','); if(cpt==NULL) { illegal_c:; sprintf(xorriso->info_text, "-as %s: unusable parameter with option -C: %s", whom, Text_shellsafe(msc, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } else if(cpt==msc || msc[1]==0) goto illegal_c; strncpy(sfe, msc, cpt-msc); sfe[cpt-msc]= 0; if(xorriso->in_drive_handle!=NULL && indev[0]) { /* give up indev before setting the load address */ ret= Xorriso_option_dev(xorriso, "", 1); if(ret<=0) goto ex; } /* growisofs submits msc1+16 to avoid a theoretical bug in mkisofs. Therefore this bug has to be emulated here. Sigh. */ ret= Xorriso_option_load(xorriso, "sbsector", sfe, 1); if(ret<=0) goto ex; ret= Xorriso_option_grow_blindly(xorriso, cpt+1, 0); if(ret<=0) goto ex; } if(old_root[0] || root_seen) { Xorriso_option_md5(xorriso, old_root_md5 ? "on" : "off", 0); Xorriso_option_disk_dev_ino(xorriso, old_root_dev && old_root_ino ? "on" : old_root_ino ? "ino_only" : "off", 0); if(!old_root_ino) Xorriso_option_hardlinks(xorriso, "without_update", 0); } if(indev[0]) { do_md5_mem= xorriso->do_md5; if(xorriso->do_md5 & 1) /* MD5 loading is enabled */ xorriso->do_md5|= 32; /* Do not check tags of superblock,tree,session because growisofs preserves the first sb tag.*/ ret= Xorriso_option_dev(xorriso, indev, 1); xorriso->do_md5= do_md5_mem; if(ret<=0) goto ex; } if(!was_other_option) {ret= 1; goto ex;} if(old_root[0]) { ret= Xorriso_iso_lstat(xorriso, old_root, &stbuf, 0); if(ret >= 0) { if(root_seen) { ret= Xorriso_mkdir(xorriso, xorriso->wdi, 1 | 2); if(ret < 0) {ret= -(ret != -1); goto ex;} } else { strcpy(xorriso->wdi, "/"); } if(strcmp(old_root, xorriso->wdi) != 0) { ret= Xorriso_clone_under(xorriso, old_root, xorriso->wdi, 0); if(ret <= 0) goto ex; } } } xorriso->padding= 300*1024; for(i= 0; iinfo_text, "-as %s: %s", whom, Text_shellsafe(argv[i], sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); ret= Xorriso_genisofs_strip_dash(xorriso, argv[i], &argpt, 0); if(ret <= 0) goto ex; ret= Xorriso_genisofs_ignore(xorriso, whom, argpt, &i, 0); if(ret == 1) continue; if(strcmp(argpt, "-version")==0) { /* was already handled in first argument scan */; } else if(strcmp(argpt, "--norock")==0) { xorriso->do_rockridge= 0; lower_r= 0; } else if(strcmp(argpt, "-R")==0 || strcmp(argpt, "-rock")==0) { ret= Xorriso_genisofs_fused_options(xorriso, whom, "R", &option_d, &iso_level, &lower_r, ra_text, 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "-r")==0 || strcmp(argpt, "-rational-rock")==0){ ret= Xorriso_genisofs_fused_options(xorriso, whom, "r", &option_d, &iso_level, &lower_r, ra_text, 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "-J")==0 || strcmp(argpt, "-joliet")==0) { ret= Xorriso_genisofs_fused_options(xorriso, whom, "J", &option_d, &iso_level, &lower_r, ra_text, 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "-joliet-long")==0) { Xorriso_relax_compliance(xorriso, "joliet_long_paths:joliet_long_names", 0); } else if(strcmp(argpt, "-joliet-utf16")==0) { Xorriso_relax_compliance(xorriso, "joliet_utf16", 0); } else if(strcmp(argpt, "-fat") == 0) { /* was already handled in first argument scan */; } else if(strcmp(argpt, "-hfs-bless") == 0 || strcmp(argpt, "-hfs-bless-by") == 0 || strcmp(argpt, "-hfsplus-file-creator-type") == 0) { arg_count= 1; if(strcmp(argpt, "-hfs-bless-by") == 0) arg_count= 2; else if(strcmp(argpt, "-hfsplus-file-creator-type") == 0) arg_count= 3; if(i + arg_count >= argc) goto not_enough_args; /* Memorize command until all pathspecs are processed */ delay_opt_list[delay_opt_count++]= i; if(argv[i] != argpt) delay_opt_list[delay_opt_count - 1]|= 1u<<31; i+= arg_count; } else if(strcmp(argpt, "-hfsplus") == 0) { /* was already handled in first argument scan */; } else if(strcmp(argpt, "-hfsplus-serial-no") == 0) { if(i+1>=argc) goto not_enough_args; i++; sprintf(pathspec, "hfsplus_serial=%.80s", argv[i]); ret= Xorriso_option_boot_image(xorriso, "any", pathspec, 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "-hfsplus-block-size") == 0 || strcmp(argpt, "-apm-block-size") == 0) { if(i+1>=argc) goto not_enough_args; i++; ret= -1; sscanf(argv[i], "%d", &ret); if(argpt[1] == 'h') sprintf(sfe, "hfsplus_block_size=%d", ret); else sprintf(sfe, "apm_block_size=%d", ret); ret= Xorriso_option_boot_image(xorriso, "any", sfe, 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "-graft-points")==0) { xorriso->allow_graft_points= 3; } else if(strcmp(argpt, "-path-list")==0 || strcmp(argpt, "--quoted_path_list")==0) { if(i+1>=argc) { not_enough_args:; sprintf(xorriso->info_text, "-as %s: Not enough arguments to option %s", whom, argv[i]); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } i++; xorriso->pacifier_style= 1; ret= Xorriso_option_path_list(xorriso, argv[i], (strcmp(argpt, "--quoted_path_list") == 0) | 2); if(ret<=0) goto problem_handler_2; ret = Xorriso_genisofs_path_pecul(xorriso, &was_path, with_emul_toc, &allow_dir_id_ext, &iso_level, 0); if(ret <= 0) goto ex; } else if(strcmp(argpt, "-f")==0 || strcmp(argpt, "-follow-links")==0) { /* was already handled in first argument scan */; } else if(strcmp(argpt, "-pad")==0) { xorriso->padding= 300*1024; } else if(strcmp(argpt, "-no-pad")==0) { xorriso->padding= 0; } else if(strcmp(argpt, "-print-size")==0) { do_print_size= 1; } else if(strcmp(argpt, "-o")==0 || strcmp(argpt, "-output") == 0) { i++; /* was already handled in first argument scan */; } else if(strcmp(argpt, "-M")==0 || strcmp(argpt, "-dev")==0 || strcmp(argpt, "-prev-session")==0) { i++; /* was already handled in first argument scan */; } else if(strcmp(argpt, "-C")==0 || strcmp(argpt, "-cdrecord-params")==0) { i++; /* was already handled in first argument scan */; } else if(strcmp(argpt, "-help")==0) { /* was already handled in first argument scan */; } else if(strcmp(argpt, "-V")==0 || strcmp(argpt, "-volid")==0 || strcmp(argpt, "-volset")==0 || strcmp(argpt, "-p")==0 || strcmp(argpt, "-preparer")==0 || strcmp(argpt, "-P")==0 || strcmp(argpt, "-publisher")==0 || strcmp(argpt, "-A")==0 || strcmp(argpt, "-appid")==0 || strcmp(argpt, "--application_use")==0 || strcmp(argpt, "-sysid")==0 || strcmp(argpt, "-biblio")==0 || strcmp(argpt, "-copyright")==0 || strcmp(argpt, "-abstract")==0 ) { if(i+1>=argc) goto not_enough_args; i++; ret= 1; if(strcmp(argpt, "-V")==0 || strcmp(argpt, "-volid")==0) ret= Xorriso_option_volid(xorriso, argv[i], 0); else if(strcmp(argpt, "-volset")==0) ret= Xorriso_option_volset_id(xorriso, argv[i], 0); else if(strcmp(argpt, "-p")==0 || strcmp(argpt, "-preparer")==0) ret= Xorriso_option_preparer_id(xorriso, argv[i], 0); else if(strcmp(argpt, "-P")==0 || strcmp(argpt, "-publisher")==0) ret= Xorriso_option_publisher(xorriso, argv[i], 0); else if(strcmp(argpt, "-A")==0 || strcmp(argpt, "-appid")==0) ret= Xorriso_option_application_id(xorriso, argv[i], 0); else if(strcmp(argpt, "-sysid")==0) ret= Xorriso_option_system_id(xorriso, argv[i], 0); else if(strcmp(argpt, "-biblio")==0) ret= Xorriso_option_biblio_file(xorriso, argv[i], 0); else if(strcmp(argpt, "-copyright")==0) ret= Xorriso_option_copyright_file(xorriso, argv[i], 0); else if(strcmp(argpt, "-abstract")==0) ret= Xorriso_option_abstract_file(xorriso, argv[i], 0); else if(strcmp(argpt, "--application_use")==0) ret= Xorriso_option_application_use(xorriso, argv[i], 0); if(ret<=0) goto problem_handler_2; } else if(strcmp(argpt, "-m")==0 || strcmp(argpt, "-exclude")==0 || strcmp(argpt, "-x")==0 || strcmp(argpt, "-old-exclude")==0) { if(i+1>=argc) goto not_enough_args; i++; mem= xorriso->do_disk_pattern; xorriso->do_disk_pattern= 1; if(strchr(argv[i], '/')!=NULL) { idx= i; ret= Xorriso_option_not_paths(xorriso, i+1, argv, &idx, 0); } else ret= Xorriso_option_not_leaf(xorriso, argv[i], 0); xorriso->do_disk_pattern= mem; if(ret<=0) goto problem_handler_2; } else if(strcmp(argpt, "-exclude-list")==0) { if(i+1>=argc) goto not_enough_args; i++; mem= xorriso->do_disk_pattern; xorriso->do_disk_pattern= 1; ret= Xorriso_option_not_list(xorriso, argv[i], 0); xorriso->do_disk_pattern= mem; if(ret<=0) goto problem_handler_2; } else if(strcmp(argpt, "-v")==0 || strcmp(argpt, "-verbose")==0 || strcmp(argpt, "-quiet")==0) { /* was already handled in first argument scan */; } else if(strcmp(argpt, "-iso-level")==0) { i++; /* was already handled in first argument scan */; } else if(strcmp(argpt, "-no-emul-boot")==0 || strcmp(argpt, "-hard-disk-boot")==0 || strcmp(argpt, "-boot-info-table")==0 || strcmp(argpt, "--grub2-boot-info") == 0 || strncmp(argpt, "isolinux_mbr=", 13)==0 || strcmp(argpt, "-eltorito-alt-boot")==0 || strcmp(argpt, "--protective-msdos-label")==0 || strcmp(argpt, "--mbr-force-bootable")==0 || strcmp(argpt, "--boot-catalog-hide")==0 || strcmp(argpt, "-isohybrid-gpt-basdat")==0 || strcmp(argpt, "-isohybrid-gpt-hfsplus")==0 || strcmp(argpt, "-isohybrid-apm-hfsplus")==0 || strcmp(argpt, "-part_like_isohybrid")==0) { delay_opt_list[delay_opt_count++]= i; if(argv[i] != argpt) delay_opt_list[delay_opt_count - 1]|= 1u<<31; } else if(strcmp(argpt, "-b") == 0 || strcmp(argpt, "-eltorito-boot") == 0 || strcmp(argpt, "-eltorito-platform") == 0 || strcmp(argpt, "--efi-boot") == 0 || strcmp(argpt, "-e") == 0 || strcmp(argpt, "-mips-boot") == 0 || strcmp(argpt, "-mipsel-boot") == 0 || strcmp(argpt, "-c") == 0 || strcmp(argpt, "-eltorito-catalog") == 0 || strcmp(argpt, "-boot-load-size") == 0 || strcmp(argpt, "-eltorito-id") == 0 || strcmp(argpt, "-eltorito-selcrit") == 0 || strcmp(argpt, "--embedded-boot")==0 || strcmp(argpt, "-generic-boot")==0 || strcmp(argpt, "-G") == 0 || strcmp(argpt, "-partition_offset") == 0 || strcmp(argpt, "-partition_hd_cyl") == 0 || strcmp(argpt, "-partition_sec_hd") == 0 || strcmp(argpt, "-partition_cyl_align") == 0 || strcmp(argpt, "-isohybrid-mbr") == 0 || strcmp(argpt, "--grub2-mbr") == 0 || strncmp(argpt, "-hppa-", 6) == 0 || strcmp(argpt, "-alpha-boot") == 0 || strcmp(argpt, "--gpt_disk_guid") == 0 || strcmp(argpt, "-iso_mbr_part_type") == 0) { if(i+1>=argc) goto not_enough_args; delay_opt_list[delay_opt_count++]= i; if(argv[i] != argpt) delay_opt_list[delay_opt_count - 1]|= 1u<<31; i++; } else if(strncmp(argpt, "--modification-date=", 20)==0) { ret= Xorriso_option_volume_date(xorriso, "uuid", argpt + 20, 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "--set_all_file_dates") == 0) { if(i+1>=argc) goto not_enough_args; i++; ret= Xorriso_option_volume_date(xorriso, "all_file_dates", argv[i], 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "-input-charset")==0) { i++; /* was already handled in first argument scan */; } else if(strcmp(argpt, "-output-charset")==0) { i++; /* was already handled in first argument scan */; } else if(strcmp(argpt, "--hardlinks")==0 || strcmp(argpt, "--acl")==0 || strcmp(argpt, "--xattr")==0 || strcmp(argpt, "--xattr-any")==0 || strcmp(argpt, "--md5")==0 || strcmp(argpt, "--for_backup")==0) { /* was already handled in first argument scan */; } else if(strcmp(argpt, "--scdbackup_tag")==0) { /* was already handled in first argument scan */; i+= 2; } else if(strcmp(argpt, "--sort-weight")==0) { if(i + 2 >= argc) goto not_enough_args; i+= 2; /* memorize for find runs after pathspecs have been added */ weight_list[weight_count++]= i - 2; } else if(strcmp(argpt, "--sort-weight-list") == 0 || strcmp(argpt, "--sort-weight-patterns") == 0) { if(i + 1 >= argc) goto not_enough_args; i++; if(Sfile_str(sort_file, argv[i], 0) <= 0) {ret= -1; goto ex;} sort_file_pattern= (strcmp(argpt, "--sort-weight-patterns") == 0); } else if(strcmp(argpt, "-z")==0 || strcmp(argpt, "-transparent-compression")==0 || strcmp(argpt, "--zisofs-version-2") == 0 || strcmp(argpt, "--zisofs2-susp-z2") == 0 || strcmp(argpt, "--zisofs2-susp-zf") == 0) { /* was already handled in first argument scan */; } else if(strcmp(argpt, "-U") == 0 || strcmp(argpt, "-untranslated-filenames") == 0) { ret= Xorriso_genisofs_fused_options(xorriso, whom, "U", &option_d, &iso_level, &lower_r, ra_text, 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "-untranslated_name_len") == 0) { if(i+1>=argc) goto not_enough_args; i++; sprintf(sfe, "untranslated_name_len=%s", argv[i]); ret= Xorriso_relax_compliance(xorriso, sfe, 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "-N") == 0 || strcmp(argpt, "-omit-version-number") == 0) { ret= Xorriso_genisofs_fused_options(xorriso, whom, "N", &option_d, &iso_level, &lower_r, ra_text, 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "-l") == 0 || strcmp(argpt, "-full-iso9660-filenames") == 0) { ret= Xorriso_genisofs_fused_options(xorriso, whom, "l", &option_d, &iso_level, &lower_r, ra_text, 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "-max-iso9660-filenames") == 0) { Xorriso_relax_compliance(xorriso, "long_names", 0); } else if(strcmp(argpt, "-d") == 0 || strcmp(argpt, "-omit-period") == 0) { ret= Xorriso_genisofs_fused_options(xorriso, whom, "d", &option_d, &iso_level, &lower_r, ra_text, 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "-allow-lowercase") == 0) { Xorriso_relax_compliance(xorriso, "lowercase", 0); } else if(strcmp(argpt, "-relaxed-filenames") == 0) { Xorriso_relax_compliance(xorriso, "7bit_ascii", 0); } else if(strcmp(argpt, "-hide") == 0 || strcmp(argpt, "-hide-list") == 0 || strcmp(argpt, "-hide-joliet") == 0 || strcmp(argpt, "-hide-joliet-list") == 0 || strcmp(argpt, "-hide-hfsplus") == 0 || strcmp(argpt, "-hide-hfsplus-list") == 0) { if(i+1>=argc) goto not_enough_args; i++; /* was already handled in first argument scan */; } else if(strcmp(argpt, "-root") == 0 || strcmp(argpt, "-old-root") == 0) { if(i+1>=argc) goto not_enough_args; i++; /* was already handled in first argument scan */; } else if(strcmp(argpt, "--old-root-no-md5")==0 || strcmp(argpt, "--old-root-devno")==0 || strcmp(argpt, "--old-root-no-ino")==0) { /* was already handled in first argument scan */; } else if(strcmp(argpt, "-dir-mode") == 0) { if(i+1>=argc) goto not_enough_args; i++; ret= Xorriso_convert_modstring(xorriso, "-as mkisofs -dir-mode", argv[i], &mode_and, &mode_or, 0); if(ret<=0) goto problem_handler_2; dir_mode= mode_or; } else if(strcmp(argpt, "-file-mode") == 0) { if(i+1>=argc) goto not_enough_args; i++; ret= Xorriso_convert_modstring(xorriso, "-as mkisofs -file-mode", argv[i], &mode_and, &mode_or, 0); if(ret<=0) goto problem_handler_2; file_mode= mode_or; } else if(strcmp(argpt, "-jigdo-jigdo") == 0 || strcmp(argpt, "-jigdo-template") == 0 || strcmp(argpt, "-jigdo-min-file-size") == 0 || strcmp(argpt, "-jigdo-exclude") == 0 || strcmp(argpt, "-jigdo-force-md5") == 0 || strcmp(argpt, "-jigdo-force-checksum") == 0 || strcmp(argpt, "-jigdo-map") == 0 || strcmp(argpt, "-jigdo-checksum-algorithm") == 0 || strcmp(argpt, "-jigdo-template-compress") == 0 || strcmp(argpt, "-checksum_algorithm_iso") == 0 || strcmp(argpt, "-checksum_algorithm_template") == 0 || strcmp(argpt, "-md5-list") == 0 || strcmp(argpt, "-checksum-list") == 0) { i++; ret= Xorriso_option_jigdo(xorriso, argpt, argv[i], 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "-chrp-boot-part") == 0 || strcmp(argpt, "-chrp-boot") == 0) { ret= Xorriso_option_boot_image(xorriso, "any", "chrp_boot_part=on", 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "-prep-boot-part") == 0) { if(i + 1 >= argc) goto not_enough_args; i++; ret= Sfile_str(xorriso->prep_partition, argv[i], 0); if(ret <= 0) goto ex; } else if(strcmp(argpt, "-efi-boot-part") == 0) { if(i + 1 >= argc) goto not_enough_args; i++; ret= Sfile_str(xorriso->efi_boot_partition, argv[i], 0); if(ret <= 0) goto ex; } else if(strcmp(argpt, "-append_partition") == 0) { if(i + 3 >= argc) goto not_enough_args; i+= 3; ret= Xorriso_option_append_partition(xorriso, argv[i - 2], argv[i - 1], argv[i], 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "-appended_part_as_gpt") == 0) { xorriso->appended_as_gpt= 1; } else if(strcmp(argpt, "-appended_part_as_apm") == 0) { xorriso->appended_as_apm= 1; } else if(strcmp(argpt, "-B") == 0 || strcmp(argpt, "-sparc-boot") == 0) { i++; if(strlen(argv[i]) >= SfileadrL) continue; /* Switch system area type to: SUN Disk Label */ strcpy(pathspec, "sparc_label="); strcat(pathspec, xorriso->ascii_disc_label); ret= Xorriso_option_boot_image(xorriso, "any", pathspec, 0); if(ret <= 0) goto problem_handler_2; /* Interpret list of boot partition images or "..." */; cpt= ept= argv[i]; partition_number= 2; while(ept != NULL) { ept= strchr(cpt, ','); if(ept != NULL) { strncpy(pathspec, cpt, ept - cpt); pathspec[ept - cpt]= 0; cpt= ept + 1; } else strcpy(pathspec, cpt); if(strcmp(pathspec, "...") == 0) { for(; partition_number <= 8; partition_number++) { sprintf(partno_text, "%d", partition_number); ret= Xorriso_option_append_partition(xorriso, partno_text, "0x0", ".", 0); if(ret <= 0) goto problem_handler_2; } } else { if(partition_number > 8) { sprintf(xorriso->info_text, "-as %s -sparc-boot %s : Too many boot images", whom, argv[i]); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE",0); goto problem_handler_2; } sprintf(partno_text, "%d", partition_number); ret= Xorriso_option_append_partition(xorriso, partno_text, "0x0", pathspec, 0); if(ret <= 0) goto problem_handler_2; partition_number++; } } } else if(strcmp(argpt, "-sparc-label") == 0) { if(i+1>=argc) goto not_enough_args; i++; sprintf(sfe, "sparc_label=%s", argv[i]); ret= Xorriso_option_boot_image(xorriso, "any", sfe, 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "--grub2-sparc-core") == 0) { if(i+1>=argc) goto not_enough_args; i++; sprintf(sfe, "grub2_sparc_core=%s", argv[i]); ret= Xorriso_option_boot_image(xorriso, "any", sfe, 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "--stdio_sync")==0) { if(i+1>=argc) goto not_enough_args; i++; /* was already handled in first argument scan */; } else if(strcmp(argpt, "--emul-toc")==0 || strcmp(argpt, "--no-emul-toc")==0) { /* was already handled in first argument scan */; } else if(strcmp(argpt, "--old-empty")==0) { xorriso->do_old_empty= 1; } else if(strcmp(argpt, "-disallow_dir_id_ext")==0) { /* was already handled in first argument scan */; } else if(strcmp(argpt, "--no_rc")==0) { /* was already handled in Xorriso_prescan_args */; } else if(strcmp(argpt, "-D") == 0 || strcmp(argpt, "-disable-deep-relocation") == 0) { ret= Xorriso_genisofs_fused_options(xorriso, whom, "D", &option_d, &iso_level, &lower_r, ra_text, 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "-hide-rr-moved") == 0) { rr_reloc_dir_pt= ".rr_moved"; goto rr_reloc_dir; } else if(strcmp(argpt, "-rr_reloc_dir") == 0) { i++; rr_reloc_dir_pt= argv[i]; rr_reloc_dir:; if(rr_reloc_dir_pt[0] == '/') rr_reloc_dir_pt++; if(strchr(rr_reloc_dir_pt, '/') != NULL) { sprintf(xorriso->info_text, "-as %s -rr_reloc_dir %s : May only use directories in root directory", whom, Text_shellsafe(argv[i], sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE",0); } ret= Xorriso_option_rr_reloc_dir(xorriso, rr_reloc_dir_pt, 0); if(ret <= 0) goto problem_handler_2; Xorriso_relax_compliance(xorriso, "deep_paths_off:long_paths_off", 0); } else if(strcmp(argpt, "-log-file") == 0 || strcmp(argpt, "-file_name_limit") == 0) { i+= 1; /* was already handled before this loop */; } else if(strcmp(argpt, "-gui") == 0) { /* was already handled in first argument scan */; } else if(strcmp(argpt, "-uid") == 0) { if(i + 1 >= argc) goto not_enough_args; i++; ret= Xorriso_option_uid(xorriso, argv[i], 0); if(ret <= 0) goto problem_handler_2; } else if(strcmp(argpt, "-gid") == 0) { if(i + 1 >= argc) goto not_enough_args; i++; ret= Xorriso_option_gid(xorriso, argv[i], 0); if(ret <= 0) goto problem_handler_2; } else if(argpt[0]=='-' && argpt[1]!=0) { ret= Xorriso_genisofs_fused_options(xorriso, whom, argv[i] + 1, &option_d, &iso_level, &lower_r, ra_text, 1); if(ret == 1) { ret= Xorriso_genisofs_fused_options(xorriso, whom, argv[i] + 1, &option_d, &iso_level, &lower_r, ra_text, 0); if(ret <= 0) goto problem_handler_2; } else { hargv[0]= argpt; ret= Xorriso_genisofs_count_args(xorriso, argc - i, hargv, &count, 1); if(ret > 0) { sprintf(xorriso->info_text, "-as %s: Unsupported option %s", whom, Text_shellsafe(argv[i], sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); i+= count; goto problem_handler_2; } else { sprintf(xorriso->info_text, "-as %s: Unrecognized option %s", whom, Text_shellsafe(argv[i], sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto problem_handler_2; } } } else { ret= Xorriso_graftable_pathspec(xorriso, argv[i], pathspec, 0); if(ret <= 0) goto problem_handler_2; add_pt= pathspec; if(old_root[0]) { /* Split pathspec */ ret= Fileliste__target_source_limit(add_pt, '=', &ept, 0); if(ret > 0) { *ept= 0; iso_rr_pt= add_pt; disk_pt= ept + 1; } else { iso_rr_pt= "/"; disk_pt= add_pt; } /* Unescape iso_rr_pt */ strcpy(eff_path, iso_rr_pt); iso_rr_pt= eff_path; for(wpt= rpt= iso_rr_pt; *rpt != 0; rpt++) { if(*rpt == '\\') { if(*(rpt + 1) == '\\') rpt++; else if(*(rpt + 1) == '=') continue; } *(wpt++) = *rpt; } *wpt= 0; if(root_seen) { ret= Sfile_prepend_path(xorriso->wdi, iso_rr_pt, 0); if(ret<=0) { Xorriso_msgs_submit(xorriso, 0, "Effective path gets much too long", 0, "FAILURE", 0); goto problem_handler_2; } } /* update_merge */ ret= Xorriso_option_update(xorriso, disk_pt, iso_rr_pt, 1 | 8 | 32); } else { mem_graft_points= xorriso->allow_graft_points; xorriso->allow_graft_points= 3; zero= 0; ret= Xorriso_option_add(xorriso, 1, &add_pt, &zero, (was_path << 1) | (root_seen << 2)); xorriso->allow_graft_points= mem_graft_points; } if(ret<=0) goto problem_handler_2; /* Enforce odd mkisofs defaults on first pathspec */ ret = Xorriso_genisofs_path_pecul(xorriso, &was_path, with_emul_toc, &allow_dir_id_ext, &iso_level, 0); if(ret <= 0) goto ex; } continue; /* regular bottom of loop */ problem_handler_2:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } if(old_root[0]) { /* Delete all visited nodes which were not found on disk */ if(root_seen) rm_merge_args[0]= xorriso->wdi; else rm_merge_args[0]= "/"; rm_merge_args[1]= "-exec"; rm_merge_args[2]= "rm_merge"; zero= 0; ret= Xorriso_option_find(xorriso, 3, rm_merge_args, &zero, 2); if(ret<=0) goto ex; } if(lower_r) { static char *lower_r_args[3]= {"/", "-exec", "mkisofs_r"}; zero= 0; ret= Xorriso_option_find(xorriso, 3, lower_r_args, &zero, 2); if(ret<=0) goto ex; } if(dir_mode >= 0) { static char *dir_mode_args[6]= {"/", "-type", "d", "-exec", "chmod", ""}; zero= 0; sprintf(sfe, "0%o", (unsigned int) dir_mode); dir_mode_args[5]= sfe; ret= Xorriso_option_find(xorriso, 6, dir_mode_args, &zero, 2); if(ret<=0) goto ex; } if(file_mode >= 0) { static char *file_mode_args[6]= {"/", "-type", "f", "-exec", "chmod", ""}; zero= 0; sprintf(sfe, "0%o", (unsigned int) file_mode); file_mode_args[5]= sfe; ret= Xorriso_option_find(xorriso, 6, file_mode_args, &zero, 2); if(ret<=0) goto ex; } if(sort_file[0]) { ret= Xorriso_apply_sort_file(xorriso, sort_file, sort_file_pattern); if(ret<=0) goto ex; } for(j= 0; j < weight_count; j++) { i= weight_list[j]; /* find argv[i+2] -exec sort_weight argv[i+1] */ zero= 0; sort_weight_args[0]= argv[i + 2]; sort_weight_args[1]= "-exec"; sort_weight_args[2]= "sort_weight"; sort_weight_args[3]= argv[i + 1]; ret= Xorriso_option_find(xorriso, 4, sort_weight_args, &zero, 2); if(ret > 0) continue; /* Problem handler */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } if(option_d) Xorriso_relax_compliance(xorriso, "deep_paths:long_paths", 0); /* After all pathspecs are added: perform delayed options, mostly boot related */ for(j= 0; j < delay_opt_count; j++) { i= delay_opt_list[j] & ~(1u << 31); if(delay_opt_list[j] & (1u << 31)) argpt= argv[i] + 1; else argpt= argv[i]; if(strcmp(argpt, "-no-emul-boot")==0) { xorriso->boot_image_emul= 0; xorriso->boot_emul_default= 0; } else if(strcmp(argpt, "-hard-disk-boot")==0) { xorriso->boot_image_emul= 1; xorriso->boot_emul_default= 0; } else if(strcmp(argpt, "-boot-info-table")==0) { xorriso->patch_isolinux_image= (xorriso->patch_isolinux_image & ~2) | 1; } else if(strcmp(argpt, "--grub2-boot-info") == 0) { xorriso->patch_isolinux_image= (xorriso->patch_isolinux_image & ~2) | 512; } else if(strcmp(argpt, "-b") == 0 || strcmp(argpt, "-eltorito-boot") == 0 || strcmp(argpt, "--efi-boot") == 0 || strcmp(argpt, "-e") == 0) { i++; if(strcmp(argpt, "--efi-boot") == 0) { if(xorriso->boot_image_bin_path[0]) { ret= Xorriso_genisofs_add_boot(xorriso, 0); if(ret <= 0) goto problem_handler_boot; } boot_path= xorriso->boot_image_bin_path; xorriso->boot_efi_default= 1; xorriso->boot_image_emul= 0; xorriso->boot_emul_default= 0; } else { boot_path= xorriso->boot_image_bin_path; if(strcmp(argpt, "-e") == 0) xorriso->boot_platform_id= 0xef; else xorriso->boot_platform_id= mkisofs_b_platform_id; xorriso->boot_efi_default= 0; if(xorriso->boot_emul_default) xorriso->boot_image_emul= 2; } boot_path[0]= 0; if(argv[i][0] != '/' && strncmp(argv[i], "--interval:", 11) != 0) strcat(boot_path, "/"); ret= Sfile_str(boot_path + strlen(boot_path), argv[i], 0); if(ret <= 0) goto ex; if(xorriso->boot_efi_default && xorriso->boot_image_bin_path[0]) { ret= Xorriso_genisofs_add_boot(xorriso, 0); if(ret <= 0) goto problem_handler_boot; } xorriso->keep_boot_image= 0; with_boot_image= 1; } else if(strcmp(argpt, "-eltorito-platform") == 0) { if(i + 1>=argc) goto not_enough_args; i++; mem= mkisofs_b_platform_id; mkisofs_b_platform_id= Xorriso_genisofs_platform(xorriso, argv[i], 0); if(mkisofs_b_platform_id < 0) { mkisofs_b_platform_id= 0; goto problem_handler_boot; } if(mkisofs_b_platform_id != mem && xorriso->boot_image_bin_path[0] != 0) { ret= Xorriso_genisofs_add_boot(xorriso, 0); if(ret <= 0) goto problem_handler_boot; } } else if(strcmp(argpt, "-c") == 0 || strcmp(argpt, "-eltorito-catalog") == 0) { if(i+1>=argc) goto not_enough_args; i++; xorriso->boot_image_cat_path[0]= 0; if(argv[i][0] != '/') strcat(xorriso->boot_image_cat_path, "/"); ret= Sfile_str(xorriso->boot_image_cat_path + strlen(xorriso->boot_image_cat_path), argv[i], 0); if(ret <= 0) goto ex; if(with_cat_path == 0) with_cat_path= 1; } else if(strcmp(argpt, "-boot-load-size") == 0) { if(i+1>=argc) goto not_enough_args; i++; if(strcmp(argv[i], "full") == 0) { xorriso->boot_img_full_size= 1; } else { sscanf(argv[i], "%d", &ret); xorriso->boot_image_load_size= ret * 512; } xorriso->boot_img_size_default= 0; } else if(strcmp(argpt, "-eltorito-id") == 0 || strcmp(argpt, "-eltorito-selcrit") == 0) { if(i+1>=argc) goto not_enough_args; i++; if(strcmp(argpt, "-eltorito-id") == 0) sprintf(sfe, "id_string=%s", argv[i]); else sprintf(sfe, "sel_crit=%s", argv[i]); ret= Xorriso_option_boot_image(xorriso, "any", sfe, 0); if(ret <= 0) goto problem_handler_boot; } else if(strncmp(argpt, "isolinux_mbr=", 13)==0) { sprintf(sfe, "isohybrid=%s", argpt + 13); ret= Xorriso_option_boot_image(xorriso, "isolinux", sfe, 0); if(ret <= 0) goto problem_handler_boot; } else if(strcmp(argpt, "-isohybrid-gpt-basdat") == 0) { xorriso->patch_isolinux_image = (xorriso->patch_isolinux_image & ~0x0fc) | (1 << 2); } else if(strcmp(argpt, "-isohybrid-gpt-hfsplus") == 0) { xorriso->patch_isolinux_image = (xorriso->patch_isolinux_image & ~0x0fc) | (2 << 2); } else if(strcmp(argpt, "-isohybrid-apm-hfsplus") == 0) { xorriso->patch_isolinux_image = xorriso->patch_isolinux_image | (1 << 8); } else if(strcmp(argpt, "-part_like_isohybrid") == 0) { xorriso->part_like_isohybrid= 1; } else if(strcmp(argpt, "-iso_mbr_part_type") == 0) { if(i + 1 >= argc) goto not_enough_args; i++; sprintf(sfe, "iso_mbr_part_type=%s", argv[i]); ret= Xorriso_option_boot_image(xorriso, "any", sfe, 0); if(ret <= 0) goto problem_handler_boot; } else if(strcmp(argpt, "--gpt_disk_guid") == 0) { if(i + 1 >= argc) goto not_enough_args; i++; ret= Xorriso_parse_gpt_guid(xorriso, argv[i], 0); if(ret <= 0) goto problem_handler_boot; } else if(strcmp(argpt, "-eltorito-alt-boot")==0) { ret= Xorriso_genisofs_add_boot(xorriso, 0); if(ret <= 0) goto problem_handler_boot; } else if(strcmp(argpt, "--embedded-boot")==0 || strcmp(argpt, "-generic-boot")==0 || strcmp(argpt, "-G") == 0 || strcmp(argpt, "-isohybrid-mbr") == 0 || strcmp(argpt, "--grub2-mbr") == 0) { if(i+1>=argc) goto not_enough_args; i++; if(strcmp(argv[i], ".") == 0) sa_path= ""; else sa_path= argv[i]; ret= Xorriso_set_system_area_path(xorriso, sa_path, 0); if(ret <= 0) goto problem_handler_boot; if(strcmp(argpt, "-isohybrid-mbr")==0) xorriso->system_area_options= (xorriso->system_area_options & ~4001) | 2; else if(strcmp(argpt, "--grub2-mbr") == 0) xorriso->system_area_options= (xorriso->system_area_options & ~2) | 0x4000; } else if(strcmp(argpt, "--protective-msdos-label")==0) { xorriso->system_area_options= (xorriso->system_area_options & ~2) | 1; } else if(strcmp(argpt, "--mbr-force-bootable") == 0) { xorriso->system_area_options= xorriso->system_area_options | (1 << 15); } else if(strcmp(argpt, "--boot-catalog-hide")==0) { xorriso->boot_image_cat_hidden|= 3; } else if(strcmp(argpt, "-partition_offset") == 0 || strcmp(argpt, "-partition_sec_hd") == 0 || strcmp(argpt, "-partition_hd_cyl") == 0 || strcmp(argpt, "-partition_cyl_align") == 0) { if(i+1>=argc) goto not_enough_args; i++; sprintf(sfe, "%s=%.16s", argpt + 1, argv[i]); ret= Xorriso_option_boot_image(xorriso, "any", sfe, 0); if(ret <= 0) goto problem_handler_boot; } else if(strcmp(argpt, "-mips-boot") == 0 || strcmp(argpt, "-mipsel-boot") == 0) { if(i + 1 >= argc) goto not_enough_args; i++; if(strcmp(argpt, "-mipsel-boot") == 0) strcpy(sfe, "mipsel_path="); else strcpy(sfe, "mips_path="); ret= Sfile_str(sfe, argv[i], 1); if(ret <= 0) goto ex; ret= Xorriso_option_boot_image(xorriso, "any", sfe, 0); if(ret <= 0) goto problem_handler_boot; } else if(strncmp(argpt, "-hppa-", 6) == 0) { if(i + 1 >= argc) goto not_enough_args; i++; sprintf(sfe, "-as mkisofs %s %s", argpt, argv[i]); palohdrversion= (xorriso->system_area_options >> 2) & 0x3f; if(palohdrversion != 4) palohdrversion= 5; ret= Xorriso_coordinate_system_area(xorriso, palohdrversion, 0, sfe, 0); if(ret <= 0) goto ex; ret= Xorriso_set_hppa_boot_parm(xorriso, argv[i], argpt + 6, 0); if(ret <= 0) goto problem_handler_boot; } else if(strcmp(argpt, "-alpha-boot") == 0) { if(i + 1 >= argc) goto not_enough_args; i++; sprintf(sfe, "-as mkisofs %s %s", argpt, argv[i]); ret= Xorriso_coordinate_system_area(xorriso, 6, 0, sfe, 0); if(ret <= 0) goto ex; ret= Xorriso_set_alpha_boot(xorriso, argv[i], 0); } else if(strcmp(argpt, "-hfs-bless") == 0) { static char *bless_arg_data[6]= { "/", "-disk_path", "", "-exec", "set_hfs_bless", "p"}; for(j= 0; j < 6; j++) bless_args[j]= bless_arg_data[j]; bless_args[2]= argv[i + 1]; zero= 0; ret= Xorriso_option_find(xorriso, 6, bless_args, &zero, 2 | 16); if(ret<=0) goto ex; if(ret < 2) { sprintf(xorriso->info_text, "-hfs-bless: Could not find a data file which stems from underneath disk directory "); Text_shellsafe(argv[i + 1], xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, "Consider to use: -hfs-bless-by p ISO_RR_PATH", 0, "HINT", 0); goto problem_handler_boot; } } else if(strcmp(argpt, "-hfs-bless-by") == 0) { ret= Xorriso_hfsplus_bless(xorriso, argv[i + 2], NULL, argv[i + 1], 0); if(ret <= 0) goto problem_handler_boot; } else if(strcmp(argpt, "-hfsplus-file-creator-type") == 0) { ret= Xorriso_hfsplus_file_creator_type(xorriso, argv[i + 3], NULL, argv[i + 1], argv[i + 2], 0); if(ret <= 0) goto problem_handler_boot; } continue; /* regular bottom of loop */ problem_handler_boot:; /* Problem handler */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } if(with_boot_image && with_cat_path == 0) strcpy(xorriso->boot_image_cat_path, "/boot.catalog"); /* The boot catalog has to be hidden separately */ if(xorriso->boot_image_cat_path[0]) { ret= Xorriso_path_is_hidden(xorriso, xorriso->boot_image_cat_path, 0); if(ret > 0) xorriso->boot_image_cat_hidden|= ret; else if(ret < 0) was_failure= 1; } /* Enforce the -boot-load-size default of mkisofs */ if(with_boot_image && xorriso->boot_img_size_default && xorriso->boot_image_emul == 0) xorriso->boot_img_full_size= 1; if(xorriso->no_emul_toc & 1) xorriso->do_padding_by_libisofs= 1; if(do_print_size) { ret= Xorriso_option_print_size(xorriso, 1); goto ex; } ret= !was_failure; ex:; if(was_path && (!do_print_size) && !old_root[0]) Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 1); if(do_print_size && Xorriso_change_is_pending(xorriso, 1)) xorriso->volset_change_pending= 2; if(weight_list != NULL) free(weight_list); if(delay_opt_list != NULL) free(delay_opt_list); Xorriso_free_meM(sort_file); Xorriso_free_meM(sfe); Xorriso_free_meM(adr); Xorriso_free_meM(pathspec); Xorriso_free_meM(eff_path); Xorriso_free_meM(indev); Xorriso_free_meM(old_root); return(ret); } int Xorriso_as_genisofs(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int end_idx, ret, old_idx; old_idx= *idx; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); (*idx)= end_idx; if(end_idx<=0 || old_idx>=argc) return(1); ret= Xorriso_genisofs(xorriso, "genisofs", end_idx-old_idx, argv+old_idx, 0); return(ret); } int Xorriso_as_cdrskin(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int end_idx, ret, old_idx; old_idx= *idx; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); (*idx)= end_idx; if(end_idx<=0 || old_idx>=argc) return(1); ret= Xorriso_cdrskin(xorriso, "cdrskin", end_idx-old_idx, argv+old_idx, 0); return(ret); } libisoburn-1.5.4/xorriso/README_gnu_xorriso0000644000175700017510000005625114005265510015654 00000000000000------------------------------------------------------------------------------ Contribution of libburnia-project.org to the GNU Operating System ------------------------------------------------------------------------------ GNU xorriso. By Thomas Schmitt Derived from and supported by libburnia-project.org, published via: http://www.gnu.org/software/xorriso/xorriso_eng.html http://www.gnu.org/software/xorriso/xorriso-1.5.4.tar.gz Provided under GPL version 3 or later. No warranty. ------------------------------------------------------------------------------ xorriso is a program which copies file objects from POSIX compliant filesystems into Rock Ridge enhanced ISO 9660 filesystems and allows session-wise manipulation of such filesystems. It can load the management information of existing ISO images and it writes the session results to optical media or to filesystem objects. Vice versa xorriso is able to restore file objects from ISO 9660 filesystems. A special property of xorriso is that it needs neither an external ISO 9660 formatter program nor an external burn program for CD or DVD but rather incorporates the libraries of libburnia-project.org . Currently it is fully supported on GNU/Linux with kernels >= 2.4, on FreeBSD with ATAPI/CAM support enabled in the kernel, see atapicam(4), on OpenSolaris (tested with kernel 5.11), on NetBSD (tested with 6.1.2 and 6.1.3). On other X/Open compliant systems there will only be POSIX i/o with disk file objects, but no direct MMC operation on CD/DVD/BD drives. By using this software you agree to the disclaimer at the end of this text: "... without even the implied warranty ..." Compilation, First Glimpse, Installation The most simple way to get xorriso from source code is the GNU xorriso tarball. Prerequisites: The tarball contains everything that is needed except the following system components: libc, libpthread plus on Solaris: libvolmgt plus on FreeBSD: libiconv, libcam, IDE and SATA drives need atapicam Optional at compile time are: libreadline and the readline-dev headers, or libedit and its header, make dialog mode more convenient. zlib and zlib-devel allow zisofs compression. on GNU/Linux: libacl and libacl-devel allow getting and setting ACLs. If they were present at compile time, then the optional libraries have to be present at runtime, too. Obtain xorriso-1.5.4.tar.gz, take it to a directory of your choice and do: tar xzf xorriso-1.5.4.tar.gz cd xorriso-1.5.4 Within that directory execute: ./configure --prefix=/usr make This will produce a binary named ./xorriso/xorriso If you want xorriso to report a "Build timestamp" with its option -version : make buildstamped You may strip the binary to reduce it in size strip ./xorriso/xorriso You may copy or move it to a directory where it can be found by the shell, or you may execute xorriso at the place where it was built, or you may execute as superuser: make install For general concepts, options and usage examples see info xorriso info xorrisofs info xorrecord or man 1 xorriso man 1 xorrisofs man 1 xorrecord You may get a first glimpse by e.g. info ./xorriso/xorriso.info man ./xorriso/xorriso.1 The installation creates several alias links pointing 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 xorriso will depend on libreadline if the library and its development header files are present at compile time. If not, then it will try to depend on libedit and its header file. Both conditional dependencies can be avoided by running ./configure --prefix=/usr --disable-libreadline make clean ; make Never omit the "make clean" command after switching enabling of libreadline. If you want to explicitly allow only the use of libedit, then do ./configure --prefix=/usr --disable-libreadline --enable-libedit Other deliberate dependency reduction options of ./configure are: --disable-libacl avoid use of ACL functions like acl_to_text() --disable-xattr avoid use of xattr functions like listxattr() on Linux or extattr_list_file() on FreeBSD --disable-zlib avoid use of zlib functions like compress2() this also avoids the use of libjte and option -jigdo. xorriso brings own system adapters which allow burning optical media on GNU/Linux, FreeBSD, Solaris, NetBSD. Alternatively it can use libcdio-0.83 or later for sending commands to optical drives: --enable-libcdio xorriso allows to use external processes as file content filters. This is a potential security risk which may be avoided by ./configure option --disable-external-filters By default the filter feature is disabled if effective user id and real user id differ. This ban can be lifted by --enable-external-filters-setuid Sometimes xorriso will yield better write performance on GNU/Linux if 64 KB are transmitted in each write operation rather than 32 KB. See option -dvd_obs . 64k can be made default at configure time by: --enable-dvd-obs-64k For xorriso -as cdrecord emulation only: In some situations GNU/Linux may deliver a better write performance to drives if the track input is read with O_DIRECT (see man 2 open). The included libburn and the cdrecord emulation of xorriso can be told to use this peculiar read mode by: --enable-track-src-odirect Linux only: libburn tries to avoid a collision with udev's drive examination by waiting 0.1 seconds before opening the device file for a longer time, after udev might have been alarmed by drive scanning activities. The waiting time can be set at ./configure time with microsecond granularity. E.g. 2 seconds: CFLAGS="$CFLAGS -DLibburn_udev_wait_useC=2000000" ./configure ...options... Waiting can be disabled by zero waiting time: CFLAGS="$CFLAGS -DLibburn_udev_wait_useC=0" Alternatively, libburn can try to be nice by opening the device file, closing it immediately, waiting, and only then opening it for real: CFLAGS="$CFLAGS -DLibburn_udev_extra_open_cyclE -DLibburn_udev_wait_useC=500000" 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 the same 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 rw-permission for the CD/DVD/BD drives which shall be used, even if only reading is intended. A list of rw-accessible drives can be obtained by xorriso -devices CD devices which offer not enough permission are invisible to normal users. The superuser should be able to see any usable drive and then set the permissions as needed. On Linux, FreeBSD, and NetBSD, rw-permissions are needed. On Solaris, the privilege "sys_devices" and r-permission are needed. The output of xorriso -devices might look like 0 -dev '/dev/sr0' rwrw-- : 'TSSTcorp' 'CDDVDW SH-S203B' 1 -dev '/dev/hda' rwrw-- : 'HL-DT-ST' 'DVD-ROM GDR8162B' On Linux, full and insecure enabling of both for everybody would look like chmod a+rw /dev/sr0 /dev/hda This is equivalent to the traditional setup chmod a+x,u+s cdrecord. On FreeBSD, device permissions are to be set in /etc/devfs.rules. On Solaris, pfexec privileges may be restricted to "basic,sys_devices". On NetBSD, rw-permission may be granted by chmod a+rw /dev/rcd?d. See below "System Dependent Drive Permission Examples". I strongly discourage to run xorriso with setuid root or via sudo ! It is not checked for the necessary degree of hacker safety. Better consider to grant the necessary permissions to group "floppy" and to add users to it. 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: SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:11.0-scsi-2:0:0:0", ENV{UDISKS_PRESENTATION_NOPOLICY}:="1" If you cannot get rid of the automounter, try whether it helps to always load the drive tray manually before starting a write run of xorriso. Wait until the drive light is off and the mounted media appears. Then try to unmount the mounted media before a write run. Besides true optical drives, xorriso can also address disk files as input or output drives. By default paths to files under /dev are accepted only if the device represents a real optical drive. Other device files may be addressed by prepending "stdio:" to the path. Like: xorriso -dev stdio:/dev/sdb ...more arguments... This rule may be changed by xorriso option -drive_class. Prefix "mmc:" causes a path to be accepted only if it is a real optical drive which is accessible by generic SCSI/MMC commands. xorriso-dd-target GNU xorriso 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 on disk. It uses the normal POSIX filesystem calls, i.e. no libburnia stuff. This program is not installed systemwide but stays in the installation directory of the xorriso tarball as test/compare_file . Usually it is run as -exec payload of a find command. It demands at least three arguments: The path of the first file to compare, the prefix1 to be cut off from path and the prefix2 which gets prepended afterwards to obtain the path of the second file to compare. As further argument there can be -no_ctime which suppresses the comparison of ctime date stamps. The exit value is 0 if no difference was detected, non-0 else. Example: After xorriso ... -pathspecs on -add /=/original/dir -- -commit_eject all mount /media/dvd cd test compare tree /media/dvd with tree /original/dir : find /original/dir -exec ./compare_file '{}' /original/dir /media/dvd ';' \ | less and vice versa: find /media/dvd -exec ./compare_file '{}' /media/dvd /original/dir ';' \ | less File Formats Sector Maps Sector maps describe the valid and invalid blocks on a media or a disk copy of a media. xorriso creates and reads these file with its option -check_media. The file begins with 32 bytes of cleartext of which the last one is a newline character. The first 25 say "xorriso sector bitmap v2 ", the remaining six characters give the size of the info text as decimal number. This number of bytes follows the first 32 and will not be interpreted by xorriso. They are rather to inform a human reader about the media type and its track layout. After the info text there are two 4 byte signed integers, most significant byte first. The first one, N, gives the number of bits in the following bitmap and the second number S gives the number of 2 KiB blocks governed by a single bit in the map. Then come the bits in form of 8-bit bytes. Data block M is covered by bit B=M/S in the map, bit number B is stored in byte B/8 as bit B%8. A valid readable data block has its bit set to 1. Checksum Tags Checksum tags are data blocks inside an ISO 9660 image which do not belong to any file but rather tell the MD5 of a certain range of data blocks. The superblock checksum tag is written after the ECMA-119 volume descriptors. The tree checksum tag is written after the ECMA-119 directory entries. The session checksum tag is written after all payload including the checksum array. (Then follows padding.) The tags are single lines of printable text, padded by 0 bytes. They have the following format: Tag_id pos=# range_start=# range_size=# [session_start|next=#] md5=# self=#\n Parameters md5= and self= are 32 digit hex, the others are decimal numbers. Tag_id distinguishes the following tag types "libisofs_rlsb32_checksum_tag_v1" Relocated 64 kB superblock tag "libisofs_sb_checksum_tag_v1" Superblock tag "libisofs_tree_checksum_tag_v1" Directory tree tag "libisofs_checksum_tag_v1" Session end tag A relocated superblock may appear at LBA 0 of an image which was produced for being stored in a disk file or on overwritable media (e.g. DVD+RW, BD-RE). xorriso records the first session at LBA 32. A follow-up session begins at the next block address which is divisible by 32 and higher than the address of the previous session's end tag. Normally no session starts after the address given by relocated superblock parameter session_start=. Session oriented media like CD-R[W], DVD-R, DVD+R, BD-R will have no relocated superblock but rather bear a table-of-content on media level. A tag is valid if pos= tells its own block address and self= tells its own MD5 up to the last hex digit of md5=. range_start= tells the first block that is covered by md5=, range_size= tells the number of blocks covered by md5=. Relocated superblocks tell the block address of their session by session_start=. Superblock and tree tag tell the block address of the next tag by next=. The newline character at the end is mandatory. libisoburn xorriso is based on libisofs which does ISO 9660 filesystem aspects and on libburn which does the input and output aspects. Parts of this foundation are accessed via libisoburn, which is closely related to xorriso. libisoburn provides several services: - Encapsulation of coordination between libisofs and libburn. - Emulation of ISO 9660 multi-session on overwritable media or random access files. - Implementation of the xorriso API. The sourcecode of all three libraries is included in the GNU xorriso tarball. It is compiled with xorriso and linked statically. But you may as well get and install releases of libburn and libisofs, in order to be able to install a release of libisoburn which produces libisoburn.so.1 and a matching dynamically linked xorriso binary. This binary is very lean but depends on properly installed libraries of suitable revision. Dynamic library and compile time header requirements for libisoburn-1.5.4 : - libburn.so.4 , version libburn-1.5.4 or higher - libisofs.so.6 , version libisofs-1.5.4 or higher libisoburn and xorriso will not start with libraries which are older than their headers seen at compile time. So compile in the oldest possible installation setup unless you have reason to enforce a newer bug fix level. GNU xorriso has less runtime dependencies and can be moved more freely. System Dependent Drive Permission Examples Accessing the optical drives requires privileges which usually are granted only to the superuser. GNU/Linux, FreeBSD, Solaris, and NetBSD offer quite different approaches for avoiding the need for unrestricted privileges. First check whether some friendly system setting already allows you to access the drives as normal user: xorriso -devices Those drives of which you see address and type strings are already usable. If there remain drives invisible which the superuser can see by the same command, then the following examples might help: --------------- On all systems: --------------- Add the authorized users of CD drives to group "floppy" in /etc/group. If missing: create this group. Changes to /etc/group often only affect new login sessions. So log out and in before making the first tests. ------------- On GNU/Linux: ------------- Allow rw-access to the drives chgrp floppy /dev/sr0 /dev/sr1 chmod g+rw /dev/sr0 /dev/sr1 It might be necessary to perform chgrp and chmod after each reboot or to edit distro dependent device configuration files for permanent settings. ----------- On FreeBSD: ----------- Edit /etc/devfs.rules and make sure to have these lines [localrules=10] add path 'acd*' mode 0664 group floppy add path 'cd*' mode 0664 group floppy add path 'pass*' mode 0664 group floppy add path 'xpt*' mode 0664 group floppy [localrules=5] add path 'pass*' mode 0664 group floppy add path 'cd*' mode 0664 group floppy add path 'xpt*' mode 0664 group floppy add path 'acd*' mode 0664 group floppy Edit /etc/rc.conf and add the following line if missing devfs_system_ruleset="localrules" This gets into effect by reboot or by command /etc/rc.d/devfs start ----------- On Solaris: ----------- Run xorriso by pfexec xorriso ...arguments... The following settings will make pfexec keep original UID and EUID and prevent most superuser powers. Be aware that you still can manipulate all device files if you have the file permissions for that. Full root privileges for xorriso can then be acquired only by command su. Edit /etc/security/exec_attr and add this line to the other "Media Backup" lines: Media Backup:solaris:cmd:::/usr/local/bin/xorriso:privs=basic,sys_devices Edit /etc/user_attr and add profile "Media Backup" to the user's line: thomas::::profiles=Media Backup,Primary Administrator;roles=root See also man privileges, man exec_attr, man user_attr. Then allow the group r-access to the drives pfexec chgrp floppy /dev/rdsk/c3t0d0s2 /dev/rdsk/c4t0d0s2 pfexec chmod g+r /dev/rdsk/c3t0d0s2 /dev/rdsk/c4t0d0s2 The last two commands have to be executed after each boot. I do not know the relevant device configuration files yet. ---------- On NetBSD: ---------- Allow rw-access to the drives chgrp floppy /dev/rcd[01]d chmod g+rw /dev/rcd[01]d ------------------------------------------------------------------------------ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 or later as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------------------------ GNU xorriso is feature-wise equivalent to the dynamic compilation of libburnia libraries and libburnia program xorriso. It restricts itself to a technical form where the legal commitments of the libburnia project and the legal intentions of FSF match completely. Libburnia project is committed to provide support for this copy in the same way as for its own software releases. It is further committed to keep its own licenses open for obtaining future copies under GPLv2+. ------------------------------------------------------------------------------ libburnia program xorriso is based on and sub project of: libburnia-project.org By Mario Danic , libburn, libisofs Vreixo Formoso , libisofs, libisoburn Thomas Schmitt , libburn, libisofs, libisoburn, xorriso Copyright (C) 2006-2021 Mario Danic, Vreixo Formoso, Thomas Schmitt. libburnia-project.org is inspired by and in libburn still containing parts of old Libburn. By Derek Foreman and Ben Jansens Copyright (C) 2002-2006 Derek Foreman and Ben Jansens GNU xorriso contains libjte out of source package jigit >= 1.17 Copyright (C) 2000-2007 Free Software Foundation, Inc. 2004-2011 Steve McIntyre 2010-2011 George Danchev, Thomas Schmitt GNU xorriso contains xorriso-dd-target Copyright (C) 2019-2021 Nio Wiklund alias sudodus, Thomas Schmitt ------------------------------------------------------------------------------ This text itself is Copyright (c) 2007 - 2021 Thomas Schmitt and is freely distributable. It shall only be modified in sync with the technical properties of xorriso. If you make use of the license to derive modified versions of xorriso then you are entitled to modify this text under that same license. libisoburn-1.5.4/xorriso/emulators.h0000644000175700017510000000217413701321754014522 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2010 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of emulators for mkisofs and cdrecord. */ #ifndef Xorriso_pvt_emul_includeD #define Xorriso_pvt_emul_includeD yes /* micro version of cdrskin */ int Xorriso_cdrskin(struct XorrisO *xorriso, char *whom, int argc, char **argv, int flag); int Xorriso_cdrskin_help(struct XorrisO *xorriso, int flag); int Xorriso_cdrskin_uses_stdout(struct XorrisO *xorriso, int argc, char **argv, int flag); int Xorriso_as_cdrskin(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* micro emulation of mkisofs */ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom, int argc, char **argv, int flag); int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag); int Xorriso_as_genisofs(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); #endif /* ! Xorriso_pvt_emul_includeD */ libisoburn-1.5.4/xorriso/disk_ops.h0000644000175700017510000001233513701321754014322 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2019 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of class DirseQ which crawls along a directory's content list. */ #ifndef Xorriso_pvt_diskop_includeD #define Xorriso_pvt_diskop_includeD yes /* @param flag bit0= simple readlink(): no normalization, no multi-hop */ int Xorriso_resolve_link(struct XorrisO *xorriso, char *link_path, char result_path[SfileadrL], int flag); int Xorriso_convert_gidstring(struct XorrisO *xorriso, char *gid_string, gid_t *gid, int flag); int Xorriso_convert_modstring(struct XorrisO *xorriso, char *cmd, char *mode, mode_t *mode_and, mode_t *mode_or, int flag); int Xorriso_convert_uidstring(struct XorrisO *xorriso, char *uid_string, uid_t *uid, int flag); /* @param flag bit0= for Xorriso_msgs_submit: use pager */ int Xorriso_hop_link(struct XorrisO *xorriso, char *link_path, struct LinkiteM **link_stack, struct stat *stbuf, int flag); int Xorriso__mode_to_perms(mode_t st_mode, char perms[11], int flag); int Xorriso_format_ls_l(struct XorrisO *xorriso, struct stat *stbuf, int flag); /* @param flag bit0= long format bit1= do not print count of nodes bit2= du format bit3= print directories as themselves (ls -d) */ int Xorriso_lsx_filev(struct XorrisO *xorriso, char *wd, int filec, char **filev, off_t boss_mem, int flag); /* @param flag bit0= do not only sum up sizes but also print subdirs bit1= this is a recursion bit2= do not report result by Xorriso_result() @return <=0 error , 1 ok , 2 could not open directory */ int Xorriso_show_dux_subs(struct XorrisO *xorriso, char *abs_path, char *rel_path, off_t *size, off_t boss_mem, struct LinkiteM *link_stack, int flag); /* @param flag >>> bit0= remove whole sub tree: rm -r bit1= remove empty directory: rmdir bit2= recursion: do not reassure in mode 2 "tree" bit3= this is for overwriting and not for plain removal bit4= count deleted files in xorriso->pacifier_count bit5= with bit0 only remove directory content, not the directory @return <=0 = error 1 = removed leaf file object 2 = removed directory or tree 3 = did not remove on user revocation */ int Xorriso_rmx(struct XorrisO *xorriso, off_t boss_mem, char *path, int flag); int Xorriso_findx(struct XorrisO *xorriso, struct FindjoB *job, char *abs_dir_parm, char *dir_path, struct stat *dir_stbuf, int depth, struct LinkiteM *link_stack, int flag); /* @param flag bit0= no hardlink reconstruction bit1= do not set xorriso->node_*_prefixes bit5= -extract_single: eventually do not insert directory tree */ int Xorriso_restore_sorted(struct XorrisO *xorriso, int count, char **src_array, char **tgt_array, int *problem_count, int flag); /* @param flag bit0= path is a directory bit2= recursion: do not reassure in mode 2 "tree" bit3= this is for overwriting and not for plain removal */ int Xorriso_reassure_restore(struct XorrisO *xorriso, char *path, int flag); /* @param flag bit7= return 4 if restore fails from denied permission do not issue error message @return <=0 failure , 1 success , 4 with bit7: permission to create file was denied */ int Xorriso_make_tmp_path(struct XorrisO *xorriso, char *orig_path, char *tmp_path, int *fd, int flag); /* @param flag bit0= change regardless of xorriso->do_auto_chmod bit1= desired is only rx */ int Xorriso_auto_chmod(struct XorrisO *xorriso, char *disk_path, int flag); int Xorriso_make_accessible(struct XorrisO *xorriso, char *disk_path,int flag); /* @param flag bit0= prefer to find a match after *img_prefixes (but deliver img_prefixes if no other can be found) */ int Xorriso_make_restore_path(struct XorrisO *xorriso, struct Xorriso_lsT **img_prefixes, struct Xorriso_lsT **disk_prefixes, char img_path[SfileadrL], char disk_path[SfileadrL], int flag); int Xorriso_restore_make_hl(struct XorrisO *xorriso, char *old_path, char *new_path, int flag); int Xorriso_afile_fopen(struct XorrisO *xorriso, char *filename, char *mode, FILE **ret_fp, int flag); int Xorriso_make_mount_cmd(struct XorrisO *xorriso, char *cmd, int lba, int track, int session, char *volid, char *devadr, char result[SfileadrL], int flag); int Xorriso_append_scdbackup_record(struct XorrisO *xorriso, int flag); int Xorriso_concat(struct XorrisO *xorriso, char *mode, char *target, int progc, char **progv, int filec, char **filev, int flag); #endif /* ! Xorriso_pvt_diskop_includeD */ libisoburn-1.5.4/xorriso/filters.c0000644000175700017510000006076513746476223014177 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains functions which operate on data filter objects. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "lib_mgt.h" #include "iso_tree.h" #include "iso_img.h" /* #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" #include "iso_manip.h" #include "sort_cmp.h" */ struct Xorriso_extF { int flag; /* unused yet */ IsoExternalFilterCommand *cmd; }; int Xorriso_extf_destroy(struct XorrisO *xorriso, struct Xorriso_extF **filter, int flag); /* @param flag see struct Xorriso_extF.flag */ int Xorriso_extf_new(struct XorrisO *xorriso, struct Xorriso_extF **filter, char *path, int argc, char **argv, int behavior, char *suffix, char *name, int flag) { int i; struct Xorriso_extF *o= NULL; IsoExternalFilterCommand *cmd; *filter= o= calloc(sizeof(struct Xorriso_extF), 1); if(o == NULL) goto failure; o->flag= flag; o->cmd= NULL; o->cmd= cmd= calloc(sizeof(IsoExternalFilterCommand), 1); if(cmd == NULL) goto failure; cmd->version= 0; cmd->refcount= 0; cmd->name= NULL; cmd->path= NULL; cmd->argv= NULL; cmd->argc= argc + 1; cmd->behavior= behavior; cmd->suffix= NULL; cmd->suffix= strdup(suffix); if(cmd->suffix == NULL) goto failure; cmd->path= strdup(path); if(cmd->path == NULL) goto failure; cmd->argv= calloc(sizeof(char *), argc + 2); if(cmd->argv == NULL) goto failure; for(i= 0; i < argc + 2; i++) cmd->argv[i]= NULL; cmd->argv[0]= strdup(path); if(cmd->argv[0] == NULL) goto failure; for(i= 0; i < argc; i++) { cmd->argv[i + 1]= strdup(argv[i]); if(cmd->argv[i] == NULL) goto failure; } cmd->name= strdup(name); if(cmd->name == NULL) goto failure; return(1); failure:; Xorriso_extf_destroy(xorriso, filter, 0); return(-1); } int Xorriso_extf_destroy(struct XorrisO *xorriso, struct Xorriso_extF **filter, int flag) { int i; IsoExternalFilterCommand *cmd; if(*filter == NULL) return(0); cmd= (*filter)->cmd; if(cmd != NULL) { if(cmd->refcount > 0) return(0); if(cmd->path != NULL) free(cmd->path); if(cmd->suffix != NULL) free(cmd->suffix); if(cmd->argv != NULL) { for(i= 0; i < cmd->argc; i++) if(cmd->argv[i] != NULL) free(cmd->argv[i]); free((char *) cmd->argv); } if(cmd->name != NULL) free(cmd->name); free((char *) cmd); } free((char *) *filter); *filter= NULL; return(1); } int Xorriso_lookup_extf(struct XorrisO *xorriso, char *name, struct Xorriso_lsT **found_lst, int flag) { struct Xorriso_extF *filter; struct Xorriso_lsT *lst; for(lst= xorriso->filters; lst != NULL; lst= Xorriso_lst_get_next(lst, 0)) { filter= (struct Xorriso_extF *) Xorriso_lst_get_text(lst, 0); if(strcmp(filter->cmd->name, name) == 0) { *found_lst= lst; return(1); } } return(0); } int Xorriso_destroy_all_extf(struct XorrisO *xorriso, int flag) { struct Xorriso_extF *filter; struct Xorriso_lsT *lst, *next_lst; for(lst= xorriso->filters; lst != NULL; lst= next_lst) { filter= (struct Xorriso_extF *) Xorriso_lst_get_text(lst, 0); Xorriso_lst_detach_text(lst, 0); next_lst= Xorriso_lst_get_next(lst, 0); Xorriso_lst_destroy(&lst, 0); Xorriso_extf_destroy(xorriso, &filter, 0); } xorriso->filters= NULL; return(1); } /* @param flag bit0= return 2 if renaming is not possible by libisofs (always: if demanded strip suffix is missing or if suffix makes name length > 255) bit1= strip suffix rather than appending it */ int Xorriso_rename_suffix(struct XorrisO *xorriso, IsoNode *node, char *suffix, char *show_path, char new_name[], int flag) { int ret, lo= 0, ls= 0, strip_suffix; char *old_name= NULL, *show_name; IsoImage *volume; strip_suffix= !!(flag & 2); ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret <= 0) goto ex; old_name= strdup((char *) iso_node_get_name(node)); show_name= old_name; if(show_path != NULL) if(show_path[0] != 0) show_name= show_path; lo= strlen(old_name); ls= strlen(suffix); if(strip_suffix) { if(lo <= ls) { /* refuse gracefully */ ret= 2; goto ex; } if(strcmp(old_name + lo - ls, suffix) != 0) { ret= 2; goto ex; } if(lo >= SfileadrL) goto cannot_remove_suffix; strcpy(new_name, old_name); new_name[lo - ls]= 0; ret = iso_image_set_node_name(volume, node, new_name, 1); if (ret < 0) { Xorriso_process_msg_queues(xorriso,0); if (!(flag & 1)) Xorriso_report_iso_error(xorriso, "", ret, "Error when renaming ISO node", 0, "FAILURE", 1); cannot_remove_suffix:; strcpy(xorriso->info_text, "-set_filter: Cannot remove suffix from "); Text_shellsafe(show_name, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, (flag & 1) ? "WARNING" : "FAILURE", 0); ret= 2 * (flag & 1); goto ex; } } else { /* check whether suffix already present */ if(lo >= ls) if(strcmp(old_name + lo - ls, suffix) == 0) { /* refuse gracefully */ ret= 2; goto ex; } if(lo + ls > 255) { cannot_append_suffix:; strcpy(xorriso->info_text, "-set_filter: Cannot append suffix to "); Text_shellsafe(show_name, xorriso->info_text, 1); strcat(xorriso->info_text, ". Left unfiltered."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, (flag & 1) ? "WARNING" : "FAILURE", 0); ret= 2 * (flag & 1); goto ex; } sprintf(new_name, "%s%s", old_name, suffix); ret = iso_image_set_node_name(volume, node, new_name, 1); if (ret < 0) { Xorriso_process_msg_queues(xorriso,0); if (!(flag & 1)) Xorriso_report_iso_error(xorriso, "", ret, "Error when renaming ISO node", 0, "FAILURE", 1); goto cannot_append_suffix; } } ret= 1; ex:; if(old_name != NULL) free(old_name); Xorriso_process_msg_queues(xorriso,0); return(ret); } /* @param flag bit0= return 2 if renaming is not possible bit1= print pacifier messages */ int Xorriso_set_filter(struct XorrisO *xorriso, void *in_node, char *path, char *filter_name, int flag) { int ret, strip_suffix= 0, strip_filter= 0, filter_ret= 0; int explicit_suffix= 0, internal_filter= 0; IsoNode *node; IsoFile *file; struct Xorriso_lsT *found_lst; struct Xorriso_extF *found_filter; IsoExternalFilterCommand *cmd = NULL; char *old_name= NULL, *new_name= NULL, *suffix= ""; IsoStream *stream; IsoImage *volume; Xorriso_alloc_meM(new_name, char, SfileadrL); new_name[0]= 0; node= (IsoNode *) in_node; if(node == NULL) { ret= Xorriso_get_node_by_path(xorriso, path, NULL, &node, 0); if(ret <= 0) goto ex; } if(!LIBISO_ISREG(node)) { strcpy(xorriso->info_text, "-set_filter: Not a regular data file node "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 0; goto ex; } file= (IsoFile *) node; if(strncmp(filter_name, "--remove-all-filters", 20) == 0) { strip_filter= 1; strip_suffix= 1; if(strlen(filter_name) > 21) { strip_suffix= (filter_name[20] != '+'); suffix= filter_name + 21; explicit_suffix= 1; } } else if(strcmp(filter_name, "--zisofs") == 0) { internal_filter= 1; } else if(strcmp(filter_name, "--zisofs-decode") == 0) { internal_filter= 2; } else if(strcmp(filter_name, "--gzip") == 0) { internal_filter= 3; suffix= ".gz"; strip_suffix= 0; explicit_suffix= 1; } else if(strcmp(filter_name, "--gunzip") == 0 || strcmp(filter_name, "--gzip-decode") == 0) { internal_filter= 4; suffix= ".gz"; strip_suffix= 1; explicit_suffix= 1; } else { ret= Xorriso_lookup_extf(xorriso, filter_name, &found_lst, 0); if(ret < 0) goto ex; if(ret == 0) { strcpy(xorriso->info_text, "-set_filter: Not a registered filter name "); Text_shellsafe(filter_name, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } found_filter= (struct Xorriso_extF *) Xorriso_lst_get_text(found_lst, 0); cmd= found_filter->cmd; suffix= cmd->suffix; strip_suffix= cmd->behavior & 8; } if(suffix[0]) { /* >>> would need full iso_rr_path of node for showing */; old_name= strdup((char *) iso_node_get_name(node)); ret= Xorriso_rename_suffix(xorriso, node, suffix, path, new_name, (flag & 1) | (strip_suffix ? 2 : 0)); if(ret <= 0 || ret == 2) goto ex; } if(strip_filter) { while(1) { if(!explicit_suffix) { stream= iso_file_get_stream(file); if(strncmp(stream->class->type, "gzip", 4) == 0) { suffix= ".gz"; strip_suffix= 1; } else if(strncmp(stream->class->type, "pizg", 4) == 0) { suffix= ".gz"; strip_suffix= 0; } else { ret= iso_stream_get_external_filter(stream, &cmd, 0); if(ret > 0) { suffix= cmd->suffix; strip_suffix= !(cmd->behavior & 8); } } if(suffix[0]) { /* >>> would need the current renaming state of path */; ret= Xorriso_rename_suffix(xorriso, node, suffix, NULL, new_name, (flag & 1) | (strip_suffix << 1)); if(ret <= 0 || ret == 2) goto ex; } } ret= iso_file_remove_filter(file, 0); if(ret != 1) break; } filter_ret= 1; } else if (internal_filter == 1 || internal_filter == 2) { filter_ret = iso_file_add_zisofs_filter(file, 1 | (internal_filter & 2)); if(filter_ret == (int) ISO_ZISOFS_TOO_MANY_PTR) { /* Remove all buffered currently unused block pointers and try again */ ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret < 0) goto ex; if(ret > 0) { Xorriso_msgs_submit(xorriso, 0, "Overflow of zisofs block pointers happened.", 0, "WARNING", 0); Xorriso_msgs_submit(xorriso, 0, "zisofs falling back to mode which needs 3 input read runs.", 0, "WARNING", 0); ret = iso_image_zisofs_discard_bpt(volume, 0); if(ret <= 0) goto ex; filter_ret = iso_file_add_zisofs_filter(file, 1 | (internal_filter & 2)); } } if(filter_ret < 0) { Xorriso_process_msg_queues(xorriso,0); if(!(internal_filter == 2 && filter_ret == (int) ISO_ZISOFS_WRONG_INPUT)) Xorriso_report_iso_error(xorriso, "", filter_ret, "Error when setting filter to ISO node", 0, "FAILURE", 1); } } else if (internal_filter == 3 || internal_filter == 4) { filter_ret = iso_file_add_gzip_filter(file, 1 | ((internal_filter == 4) << 1)); if(filter_ret < 0) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, "", filter_ret, "Error when setting filter to ISO node", 0, "FAILURE", 1); } } else { #ifndef Xorriso_allow_extf_suiD /* This is a final safety precaution before iso_file_add_external_filter() performs fork() and executes the alleged filter program. */ if(getuid() != geteuid()) { sprintf(xorriso->info_text, "-set_filter: UID and EUID differ. Will not run external programs."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); ret= 0; goto ex; } #endif /* ! Xorriso_allow_extf_suiD */ filter_ret = iso_file_add_external_filter(file, cmd, 0); if(filter_ret < 0) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, "", filter_ret, "Error when setting filter to ISO node", 0, "FAILURE", 1); } } if(filter_ret != 1 && new_name[0] && old_name != NULL) { ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) goto ex; ret = iso_image_set_node_name(volume, node, old_name, 1); if (ret < 0) { Xorriso_process_msg_queues(xorriso,0); if (!(flag & 1)) Xorriso_report_iso_error(xorriso, "", ret, "Error when renaming ISO node", 0, "FAILURE", 1); } } if(flag & 2) { xorriso->pacifier_count++; Xorriso_pacifier_callback(xorriso, "file filters processed", xorriso->pacifier_count, xorriso->pacifier_total, "", 0); } if(filter_ret < 0) { ret= 0; goto ex; } ret= filter_ret; ex:; if(old_name != NULL) free(old_name); Xorriso_free_meM(new_name); Xorriso_process_msg_queues(xorriso,0); return(ret); } int Xorriso_external_filter_banned(struct XorrisO *xorriso, char *purpose, int flag) { int is_banned= 0; #ifndef Xorriso_allow_external_filterS /* To be controlled by: configure --enable-external-filters */ sprintf(xorriso->info_text, "%s : Banned at compile time.", purpose); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); sprintf(xorriso->info_text, "This may be changed at compile time by ./configure option --enable-external-filters"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); is_banned= 1; #endif /* ! Xorriso_allow_external_filterS */ #ifndef Xorriso_allow_extf_suiD /* To be controlled by: configure --enable-external-filters-setuid */ if(getuid() != geteuid()) { sprintf(xorriso->info_text, "-set_filter: UID and EUID differ. Will not run external programs."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); sprintf(xorriso->info_text, "This may be changed at compile time by ./configure option --enable-external-filters-setuid"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); is_banned= 1; } #endif /* ! Xorriso_allow_extf_suiD */ if(xorriso->filter_list_closed) { sprintf(xorriso->info_text, "%s : Banned by previous command -close_filter_list", purpose); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); is_banned= 1; } return(is_banned); } /* @param flag bit0= delete filter with the given name */ int Xorriso_external_filter(struct XorrisO *xorriso, char *name, char *options, char *path, int argc, char **argv, int flag) { int ret, delete= 0, behavior= 0, extf_flag= 0, is_banned= 0; char *what, *what_next, *suffix= ""; struct Xorriso_lsT *lst; struct Xorriso_extF *found_filter, *new_filter= NULL; is_banned= Xorriso_external_filter_banned( xorriso, flag & 1 ? "-unregister_filter" : "-external_filter", 0); if(is_banned) return(0); if((!(flag & 1)) && path[0] != '/') { sprintf(xorriso->info_text, "-external_filter : Given command path does not begin by '/' : "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } delete= flag & 1; ret= Xorriso_lookup_extf(xorriso, name, &lst, 0); if(ret < 0) return(ret); if(ret > 0) { if(delete) { found_filter= (struct Xorriso_extF *) Xorriso_lst_get_text(lst, 0); if(found_filter->cmd->refcount > 0) { sprintf(xorriso->info_text, "-external_filter: Cannot remove filter because it is in use by %.f nodes : ", (double) found_filter->cmd->refcount); Text_shellsafe(name, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } Xorriso_lst_detach_text(lst, 0); if(xorriso->filters == lst) xorriso->filters= Xorriso_lst_get_next(lst, 0); Xorriso_lst_destroy(&lst, 0); Xorriso_extf_destroy(xorriso, &found_filter, 0); ret= 1; goto ex; } strcpy(xorriso->info_text, "-external_filter: filter with given name already existing: "); Text_shellsafe(name, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(delete) { strcpy(xorriso->info_text, "-external_filter: filter with given name does not exist: "); Text_shellsafe(name, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } for(what= options; what!=NULL; what= what_next) { what_next= strchr(what, ':'); if(what_next!=NULL) { *what_next= 0; what_next++; } if(strncmp(what, "default", 7) == 0) { suffix= ""; behavior= 0; } else if(strncmp(what, "suffix=", 7) == 0) { suffix= what + 7; } else if(strcmp(what, "remove_suffix") == 0) { behavior|= 8; } else if(strcmp(what, "if_nonempty") == 0) { behavior|= 1; } else if(strcmp(what, "if_reduction") == 0) { behavior|= 2; } else if(strcmp(what, "if_block_reduction") == 0) { behavior|= 4; } else if(strncmp(what, "used=", 5) == 0) { ; /* this is informational output from -status */ } else if(what[0]) { strcpy(xorriso->info_text, "-external_filter: unknown option "); Text_shellsafe(what, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } ret= Xorriso_extf_new(xorriso, &new_filter, path, argc, argv, behavior, suffix, name, extf_flag); if(ret <= 0) { could_not_create:; strcpy(xorriso->info_text, "-external_filter: Could not create filter object"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } ret= Xorriso_lst_append_binary(&(xorriso->filters), (char *) new_filter,0, 4); if(ret <= 0) goto could_not_create; ret= 1; ex:; if(ret <= 0) { if(new_filter != NULL) Xorriso_extf_destroy(xorriso, &new_filter, 0); } return(ret); } int Xorriso_status_extf(struct XorrisO *xorriso, char *filter, FILE *fp, int flag) /* bit1= do only report to fp */ { int i, maxl= 4 * SfileadrL; struct Xorriso_extF *extf; struct Xorriso_lsT *lst; char *line; line= xorriso->result_line; for(lst= xorriso->filters; lst != NULL; lst= Xorriso_lst_get_next(lst, 0)) { extf= (struct Xorriso_extF *) Xorriso_lst_get_text(lst, 0); strcpy(xorriso->result_line, "-external_filter "); Text_shellsafe(extf->cmd->name, line, 1); if((int) strlen(line) > maxl) continue; strcat(line, " "); if(extf->cmd->suffix[0]) { strcat(line, "suffix="); Text_shellsafe(extf->cmd->suffix, line, 1); if((int) strlen(line) > maxl) continue; strcat(line, ":"); } if(extf->cmd->behavior & 8) strcat(line, "remove_suffix:"); if(extf->cmd->behavior & 1) strcat(line, "if_nonempty:"); if(extf->cmd->behavior & 2) strcat(line, "if_reduction:"); if(extf->cmd->behavior & 4) strcat(line, "if_block_reduction:"); sprintf(line + strlen(line), "used=%.f ", (double) extf->cmd->refcount); if((int) strlen(line) > maxl) continue; Text_shellsafe(extf->cmd->path, line, 1); if((int) strlen(line) > maxl) continue; for(i= 1; i < extf->cmd->argc; i++) { strcat(line, " "); Text_shellsafe(extf->cmd->argv[i], line, 1); if((int) strlen(line) > maxl) break; } if(i < extf->cmd->argc) continue; strcat(line, " --\n"); Xorriso_status_result(xorriso, filter, fp, flag&2); } if(xorriso->filter_list_closed) { strcpy(line, "-close_filter_list\n"); Xorriso_status_result(xorriso, filter, fp, flag&2); } return(1); } /* @param flag bit0= iso_zisofs_set_params bit1= iso_zisofs_ctrl_susp_z2 */ int Xorriso_set_zisofs_params(struct XorrisO *xorriso, int flag) { int ret, i; struct iso_zisofs_ctrl ctrl; if(flag & 2) { iso_zisofs_ctrl_susp_z2(!!xorriso->zisofs_susp_z2); } if(!(flag & 1)) return(1); memset(&ctrl, 0, sizeof(ctrl)); ctrl.version= 1; ret= iso_zisofs_get_params(&ctrl, 0); if(ret < 0) { Xorriso_report_iso_error(xorriso, "", ret, "Error when inquiring zisofs parameters before setting some", 0, "FAILURE", 1); return(0); } ctrl.compression_level= xorriso->zlib_level; if(xorriso->zisofs_block_size == (1 << 16)) ctrl.block_size_log2= 16; else if(xorriso->zisofs_block_size == (1 << 17)) ctrl.block_size_log2= 17; else ctrl.block_size_log2= 15; ctrl.v2_enabled= xorriso->zisofs_v2_enabled; ctrl.max_total_blocks= xorriso->zisofs_max_total_blocks; ctrl.max_file_blocks= xorriso->zisofs_max_file_blocks; ctrl.v2_block_size_log2= 17; for(i= 15; i <= 20; i++) if(xorriso->zisofs_v2_block_size == (1 << i)) ctrl.v2_block_size_log2= i; ctrl.block_number_target= xorriso->zisofs_block_number_target; ctrl.bpt_discard_free_ratio= xorriso->zisofs_bpt_discard_free_ratio; ret= iso_zisofs_set_params(&ctrl, 0); Xorriso_process_msg_queues(xorriso,0); if(ret < 0) { Xorriso_report_iso_error(xorriso, "", ret, "Error when setting zisofs parameters", 0, "FAILURE", 1); return(0); } return(1); } uint64_t Xorriso_zisofs_current_blocks(struct XorrisO *xorriso, int flag) { int ret; struct iso_zisofs_ctrl ctrl; memset(&ctrl, 0, sizeof(ctrl)); ctrl.version= 1; ret = iso_zisofs_get_params(&ctrl, 0); if(ret != 1) return(0); return(ctrl.current_total_blocks); } int Xorriso_status_zisofs(struct XorrisO *xorriso, char *filter, FILE *fp, int flag) /* bit0= only report non-default settings bit1= only report to fp */ { off_t ziso_count= 0, osiz_count= 0; off_t gzip_count= 0, gunzip_count= 0; uint64_t used_blocks; int always= 0; iso_zisofs_get_refcounts(&ziso_count, &osiz_count, 0); iso_gzip_get_refcounts(&gzip_count, &gunzip_count, 0); if(!(flag & 1)) { always= 1; } else if(filter != NULL) { if(filter[0] != 0) always= 1; } if(always || !( xorriso->zlib_level == xorriso->zlib_level_default && xorriso->zisofs_block_size == xorriso->zisofs_block_size_default && xorriso->zisofs_by_magic == 0)) { sprintf(xorriso->result_line, "-zisofs level=%d:block_size=%dk:by_magic=%s\n", xorriso->zlib_level, xorriso->zisofs_block_size / 1024, xorriso->zisofs_by_magic == 1 ? "on" : xorriso->zisofs_by_magic == 2 ? "v2" : "off"); Xorriso_status_result(xorriso, filter, fp, flag & 2); } if(always || !( xorriso->zisofs_v2_enabled == 0 && xorriso->zisofs_v2_block_size == xorriso->zisofs_v2_block_size_default && xorriso->zisofs_block_number_target == -1)){ sprintf(xorriso->result_line, "-zisofs version_2=%s:block_size_v2=%dk:susp_z2=%s:bpt_target=%.f\n", xorriso->zisofs_v2_enabled ? xorriso->zisofs_v2_enabled == 1 ? "as_needed" : "on" : "off", xorriso->zisofs_v2_block_size / 1024, xorriso->zisofs_susp_z2 ? "on" : "off", (double) xorriso->zisofs_block_number_target); Xorriso_status_result(xorriso, filter, fp, flag & 2); } used_blocks= Xorriso_zisofs_current_blocks(xorriso, 0); if(always || !( xorriso->zisofs_max_total_blocks == xorriso->zisofs_max_total_blocks_default && xorriso->zisofs_max_file_blocks == xorriso->zisofs_max_file_blocks_default && xorriso->zisofs_bpt_discard_free_ratio == xorriso->zisofs_bpt_discard_free_ratio_default)) { sprintf(xorriso->result_line, "-zisofs max_bpt=%.f:max_bpt_f=%.f:bpt_free_ratio=%.3f\n", (double) xorriso->zisofs_max_total_blocks * 8.0, (double) xorriso->zisofs_max_file_blocks * 8.0, xorriso->zisofs_bpt_discard_free_ratio); Xorriso_status_result(xorriso, filter, fp, flag & 2); } if(always || !(used_blocks == 0)) { sprintf(xorriso->result_line, "-zisofs bpt_used=%.f:bpt_ratio_used=%.3f\n", (double) used_blocks * 8.0, ((double) used_blocks) / (double) xorriso->zisofs_max_total_blocks); Xorriso_status_result(xorriso, filter, fp, flag & 2); } if(always || !( ziso_count == 0 && osiz_count == 0 && gzip_count == 0 && gunzip_count == 0)) { sprintf(xorriso->result_line, "-zisofs ziso_used=%.f:osiz_used=%.f:gzip_used=%.f:gunzip_used=%.f\n", (double) ziso_count, (double) osiz_count, (double) gzip_count, (double) gunzip_count); Xorriso_status_result(xorriso, filter, fp, flag & 2); } return(1); } libisoburn-1.5.4/xorriso/check_media.h0000644000175700017510000001555613762645033014741 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of classes SpotlistiteM, SpotlisT, SectorbitmaP, CheckmediajoB which represent media checks and their outcome. */ #ifndef Xorriso_pvt_check_includeD #define Xorriso_pvt_check_includeD yes struct SpotlisT; /* List of intervals with different read qualities */ struct CheckmediajoB; /* Parameters for Xorriso_check_media() */ int Xorriso_check_media_setup_job(struct XorrisO *xorriso, struct CheckmediajoB *job, char **argv, int old_idx, int end_idx, int flag); int Xorriso_sectormap_to_spotlist(struct XorrisO *xorriso, struct CheckmediajoB *job, struct SpotlisT **spotlist, int flag); /* @param flag bit0= mark untested areas as valid */ int Xorriso_spotlist_to_sectormap(struct XorrisO *xorriso, struct SpotlisT *spotlist, int read_chunk, struct SectorbitmaP **map, int flag); /* Opens the -check_media data copy in for reading and writing */ int Xorriso_open_job_data_to(struct XorrisO *xorriso, struct CheckmediajoB *job, int flag); /* @param report Buffer of at least 10*SfileadrL @param flag bit0= only report non-default settings @return <=0 error , 1 ok , 2 with bit0: every option is on default setting */ int Xorriso_check_media_list_job(struct XorrisO *xorriso, struct CheckmediajoB *job, char *report, int flag); int Xorriso_update_in_sector_map(struct XorrisO *xorriso, struct SpotlisT *spotlist, int read_chunk, struct CheckmediajoB *job, int flag); /* Distiniction between valid and invalid sectors */ struct SectorbitmaP { int sectors; int sector_size; unsigned char *map; int map_size; }; int Spotlist_new(struct SpotlisT **o, int flag); int Spotlist_destroy(struct SpotlisT **o, int flag); int Spotlist_add_item(struct SpotlisT *o, int start_lba, int blocks, int quality, int flag); int Spotlist_count(struct SpotlisT *o, int flag); int Spotlist_block_count(struct SpotlisT *o, int flag); int Spotlist_sector_size(struct SpotlisT *o, int read_chunk, int flag); int Spotlist_get_item(struct SpotlisT *o, int idx, int *start_lba, int *blocks, int *quality, int flag); char *Spotlist__quality_name(int quality, char name[80], int bad_limit, int flag); #define Xorriso_read_quality_gooD 0x7fffffff #define Xorriso_read_quality_md5_matcH 0x70000000 #define Xorriso_read_quality_sloW 0x60000000 #define Xorriso_read_quality_partiaL 0x50000000 #define Xorriso_read_quality_valiD 0x40000000 #define Xorriso_read_quality_untesteD 0x3fffffff #define Xorriso_read_quality_md5_mismatcH 0x38000000 #define Xorriso_read_quality_invaliD 0x30000000 #define Xorriso_read_quality_tao_enD 0x20000000 #define Xorriso_read_quality_off_tracK 0x10000000 #define Xorriso_read_quality_unreadablE 0x00000000 struct CheckmediajoB { int use_dev; /* 0= use indev , 1= use outdev , 2= use sector map*/ int min_lba; /* if >=0 : begin checking at this address */ int max_lba; /* if >=0 : read up to this address, else use mode */ int min_block_size; /* granularity desired by user */ int async_chunks; /* >= 2 : run MD5 thread, use given number of chunks else : synchronous */ int mode; /* 0= track by track 1= single sweep over libisoburn medium capacity 2= single sweep over libburn medium capacity */ time_t start_time; int time_limit; /* Number of seconds after which to abort */ int item_limit; /* Maximum number of medium check list items as result */ char abort_file_path[SfileadrL]; char data_to_path[SfileadrL]; int data_to_fd; off_t data_to_offset; /* usually 0 with image copy, negative with file copy */ off_t data_to_limit; /* used with file copy */ int data_to_skip; /* number of bytes to skip on writing. < 2048 */ int patch_lba0; int patch_lba0_msc1; char sector_map_path[SfileadrL]; struct SectorbitmaP *sector_map; int map_with_volid; /* 0=add quick toc to map file, 1=read ISO heads for toc */ int retry; /* -1= only try full read_chunk, 1=retry with 2k blocks 0= retry with CD, full chunk else */ int report_mode; /* 0= print MCL items 1= print damaged files */ char event_severity[20]; /* If not "ALL": trigger event of given severity at the end of a check job if bad blocks were discovered. */ double slow_threshold_seq; /* Time limit in seconds for the decision whether a read operation is considered slow. This does not apply to thr first read of an interval. */ }; int Checkmediajob_new(struct CheckmediajoB **o, int flag); int Checkmediajob_destroy(struct CheckmediajoB **o, int flag); int Checkmediajob_copy(struct CheckmediajoB *from, struct CheckmediajoB *to, int flag); int Sectorbitmap_new(struct SectorbitmaP **o, int sectors, int sector_size, int flag); int Sectorbitmap_destroy(struct SectorbitmaP **o, int flag); int Sectorbitmap_from_file(struct SectorbitmaP **o, char *path, char *msg, int *os_errno, int flag); int Sectorbitmap_to_file(struct SectorbitmaP *o, char *path, char *info, char *msg, int *os_errno, int flag); int Sectorbitmap_set(struct SectorbitmaP *o, int sector, int flag); int Sectorbitmap_set_range(struct SectorbitmaP *o, int start_sector, int sectors, int flag); int Sectorbitmap_is_set(struct SectorbitmaP *o, int sector, int flag); int Sectorbitmap_bytes_are_set(struct SectorbitmaP *o, off_t start_byte, off_t end_byte, int flag); int Sectorbitmap_get_layout(struct SectorbitmaP *o, int *sectors, int *sector_size, int flag); int Sectorbitmap_copy(struct SectorbitmaP *from, struct SectorbitmaP *to, int flag); int Sectorbitmap_clone(struct SectorbitmaP *from, struct SectorbitmaP **clone, int flag); #endif /* ! Xorriso_pvt_check_includeD */ libisoburn-1.5.4/xorriso/base_obj.c0000644000175700017510000005036113763670445014263 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains functions which are needed to read data from ISO image. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_STDINT_H #include #else #ifdef HAVE_INTTYPES_H #include #endif #endif #ifdef Xorriso_standalonE #ifdef Xorriso_with_libjtE #include "../libjte/libjte.h" #endif #else #ifdef Xorriso_with_libjtE #include #endif #endif /* ! Xorriso_standalonE */ #include "xorriso.h" #include "xorriso_private.h" #include "base_obj.h" #include "lib_mgt.h" /* See Xorriso__preset_signal_behavior() */ static int Xorriso_signal_behavioR= 1; void Xorriso__version(int *major, int *minor, int *micro) { *major= Xorriso_header_version_majoR; *minor= Xorriso_header_version_minoR; *micro= Xorriso_header_version_micrO; } int Xorriso__is_compatible(int major, int minor, int micro, int flag) { int own_major, own_minor, own_micro; Xorriso__version(&own_major, &own_minor, &own_micro); return(own_major > major || (own_major == major && (own_minor > minor || (own_minor == minor && own_micro >= micro)))); } char *Xorriso__get_patch_level_text(int flag) { return(Xorriso_program_patch_leveL); } /** The list of startup file names */ #define Xorriso_rc_nuM 4 static char Xorriso_sys_rc_nameS[Xorriso_rc_nuM][80]= { "/etc/default/xorriso", "/etc/opt/xorriso/rc", "/etc/xorriso/xorriso.conf", "placeholder for $HOME/.xorrisorc" }; int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag) { int i, ret; struct XorrisO *m; char *leafname= NULL; leafname= TSOB_FELD(char, SfileadrL); if(leafname == NULL) return(-1); *xorriso= m= TSOB_FELD(struct XorrisO,1); if(m==NULL) { free(leafname); return(-1); } /* Base initialization by actions which must not fail */ m->libs_are_started= 0; strncpy(m->progname,progname,sizeof(m->progname)-1); m->progname[sizeof(m->progname)-1]= 0; if(getcwd(m->initial_wdx,sizeof(m->initial_wdx)-1)==NULL) m->initial_wdx[0]= 0; m->no_rc= 0; m->argument_emulation= 0; m->rc_filename_count= Xorriso_rc_nuM; for(i=0;irc_filename_count-1;i++) strcpy(m->rc_filenames[i],Xorriso_sys_rc_nameS[i]); m->rc_filenames[m->rc_filename_count-1][0]= 0; m->arrange_args= 0; m->mkisofsrc_done= 0; m->wdi[0]= 0; strcpy(m->wdx, m->initial_wdx); m->did_something_useful= 0; m->add_plainly= 0; m->split_size= 0; strcpy(m->list_delimiter, "--"); m->ino_behavior= 1 | 2 | 4 | 32; /* off:no_lsl_count */ m->iso_level= 3; m->iso_level_is_default= 1; m->do_joliet= 0; m->do_hfsplus= 0; m->do_fat= 0; m->do_rockridge= 1; m->do_iso1999= 0; m->ecma119_map= 1; m->joliet_map= 1; m->do_aaip= 0; m->do_md5= 64; m->no_emul_toc= 0; m->do_old_empty= 0; m->scdbackup_tag_name[0]= 0; m->scdbackup_tag_time[0]= 0; m->scdbackup_tag_written[0]= 0; m->scdbackup_tag_listname[0]= 0; m->relax_compliance= 0; m->allow_dir_id_ext_dflt= 1; m->rr_reloc_dir[0]= 0; m->rr_reloc_flags= 1; m->untranslated_name_len= 0; m->do_follow_pattern= 1; m->do_follow_param= 0; m->do_follow_links= 0; m->follow_link_limit= 100; m->resolve_link_rec_count= 0; m->resolve_link_rec_limit= 100; m->do_follow_concat= 0; m->do_follow_mount= 1; m->do_global_uid= 0; m->global_uid= 0; m->isofs_size= 0; m->isofs_has_what= 0; m->tree_loaded= 0; m->rr_loaded= 0; strcpy(m->volid, "ISOIMAGE"); m->volid_default= 1; m->loaded_volid[0]= 0; m->assert_volid[0]= 0; m->assert_volid_sev[0]= 0; m->preparer_id[0]= 0; m->publisher[0]= 0; m->application_id[0]= 0; m->system_id[0]= 0; m->volset_id[0]= 0; m->copyright_file[0]= 0; m->biblio_file[0]= 0; m->abstract_file[0]= 0; strcpy(m->application_use, " "); m->session_logfile[0]= 0; m->session_lba= -1; m->session_blocks= 0; m->do_global_gid= 0; m->global_gid= 0; m->do_global_mode= 0; m->global_dir_mode= 0555; m->global_file_mode= 0444; m->do_tao= 0; m->filters= NULL; m->filter_list_closed= 0; m->zlib_level_default= m->zlib_level= 6; m->zisofs_block_size= m->zisofs_block_size_default= (1 << 15); m->zisofs_by_magic= 0; m->zisofs_v2_enabled= 0; m->zisofs_max_total_blocks= m->zisofs_max_total_blocks_default= 0x2000000; m->zisofs_max_file_blocks= m->zisofs_max_file_blocks_default= 0x2000000; m->zisofs_block_size= m->zisofs_block_size_default= (1 << 15); m->zisofs_v2_block_size= m->zisofs_v2_block_size_default= (1 << 17); m->zisofs_block_number_target= -1; m->zisofs_bpt_discard_free_ratio= m->zisofs_bpt_discard_free_ratio_default= -1.0; m->zisofs_susp_z2= m->zisofs_susp_z2_default= 0; m->do_overwrite= 2; m->do_reassure= 0; m->drive_blacklist= NULL; m->drive_greylist= NULL; m->drive_whitelist= NULL; m->toc_emulation_flag= 0; m->image_start_mode= 0; m->image_start_value[0]= 0; m->displacement= 0; m->displacement_sign= 0; m->read_fs= 0; m->drives_exclusive= 1; m->drives_access= 1; m->linux_scsi_dev_family= 0; m->early_stdio_test= 0; m->cache_num_tiles= 0; m->cache_tile_blocks= 0; m->cache_default= 1 | 2; m->do_calm_drive= 1; m->indev[0]= 0; m->in_drive_handle= NULL; m->in_volset_handle= NULL; m->in_charset= NULL; m->isofs_st_out= time(0) - 1; m->indev_is_exclusive= 1; m->indev_access= 1; m->indev_off_adr[0]= 0; m->isofs_st_in= 0; m->volset_change_pending= 0; m->no_volset_present= 0; m->in_sector_map= NULL; m->check_media_default= NULL; m->check_media_bad_limit= Xorriso_read_quality_invaliD; m->outdev[0]= 0; m->out_drive_handle= NULL; m->out_charset= NULL; m->dev_fd_1= -1; m->outdev_is_exclusive= 1; m->outdev_access= 1; m->outdev_off_adr[0]= 0; m->grow_blindly_msc2= -1; m->ban_stdio_write= 0; m->do_dummy= 0; m->do_close= 0; m->auto_close= 0; m->write_speed= 0; /* max */ m->read_speed= -2; /* do not set */ m->read_speed_force= 0; m->read_speed_corr= 250000; /* look back at most 0.25 seconds with _force */ m->fs= 4*512; /* 4 MiB */ m->padding= 300*1024; m->do_padding_by_libisofs= 0; m->alignment= 0; m->do_stream_recording= 0; m->dvd_obs= 0; m->modesty_on_drive= 0; m->min_buffer_usec= 5000; m->max_buffer_usec= 25000; m->buffer_timeout_sec= 120; m->min_buffer_percent= 90; m->max_buffer_percent= 95; m->use_immed_bit= 0; m->use_immed_bit_default= 0; m->stdio_sync= 0; m->stdio_sync_is_default= 1; m->keep_boot_image= 0; m->boot_image_cat_path[0]= 0; m->boot_image_cat_hidden= 0; m->boot_count= 0; m->boot_platform_id= 0x00; /* El Torito Boot Catalog Platform ID: 0 = 80x86 */ m->patch_isolinux_image= 0; m->boot_image_bin_path[0]= 0; m->boot_image_bin_form[0]= 0; m->boot_image_emul= 0; m->boot_emul_default= 1; m->boot_image_load_size= 4 * 512; /* hearsay out of libisofs/demo/iso.c */ m->boot_img_size_default= 1; m->boot_img_full_size= 0; memset(m->boot_id_string, 0, sizeof(m->boot_id_string)); memset(m->boot_selection_crit, 0, sizeof(m->boot_selection_crit)); #ifdef Xorriso_with_isohybriD m->boot_image_isohybrid= 1; #else m->boot_image_isohybrid= 0; #endif m->boot_efi_default= 0; m->system_area_disk_path[0]= 0; m->system_area_clear_loaded= 0; m->system_area_options= 0; m->patch_system_area= 0; m->partition_offset= 0; m->partition_secs_per_head= 0; m->partition_heads_per_cyl= 0; m->prep_partition[0]= 0; m->efi_boot_partition[0]= 0; for(i= 0; i < Xorriso_max_appended_partitionS; i++) { m->appended_partitions[i]= NULL; m->appended_part_types[i]= 0; memset(m->appended_part_type_guids[i], 0, 16); m->appended_part_gpt_flags[i]= 0; } m->appended_as_gpt= 0; m->appended_as_apm= 0; m->part_like_isohybrid= 0; m->iso_mbr_part_type= -1; memset(m->iso_gpt_type_guid, 0, 16); m->iso_mbr_part_flag= 0; memset(m->gpt_guid, 0, 16); m->gpt_guid_mode= 0; m->ascii_disc_label[0]= 0; m->grub2_sparc_core[0]= 0; memset(m->hfsp_serial_number, 0, 8); m->hfsp_block_size= 0; m->apm_block_size= 0; m->vol_creation_time= 0; m->vol_modification_time= 0; m->vol_expiration_time= 0; m->vol_effective_time= 0; m->vol_uuid[0]= 0; m->all_file_dates[0]= 0; m->do_override_now_time= 0; m->now_time_override= 0; #ifdef Xorriso_with_libjtE m->libjte_handle= NULL; #endif m->jigdo_params= NULL; m->jigdo_values= NULL; m->libjte_params_given= 0; m->loaded_boot_bin_lba= 0; m->loaded_boot_cat_path[0]= 0; m->allow_graft_points= 0; m->allow_restore= 0; m->do_concat_split= 1; m->do_auto_chmod= 0; m->do_restore_sort_lba= 0; m->do_strict_acl= 0; m->dialog= 0; m->buffered_dialog= NULL; m->bsl_interpretation= 0; m->sh_style_result= 0; m->search_mode= 0; m->structured_search= 1; m->do_iso_rr_pattern= 1; m->do_disk_pattern= 2; m->temp_mem_limit= 16*1024*1024; m->file_size_limit= Xorriso_default_file_size_limiT; m->file_name_limit= 255; m->disk_exclusions= NULL; m->iso_rr_hidings= NULL; m->joliet_hidings= NULL; m->hfsplus_hidings= NULL; m->disk_excl_mode= 1; m->use_stdin= 0; m->tolerate_stdin_eof= 0; m->result_page_length= 0; m->result_page_width= 80; m->mark_text[0]= 0; m->packet_output= 0; for(i=0; i<4; i++) { m->logfile[i][0]= 0; m->logfile_fp[i]= NULL; } m->pktlog_fp= NULL; m->stderr_fp= NULL; for(i= 0; i < Xorriso_max_outlist_stacK; i++) { m->result_msglists[i]= NULL; m->info_msglists[i]= NULL; m->msglist_flags[i]= 0; } m->lib_msg_queue_lock_ini= 0; m->result_msglists_lock_ini= 0; m->write_to_channel_lock_ini= 0; m->msg_watcher_lock_ini= 0; m->msg_watcher_state= 0; m->msgw_result_handler= NULL; m->msgw_result_handle= NULL; m->msgw_info_handler= NULL; m->msgw_info_handle= NULL; m->msgw_stack_handle= -1; m->msgw_msg_pending= 0; m->msgw_fetch_lock_ini= 0; m->msg_sieve= NULL; m->msg_sieve_disabled= 0; m->msglist_stackfill= 0; m->status_history_max= Xorriso_status_history_maX; m->scsi_log= 0; strcpy(m->report_about_text, "UPDATE"); Xorriso__text_to_sev(m->report_about_text, &m->report_about_severity, 0); m->library_msg_direct_print= 0; strcpy(m->abort_on_text,"FAILURE"); Xorriso__text_to_sev(m->abort_on_text, &m->abort_on_severity, 0); m->abort_on_is_default= 1; m->problem_status= 0; m->problem_status_lock_ini= 0; m->problem_status_text[0]= 0; m->errfile_log[0]= 0; m->errfile_mode= 0; m->errfile_fp= NULL; m->img_read_error_mode= 1; /* abort faulty image reading with FAILURE */ m->extract_error_mode= 1; /* keep extracted files after read error */ strcpy(m->return_with_text, "SORRY"); Xorriso__text_to_sev(m->return_with_text, &m->return_with_severity, 0); m->return_with_value= 32; m->eternal_problem_status= 0; m->eternal_problem_status_text[0]= 0; m->re= NULL; /* >>> ??? how to initialize m->match[0] ? */ m->re_constants= NULL; m->re_count= 0; m->re_fill= 0; m->reg_expr[0]= 0; m->run_state= 0; m->is_dialog= 0; m->bar_is_fresh= 0; m->pending_option[0]= 0; m->request_to_abort= 0; m->request_not_to_ask= 0; m->idle_time= 0.0; m->re_failed_at= -1; m->prepended_wd= 0; m->insert_count= 0; m->insert_bytes= 0; m->error_count= 0; m->launch_frontend_banned= 0; m->pacifier_style= 0; m->pacifier_interval= 1.0; m->pacifier_count= 0; m->pacifier_prev_count= 0; m->pacifier_total= 0; m->pacifier_byte_count= 0; m->pacifier_fifo= NULL; m->start_time= 0.0; m->last_update_time= 0.0; m->find_compare_result= 1; m->find_check_md5_result= 0; m->last_abort_file_time= 0.0; m->node_counter= 0; m->node_array_size= 0; m->node_array= NULL; m->node_disk_prefixes= NULL; m->node_img_prefixes= NULL; m->hln_count= 0; m->hln_array= NULL; m->hln_targets= NULL; m->hln_change_pending= 0; m->di_do_widen= NULL; m->di_disk_paths= NULL; m->di_iso_paths= NULL; m->node_targets_availmem= 0; m->di_count= 0; m->di_array= NULL; m->perm_stack= NULL; m->update_flags= 0; m->show_hfs_cmd_flag= 0; m->show_hfs_cmd_count= 0; m->show_hfs_cmds= NULL; m->sparse_min_gap= 0; m->result_line[0]= 0; m->result_line_counter= 0; m->result_page_counter= 0; m->result_open_line_len= 0; m->info_text[0]= 0; /* Here begin actions which might fail */ ret= Sfile_leafname(progname, leafname, 0); if(ret<=0) goto failure; if(strcmp(leafname, "osirrox")==0) { m->allow_restore= 1; m->drives_exclusive= 0; m->drives_access= 0; } else if(strcmp(leafname, "xorrisofs")==0 || strcmp(leafname, "genisofs")==0 || strcmp(leafname, "mkisofs")==0 || strcmp(leafname, "genisoimage")==0) { m->argument_emulation= 1; m->pacifier_style= 1; Xorriso_protect_stdout(*xorriso, 0); } else if(strcmp(leafname, "xorrecord")==0 || strcmp(leafname, "wodim")==0 || strcmp(leafname, "cdrecord")==0 || strcmp(leafname, "cdrskin")==0) { m->argument_emulation= 2; m->pacifier_style= 2; } ret= Exclusions_new(&(m->disk_exclusions), 0); if(ret<=0) goto failure; ret= Exclusions_new(&(m->iso_rr_hidings), 0); if(ret<=0) goto failure; ret= Exclusions_new(&(m->joliet_hidings), 0); if(ret<=0) goto failure; ret= Exclusions_new(&(m->hfsplus_hidings), 0); if(ret<=0) goto failure; Xorriso_relax_compliance(m, "default", 0); ret= Xorriso_lst_new(&(m->drive_greylist), "/dev", m->drive_greylist, 1); if(ret <= 0) goto failure; Xorriso_preparer_string(m, m->preparer_id, 1); /* avoids library calls */ ret= pthread_mutex_init(&(m->lib_msg_queue_lock), NULL); if(ret != 0) goto failure; m->lib_msg_queue_lock_ini= 1; ret= pthread_mutex_init(&(m->result_msglists_lock), NULL); if(ret != 0) goto failure; m->result_msglists_lock_ini= 1; ret= pthread_mutex_init(&(m->write_to_channel_lock), NULL); if(ret != 0) goto failure; m->result_msglists_lock_ini= 1; ret= pthread_mutex_init(&(m->problem_status_lock), NULL); if(ret != 0) goto failure; m->problem_status_lock_ini= 1; ret= pthread_mutex_init(&(m->msg_watcher_lock), NULL); if(ret != 0) goto failure; m->msg_watcher_lock_ini= 1; ret= pthread_mutex_init(&(m->msgw_fetch_lock), NULL); if(ret != 0) goto failure; m->msgw_fetch_lock_ini= 1; if(leafname != NULL) free(leafname); return(1); failure:; Xorriso_destroy(xorriso, 0); if(leafname != NULL) free(leafname); return(-1); } int Xorriso_destroy_re(struct XorrisO *m, int flag) { int i; if(m->re!=NULL) { for(i=0;ire_fill;i++) { if(m->re_constants!=NULL) if(m->re_constants[i]!=NULL) continue; /* ,->re[i] was never subject to regcomp() */ regfree(&(m->re[i])); } free((char *) m->re); m->re= NULL; } if(m->re_constants!=NULL) { for(i=0;ire_fill;i++) if(m->re_constants[i]!=NULL) free(m->re_constants[i]); free((char *) m->re_constants); m->re_constants= NULL; } m->re_count= 0; m->re_fill= 0; return(1); } /* @param flag bit0= global shutdown of libraries */ int Xorriso_destroy(struct XorrisO **xorriso, int flag) { struct XorrisO *m; int i; m= *xorriso; if(m==NULL) return(0); /* Give up drives and image to unref all connected xorriso objects */ Xorriso_give_up_drive(m, 3); if(m->in_charset!=NULL) free(m->in_charset); if(m->out_charset!=NULL) free(m->out_charset); Checkmediajob_destroy(&(m->check_media_default), 0); Sectorbitmap_destroy(&(m->in_sector_map), 0); Xorriso_destroy_re(m,0); Exclusions_destroy(&(m->disk_exclusions), 0); Exclusions_destroy(&(m->iso_rr_hidings), 0); Exclusions_destroy(&(m->joliet_hidings), 0); Exclusions_destroy(&(m->hfsplus_hidings), 0); Xorriso_destroy_all_extf(m, 0); Xorriso_lst_destroy_all(&(m->drive_blacklist), 0); Xorriso_lst_destroy_all(&(m->drive_greylist), 0); Xorriso_lst_destroy_all(&(m->drive_whitelist), 0); Xorriso_destroy_node_array(m, 0); Xorriso_destroy_hln_array(m, 0); Xorriso_destroy_di_array(m, 0); #ifdef Xorriso_with_libjtE if(m->libjte_handle) libjte_destroy(&(m->libjte_handle)); #endif Xorriso_lst_destroy_all(&(m->jigdo_params), 0); Xorriso_lst_destroy_all(&(m->jigdo_values), 0); for(i= 0; i < Xorriso_max_appended_partitionS; i++) if(m->appended_partitions[i] != NULL) free(m->appended_partitions[i]); Xorriso_detach_libraries(m, flag&1); if(m->lib_msg_queue_lock_ini) pthread_mutex_destroy(&(m->lib_msg_queue_lock)); if(m->result_msglists_lock_ini) pthread_mutex_destroy(&(m->result_msglists_lock)); if(m->write_to_channel_lock_ini) pthread_mutex_destroy(&(m->write_to_channel_lock)); if(m->problem_status_lock_ini) pthread_mutex_destroy(&(m->problem_status_lock)); if(m->msg_watcher_lock_ini) pthread_mutex_destroy(&(m->msg_watcher_lock)); if(m->msgw_fetch_lock_ini) pthread_mutex_destroy(&(m->msgw_fetch_lock)); Xorriso_sieve_dispose(m, 0); free((char *) m); *xorriso= NULL; return(1); } int Xorriso_destroy_node_array(struct XorrisO *xorriso, int flag) { int i; if(xorriso->node_array != NULL) { for(i= 0; i < xorriso->node_counter; i++) iso_node_unref((IsoNode *) xorriso->node_array[i]); free(xorriso->node_array); } xorriso->node_array= NULL; xorriso->node_counter= xorriso->node_array_size= 0; Xorriso_lst_destroy_all(&(xorriso->node_disk_prefixes), 0); Xorriso_lst_destroy_all(&(xorriso->node_img_prefixes), 0); return(1); } /* @param flag bit0= do not destroy hln_array but only hln_targets */ int Xorriso_destroy_hln_array(struct XorrisO *xorriso, int flag) { int i; if(xorriso->hln_array != NULL && !(flag & 1)) { for(i= 0; i < xorriso->hln_count; i++) iso_node_unref((IsoNode *) xorriso->hln_array[i]); free(xorriso->hln_array); xorriso->hln_array= NULL; xorriso->hln_count= 0; } if(xorriso->hln_targets != NULL) { for(i= 0; i < xorriso->hln_count; i++) if(xorriso->hln_targets[i] != NULL) free(xorriso->hln_targets[i]); free(xorriso->hln_targets); xorriso->hln_targets= NULL; } xorriso->node_targets_availmem= 0; return(1); } int Xorriso_destroy_di_array(struct XorrisO *xorriso, int flag) { int i; if(xorriso->di_array != NULL) { for(i= 0; i < xorriso->di_count; i++) if(xorriso->di_array[i] != NULL) iso_node_unref((IsoNode *) xorriso->di_array[i]); free(xorriso->di_array); xorriso->di_array= NULL; } if(xorriso->di_do_widen != NULL) { free(xorriso->di_do_widen); xorriso->di_do_widen= NULL; } Xorriso_lst_destroy_all(&(xorriso->di_disk_paths), 0); Xorriso_lst_destroy_all(&(xorriso->di_iso_paths), 0); xorriso->di_count= 0; #ifdef NIX /* <<< */ fprintf(stderr, "xorriso_DEBUG: get_di_count= %lu\n", Xorriso_get_di_counteR); #endif /* NIX */ return(1); } int Xorriso_new_node_array(struct XorrisO *xorriso, off_t mem_limit, int addon_nodes, int flag) { int i; if(xorriso->node_counter <= 0) return(1); xorriso->node_array= calloc(xorriso->node_counter + addon_nodes, sizeof(IsoNode *)); if(xorriso->node_array == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); return(-1); } for(i= 0; i < xorriso->node_counter + addon_nodes; i++) xorriso->node_array[i]= NULL; xorriso->node_array_size= xorriso->node_counter + addon_nodes; xorriso->node_counter= 0; return(1); } /* @param flag bit0= do not allocate hln_array but only hln_targets */ int Xorriso_new_hln_array(struct XorrisO *xorriso, off_t mem_limit, int flag) { int i; Xorriso_destroy_hln_array(xorriso, flag & 1); if(xorriso->hln_count <= 0) return(1); if(!(flag & 1)) { xorriso->hln_array= calloc(xorriso->hln_count, sizeof(char *)); if(xorriso->hln_array == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); return(-1); } for(i= 0; i < xorriso->hln_count; i++) xorriso->hln_array[i]= NULL; } xorriso->hln_targets= calloc(xorriso->hln_count, sizeof(char *)); if(xorriso->hln_targets == NULL) { if(!(flag & 1)) { free(xorriso->hln_array); xorriso->hln_array= NULL; } Xorriso_no_malloc_memory(xorriso, NULL, 0); return(-1); } for(i= 0; i < xorriso->hln_count; i++) xorriso->hln_targets[i]= NULL; xorriso->node_targets_availmem= mem_limit - xorriso->hln_count * sizeof(void *) - xorriso->hln_count * sizeof(char *); if(xorriso->node_targets_availmem < 0) xorriso->node_targets_availmem= 0; return(1); } int Xorriso__preset_signal_behavior(int behavior, int flag) { if(behavior < 0 || behavior > 3) return(0); Xorriso_signal_behavioR= behavior; return(1); } int Xorriso__get_signal_behavior(int flag) { return(Xorriso_signal_behavioR); } libisoburn-1.5.4/xorriso/disk_ops.c0000644000175700017510000017141713701321754014324 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2019 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of actions on onjects of disk filesystems. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include /* O_BINARY is needed for Cygwin but undefined elsewhere */ #ifndef O_BINARY #define O_BINARY 0 #endif #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" /* @param flag bit0= simple readlink(): no normalization, no multi-hop bit1= this is potentially a recursion */ int Xorriso_resolve_link(struct XorrisO *xorriso, char *link_path, char result_path[SfileadrL], int flag) { ssize_t l; struct stat stbuf; int link_count= 0, ret, show_errno= 0; char *buf= NULL, *dirbuf= NULL, *lpt, *spt; static int link_limit= 100; if(flag & 1) { xorriso->resolve_link_rec_count++; if(xorriso->resolve_link_rec_count > xorriso->resolve_link_rec_limit) { Xorriso_msgs_submit(xorriso, 0, link_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "Too many link recursions before : "); Text_shellsafe(link_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, show_errno, "FAILURE", 0); {ret= 0; goto ex;} } } else xorriso->resolve_link_rec_count= 0; Xorriso_alloc_meM(buf, char, SfileadrL); Xorriso_alloc_meM(dirbuf, char, SfileadrL); if(!(flag&1)) if(stat(link_path, &stbuf)==-1) if(errno==ELOOP) { show_errno= errno; goto too_many_hops; } lpt= link_path; while(1) { l= readlink(lpt, buf, SfileadrL-1); if(l==-1) { handle_error:; Xorriso_msgs_submit(xorriso, 0, link_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "Cannot obtain link target of : "); Text_shellsafe(link_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE",0); handle_abort:; if(strcmp(lpt, link_path)!=0) { sprintf(xorriso->info_text, "Problem occurred with intermediate path : "); Text_shellsafe(lpt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } {ret= 0; goto ex;} } buf[l]= 0; if(l==0) { Xorriso_msgs_submit(xorriso, 0, link_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "Empty link target with : "); Text_shellsafe(link_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); goto handle_abort; } if(flag&1) { strcpy(result_path, buf); {ret= 1; goto ex;} } /* normalize relative to disk_path */ if(Sfile_str(dirbuf, lpt, 0)<=0) {ret= -1; goto ex;} while(1) { spt= strrchr(dirbuf,'/'); if(spt!=NULL) { *spt= 0; if(*(spt+1)!=0) break; } else break; } ret= Xorriso_normalize_img_path(xorriso, dirbuf, buf, result_path, 2|4); if(ret<=0) { goto ex; } if(lstat(result_path, &stbuf)==-1) { lpt= result_path; goto handle_error; } if(!S_ISLNK(stbuf.st_mode)) break; lpt= result_path; link_count++; if(link_count>link_limit) { too_many_hops:; Xorriso_msgs_submit(xorriso, 0, link_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "Too many link hops with : "); Text_shellsafe(link_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, show_errno, "FAILURE", 0); {ret= 0; goto ex;} } } ret= 1; ex:; Xorriso_free_meM(buf); Xorriso_free_meM(dirbuf); if(xorriso->resolve_link_rec_count > 0) xorriso->resolve_link_rec_count--; return(ret); } int Xorriso_convert_uidstring(struct XorrisO *xorriso, char *uid_string, uid_t *uid, int flag) { double num= 0.0; char text[80]; struct passwd *pwd; sscanf(uid_string, "%lf", &num); sprintf(text,"%.f",num); if(strcmp(text,uid_string)==0) { *uid= num; return(1); } pwd= getpwnam(uid_string); if(pwd==NULL) { sprintf(xorriso->info_text, "-uid: Not a known user: '%s'", uid_string); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } *uid= pwd->pw_uid; return(1); } int Xorriso_convert_gidstring(struct XorrisO *xorriso, char *gid_string, gid_t *gid, int flag) { double num= 0.0; char text[80]; struct group *grp; sscanf(gid_string, "%lf", &num); sprintf(text,"%.f",num); if(strcmp(text,gid_string)==0) { *gid= num; return(1); } grp= getgrnam(gid_string); if(grp==NULL) { sprintf(xorriso->info_text, "-gid: Not a known group: '%s'", gid_string); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } *gid= grp->gr_gid; return(1); } int Xorriso_convert_modstring(struct XorrisO *xorriso, char *cmd, char *mode, mode_t *mode_and, mode_t *mode_or, int flag) { int who_val= 0; char *mpt, *vpt, *opt; unsigned int num= 0; mode_t mode_val,mask; *mode_and= ~0; *mode_or= 0; if(mode[0]=='0') { *mode_and= 0; sscanf(mode,"%o",&num); *mode_or= num; } else if(strchr(mode,'+')!=NULL || strchr(mode,'-')!=NULL || strchr(mode,'=')!=NULL) { /* [ugoa][+-][rwxst] */; for(mpt= mode; mpt!=NULL; mpt= strchr(mpt, ',')) { if(*mpt==',') mpt++; if(strlen(mpt)<2) goto unrecognizable; who_val= 0; for(vpt= mpt; *vpt!='+' && *vpt!='-' && *vpt!='='; vpt++) { if(*vpt=='u') who_val|= 4; else if(*vpt=='g') who_val|= 2; else if(*vpt=='o') who_val|= 1; else if(*vpt=='a') who_val|= 7; else goto unrecognizable; } opt= vpt; mode_val= 0; for(vpt= opt+1; *vpt!=0 && *vpt!=','; vpt++) { if(*vpt=='r') { if(who_val&4) mode_val|= S_IRUSR; if(who_val&2) mode_val|= S_IRGRP; if(who_val&1) mode_val|= S_IROTH; } else if(*vpt=='w') { if(who_val&4) mode_val|= S_IWUSR; if(who_val&2) mode_val|= S_IWGRP; if(who_val&1) mode_val|= S_IWOTH; } else if(*vpt=='x') { if(who_val&4) mode_val|= S_IXUSR; if(who_val&2) mode_val|= S_IXGRP; if(who_val&1) mode_val|= S_IXOTH; } else if(*vpt=='s') { if(who_val&4) mode_val|= S_ISUID; if(who_val&2) mode_val|= S_ISGID; } else if(*vpt=='t') { if(who_val&1) mode_val|= S_ISVTX; } else goto unrecognizable; } if(*opt=='+') { (*mode_or)|= mode_val; } else if(*opt=='=') { mask= 0; if(who_val&1) mask|= S_IRWXO|S_ISVTX; if(who_val&2) mask|= S_IRWXG|S_ISGID; if(who_val&4) mask|= S_IRWXU|S_ISUID; (*mode_and)&= ~(mask); (*mode_or)= ((*mode_or) & ~mask) | mode_val; } else if(*opt=='-') { (*mode_or)&= ~mode_val; (*mode_and)&= ~mode_val; } } } else { unrecognizable:; sprintf(xorriso->info_text, "%s: Unrecognizable or faulty permission mode ", cmd); Text_shellsafe(mode, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } return(1); } /* @param flag bit0= for Xorriso_msgs_submit: use pager bit1= do not issue warnings */ int Xorriso_hop_link(struct XorrisO *xorriso, char *link_path, struct LinkiteM **link_stack, struct stat *stbuf, int flag) { int ret; struct LinkiteM *litm; if(*link_stack != NULL) { if(Linkitem_get_link_count(*link_stack, 0) >= xorriso->follow_link_limit) { sprintf(xorriso->info_text, "Too many symbolic links in single tree branch at : "); Text_shellsafe(link_path, xorriso->info_text, 1); if(!(flag&2)) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0,"WARNING",flag&1); return(0); } } ret= stat(link_path, stbuf); if(ret==-1) return(0); ret= Linkitem_find(*link_stack, stbuf->st_dev, stbuf->st_ino, &litm, 0); if(ret>0) { sprintf(xorriso->info_text, "Detected symbolic link loop around : "); Text_shellsafe(link_path, xorriso->info_text, 1); if(!(flag&2)) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", flag&1); return(0); } ret= Linkitem_new(&litm, link_path, stbuf->st_dev, stbuf->st_ino, *link_stack, 0); if(ret<=0) { sprintf(xorriso->info_text, "Cannot add new item to link loop prevention stack"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", flag&1); return(-1); } *link_stack= litm; return(1); } /* @param flag bit0= do not only sum up sizes but also print subdirs bit1= this is a recursion bit2= do not report result by Xorriso_result() @return <=0 error , 1 ok , 2 could not open directory */ int Xorriso_show_dux_subs(struct XorrisO *xorriso, char *abs_path, char *rel_path, off_t *size, off_t boss_mem, struct LinkiteM *link_stack, int flag) { int i, ret, no_sort= 0, filec= 0, l, j, fc, no_dive, is_link; char **filev= NULL, *namept; off_t sub_size, report_size, mem= 0; struct DirseQ *dirseq= NULL; struct stat stbuf; dev_t dir_dev; struct LinkiteM *own_link_stack; char *path= NULL, *show_path= NULL, *name= NULL, *sfe= NULL; own_link_stack= link_stack; namept= name; *size= 0; Xorriso_alloc_meM(sfe, char, 5 * SfileadrL); Xorriso_alloc_meM(path, char, SfileadrL); Xorriso_alloc_meM(show_path, char, SfileadrL); Xorriso_alloc_meM(name, char, SfileadrL); if(lstat(abs_path, &stbuf)==-1) {ret= 2; goto ex;} dir_dev= stbuf.st_dev; if(S_ISLNK(stbuf.st_mode)) { if(!(xorriso->do_follow_links || (xorriso->do_follow_param && !(flag&2)))) {ret= 2; goto ex;} if(stat(abs_path, &stbuf)==-1) {ret= 2; goto ex;} if(dir_dev != stbuf.st_dev && !(xorriso->do_follow_mount || (xorriso->do_follow_param && !(flag&2)))) {ret= 2; goto ex;} } ret= Dirseq_new(&dirseq, abs_path, 1); if(ret<0) { sprintf(xorriso->info_text, "Cannot obtain disk directory iterator"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } if(ret==0) {ret= 2; goto ex;} while(1) { Linkitem_reset_stack(&own_link_stack, link_stack, 0); ret= Dirseq_next_adr(dirseq,name,0); if(ret<0) goto ex; if(ret==0) break; sub_size= 0; strcpy(show_path, rel_path); if(Sfile_add_to_path(show_path, name, 0)<=0) goto much_too_long; strcpy(path, abs_path); if(Sfile_add_to_path(path, name, 0)<=0) { much_too_long:; Xorriso_much_too_long(xorriso, strlen(path)+strlen(name)+1, 2); {ret= -1; goto ex;} } no_dive= 0; ret= lstat(path, &stbuf); if(ret==-1) continue; is_link= S_ISLNK(stbuf.st_mode); if(is_link && xorriso->do_follow_links) { ret= Xorriso_hop_link(xorriso, path, &own_link_stack, &stbuf, 1); if(ret<0) {ret= -1; goto ex;} if(ret!=1) no_dive= 1; } if(!S_ISDIR(stbuf.st_mode)) no_dive= 1; if(dir_dev != stbuf.st_dev && !xorriso->do_follow_mount) no_dive= 1; if(!no_dive) { filec++; l= strlen(rel_path)+1; mem+= l; if(l % sizeof(char *)) mem+= sizeof(char *)-(l % sizeof(char *)); if(flag&1) /* diving and counting is done further below */ continue; ret= Xorriso_show_dux_subs(xorriso, path, show_path, &sub_size, boss_mem, own_link_stack,2); if(ret<0) goto ex; if(ret==0) continue; } /* sub_size+= stbuf.st_size+strlen(name)+1; */ sub_size+= stbuf.st_size+2048; if(sub_size>0) (*size)+= sub_size; } if(filec<=0 || !(flag&1)) {ret= 1; goto ex;} /* Try to get a sorted list of directory names */ mem+= (filec+1)*sizeof(char *); ret= Xorriso_check_temp_mem_limit(xorriso, mem+boss_mem, 2); if(ret<0) goto ex; Dirseq_rewind(dirseq, 0); if(ret==0) { no_sort_possible:; no_sort= 1; } else { filev= (char **) calloc(filec+1, sizeof(char *)); if(filev==NULL) goto no_sort_possible; else { for(i= 0; ido_follow_links) { ret= stat(path,&stbuf); if(ret==-1) continue; } if(!S_ISDIR(stbuf.st_mode)) continue; if(dir_dev != stbuf.st_dev && !xorriso->do_follow_mount) continue; if(fc>=filec) { /* Number of files changed (or programming error) */ revoke_sorting:; for(j=0; j1) Sort_argv(filec, filev, 0); } } for(i= 0; (no_sort || irequest_to_abort); i++) { Linkitem_reset_stack(&own_link_stack, link_stack, 0); if(no_sort) { ret= Dirseq_next_adr(dirseq,name,0); if(ret<0) goto ex; if(ret==0) break; } else namept= filev[i]; sub_size= 0; strcpy(show_path, rel_path); if(Sfile_add_to_path(show_path, namept, 0)<=0) goto much_too_long; strcpy(path, abs_path); if(Sfile_add_to_path(path, namept, 0)<=0) goto much_too_long; no_dive= 0; ret= lstat(path,&stbuf); if(ret==-1) continue; is_link= S_ISLNK(stbuf.st_mode); if(is_link && xorriso->do_follow_links) { ret= Xorriso_hop_link(xorriso, path, &own_link_stack, &stbuf, 1); if(ret<0) {ret= -1; goto ex;} if(ret!=1) continue; } if(!S_ISDIR(stbuf.st_mode)) continue; if(dir_dev == stbuf.st_dev || xorriso->do_follow_mount) { ret= Xorriso_show_dux_subs(xorriso, path, show_path, &sub_size, boss_mem+mem, own_link_stack, 2|(flag&1)); if(ret<0) goto ex; } /* sub_size+= stbuf.st_size+strlen(namept)+1; */ sub_size+= stbuf.st_size+2048; if(sub_size>0) (*size)+= sub_size; report_size= sub_size/1024; if(report_size*1024sh_style_result) sprintf(xorriso->result_line, "%-7.f ",(double) (report_size)); else sprintf(xorriso->result_line, "%7.f ",(double) (report_size)); sprintf(xorriso->result_line+strlen(xorriso->result_line), "%s\n", Xorriso_esc_filepath(xorriso,show_path, sfe, 0)); Xorriso_result(xorriso, 0); } } ret= 1; ex:; Xorriso_free_meM(sfe); Xorriso_free_meM(path); Xorriso_free_meM(show_path); Xorriso_free_meM(name); Linkitem_reset_stack(&own_link_stack, link_stack, 0); Dirseq_destroy(&dirseq, 0); if(filev!=NULL) { for(i=0; i> 2) & 63; if(hidden_state == 1) perms[9]= 'I'; else if(hidden_state == 2) perms[9]= 'J'; else if(hidden_state == 4) perms[9]= 'A'; else if(hidden_state) perms[9]= 'H'; if(flag & 2) { if(hidden_state) perms[9]= tolower(perms[9]); else perms[9]= '+'; } return(1); } /* @param flag bit0= recognize Xorriso_IFBOOT as file type bit1= add '+' to perms bit2-7: hidden_state : bit2= hide in ISO/RR bit3= hide in Joliet bit4= hide in HFS+ */ int Xorriso_format_ls_l(struct XorrisO *xorriso, struct stat *stbuf, int flag) { int show_major_minor= 0, high_shift= 0, high_mask= 0; char *rpt, perms[11], mm_text[80]; mode_t st_mode; dev_t dev, major, minor; rpt= xorriso->result_line; rpt[0]= 0; st_mode= stbuf->st_mode; if(S_ISDIR(st_mode)) strcat(rpt, "d"); else if(S_ISREG(st_mode)) { strcat(rpt, "-"); } else if(S_ISLNK(st_mode)) strcat(rpt, "l"); else if(S_ISBLK(st_mode)) { strcat(rpt, "b"); show_major_minor= 1; } else if(S_ISCHR(st_mode)) { strcat(rpt, "c"); show_major_minor= 1; } else if(S_ISFIFO(st_mode)) strcat(rpt, "p"); else if(S_ISSOCK(st_mode)) strcat(rpt, "s"); else if((flag & 1) && (st_mode & S_IFMT) == Xorriso_IFBOOT) strcat(rpt, "e"); else strcat(rpt, "?"); Xorriso__mode_to_perms(st_mode, perms, flag & (2 | 252)); strcat(rpt, perms); sprintf(rpt+strlen(rpt)," %3u ",(unsigned int) stbuf->st_nlink); sprintf(rpt+strlen(rpt), "%-8lu ", (unsigned long) stbuf->st_uid); sprintf(rpt+strlen(rpt), "%-8lu ", (unsigned long) stbuf->st_gid); if(show_major_minor) { dev= stbuf->st_rdev; /* according to /usr/include/sys/sysmacros.h : gnu_dev_major(),_minor() >>> but this looks as if it should go to some system dependency >>> in FreeBSD dev_t is 32 bit */ if(sizeof(dev_t) > 4) { high_shift= 32; high_mask= ~0xfff; } major= (((dev >> 8) & 0xfff) | ((unsigned int) (dev >> high_shift) & high_mask)) & 0xffffffff; minor= (((dev & 0xff) | ((unsigned int) (dev >> 12) & ~0xff))) & 0xffffffff; sprintf(mm_text, "%u,%u", (unsigned int) major, (unsigned int) minor); sprintf(rpt+strlen(rpt), "%8s ", mm_text); } else sprintf(rpt+strlen(rpt), "%8.f ", (double) stbuf->st_size); Ftimetxt(stbuf->st_mtime, rpt+strlen(rpt), 0); strcat(rpt, " "); return(1); } struct DirentrY { char *adr; struct DirentrY *next; }; int Xorriso_sorted_dir_x(struct XorrisO *xorriso, char *dir_path, int *filec, char ***filev, off_t boss_mem, int flag) { int count= 0, ret; char *name= NULL; struct DirseQ *dirseq= NULL; off_t mem; struct DirentrY *last= NULL, *current= NULL; Xorriso_alloc_meM(name, char, SfileadrL); *filec= 0; *filev= NULL; mem= boss_mem; ret= Dirseq_new(&dirseq, dir_path, 1); if(ret<=0) goto ex; while(1) { /* loop over directory content */ ret= Dirseq_next_adr(dirseq,name,0); if(ret==0) break; if(ret<0) goto ex; mem+= strlen(name)+8+sizeof(struct DirentrY)+sizeof(char *); if(mem>xorriso->temp_mem_limit) {ret= 0; goto ex;} current= (struct DirentrY *) calloc(1, sizeof(struct DirentrY)); if(current==NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); {ret= -1; goto ex;} } current->adr= NULL; current->next= last; last= current; last->adr= strdup(name); if(last->adr==NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); {ret= -1; goto ex;} } count++; } *filec= count; if(count==0) {ret= 1; goto ex;} (*filev)= (char **) calloc(count, sizeof(char *)); if(*filev==NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); {ret= -1; goto ex; } } count= 0; for(current= last; current!=NULL; current= last) { last= current->next; (*filev)[count++]= current->adr; free((char *) current); } Sort_argv(*filec, *filev, 0); ret= 1; ex:; for(current= last; current!=NULL; current= last) { last= current->next; free(current->adr); free((char *) current); } Xorriso_free_meM(name); Dirseq_destroy(&dirseq, 0); return(ret); } /* @param flag bit0= long format bit1= do not print count of nodes bit2= du format bit3= print directories as themselves (ls -d) */ int Xorriso_lsx_filev(struct XorrisO *xorriso, char *wd, int filec, char **filev, off_t boss_mem, int flag) { int i, ret, was_error= 0, dfilec= 0, pass, passes; char *path= NULL, *acl_text= NULL; char *rpt, *link_target= NULL, **dfilev= NULL; off_t size; struct stat stbuf; Xorriso_alloc_meM(path, char, SfileadrL); Xorriso_alloc_meM(link_target, char, SfileadrL); rpt= xorriso->result_line; Sort_argv(filec, filev, 0); /* Count valid nodes, warn of invalid ones */ for(i= 0; iinfo_text, "Not found in local filesystem: "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 1); was_error++; continue; } } if((flag&8) && !(flag&(2|4))) { sprintf(xorriso->info_text,"Valid local files found: %d\n",filec-was_error); Xorriso_info(xorriso,1); if(filec-was_error<=0) {ret= !was_error; goto ex;} } passes= 1+!(flag&(4|8)); for(pass= 0; passrequest_to_abort); i++) { ret= Xorriso_make_abs_adr(xorriso, wd, filev[i], path, 1|2|4); if(ret<=0) continue; ret= lstat(path, &stbuf); if(ret==-1) continue; if(S_ISLNK(stbuf.st_mode) && (xorriso->do_follow_links || xorriso->do_follow_param)) { ret= stat(path, &stbuf); if(ret==-1) ret= lstat(path, &stbuf); if(ret==-1) continue; } if(S_ISDIR(stbuf.st_mode) && !(flag&(4|8))) { if(pass==0) continue; if(filec>1) { strcpy(xorriso->result_line, "\n"); Xorriso_result(xorriso,0); Xorriso_esc_filepath(xorriso,filev[i], xorriso->result_line, 0); strcat(xorriso->result_line, ":\n"); Xorriso_result(xorriso,0); } ret= Xorriso_sorted_dir_x(xorriso, path, &dfilec, &dfilev, boss_mem, 0); if(ret<=0) { /* >>> DirseQ loop and single item Xorriso_lsx_filev() */; } else { if(flag&1) { sprintf(xorriso->result_line, "total %d\n", dfilec); Xorriso_result(xorriso,0); } Xorriso_lsx_filev(xorriso, path, dfilec, dfilev, boss_mem, (flag&1)|2|8); } if(dfilec>0) Sfile_destroy_argv(&dfilec, &dfilev, 0); continue; } else if(pass>0) continue; link_target[0]= 0; rpt[0]= 0; if((flag&5)==1) { Xorriso_local_getfacl(xorriso, path, &acl_text, 16); ret= Xorriso_format_ls_l(xorriso, &stbuf, (acl_text != NULL) << 1); Xorriso_local_getfacl(xorriso, path, &acl_text, 1 << 15); if(ret<=0) continue; if(S_ISLNK(stbuf.st_mode)) { ret= Xorriso_resolve_link(xorriso, path, link_target, 1); if(ret<=0) link_target[0]= 0; } } else if(flag&4) { /* -dux or -dusx */ size= stbuf.st_size; if(S_ISDIR(stbuf.st_mode)) { ret= Xorriso_show_dux_subs(xorriso, path, filev[i], &size, boss_mem, NULL, flag&1); if(ret<0) {ret= -1; goto ex;} if(ret==0) continue; } if(xorriso->sh_style_result) sprintf(rpt, "%-7.f ",(double) (size/1024)); else sprintf(rpt, "%7.f ",(double) (size/1024)); } if(link_target[0]) { Xorriso_esc_filepath(xorriso,filev[i], xorriso->result_line, 1); strcat(xorriso->result_line, " -> "); Xorriso_esc_filepath(xorriso,link_target, xorriso->result_line, 1 | 2); } else { Xorriso_esc_filepath(xorriso,filev[i], xorriso->result_line, 1); } strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); } ret= !was_error; ex:; Xorriso_free_meM(path); Xorriso_free_meM(link_target); return(ret); } /* @param flag >>> bit0= remove whole sub tree: rm -r bit1= remove empty directory: rmdir bit2= recursion: do not reassure in mode 2 "tree" bit3= this is for overwriting and not for plain removal bit4= count deleted files in xorriso->pacifier_count bit5= with bit0 only remove directory content, not the directory bit6= permission to call Xorriso_make_accessible() @return <=0 = error 1 = removed leaf file object 2 = removed directory or tree 3 = did not remove on user revocation */ int Xorriso_rmx(struct XorrisO *xorriso, off_t boss_mem, char *path, int flag) { int ret, is_dir= 0, made_accessible= 0; struct stat victim_stbuf; struct DirseQ *dirseq= NULL; char *sfe= NULL, *sub_path= NULL; struct PermiteM *perm_stack_mem; perm_stack_mem= xorriso->perm_stack; /* Avoiding large local memory objects in order to save stack space */ sfe= malloc(5*SfileadrL); sub_path= malloc(2*SfileadrL); if(sfe==NULL || sub_path==NULL) { Xorriso_no_malloc_memory(xorriso, &sfe, 0); {ret= -1; goto ex;} } if(Xorriso_much_too_long(xorriso, strlen(path), 0)<=0) {ret= 0; goto ex;} ret= lstat(path, &victim_stbuf); if(ret==-1) { if((flag & 64) && errno == EACCES) { ret= Xorriso_make_accessible(xorriso, path, 0); if(ret < 0) goto ex; made_accessible= 1; ret= lstat(path, &victim_stbuf); } if(ret==-1) { sprintf(xorriso->info_text, "Cannot lstat(%s)", Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); {ret= 0; goto ex;} } } if(strcmp(path, "/")==0) { sprintf(xorriso->info_text, "May not delete root directory"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } if(S_ISDIR(victim_stbuf.st_mode)) is_dir= 1; if(!is_dir) { if(flag&2) { /* rmdir */ sprintf(xorriso->info_text, "%s in disk filesystem is not a directory", Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } else { if(flag&1) { /* rm -r */ #ifdef Osirrox_not_yeT /* >>> */ struct stat *victim_node= NULL; victim_node= &victim_stbuf; if((xorriso->do_reassure==1 && !xorriso->request_not_to_ask) || (flag&32)) { /* Iterate over subordinates and delete them */ mem= boss_mem; ret= Xorriso_findi_iter(xorriso, (IsoDir *) victim_node, &mem, &iter, &node_array, &node_count, &node_idx, &node, 1|2); if(ret<=0) { cannot_create_iter:; Xorriso_cannot_create_iter(xorriso, ret, 0); ret= -1; goto ex; } pl= strlen(path); strcpy(sub_path, path); if(pl==0 || sub_path[pl-1]!='/') { sub_path[pl++]= '/'; sub_path[pl]= 0; } sub_name= sub_path+pl; while(1) { ret= Xorriso_findi_iter(xorriso, (IsoDir *) victim_node, &mem, &iter, &node_array, &node_count, &node_idx, &node, 0); if(ret<0) goto ex; if(ret==0 || xorriso->request_to_abort) break; name= (char *) iso_node_get_name(node); if(Xorriso_much_too_long(xorriso, pl+1+strlen(name), 0)<=0) {ret= 0; goto rm_r_problem_handler;} strcpy(sub_name, name); ret= Xorriso_rmi(xorriso, iter, mem, sub_path, (flag&(1|2|8|16))|4); if(ret==3 || ret<=0 || xorriso->request_to_abort) { rm_r_problem_handler:; not_removed= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret<0) goto dir_not_removed; } } if(flag&32) {ret= 2; goto ex;} if(not_removed) { dir_not_removed:; sprintf(xorriso->info_text, "Directory not removed: %s", Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); if(ret>0) ret= 3; goto ex; } } #else /* Osirrox_not_yeT */ sprintf(xorriso->info_text, "-rm_rx is not implemented yet"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; #endif /* !Osirrox_not_yeT */ } else { if(!(flag&2)) { /* not rmdir */ sprintf(xorriso->info_text, "%s in disk filesystem is a directory", Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } ret= Dirseq_new(&dirseq, path, 1); if(ret>0) { ret= Dirseq_next_adr(dirseq, sfe, 0); if(ret>0) { sprintf(xorriso->info_text, "Directory not empty on attempt to delete: %s", Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } } } if(xorriso->request_to_abort) {ret= 3; goto ex;} ret= Xorriso_reassure_restore(xorriso, path, (flag&(4|8)) | !!is_dir); if(ret<=0 || ret==3) goto ex; if(is_dir) ret= rmdir(path); else ret= unlink(path); if(ret == -1) { if((flag & 64) && errno == EACCES && !made_accessible) { ret= Xorriso_make_accessible(xorriso, path, 0); if(ret < 0) goto ex; made_accessible= 1; if(is_dir) ret= rmdir(path); else ret= unlink(path); } if(ret == -1) { sprintf(xorriso->info_text, "Cannot delete from disk filesystem %s", Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= -1; goto ex; } } if(flag&16) xorriso->pacifier_count++; ret= 1+!!is_dir; ex:; if(made_accessible) Permstack_pop(&(xorriso->perm_stack), perm_stack_mem, xorriso, 0); if(sfe!=NULL) free(sfe); if(sub_path!=NULL) free(sub_path); Dirseq_destroy(&dirseq, 0); return(ret); } /* @param flag bit0= recursion */ int Xorriso_findx_action(struct XorrisO *xorriso, struct FindjoB *job, char *abs_path, char *show_path, int depth, int flag) { int ret= 0, type, action= 0, dpl= 0, compare_result, uret; uid_t user= 0; gid_t group= 0; time_t date= 0; mode_t mode_or= 0, mode_and= ~1; char *target, *text_2, *wdi_mem= NULL, *disk_prefix, *iso_path= NULL; char *basename; struct FindjoB *subjob; struct stat stbuf; Xorriso_alloc_meM(iso_path, char, SfileadrL); action= Findjob_get_action_parms(job, &target, &text_2, &user, &group, &mode_and, &mode_or, &type, &date, &subjob, 0); if(action<0) action= 0; if(action==15 || action==16 || action==18 || action==19 || action==20) { /* in_iso , not_in_iso, add_missing , empty_iso_dir , is_full_in_iso */ Findjob_get_start_path(job, &disk_prefix, 0); if(strncmp(abs_path, disk_prefix, strlen(disk_prefix))!=0) {ret= -1; goto ex;} dpl= strlen(disk_prefix); if(strlen(target)+strlen(abs_path)-dpl >= SfileadrL) {ret= -1; goto ex;} if(abs_path[dpl]=='/') dpl++; ret= Xorriso_make_abs_adr(xorriso, target, abs_path+dpl, iso_path, 4); if(ret<=0) {goto ex;} } if(action==15) { /* in_iso */ ret= Xorriso_iso_lstat(xorriso, iso_path, &stbuf, 0); if(ret<0) {ret= 1; goto ex;} Text_shellsafe(show_path, xorriso->result_line, 0); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); ret= 1; } else if(action==16) { /* not_in_iso */ ret= Xorriso_compare_2_files(xorriso, abs_path, iso_path, abs_path+dpl, &compare_result, 4); if(retfind_compare_result) xorriso->find_compare_result= ret; if(ret>=0) ret= 1; } else if(action==18) { /* add_missing */ ret= Xorriso_compare_2_files(xorriso, abs_path, iso_path, abs_path+dpl, &compare_result, 4|(1u<<31)); if(retfind_compare_result) xorriso->find_compare_result= ret; if(ret==0) { uret= Xorriso_update_interpreter(xorriso, NULL, NULL, compare_result, abs_path, iso_path, ((flag&1)<<2) | 2); if(uret<=0) ret= 0; } if(ret>=0) ret= 1; } else if(action==19) { /* empty_iso_dir */ ret= Xorriso_iso_lstat(xorriso, iso_path, &stbuf, 0); if(ret<0) {ret= 1; goto ex;} if(!S_ISDIR(stbuf.st_mode)) {ret= 1; goto ex;} ret= Xorriso_rmi(xorriso, NULL, (off_t) 0, iso_path, 1|32); if(ret>0) { sprintf(xorriso->info_text, "Emptied directory "); Text_shellsafe(iso_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0); } } else if(action==20) { /* is_full_in_iso */ ret= Xorriso_iso_lstat(xorriso, iso_path, &stbuf, 0); if(ret<0) {ret= 1; goto ex;} if(!S_ISDIR(stbuf.st_mode)) {ret= 1; goto ex;} wdi_mem= strdup(xorriso->wdi); if(wdi_mem == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); {ret= -1; goto ex;} } strcpy(xorriso->wdi, iso_path); ret= Xorriso_ls(xorriso, 4|8); strcpy(xorriso->wdi, wdi_mem); if(ret>0) { strcpy(xorriso->result_line, "d "); Text_shellsafe(iso_path, xorriso->result_line, 1); strcat(xorriso->result_line, " (ISO) : non-empty directory (would not match mount point)\n"); Xorriso_result(xorriso,0); } {ret= 1; goto ex;} } else if(action == 40) { /* estimate_size */ basename= strrchr(abs_path, '/'); if(basename != NULL) basename++; else basename= abs_path; ret= lstat(abs_path, &stbuf); if(ret != -1) ret= Xorriso_estimate_file_size(xorriso, job, basename, stbuf.st_mode, stbuf.st_size, 0); } else if(action == 44) { /* list_extattr */ ret= Xorriso_list_extattr(xorriso, NULL, abs_path, show_path, target, 2); } else { Xorriso_esc_filepath(xorriso,show_path, xorriso->result_line, 0); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); ret= 1; } ex:; if(action==15 || action==16 || action==18 || action==19 || action==20) if(xorriso->no_volset_present) xorriso->request_to_abort= 1; /* Need an image. No use to try again. */ if(wdi_mem != NULL) free(wdi_mem); Xorriso_free_meM(iso_path); return(ret); } /* @param flag bit0=recursion */ int Xorriso_findx(struct XorrisO *xorriso, struct FindjoB *job, char *abs_dir_parm, char *dir_path, struct stat *dir_stbuf, int depth, struct LinkiteM *link_stack, int flag) { int ret,is_link, no_dive; struct DirseQ *dirseq= NULL; struct stat stbuf; struct LinkiteM *own_link_stack; char *abs_dir_path, *namept; char *name= NULL, *path= NULL, *sfe= NULL; char *abs_dir_path_data= NULL, *abs_path= NULL; job->depth= depth; if(xorriso->request_to_abort) {ret= 0; goto ex;} Xorriso_alloc_meM(sfe, char, 5*SfileadrL); Xorriso_alloc_meM(name, char, SfileadrL); Xorriso_alloc_meM(path, char, SfileadrL); Xorriso_alloc_meM(abs_dir_path_data, char, SfileadrL); Xorriso_alloc_meM(abs_path, char, SfileadrL); own_link_stack= link_stack; abs_dir_path= abs_dir_parm; if(abs_dir_path[0]==0) { ret= Xorriso_make_abs_adr(xorriso, xorriso->wdx, dir_path, abs_dir_path_data, 1|2|8); if(ret<=0) goto ex; abs_dir_path= abs_dir_path_data; ret= Xorriso_path_is_excluded(xorriso, abs_dir_path, !(flag&1)); if(ret<0) goto ex; if(ret>0) {ret= 0; goto ex;} ret= lstat(abs_dir_path, dir_stbuf); if(ret==-1) {ret= 0; goto ex;} if(S_ISLNK(dir_stbuf->st_mode) && (xorriso->do_follow_links || (xorriso->do_follow_param && !(flag&1)))) if(stat(abs_dir_path, &stbuf)!=-1) if(dir_stbuf->st_dev == stbuf.st_dev || (xorriso->do_follow_mount || (xorriso->do_follow_param && !(flag&1)))) memcpy(dir_stbuf, &stbuf, sizeof(struct stat)); namept= strrchr(dir_path, '/'); if(namept==NULL) namept= dir_path; else namept++; ret= Findjob_test_2(xorriso, job, NULL, namept, dir_path, NULL, dir_stbuf, 0); if(ret<0) goto ex; if(ret>0) { ret= Xorriso_findx_action(xorriso, job, abs_dir_path, dir_path, depth, flag&1); if(xorriso->request_to_abort) {ret= 0; goto ex;} if(ret<=0) { if(Xorriso_eval_problem_status(xorriso, ret, 1|2)<0) goto ex; } } } if(xorriso->request_to_abort) {ret= 1; goto ex;} if(!S_ISDIR(dir_stbuf->st_mode)) {ret= 2; goto ex;} ret= Dirseq_new(&dirseq, abs_dir_path, 1); if(ret<0) { sprintf(xorriso->info_text, "Cannot obtain disk directory iterator"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } if(ret==0) {ret= 2; goto ex;} job->depth++; while(!xorriso->request_to_abort) { Linkitem_reset_stack(&own_link_stack, link_stack, 0); ret= Dirseq_next_adr(dirseq,name,0); if(ret==0) break; if(ret<0) { sprintf(xorriso->info_text,"Failed to obtain next directory entry"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } ret= Xorriso_make_abs_adr(xorriso, abs_dir_path, name, abs_path, 1); if(ret<=0) goto ex; ret= Xorriso_make_abs_adr(xorriso, dir_path, name, path, 4); if(ret<=0) goto ex; ret= Xorriso_path_is_excluded(xorriso, abs_path, 0); /* (is never param) */ if(ret<0) goto ex; if(ret>0) continue; ret= lstat(abs_path, &stbuf); if(ret==-1) continue; no_dive= 0; is_link= S_ISLNK(stbuf.st_mode); if(is_link && xorriso->do_follow_links) { ret= Xorriso_hop_link(xorriso, abs_path, &own_link_stack, &stbuf, 2); if(ret<0) {ret= -1; goto ex;} if(ret!=1) no_dive= 1; } ret= Findjob_test_2(xorriso, job, NULL, name, path, dir_stbuf, &stbuf, 0); if(ret<0) goto ex; if(ret>0) { ret= Xorriso_findx_action(xorriso, job, abs_path, path, depth, flag&1); if(xorriso->request_to_abort) {ret= 0; goto ex;} if(ret<=0) { if(Xorriso_eval_problem_status(xorriso, ret, 1|2)<0) goto ex; } } if(!S_ISDIR(stbuf.st_mode)) no_dive= 1; if(dir_stbuf->st_dev != stbuf.st_dev && !xorriso->do_follow_mount) no_dive= 1; if(!no_dive) { ret= Xorriso_findx(xorriso, job, abs_path, path, &stbuf, depth+1, own_link_stack, flag|1); if(ret<0) goto ex; } } ret= 1; ex:; job->depth= depth; Xorriso_free_meM(sfe); Xorriso_free_meM(name); Xorriso_free_meM(path); Xorriso_free_meM(abs_dir_path_data); Xorriso_free_meM(abs_path); Dirseq_destroy(&dirseq, 0); return(ret); } /* @param flag bit0= no hardlink reconstruction bit1= do not set xorriso->node_*_prefixes bit5= -extract_single: eventually do not insert directory tree */ int Xorriso_restore_sorted(struct XorrisO *xorriso, int count, char **src_array, char **tgt_array, int *problem_count, int flag) { int i, ret, with_node_array= 0, hflag= 0, hret; *problem_count= 0; if(!(((xorriso->ino_behavior & 16) && xorriso->do_restore_sort_lba) || (xorriso->ino_behavior & 4) || (flag & 1))) { ret= Xorriso_make_hln_array(xorriso, 0); if(ret<=0) goto ex; } if(xorriso->do_restore_sort_lba) { /* Count affected nodes */ Xorriso_destroy_node_array(xorriso, 0); for(i= 0; i < count; i++) { if(src_array[i] == NULL || tgt_array[i] == NULL) continue; /* sort_lba : Make directories plus node_array and then run array extractor (with eventual hardlink detection) */ hflag= (1 << 7) | ((!!(flag & 2)) << 9) | (flag & 32); ret= Xorriso_restore(xorriso, src_array[i], tgt_array[i], (off_t) 0, (off_t) 0, hflag); if(ret <= 0) { (*problem_count)++; hret= Xorriso_eval_problem_status(xorriso, ret, 1 | 2); if(hret < 0) goto ex; } with_node_array= 1; } } if(with_node_array) { /* Allocate and fill node array */ if(xorriso->node_counter <= 0) {ret= 2; goto ex;} ret= Xorriso_new_node_array(xorriso, xorriso->temp_mem_limit, 0, !xorriso->do_restore_sort_lba); if(ret<=0) goto ex; for(i= 0; i < count; i++) { if(src_array[i] == NULL || tgt_array[i] == NULL) continue; ret= Xorriso_restore(xorriso, src_array[i], tgt_array[i], (off_t) 0, (off_t) 0, (2 << 7) | (flag & 32)); if(ret <= 0) { (*problem_count)++; hret= Xorriso_eval_problem_status(xorriso, ret, 1 | 2); if(hret < 0) goto ex; } } } /* Perform restore operations */ if(xorriso->do_restore_sort_lba) { ret= Xorriso_restore_node_array(xorriso, 0); if(ret <= 0) goto ex; } else { for(i= 0; i < count; i++) { if(src_array[i] == NULL || tgt_array[i] == NULL) continue; ret= Xorriso_restore(xorriso, src_array[i], tgt_array[i], (off_t) 0, (off_t) 0, flag & 32); if(ret <= 0) { (*problem_count)++; hret= Xorriso_eval_problem_status(xorriso, ret, 1 | 2); if(hret < 0) goto ex; } } } ret= 1; ex:; return(ret); } /* @param flag bit0= path is a directory bit2= recursion: do not reassure in mode 2 "tree" bit3-7= question text mode 0= plain removal 1= replacing file object 2= overwriting of content, keeping file object 3= appending of content, keeping file object */ int Xorriso_reassure_restore(struct XorrisO *xorriso, char *path, int flag) { int ret, mode; mode= (flag >> 3) & 31; while((xorriso->do_reassure==1 || (xorriso->do_reassure==2 && !(flag&4))) && !xorriso->request_not_to_ask) { /* ls -ld */ Xorriso_lsx_filev(xorriso, xorriso->wdx, 1, &path, (off_t) 0, 1|2|8); if(flag&1) /* du -s */ Xorriso_lsx_filev(xorriso, xorriso->wdx, 1, &path, (off_t) 0, 2|4); if(mode == 3) sprintf(xorriso->info_text, "File exists. Append content ? n= no, y= yes, x= abort, @= stop asking\n"); else if(mode == 2) sprintf(xorriso->info_text, "File exists. Overwrite content ? n= no, y= yes, x= abort, @= stop asking\n"); else if(mode == 1) sprintf(xorriso->info_text, "File exists. Remove ? n= keep old, y= remove, x= abort, @= stop asking\n"); else sprintf(xorriso->info_text, "Remove above file ? n= keep it, y= remove it, x= abort, @= stop asking\n"); Xorriso_info(xorriso, 4); ret= Xorriso_request_confirmation(xorriso, 1|2|4|16); if(ret<=0) goto ex; if(xorriso->request_to_abort) { sprintf(xorriso->info_text, "File alteration operation aborted by user before file: "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= 3; goto ex; } if(ret==3) continue; if(ret==6) /* yes */ break; if(ret==4) { /* yes, do not ask again */ xorriso->request_not_to_ask= 1; break; } if(ret==1) { /* no */ sprintf(xorriso->info_text, "Kept in existing state: "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= 3; goto ex; } } ret= 1; ex: return(ret); } /* @param flag bit7= return 4 if restore fails from denied permission do not issue error message @return <=0 failure , 1 success , 4 with bit7: permission to create file was denied */ int Xorriso_make_tmp_path(struct XorrisO *xorriso, char *orig_path, char *tmp_path, int *fd, int flag) { char *cpt; cpt= strrchr(orig_path, '/'); if(cpt==NULL) tmp_path[0]= 0; else { strncpy(tmp_path, orig_path, cpt+1-orig_path); tmp_path[cpt+1-orig_path]= 0; } strcat(tmp_path, "_tmp_xorriso_restore_XXXXXX"); *fd= mkstemp(tmp_path); if(*fd==-1) { if(errno == EACCES && (flag & 128)) return(4); strcpy(xorriso->info_text, "Cannot create temporary file : "); Text_shellsafe(tmp_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); return(0); } fchmod(*fd, S_IRUSR|S_IWUSR); return(1); } /* @param flag bit0= change regardless of xorriso->do_auto_chmod bit1= desired is only rx @return -1=severe error , -2= cannot chmod, 0= nothing to do, 1 = chmoded */ int Xorriso_auto_chmod(struct XorrisO *xorriso, char *disk_path, int flag) { int ret, is_link= 0; char *path_pt, *link_target= NULL; mode_t mode, desired= S_IRUSR | S_IWUSR | S_IXUSR; struct stat stbuf; Xorriso_alloc_meM(link_target, char, SfileadrL); if(!(xorriso->do_auto_chmod || (flag & 1))) {ret= 0; goto ex;} if(flag & 2) desired &= ~S_IWUSR; path_pt= disk_path; ret= lstat(path_pt, &stbuf); if(ret==-1) {ret= 0; goto ex;} if(S_ISLNK(stbuf.st_mode)) { is_link= 1; ret= stat(path_pt, &stbuf); if(ret==-1) {ret= 0; goto ex;} } if(!S_ISDIR(stbuf.st_mode)) {ret= 0; goto ex;} if(is_link) { ret= Xorriso_resolve_link(xorriso, path_pt, link_target, 0); if(ret<=0) goto ex; path_pt= link_target; } if((stbuf.st_mode & desired) == desired) {ret= 0; goto ex;} if(stbuf.st_uid!=geteuid()) {ret= -2; goto ex;} mode= (stbuf.st_mode | desired) & 07777; ret= chmod(path_pt, mode); if(ret==-1) { sprintf(xorriso->info_text, "Cannot change access permissions of disk directory: chmod %o ", (unsigned int) (mode & 07777)); Text_shellsafe(path_pt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "SORRY", 0); {ret= -2; goto ex;} } ret= Permstack_push(&(xorriso->perm_stack), path_pt, &stbuf, 0); if(ret<=0) goto ex; ret= 1; ex:; Xorriso_free_meM(link_target); return(ret); } int Xorriso_make_accessible(struct XorrisO *xorriso, char *disk_path, int flag) { int done= 0, ret, just_rx= 2; char *npt, *apt, *path, *wpt; Xorriso_alloc_meM(path, char, SfileadrL); apt= disk_path; wpt= path; for(npt= apt; !done; apt= npt + 1) { npt= strchr(apt, '/'); if(npt == NULL) break; if(strchr(npt + 1, '/') == NULL) just_rx= 0; strncpy(wpt, apt, npt + 1 - apt); wpt+= npt + 1 - apt; *wpt= 0; ret= Xorriso_auto_chmod(xorriso, path, just_rx); if(ret == -1) {ret= -1; goto ex;} if(ret == -2) {ret= 0; goto ex;} } ret= 1; ex: Xorriso_free_meM(path); return(ret); } /* @param flag bit0= prefer to find a match after *img_prefixes (but deliver img_prefixes if no other can be found) */ int Xorriso_make_restore_path(struct XorrisO *xorriso, struct Xorriso_lsT **img_prefixes, struct Xorriso_lsT **disk_prefixes, char img_path[SfileadrL], char disk_path[SfileadrL], int flag) { int li; struct Xorriso_lsT *s, *d, *found_s= NULL, *found_d= NULL; char *ipfx, *dpfx; /* Obtain disk_path by replacing start piece of img_path */ d= *disk_prefixes; for(s= *img_prefixes; s != NULL; s= Xorriso_lst_get_next(s, 0), d= Xorriso_lst_get_next(d, 0)) { ipfx= Xorriso_lst_get_text(s, 0); li= strlen(ipfx); dpfx= Xorriso_lst_get_text(d, 0); if(li == 1 && ipfx[0] == '/') { li= 0; if(img_path[0] != '/') continue; } else { if(strncmp(img_path, ipfx, li) != 0) continue; if(img_path[li] != 0 && img_path[li] != '/') continue; } if(strlen(dpfx) + strlen(img_path) - li + 1 >= SfileadrL) return(-1); if(img_path[li]=='/') { if(dpfx[0] == '/' && dpfx[1] == 0) sprintf(disk_path, "/%s", img_path + li + 1); else sprintf(disk_path, "%s/%s", dpfx, img_path + li + 1); } else strcpy(disk_path, dpfx); /* img_path[li] is 0, img_path equals ipfx */ found_s= s; found_d= d; if(s != *img_prefixes || !(flag & 1)) break; } *img_prefixes= found_s; *disk_prefixes= found_d; return(found_s != NULL); } /* @param flag bit0=permission to run Xorriso_make_accessible */ int Xorriso_restore_make_hl(struct XorrisO *xorriso, char *old_path, char *new_path, int flag) { int ret; struct PermiteM *perm_stack_mem; ret= link(old_path, new_path); if(ret == 0) return(1); if(errno == EACCES && (flag & 1)) { perm_stack_mem= xorriso->perm_stack; ret= Xorriso_make_accessible(xorriso, new_path, 0); if(ret > 0) { ret= link(old_path, new_path); if(ret == 0) { Permstack_pop(&(xorriso->perm_stack), perm_stack_mem, xorriso, 0); return(1); } } Permstack_pop(&(xorriso->perm_stack), perm_stack_mem, xorriso, 0); } sprintf(xorriso->info_text, "Hardlinking failed: "); Text_shellsafe(new_path, xorriso->info_text, 1); strcat(xorriso->info_text, " -> "); Text_shellsafe(old_path, xorriso->info_text, 1 | 2); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "WARNING", 0); return(0); } int Xorriso_afile_fopen(struct XorrisO *xorriso, char *filename, char *mode, FILE **ret_fp, int flag) /* bit0= do not print error message on failure bit1= do not open stdin */ { FILE *fp= NULL; *ret_fp= NULL; if(strcmp(filename,"-")==0) { if(mode[0]=='a' || mode[0]=='w' || (mode[0]=='r' && mode[1]=='+') || (mode[0]=='r' && mode[1]=='b' && mode[2]=='+')) fp= stdout; else if(flag & 2) { Xorriso_msgs_submit(xorriso, 0, "Not allowed as input path: '-'", 0, "FAILURE", 0); return(0); } else { Xorriso_msgs_submit(xorriso, 0, "Ready for data at standard input", 0, "NOTE", 0); fp= stdin; } } else if(strncmp(filename,"tcp:",4)==0){ Xorriso_msgs_submit(xorriso, 0, "TCP/IP service isn't implemented yet.", 0, "FAILURE", 0); } else if(strncmp(filename,"file:",5)==0){ fp= fopen(filename+5,mode); } else { fp= fopen(filename,mode); } if(fp==NULL){ if(!(flag&1)) { sprintf(xorriso->info_text, "Failed to open file '%s' in %s mode", filename, mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); } return(0); } *ret_fp= fp; return(1); } /* @param flag bit0= make absolute command paths with known systems bit1= do not allow prefixes with cmd bit2= interpret unprefixed cmd as shell: bit3= do not care for device filetype */ int Xorriso_make_mount_cmd(struct XorrisO *xorriso, char *cmd, int lba, int track, int session, char *volid, char *devadr, char result[SfileadrL], int flag) { int ret, reg_file= 0, is_safe= 0, sys_code= 0; char *form= NULL, session_text[12], track_text[12], lba_text[12]; char *vars[5][2], *sfe= NULL, *volid_sfe= NULL, *cpt, *sysname; char *cooked_dev= NULL, *eff_dev; struct stat stbuf; Xorriso_alloc_meM(form, char, 6 * SfileadrL); Xorriso_alloc_meM(sfe, char, 5 * SfileadrL); Xorriso_alloc_meM(volid_sfe, char, 5 * 80 + 1); Xorriso_alloc_meM(cooked_dev, char, SfileadrL); if(strlen(cmd) > SfileadrL) { Xorriso_msgs_submit(xorriso, 0, "Argument much too long", 0, "FAILURE", 0); {ret= 0; goto ex;} } eff_dev= devadr; ret= stat(devadr, &stbuf); if(ret != -1 && !(flag & 8)) if(S_ISREG(stbuf.st_mode)) reg_file= 1; if(strncmp(cmd, "linux:", 6) == 0 && !(flag & 2)) { cpt= cmd + 6; sys_code= 1; } else if(strncmp(cmd, "freebsd:", 8) == 0 && !(flag & 2)) { cpt= cmd + 8; sys_code= 2; } else if(strncmp(cmd, "netbsd:", 7) == 0 && !(flag & 2)) { cpt= cmd + 7; sys_code= 3; } else if(strncmp(cmd, "string:", 7) == 0 && !(flag & 2)) { cpt= cmd + 7; strcpy(form, cpt); } else if(flag & 4) { cpt= cmd; strcpy(form, cpt); } else { cpt= cmd; ret= System_uname(&sysname, NULL, NULL, NULL, 0); if(ret <= 0) { Xorriso_msgs_submit(xorriso, 0, "-mount*: Cannot determine current system type", 0, "FAILURE", 0); {ret= 0; goto ex;} } else if(strcmp(sysname, "FreeBSD") == 0 || strcmp(sysname, "GNU/kFreeBSD") == 0) { /* "GNU/kFreeBSD" = Debian kfreebsd */ sys_code= 2; } else if(strcmp(sysname, "NetBSD") == 0) { sys_code= 3; } else if(strcmp(sysname, "Linux") == 0) { sys_code= 1; } else { sprintf(xorriso->info_text, "-mount*: Unsupported system type %s", Text_shellsafe(sysname, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } if(sys_code == 1) { /* GNU/Linux */ sprintf(form, "%smount -t iso9660 -o %snodev,noexec,nosuid,ro,sbsector=%%sbsector%% %%device%% %s", (flag & 1 ? "/bin/" : ""), (reg_file || (xorriso->mount_opts_flag & 1) ? "loop," : ""), Text_shellsafe(cpt, sfe, 0)); is_safe= 1; } else if(sys_code == 2 || sys_code == 3) { /* FreeBSD , NetBSD */ if(reg_file) { /* <<< Considered to create vnode as of J.R. Oldroyd , 20 Nov 2008 but for now refraining from creating that persistent file object strcpy(form, "n=$(mdconfig -a -t vnode -f %device%)"); sprintf(form + strlen(form), " && mount -t cd9660 -o noexec,nosuid -s %%sbsector%% /dev/\"$n\" %s", Text_shellsafe(cmd+8, sfe, 0)); */ Xorriso_msgs_submit(xorriso, 0, "Detected regular file as mount device with BSD style command.", 0, "FAILURE", 0); if(sys_code == 2) { Xorriso_msgs_submit(xorriso, 0, "Command mdconfig -a -t vnode -f can create a device node which uses the file", 0, "HINT", 0); } else { Xorriso_msgs_submit(xorriso, 0, "Command vnconfig -c vndX can create a device node which uses the file", 0, "HINT", 0); } {ret= 0; goto ex;} } else { if(sys_code == 3 && strncmp(devadr, "/dev/rcd", 8) == 0) { sprintf(cooked_dev, "/dev/cd%s", devadr + 8); eff_dev= cooked_dev; } sprintf(form, "%smount_cd9660 -o noexec,nosuid -s %%sbsector%% %%device%% %s", (flag & 1 ? "/sbin/" : ""), Text_shellsafe(cpt, sfe, 0)); } is_safe= 1; } sprintf(session_text, "%d", session); sprintf(track_text, "%d", track); sprintf(lba_text, "%d", lba); vars[0][0]= "sbsector"; vars[0][1]= lba_text; vars[1][0]= "track"; vars[1][1]= track_text; vars[2][0]= "session"; vars[2][1]= session_text; vars[3][0]= "volid"; vars[3][1]= Text_shellsafe(volid, volid_sfe, 0); vars[4][0]= "device"; vars[4][1]= Text_shellsafe(eff_dev, sfe, 0); ret= Sregex_resolve_var(form, vars, 5, "%", "%", "%", result, SfileadrL, 0); if(ret <= 0) goto ex; ret= 1 + is_safe; ex:; Xorriso_free_meM(cooked_dev); Xorriso_free_meM(volid_sfe); Xorriso_free_meM(sfe); Xorriso_free_meM(form); return(ret); } int Xorriso_append_scdbackup_record(struct XorrisO *xorriso, int flag) { FILE *fp= NULL; char dummy[81], name[81], timestamp[81], size[81], md5[81]; if(xorriso->scdbackup_tag_written[0] == 0) return(1); name[0]= timestamp[0]= size[0]= md5[0]= 0; sscanf(xorriso->scdbackup_tag_written, "%s %s %s %s %s %s %s", dummy, dummy, dummy, name, timestamp, size, md5); sprintf(xorriso->info_text, "scdbackup tag written : %s %s %s %s\n", name, timestamp, size, md5); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); if(xorriso->scdbackup_tag_listname[0]) { fp= fopen(xorriso->scdbackup_tag_listname, "a"); if(fp==0) { strcpy(xorriso->info_text, "-scdbackup_tag: Cannot open file "); Text_shellsafe(xorriso->scdbackup_tag_listname, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } fprintf(fp, "%s %s %s %s\n", name, timestamp, size, md5); fclose(fp); } return(1); } /* @param flag bit0= for append rather than overwrite */ int Xorriso_is_concat_target(struct XorrisO *xorriso, char *target, int *ftype, int *fd, int flag) { int ret; char *why= ""; *ftype= 0; *fd = -1; if(strcmp(target, "-") == 0) { *fd= 1; *ftype= 8; /* character device */ return(1); } *ftype= Sfile_type(target, 1 | 8 | 16); if(*ftype == -1) return(2); /* not yet existing regular */ if(*ftype & 1024) { *fd= Sfile_get_dev_fd_no(target, 0); *ftype &= ~1024; } if(*ftype & 2048) { why= "fstat(2) returned -1 on file descriptor number."; goto not_usable; } if(*ftype == 3) { if(!xorriso->do_follow_concat) { why= "May not follow symbolic link. No -follow \"...:concat:...\"."; goto not_usable; } *ftype= Sfile_type(target, 1 | 4 | 8); if(*ftype == -1) return(2); /* not yet existing regular */ } if(*ftype == 2) { why= "May not write data into a directory."; goto not_usable; } if(*ftype == 0) { why= "Cannot determine file type."; goto not_usable; } if(*ftype == 7) { /* >>> what to do with UNIX socket ? */; why= "Cannot yet handle socket file as target."; goto not_usable; } if(xorriso->do_overwrite != 1 && xorriso->do_overwrite != 2) { why= "May not alter existing file."; goto not_usable; } ret= Xorriso_reassure_restore(xorriso, target, (2 + (flag & 1)) << 3); if(ret <= 0 || ret == 0) { why= "User revoked alteration of existing file."; goto not_usable; } if(*ftype == 1) return(2); /* existing regular */ if(*ftype == 4 || *ftype == 6 || *ftype == 8) return(1); /* named pipe, block device, character device */ not_usable:; sprintf(xorriso->info_text, "Unsuitable -concat target: "); Text_shellsafe(target, xorriso->info_text, 1); sprintf(xorriso->info_text + strlen(xorriso->info_text), ". %s", why); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } int Xorriso_concat(struct XorrisO *xorriso, char *mode, char *target, int progc, char **progv, int filec, char **filev, int flag) { int ret, i, fd= -1, target_is_regular= 0, fd_opened= 0, ftype, prog_forked= 0; int status; int open_mode= O_WRONLY | O_CREAT; struct stat stbuf; pid_t forked_pid; for(i= 0; i < filec; i++) { ret= Xorriso_iso_lstat(xorriso, filev[i], &stbuf, 4); if(ret == -1) goto ex; if(!S_ISREG(stbuf.st_mode)) { sprintf(xorriso->info_text, "-concat: iso_rr_path is not a regular data file: "); Text_shellsafe(filev[i], xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } if(strcmp(mode, "overwrite") == 0) { ret= Xorriso_is_concat_target(xorriso, target, &ftype, &fd, 0); if(ret <= 0) goto ex; if(ret == 2) { target_is_regular= 1; open_mode |= O_TRUNC; } if(fd == -1) { fd= open(target, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 0666); fd_opened= 1; } } else if(strcmp(mode, "append") == 0) { ret= Xorriso_is_concat_target(xorriso, target, &ftype, &fd, 1); if(ret <= 0) goto ex; target_is_regular= (ret == 2); if(fd == -1) { fd= open(target, O_WRONLY | O_CREAT | O_BINARY, 0666); fd_opened= 1; if(fd != -1 && target_is_regular) { ret= lseek(fd, (off_t) 0, SEEK_END); if(ret == -1) { sprintf(xorriso->info_text, "-concat append: Cannot lseek(2) to file end of "); Text_shellsafe(target, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } } } else if(strcmp(mode, "pipe") == 0) { ret= Xorriso_pipe_open(xorriso, "-concat pipe", progv[0], progc, progv, "", &fd, &forked_pid, 2 | 8); if(ret <= 0) goto ex; fd_opened= 1; prog_forked= 1; } else { sprintf(xorriso->info_text, "-concat: Unknown mode "); Text_shellsafe(mode, xorriso->info_text, 1); strcat(xorriso->info_text, ". Known modes: overwrite, append, pipe"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(fd == -1) { sprintf(xorriso->info_text, "-concat: Cannot open file handle to "); Text_shellsafe(target, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } for(i= 0; i < filec; i++) { ret= Xorriso_iso_file_to_fd(xorriso, filev[i], fd, 0); if(ret <= 0) { if(i < filec - 1) { ret= Xorriso_eval_problem_status(xorriso, ret, 1 | 2); if(ret < 0) { sprintf(xorriso->info_text, "-concat: Aborted although %d files stay unprocessed.", filec - i + 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } } } ret= 1; ex:; if(fd_opened && fd != -1) close(fd); if(prog_forked) Xorriso_wait_child_end(xorriso, forked_pid, &status, 0); return(ret); } libisoburn-1.5.4/xorriso/sort_cmp.h0000644000175700017510000000376113701321754014340 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2010 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of functions which sort and compare tree nodes. */ #ifndef Xorriso_pvt_sort_cmp_includeD #define Xorriso_pvt_sort_cmp_includeD yes int Xorriso__findi_sorted_ino_cmp(const void *p1, const void *p2); int Xorriso__hln_cmp(const void *p1, const void *p2); int Xorriso__findi_sorted_cmp(const void *p1, const void *p2); int Xorriso__search_node(void *node_array[], int n, int (*cmp)(const void *p1, const void *p2), void *node, int *idx, int flag); int Xorriso_search_in_hln_array(struct XorrisO *xorriso, void *node, int *idx, int flag); int Xorriso__get_di(IsoNode *node, dev_t *dev, ino_t *ino, int flag); int Xorriso__di_ino_cmp(const void *p1, const void *p2); int Xorriso__di_cmp(const void *p1, const void *p2); int Xorriso__sort_di(void *node_array[], int count, int flag); int Xorriso_invalidate_di_item(struct XorrisO *xorriso, IsoNode *node, int flag); int Xorriso_search_di_range(struct XorrisO *xorriso, IsoNode *node, int *idx, int *low, int *high, int flag); int Xorriso__node_lba_cmp(const void *node1, const void *node2); int Xorriso__node_name_cmp(const void *node1, const void *node2); int Xorriso_sorted_node_array(struct XorrisO *xorriso, IsoDir *dir_node, int *nodec, IsoNode ***node_array, off_t boss_mem, int flag); int Xorriso_remake_hln_array(struct XorrisO *xorriso, int flag); int Xorriso_make_di_array(struct XorrisO *xorriso, int flag); int Xorriso_search_hardlinks(struct XorrisO *xorriso, IsoNode *node, int *node_idx, int *min_hl, int *max_hl, int flag); #endif /* ! Xorriso_pvt_sort_cmp_includeD */ libisoburn-1.5.4/xorriso/iso_img.c0000644000175700017510000031042613762644771014150 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains functions which operate on ISO images and their global properties. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" #include "lib_mgt.h" #include "iso_img.h" #include "iso_tree.h" #include "drive_mgt.h" int Xorriso_set_ignore_aclea(struct XorrisO *xorriso, int flag) { int ret, hflag; IsoImage *volume; ret= Xorriso_get_volume(xorriso, &volume, 1); if(ret<=0) return(ret); hflag= (~xorriso->do_aaip) & 1; if((xorriso->ino_behavior & (1 | 2)) && !(xorriso->do_aaip & (4 | 16))) hflag|= 2; if(xorriso->do_aaip & 1024) hflag|= 8; iso_image_set_ignore_aclea(volume, hflag); return(1); } int Xorriso_update_volid(struct XorrisO *xorriso, int flag) { int gret, sret= 1; gret= Xorriso_get_volid(xorriso, xorriso->loaded_volid, 0); if(gret<=0 || (!xorriso->volid_default) || xorriso->loaded_volid[0]==0) sret= Xorriso_set_volid(xorriso, xorriso->volid, 1); return(gret>0 && sret>0); } int Xorriso_create_empty_iso(struct XorrisO *xorriso, int flag) { int ret; IsoImage *volset; struct isoburn_read_opts *ropts; struct burn_drive_info *dinfo= NULL; struct burn_drive *drive= NULL; if(xorriso->out_drive_handle != NULL) { ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to attach volset to drive", 2); if(ret<=0) return(ret); } if(xorriso->in_volset_handle!=NULL) { iso_image_unref((IsoImage *) xorriso->in_volset_handle); xorriso->in_volset_handle= NULL; Sectorbitmap_destroy(&(xorriso->in_sector_map), 0); Xorriso_destroy_di_array(xorriso, 0); Xorriso_destroy_hln_array(xorriso, 0); xorriso->loaded_volid[0]= 0; xorriso->volset_change_pending= 0; xorriso->boot_count= 0; xorriso->no_volset_present= 0; } ret= isoburn_ropt_new(&ropts, 0); if(ret<=0) return(ret); /* Note: no return before isoburn_ropt_destroy() */ isoburn_ropt_set_extensions(ropts, isoburn_ropt_pretend_blank); isoburn_ropt_set_input_charset(ropts, xorriso->in_charset); isoburn_ropt_set_data_cache(ropts, 1, 1, 0); isoburn_set_read_pacifier(drive, NULL, NULL); isoburn_ropt_set_truncate_mode(ropts, 1, xorriso->file_name_limit); ret= isoburn_read_image(drive, ropts, &volset); Xorriso_process_msg_queues(xorriso,0); isoburn_ropt_destroy(&ropts, 0); if(ret<=0) { sprintf(xorriso->info_text, "Failed to create new empty ISO image object"); Xorriso_report_iso_error(xorriso, "", ret, xorriso->info_text, 0, "FATAL", 0); return(-1); } xorriso->in_volset_handle= (void *) volset; xorriso->in_sector_map= NULL; Xorriso_update_volid(xorriso, 0); xorriso->volset_change_pending= 0; xorriso->boot_count= 0; xorriso->system_area_clear_loaded= (strcmp(xorriso->system_area_disk_path, "/dev/zero") == 0); xorriso->no_volset_present= 0; return(1); } int Xorriso_record_boot_info(struct XorrisO *xorriso, int flag) { int ret; struct burn_drive_info *dinfo; struct burn_drive *drive; IsoImage *image; ElToritoBootImage *bootimg; IsoFile *bootimg_node; IsoBoot *bootcat_node; xorriso->loaded_boot_bin_lba= -1; xorriso->loaded_boot_cat_path[0]= 0; ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to record boot LBAs", 0); if(ret<=0) return(0); image= isoburn_get_attached_image(drive); if(image == NULL) return(0); ret= iso_image_get_boot_image(image, &bootimg, &bootimg_node, &bootcat_node); iso_image_unref(image); /* release obtained reference */ if(ret != 1) return(0); if(bootimg_node != NULL) Xorriso__file_start_lba((IsoNode *) bootimg_node, &(xorriso->loaded_boot_bin_lba), 0); if(bootcat_node != NULL) Xorriso_path_from_lba(xorriso, (IsoNode *) bootcat_node, 0, xorriso->loaded_boot_cat_path, 0); return(1); } int Xorriso_assert_volid(struct XorrisO *xorriso, int msc1, int flag) { int ret, image_blocks; char volid[33]; struct burn_drive_info *dinfo; struct burn_drive *drive; if(xorriso->assert_volid[0] == 0) return(1); ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to perform -assert_volid", 0); if(ret<=0) return(0); ret= isoburn_read_iso_head(drive, msc1, &image_blocks, volid, 1); Xorriso_process_msg_queues(xorriso,0); if(ret <= 0) { sprintf(xorriso->info_text, "-assert_volid: Cannot determine Volume Id at LBA %d.", msc1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, xorriso->assert_volid_sev, 0); return(0); } ret= Sregex_match(xorriso->assert_volid, volid, 0); if(ret < 0) return(2); if(ret == 0) { strcpy(xorriso->info_text, "-assert_volid: Volume id does not match pattern: "); Text_shellsafe(xorriso->assert_volid, xorriso->info_text, 1); strcat(xorriso->info_text, " <> "); Text_shellsafe(volid, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, xorriso->assert_volid_sev, 0); return(0); } return(ret); } /* @return <0 yes , 0 no , <0 error */ int Xorriso_is_isohybrid(struct XorrisO *xorriso, IsoFile *bootimg_node, int flag) { int ret; unsigned char buf[68]; void *data_stream= NULL; ret= Xorriso_iso_file_open(xorriso, "", (void *) bootimg_node, &data_stream, 1); if(ret <= 0) return(-1); ret= Xorriso_iso_file_read(xorriso, data_stream, (char *) buf, 68, 0); Xorriso_iso_file_close(xorriso, &data_stream, 0); if(ret <= 0) return(0); if(buf[64] == 0xfb && buf[65] == 0xc0 && buf[66] == 0x78 && buf[67] == 0x70) return(1); return(0); } int Xorriso_image_has_md5(struct XorrisO *xorriso, int flag) { int ret; IsoImage *image; uint32_t start_lba, end_lba; char md5[16]; ret= Xorriso_get_volume(xorriso, &image, 0); if(ret<=0) return(ret); ret= iso_image_get_session_md5(image, &start_lba, &end_lba, md5, 0); Xorriso_process_msg_queues(xorriso,0); if(ret <= 0) return(0); return(1); } static const char *un0(const char *text) { if(text == NULL) return(""); return(text); } static int Xorriso_report_pvd_time(struct XorrisO *xorriso, char *head, char *pvd_time, int flag) { char *msg, hr[17]; int at; msg= xorriso->result_line; strncpy(hr, pvd_time, 16); hr[16]= 0; sprintf(msg, "%s %s\n", head, hr); Xorriso_result(xorriso,0); if(pvd_time[16] != 0) { at= abs(pvd_time[16]); sprintf(msg, "%2.2s. Time Zone: %c%-2.2d:%-2.2d\n", head, pvd_time[16] > 0 ? '+' : '-', at / 4, (at - (at / 4) * 4) * 15); Xorriso_result(xorriso,0); } return(1); } int Xorriso_pvd_info(struct XorrisO *xorriso, int flag) { int ret, msc1= -1, msc2, i; IsoImage *image; struct burn_drive_info *dinfo; struct burn_drive *drive; char *msg, block_head[8], *crt, *mdt, *ext, *eft; off_t head_count; msg= xorriso->result_line; ret= Xorriso_get_volume(xorriso, &image, 0); if(ret<=0) return(ret); ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "", 16); if(ret > 0) { ret= Xorriso_msinfo(xorriso, &msc1, &msc2, 1 | 4); if(ret<0) return(ret); Xorriso_toc(xorriso, 128); if(msc1 >= 0) { for(i = msc1 + 16; i < msc1 + 32; i++) { ret= burn_read_data(drive, (off_t) i * (off_t) 2048, block_head, (off_t) sizeof(block_head), &head_count, 2); if(ret <= 0) { i= msc1 + 32; break; } if(block_head[0] == 1 && strncmp(block_head + 1, "CD001", 5) == 0) break; } if(i < msc1 + 32) { sprintf(msg, "PVD address : %ds\n", i); Xorriso_result(xorriso,0); } } } sprintf(msg, "Volume Id : %s\n", un0(iso_image_get_volume_id(image))); Xorriso_result(xorriso,0); sprintf(msg, "Volume Set Id: %s\n", xorriso->volset_id); Xorriso_result(xorriso,0); sprintf(msg, "Publisher Id : %s\n", xorriso->publisher); Xorriso_result(xorriso,0); sprintf(msg, "Preparer Id : %s\n", un0(iso_image_get_data_preparer_id(image))); Xorriso_result(xorriso,0); sprintf(msg, "App Id : %s\n", xorriso->application_id); Xorriso_result(xorriso,0); sprintf(msg, "System Id : %s\n", xorriso->system_id); Xorriso_result(xorriso,0); sprintf(msg, "CopyrightFile: %s\n", xorriso->copyright_file); Xorriso_result(xorriso,0); sprintf(msg, "Abstract File: %s\n", xorriso->abstract_file); Xorriso_result(xorriso,0); sprintf(msg, "Biblio File : %s\n", xorriso->biblio_file); Xorriso_result(xorriso,0); ret= iso_image_get_pvd_times(image, &crt, &mdt, &ext, &eft); if(ret != ISO_SUCCESS) crt= mdt= ext= eft= " "; /* Need 17 bytes. Last byte 0. */ Xorriso_report_pvd_time(xorriso, "Creation Time:", crt, 0); Xorriso_report_pvd_time(xorriso, "Modif. Time :", mdt, 0); Xorriso_report_pvd_time(xorriso, "Expir. Time :", ext, 0); Xorriso_report_pvd_time(xorriso, "Eff. Time :", eft, 0); return(1); } /* @param flag bit0= do not mark image as changed */ int Xorriso_set_volid(struct XorrisO *xorriso, char *volid, int flag) { int ret; IsoImage *volume; if(xorriso->in_volset_handle == NULL) return(2); ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) return(ret); if(iso_image_get_volume_id(volume) == NULL || strcmp(iso_image_get_volume_id(volume), volid) != 0) if(!(flag&1)) Xorriso_set_change_pending(xorriso, 1); iso_image_set_volume_id(volume, volid); Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text,"Volume ID: '%s'",iso_image_get_volume_id(volume)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); return(1); } int Xorriso_get_volid(struct XorrisO *xorriso, char volid[33], int flag) { int ret; IsoImage *volume; ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) return(ret); strncpy(volid, iso_image_get_volume_id(volume), 32); volid[32]= 0; return(1); } /* bit0= do only report non-default settings bit1= do only report to fp bit2= is_default bit3= append -boot_image any next bit4= concentrate boot options bit5= override load_size by "full" */ int Xorriso_boot_item_status(struct XorrisO *xorriso, char *cat_path, char *bin_path, int platform_id, int patch_isolinux, int emul, off_t load_size, unsigned char *id_string, unsigned char *selection_crit, char *form, char *filter, FILE *fp, int flag) { int is_default, no_defaults, i, is_default_id= 0, ret; char *line, *bspec= NULL, zeros[28], *partition_entry; off_t file_size; struct stat stbuf; Xorriso_alloc_meM(bspec, char, SfileadrL + 80); no_defaults= flag & 1; line= xorriso->result_line; if(flag & 32) load_size= -1; if((flag & 16) && bin_path[0] != 0) { /* Concentrate boot options. */ memset(zeros, 0, 28); if(memcmp(id_string, zeros, 28) == 0 && memcmp(selection_crit, zeros, 20) == 0) is_default_id= 1; /* -boot_image isolinux dir= ... */ bspec[0]= 0; if(strcmp(form, "isolinux") != 0 && strcmp(form, "any") != 0) ; else if(strcmp(bin_path, "/isolinux.bin") == 0 && strcmp(cat_path, "/boot.cat") == 0) strcpy(bspec, "dir=/"); else if(strcmp(bin_path, "/isolinux/isolinux.bin") == 0 && strcmp(cat_path, "/isolinux/boot.cat") == 0) strcpy(bspec, "dir=/isolinux"); else if(strcmp(xorriso->boot_image_bin_path, "/boot/isolinux/isolinux.bin") == 0 && strcmp(xorriso->boot_image_cat_path, "/boot/isolinux/boot.cat") == 0) strcpy(bspec, "dir=/boot/isolinux"); memset(zeros, 0, 28); if(bspec[0] && platform_id == 0 && (patch_isolinux & 0x3ff) == 1 && load_size == 2048 && is_default_id && emul == 0) { sprintf(line, "-boot_image isolinux %s\n", bspec); Xorriso_status_result(xorriso,filter,fp,flag&2); {ret= 1; goto ex;}; } file_size= 0; ret= Xorriso_iso_lstat(xorriso, bin_path, &stbuf, 2 | 4); if(ret == 0) { file_size= ((stbuf.st_size / (off_t) 512) + !!(stbuf.st_size % (off_t) 512)) * 512; if(flag & 32) load_size= file_size * 512; } if(platform_id == 0xef && (patch_isolinux & 0x3ff) == 0 && load_size / 512 == file_size && is_default_id && emul == 0) { sprintf(line, "-boot_image any efi_path="); Text_shellsafe(bin_path, line, 1); strcat(line, "\n"); Xorriso_status_result(xorriso,filter,fp,flag&2); {ret= 1; goto ex;}; } } is_default= (bin_path[0] == 0) || (flag & 4); sprintf(line, "-boot_image %s bin_path=", form); Text_shellsafe(bin_path, line, 1); strcat(line, "\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (emul == 0); sprintf(line, "-boot_image %s emul_type=%s\n", form, emul == 2 ? "diskette" : emul == 1 ? "hard_disk" : "no_emulation"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= (platform_id == 0 || (flag & 4)); sprintf(line, "-boot_image %s platform_id=0x%-2.2x\n", form, platform_id); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= ((patch_isolinux & 1) == 0 || bin_path[0] == 0 || (flag & 4)); sprintf(line, "-boot_image %s boot_info_table=%s\n", (patch_isolinux & 2) ? "grub" : form, (patch_isolinux & 1) ? "on" : "off"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= ((patch_isolinux & 512) == 0 || bin_path[0] == 0 || (flag & 4)); sprintf(line, "-boot_image grub grub2_boot_info=%s\n", (patch_isolinux & 512) ? "on" : "off"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); if(flag & 32) { is_default= 0; sprintf(line, "-boot_image %s load_size=full", form); } else { is_default= (load_size == 2048 || (flag & 4)); sprintf(line, "-boot_image %s load_size=%lu\n", form, (unsigned long) load_size); } if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= 1; if(!(flag & 4)) for(i= 0; i < 20; i++) if(selection_crit[i]) is_default= 0; sprintf(line, "-boot_image %s sel_crit=", form); for(i= 0; i < 20; i++) sprintf(line + strlen(line), "%-2.2X", (unsigned int) selection_crit[i]); strcat(line, "\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= 1; if(!(flag & 4)) for(i= 0; i < 28; i++) if(id_string[i]) is_default= 0; sprintf(line, "-boot_image %s id_string=", form); for(i= 0; i < 28; i++) sprintf(line + strlen(line), "%-2.2X", (unsigned int) id_string[i]); strcat(line, "\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= 1; partition_entry= ""; if((patch_isolinux & 0x0fc) == (1 << 2)) partition_entry= "gpt_basdat"; else if((patch_isolinux & 0x0fc) == (2 << 2)) partition_entry= "gpt_hfsplus"; if(partition_entry[0]) { sprintf(line, "-boot_image isolinux partition_entry=%s\n", partition_entry); Xorriso_status_result(xorriso, filter, fp, flag & 2); is_default= 0; } if(patch_isolinux & (1 << 8)) { sprintf(line, "-boot_image isolinux partition_entry=apm_hfsplus\n"); Xorriso_status_result(xorriso, filter, fp, flag & 2); is_default= 0; } if(is_default && !no_defaults) { sprintf(line, "-boot_image isolinux partition_entry=off\n"); Xorriso_status_result(xorriso, filter, fp, flag & 2); } ret= 1; ex:; Xorriso_free_meM(bspec); return(ret); } int Xorriso_status_hppa(struct XorrisO *xorriso, char *what, char *value, char *filter, FILE *fp, int flag) { char *line; line= xorriso->result_line; if(value == NULL) return(1); sprintf(line, "-boot_image any hppa_%s=", what); Text_shellsafe(value, line, 1); strcat(line, "\n"); Xorriso_status_result(xorriso, filter, fp, flag & 2); return(1); } /* bit0= do only report non-default settings bit1= do only report to fp */ int Xorriso_boot_status_non_mbr(struct XorrisO *xorriso, IsoImage *image, char *filter, FILE *fp, int flag) { int i, num_boots, sa_type; char *paths[15], *line; int ret; char num[4]; char *cmdline, *bootloader, *kernel_32, *kernel_64, *ramdisk; line= xorriso->result_line; sa_type= (xorriso->system_area_options & 0xfc) >> 2; if(sa_type == 3) { sprintf(line, "-boot_image any sparc_label="); Text_shellsafe(xorriso->ascii_disc_label, line, 1); strcat(line, "\n"); Xorriso_status_result(xorriso, filter, fp, flag & 2); sprintf(line, "-boot_image grub grub2_sparc_core="); Text_shellsafe(xorriso->grub2_sparc_core, line, 1); strcat(line, "\n"); Xorriso_status_result(xorriso, filter, fp, flag & 2); return(0); } else if(sa_type == 1 || sa_type == 2) { num_boots= iso_image_get_mips_boot_files(image, paths, 0); Xorriso_process_msg_queues(xorriso, 0); if(num_boots > 0) { if(sa_type == 2) num_boots= 1; for(i= 0; i < num_boots; i++) { sprintf(line, "-boot_image any mips%s_path=", sa_type ==2 ? "el" : ""); Text_shellsafe(paths[i], line, 1); strcat(line, "\n"); Xorriso_status_result(xorriso, filter, fp, flag & 2); } } return(num_boots); } else if(sa_type == 4 || sa_type == 5) { ret= iso_image_get_hppa_palo(image, &cmdline, &bootloader, &kernel_32, &kernel_64, &ramdisk); if(ret == 1) { Xorriso_status_hppa(xorriso, "cmdline", cmdline, filter, fp, 0); Xorriso_status_hppa(xorriso, "bootloader", bootloader, filter, fp, 0); Xorriso_status_hppa(xorriso, "kernel_32", kernel_32, filter, fp, 0); Xorriso_status_hppa(xorriso, "kernel_64", kernel_64, filter, fp, 0); Xorriso_status_hppa(xorriso, "ramdisk", ramdisk, filter, fp, 0); sprintf(num, "%d", sa_type); Xorriso_status_hppa(xorriso, "hdrversion", num, filter, fp, 0); } return(0); } else if(sa_type == 6) { ret= iso_image_get_alpha_boot(image, &bootloader); if (ret == 1 && bootloader != NULL) { sprintf(line, "-boot_image any alpha_boot="); Text_shellsafe(bootloader, line, 1); strcat(line, "\n"); Xorriso_status_result(xorriso, filter, fp, flag & 2); } return(0); } return(0); } /* bit0= do only report non-default settings bit1= do only report to fp */ int Xorriso_append_part_status(struct XorrisO *xorriso, IsoImage *image, char *filter, FILE *fp, int flag) { int i, l, is_default; is_default= (xorriso->appended_as_gpt == 0); sprintf(xorriso->result_line, "-boot_image any appended_part_as=%s\n", xorriso->appended_as_gpt ? "gpt" : "mbr"); if(!(is_default && (flag & 1))) Xorriso_status_result(xorriso, filter, fp, flag & 2); for(i= 0; i < Xorriso_max_appended_partitionS; i++) { if(xorriso->appended_partitions[i] == NULL) continue; sprintf(xorriso->result_line, "-append_partition %d ", i + 1); l= strlen(xorriso->result_line); if(xorriso->appended_part_gpt_flags[i] & 1) { Xorriso__format_guid(xorriso->appended_part_type_guids[i], xorriso->result_line + l, 0); strcpy(xorriso->result_line + l + 32, " "); } else { sprintf(xorriso->result_line + l, "0x%2.2x ", (unsigned int) xorriso->appended_part_types[i]); } Text_shellsafe(xorriso->appended_partitions[i], xorriso->result_line, 1); strcat(xorriso->result_line, "\n"); Xorriso_status_result(xorriso, filter, fp, flag & 2); } return(1); } /* bit0= do only report non-default settings bit1= do only report to fp */ int Xorriso_boot_image_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag) { int ret, i, num_boots, hflag; int is_default, no_defaults; char *path= NULL, *form= "any", *line, *hpt; struct burn_drive_info *dinfo; struct burn_drive *drive; IsoImage *image= NULL; ElToritoBootImage **boots = NULL; IsoFile **bootnodes = NULL; int platform_id, patch, load_size; enum eltorito_boot_media_type media_type; unsigned char id_string[29], sel_crit[21]; Xorriso_alloc_meM(path, char, SfileadrL); line= xorriso->result_line; no_defaults= flag & 1; ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to print boot info", 2 | 16); if(ret<=0) goto no_image; image= isoburn_get_attached_image(drive); Xorriso_process_msg_queues(xorriso,0); if(image == NULL) goto no_image; ret= Xorriso_boot_status_non_mbr(xorriso, image, filter, fp, flag & 3); if(ret < 0) /* == 0 is normal */ {ret= 0; goto ex;} if(xorriso->boot_count == 0 && xorriso->boot_image_bin_path[0] == 0) { no_image:; if(xorriso->patch_isolinux_image & 1) { sprintf(line, "-boot_image %s patch\n", xorriso->patch_isolinux_image & 2 ? "grub" : form); is_default= 0; } else if(xorriso->keep_boot_image) { sprintf(line, "-boot_image %s keep\n", form); is_default= 0; } else { sprintf(line, "-boot_image %s discard\n", form); is_default= 1; } if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); goto report_open_item; } is_default= (xorriso->boot_image_cat_path[0] == 0); sprintf(line,"-boot_image %s cat_path=", form); Text_shellsafe(xorriso->boot_image_cat_path, line, 1); strcat(line, "\n"); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= !xorriso->boot_image_cat_hidden; hpt= Xorriso__hide_mode_text(xorriso->boot_image_cat_hidden & 63, 0); if(hpt != NULL) sprintf(line, "-boot_image %s cat_hidden=%s\n", form, hpt); Xorriso_free_meM(hpt); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); if(xorriso->boot_count > 0) { /* show attached boot image info */; ret= iso_image_get_all_boot_imgs(image, &num_boots, &boots, &bootnodes, 0); Xorriso_process_msg_queues(xorriso,0); if(ret == 1 && num_boots > 0) { for(i= 0; i < num_boots; i++) { ret= Xorriso_path_from_node(xorriso, (IsoNode *) bootnodes[i], path, 0); if(ret <= 0) continue; platform_id= el_torito_get_boot_platform_id(boots[i]); patch= el_torito_get_isolinux_options(boots[i], 0); el_torito_get_boot_media_type(boots[i], &media_type); load_size= el_torito_get_load_size(boots[i]) * 512; el_torito_get_id_string(boots[i], id_string); el_torito_get_selection_crit(boots[i], sel_crit); if(media_type == ELTORITO_FLOPPY_EMUL) media_type= 2; else if(media_type == ELTORITO_HARD_DISC_EMUL) media_type= 1; else media_type= 0; ret= Xorriso_boot_item_status(xorriso, xorriso->boot_image_cat_path, path, platform_id, patch, media_type, load_size, id_string, sel_crit, "any", filter, fp, 16 | (flag & 3)); if(ret <= 0) continue; sprintf(line,"-boot_image %s next\n", form); Xorriso_status_result(xorriso,filter,fp,flag&2); } } } /* Show pending boot image info */ if(strcmp(xorriso->boot_image_bin_form, "isolinux") == 0 || strcmp(xorriso->boot_image_bin_form, "grub") == 0) form= xorriso->boot_image_bin_form; if(xorriso->boot_count > 0 && xorriso->boot_platform_id == 0 && xorriso->patch_isolinux_image == 0 && xorriso->boot_image_bin_path[0] == 0 && xorriso->boot_image_emul == 0 && xorriso->boot_image_load_size == 4 * 512) { for(i= 0; i < 20; i++) if(xorriso->boot_selection_crit[i]) break; if(i >= 20) for(i= 0; i < 28; i++) if(xorriso->boot_id_string[i]) break; if(i >= 28) {ret= 1; goto ex;} /* Images registered, pending is still default */ } report_open_item:; hflag= 16; if(xorriso->boot_platform_id == 0xef && !xorriso->boot_efi_default) hflag= 0; ret= Xorriso_boot_item_status(xorriso, xorriso->boot_image_cat_path, xorriso->boot_image_bin_path, xorriso->boot_platform_id, xorriso->patch_isolinux_image, xorriso->boot_image_emul, xorriso->boot_image_load_size, xorriso->boot_id_string, xorriso->boot_selection_crit, form, filter, fp, hflag | (flag & 3)); if(ret <= 0) goto ex; ret = Xorriso_append_part_status(xorriso, image, filter, fp, flag & 3); if(ret <= 0) goto ex; ret= 1; ex: if(boots != NULL) free(boots); if(bootnodes != NULL) free(bootnodes); if(image != NULL) iso_image_unref(image); Xorriso_free_meM(path); return(ret); } int Xorriso__append_boot_params(char *line, ElToritoBootImage *bootimg, int flag) { unsigned int platform_id; platform_id= el_torito_get_boot_platform_id(bootimg); if(platform_id != 0) sprintf(line + strlen(line), " , platform_id=0x%-2.2X ", (unsigned int) platform_id); if(el_torito_seems_boot_info_table(bootimg, 0)) sprintf(line + strlen(line), " , boot_info_table=on"); if(el_torito_seems_boot_info_table(bootimg, 1)) sprintf(line + strlen(line), " , grub2_boot_info=on"); return(1); } /* @param flag bit0= no output if no boot record was found bit1= short form bit3= report to info channel (else to result channel) */ int Xorriso_show_boot_info(struct XorrisO *xorriso, int flag) { int ret, bin_path_valid= 0, i, num_boots, sa_count; char *respt, *path= NULL, **sa_report= NULL, *sa_summary= NULL; unsigned char *lb0= NULL; struct burn_drive_info *dinfo; struct burn_drive *drive; IsoImage *image= NULL; ElToritoBootImage *bootimg, **boots = NULL; IsoFile *bootimg_node, **bootnodes = NULL; IsoBoot *bootcat_node; Xorriso_alloc_meM(path, char, SfileadrL); Xorriso_alloc_meM(lb0, unsigned char, 2048); respt= xorriso->result_line; if(xorriso->boot_count > 0) { if(!(flag & 1)) { sprintf(respt, "Boot record : (overridden by -boot_image any next)\n"); Xorriso_toc_line(xorriso, flag & 8); } ret= 1; goto ex; } ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to print boot info", 16); if(ret<=0) goto no_boot; image= isoburn_get_attached_image(drive); if(image == NULL) { ret= 0; no_boot:; if(!(flag & 1)) { sprintf(respt, "Boot record : none\n"); Xorriso_toc_line(xorriso, flag & 8); } goto ex; } ret= iso_image_report_system_area(image, &sa_report, &sa_count, 0); if(ret > 0 && sa_report != NULL) for(i= 0; i < sa_count; i++) if(strncmp(sa_report[i], "System area summary: ", 21) == 0) { Xorriso_alloc_meM(sa_summary, char, strlen(sa_report[i] + 21) + 1); strcpy(sa_summary, sa_report[i] + 21); break; } if(sa_report != NULL) iso_image_report_system_area(image, &sa_report, &sa_count, 1 << 15); Xorriso_process_msg_queues(xorriso,0); /* Using the nodes with extreme care . They might be deleted meanwhile. */ ret= iso_image_get_boot_image(image, &bootimg, &bootimg_node, &bootcat_node); if(ret != 1) { if(sa_summary == NULL) goto no_boot; sprintf(respt, "Boot record : (system area only) , %s\n", sa_summary); Xorriso_toc_line(xorriso, flag & 8); ret= 1; goto ex; } ret= iso_image_get_all_boot_imgs(image, &num_boots, &boots, &bootnodes, 0); Xorriso_process_msg_queues(xorriso,0); if(ret != 1) { num_boots= 0; } else { ret= Xorriso_path_from_node(xorriso, (IsoNode *) bootnodes[0], path, 0); if(ret > 0) bin_path_valid= 1; } sprintf(respt, "Boot record : El Torito"); if(sa_summary != NULL) sprintf(respt + strlen(respt), " , %s", sa_summary); strcat(respt, "\n"); Xorriso_toc_line(xorriso, flag & 8); if(flag & 2) {ret= 1; goto ex;} if(xorriso->loaded_boot_cat_path[0]) { sprintf(respt, "Boot catalog : "); Text_shellsafe(xorriso->loaded_boot_cat_path, respt, 1); strcat(respt, "\n"); } else { sprintf(respt, "Boot catalog : -not-found-at-load-time-\n"); } Xorriso_toc_line(xorriso, flag & 8); if(bin_path_valid) { sprintf(respt, "Boot image : "); Text_shellsafe(path, respt, 1); } else if(xorriso->loaded_boot_bin_lba <= 0) { sprintf(respt, "Boot image : -not-found-at-load-time-"); } else { sprintf(respt, "Boot image : -not-found-any-more-by-lba=%d", xorriso->loaded_boot_bin_lba); } Xorriso__append_boot_params(respt, bootimg, 0); strcat(respt, "\n"); Xorriso_toc_line(xorriso, flag & 8); if(num_boots > 1) { for(i= 1; i < num_boots; i++) { ret= Xorriso_path_from_node(xorriso, (IsoNode *) bootnodes[i], path, 0); if(ret > 0) { sprintf(respt, "Boot image : "); Text_shellsafe(path, respt, 1); } else sprintf(respt, "Boot image : -not-found-any-more-"); Xorriso__append_boot_params(respt, boots[i], 0); strcat(respt, "\n"); Xorriso_toc_line(xorriso, flag & 8); } } ret= 1; ex:; if(boots != NULL) free(boots); if(bootnodes != NULL) free(bootnodes); if(image != NULL) iso_image_unref(image); /* release obtained reference */ Xorriso_free_meM(path); Xorriso_free_meM(lb0); Xorriso_free_meM(sa_summary); return(ret); } /* @param flag bit0=silently return 0 if no volume/image is present */ int Xorriso_get_volume(struct XorrisO *xorriso, IsoImage **volume, int flag) { *volume= NULL; if(xorriso->in_volset_handle==NULL) { if(flag & 1) return(0); Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text,"No ISO image present."); if(xorriso->indev[0]==0 && xorriso->outdev[0]==0) sprintf(xorriso->info_text+strlen(xorriso->info_text), " No -dev, -indev, or -outdev selected."); else sprintf(xorriso->info_text+strlen(xorriso->info_text), " Possible program error with drive '%s'.", xorriso->indev); if(!xorriso->no_volset_present) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); xorriso->no_volset_present= 1; return(0); } *volume= (IsoImage *) xorriso->in_volset_handle; xorriso->no_volset_present= 0; return(*volume != NULL); } /* @param flag bit0= do not return 1 on volset_change_pending != 1 */ int Xorriso_change_is_pending(struct XorrisO *xorriso, int flag) { if(flag & 1) return(xorriso->volset_change_pending == 1); return(!!xorriso->volset_change_pending); } /* @param flag bit0= do not set hln_change_pending */ int Xorriso_set_change_pending(struct XorrisO *xorriso, int flag) { int ret; IsoImage *image; ret= Xorriso_get_volume(xorriso, &image, 1); if(ret <= 0) return ret; /* Do not override mark of -as mkisofs -print-size */ if(xorriso->volset_change_pending != 2) xorriso->volset_change_pending= 1; if(!(flag & 1)) xorriso->hln_change_pending= 1; return(1); } /** @param flag bit0= print mount command to result channel rather than performing it bit1= do not allow prefixes with cmd bit2= interpret unprefixed cmd as shell: */ int Xorriso_mount(struct XorrisO *xorriso, char *dev, int adr_mode, char *adr_value, char *cmd, int flag) { int ret, lba, track, session, params_flag= 0, is_safe= 0, is_extra_drive= 0; int give_up= 0, mount_chardev= 0, status, aquire_flag= 0; char volid[33], *devadr, *mount_command= NULL, *adr_data= NULL, *adr_pt; char *dev_path, *libburn_adr= NULL; char *dpt, *sysname= ""; struct stat stbuf; struct burn_drive_info *dinfo= NULL; struct burn_drive *drive= NULL; Xorriso_alloc_meM(mount_command, char, SfileadrL); Xorriso_alloc_meM(adr_data, char, 163); Xorriso_alloc_meM(libburn_adr, char, BURN_DRIVE_ADR_LEN + SfileadrL); devadr= dev; adr_pt= adr_value; if(strcmp(dev, "indev") == 0) { ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to perform -mount \"indev\"", 0); if(ret<=0) goto ex; dev_path= devadr= xorriso->indev; if(strncmp(dev_path, "stdio:", 6) == 0) dev_path+= 6; else if(strncmp(dev_path, "mmc:", 4) == 0) dev_path+= 4; if(xorriso->in_drive_handle == xorriso->out_drive_handle) give_up= 3; else give_up= 1; } else if(strcmp(dev, "outdev") == 0) { ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to perform -mount \"outdev\"", 2); if(ret<=0) goto ex; dev_path= devadr= xorriso->outdev; if(strncmp(dev_path, "stdio:", 6) == 0) dev_path+= 6; else if(strncmp(dev_path, "mmc:", 4) == 0) dev_path+= 4; if(xorriso->in_drive_handle == xorriso->out_drive_handle) give_up= 3; else give_up= 2; } else { is_extra_drive= 1; dev_path= dev; if(strncmp(dev_path, "stdio:", 6) == 0) dev_path+= 6; else if(strncmp(dev_path, "mmc:", 4) == 0) dev_path+= 4; /* do only accept regular files and block devices */ ret= stat(dev_path, &stbuf); if(ret == -1) { sprintf(xorriso->info_text, "Cannot determine properties of file "); Text_shellsafe(dev_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } ret= System_uname(&sysname, NULL, NULL, NULL, 0); if(ret > 0 && strcmp(sysname, "FreeBSD") == 0) mount_chardev= 1; if(!(S_ISREG(stbuf.st_mode) || (S_ISBLK(stbuf.st_mode) && !mount_chardev) || (S_ISCHR(stbuf.st_mode) && !mount_chardev))) { sprintf(xorriso->info_text, "File object is not suitable as mount device: "); Text_shellsafe(dev_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } /* Acquire drive as direct libburn address or via stdio: prefix */ if(strncmp(dev, "mmc:", 4) == 0) ret= burn_drive_convert_fs_adr(dev + 4, libburn_adr); else ret= burn_drive_convert_fs_adr(dev, libburn_adr); Xorriso_process_msg_queues(xorriso,0); if(ret < 0) {ret= -1; goto ex;} if(ret == 0 && strncmp(dev, "stdio:", 6) != 0 && strncmp(dev, "mmc:", 4) != 0) sprintf(libburn_adr, "stdio:%s", dev); burn_preset_device_open( (xorriso->drives_exclusive && !(xorriso->mount_opts_flag & 1)) | (xorriso->linux_scsi_dev_family << 2), 0, 0); aquire_flag= 1; if((xorriso->toc_emulation_flag & 2) && adr_mode == 3) aquire_flag|= 16; if(xorriso->toc_emulation_flag & 4) aquire_flag|= 128; if(xorriso->toc_emulation_flag & 8) aquire_flag|= 512; ret= isoburn_drive_aquire(&dinfo, libburn_adr, aquire_flag); burn_preset_device_open(1 | (xorriso->linux_scsi_dev_family << 2), 0, 0); Xorriso_process_msg_queues(xorriso,0); if(ret <= 0) {ret= 0; goto ex;} drive= dinfo[0].drive; } if(adr_mode == 4 && strlen(adr_pt) <= 80) { ret= Xorriso__bourne_to_reg(adr_pt, adr_data, 0); if(ret == 1) { params_flag|= 4; adr_pt= adr_data; } } ret= isoburn_get_mount_params(drive, adr_mode, adr_pt, &lba, &track, &session, volid, params_flag); Xorriso_process_msg_queues(xorriso,0); if(ret <= 0) goto ex; if(((session <= 0 || track <= 0) && !(aquire_flag & 16)) || ret == 2) { Xorriso_msgs_submit(xorriso, 0, "-mount : Given address does not point to an ISO 9660 session", 0, "FAILURE", 0); ret= 0; goto ex; } if(strstr(devadr, "stdio:") == devadr) devadr+= 6; if(strstr(devadr, "mmc:") == devadr) devadr+= 4; ret= Xorriso_make_mount_cmd(xorriso, cmd, lba, track, session, volid, devadr, mount_command, (flag & (2 | 4)) | ((flag & 4) << 1)); if(ret <= 0) goto ex; if(ret == 2) is_safe= 1; if(is_extra_drive) { isoburn_drive_release(drive, 0); burn_drive_info_free(dinfo); drive= NULL; } else if(give_up > 0 && !((flag & 1) || (xorriso->mount_opts_flag & 1))) { ret= Xorriso_give_up_drive(xorriso, give_up); if(ret <= 0) goto ex; } Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "Volume id : "); Text_shellsafe(volid, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso, 0); if(flag & 1) { sprintf(xorriso->result_line, "%s\n", mount_command); Xorriso_result(xorriso,0); } else { sprintf(xorriso->info_text, "Mount command: %s\n", mount_command); Xorriso_info(xorriso, 0); if(!is_safe) { Xorriso_msgs_submit(xorriso, 0, "-mount : Will not perform mount command which stems from command template.", 0, "SORRY", 0); sprintf(xorriso->result_line, "%s\n", mount_command); Xorriso_result(xorriso,0); } else { ret= Xorriso_execv(xorriso, mount_command, 0, NULL, "/bin:/sbin", NULL, NULL, NULL, &status, 1); if(WIFEXITED(status) && WEXITSTATUS(status) != 0) { sprintf(xorriso->info_text, "-mount : mount command failed with exit value %d", (int) WEXITSTATUS(status)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } sprintf(xorriso->info_text, "\nMounted session %d of device ", session); Text_shellsafe(dev_path, xorriso->info_text, 1); dpt= strchr(cmd, ':'); if(dpt == NULL) dpt= cmd ; else dpt++; sprintf(xorriso->info_text + strlen(xorriso->info_text), " as directory "); Text_shellsafe(dpt, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso, 0); } } ret= 1; ex:; if(is_extra_drive && drive != NULL) { isoburn_drive_release(drive, 0); burn_drive_info_free(dinfo); Xorriso_process_msg_queues(xorriso,0); } Xorriso_free_meM(mount_command); Xorriso_free_meM(adr_data); Xorriso_free_meM(libburn_adr); return(ret); } /* @param flag bit0= give up all boot file paths bit1= refuse if already a path is added */ int Xorriso_add_mips_boot_file(struct XorrisO *xorriso, char *path, int flag) { int ret; IsoImage *image; char *paths[15]; ret= Xorriso_get_volume(xorriso, &image, 0); if(ret <= 0) return ret; if(flag & 1) { iso_image_give_up_mips_boot(image, 0); Xorriso_process_msg_queues(xorriso,0); return(1); } if(flag & 2) { ret= iso_image_get_mips_boot_files(image, paths, 0); Xorriso_process_msg_queues(xorriso,0); if(ret < 0) goto report_error; if(ret > 0) { Xorriso_msgs_submit(xorriso, 0, "There is already a boot image file registered.", 0, "FAILURE", 0); return(0); } } ret = iso_image_add_mips_boot_file(image, path, 0); Xorriso_process_msg_queues(xorriso,0); if (ret < 0) { report_error:; Xorriso_report_iso_error(xorriso, "", ret, "Error when adding MIPS boot file", 0, "FAILURE", 1); return(0); } return(1); } /* @param flag bit0= Give up HP-PA boot parameters */ int Xorriso_set_hppa_boot_parm(struct XorrisO *xorriso, char *text, char *what, int flag) { int ret; IsoImage *image; char *par[5]; ret= Xorriso_get_volume(xorriso, &image, 0); if(ret <= 0) return(ret); par[0]= par[1]= par[2]= par[3]= par[4]= NULL; if(flag & 1) { /* Give up HP-PA boot parameters */ iso_image_set_hppa_palo(image, par[0], par[1], par[2], par[3], par[4], 1); return(1); } if(strcmp(what, "cmdline") == 0) { par[0]= text; } else if(strcmp(what, "bootloader") == 0) { par[1]= text; } else if(strcmp(what, "kernel_32") == 0 || strcmp(what, "kernel-32") == 0) { par[2]= text; } else if(strcmp(what, "kernel_64") == 0 || strcmp(what, "kernel-64") == 0) { par[3]= text; } else if(strcmp(what, "ramdisk") == 0) { par[4]= text; } else if(strcmp(what, "hdrversion") == 0) { if(strcmp(text, "4") == 0) { xorriso->system_area_options= (xorriso->system_area_options & ~0xfc) | (4 << 2); } else if(strcmp(text, "5") == 0) { xorriso->system_area_options= (xorriso->system_area_options & ~0xfc) | (5 << 2); } else { strcpy(xorriso->info_text, "Unsupported HP-PA PALO header version "); Text_shellsafe(text, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } else { strcpy(xorriso->info_text, "HP-PA boot parameter name not recognized: hppa_"); Text_shellsafe(what, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= iso_image_set_hppa_palo(image, par[0], par[1], par[2], par[3], par[4], 0); if (ret < 0) { Xorriso_report_iso_error(xorriso, "", ret, "Error when adding HP-PA boot parameter", 0, "FAILURE", 1); return(0); } return(1); } /* @param flag bit0= Give up DEC Alpha boot parameters */ int Xorriso_set_alpha_boot(struct XorrisO *xorriso, char *path, int flag) { int ret; IsoImage *image; ret= Xorriso_get_volume(xorriso, &image, 0); if(ret <= 0) return(ret); if(flag & 1) { /* Give up boot parameters */ iso_image_set_alpha_boot(image, NULL, 1); return(1); } ret= iso_image_set_alpha_boot(image, path, 0); if (ret < 0) { Xorriso_report_iso_error(xorriso, "", ret, "Error when adding DEC Alpha boot loader", 0, "FAILURE", 1); return(0); } return(1); } /* @param flag bit0= do not set xorriso->system_area_options, just check bit1= only check for grub2_mbr <-> isolinux partition_table */ int Xorriso_coordinate_system_area(struct XorrisO *xorriso, int sa_type, int options, char *cmd, int flag) { int old_type, old_options, new_options; static char *type_names[7] = { "MBR", "MIPS Big Endian Volume Header", "MIPS Little Endian Boot Block", "SUN Disk Label", "HP-PA PALO v4", "HP-PA PALO v5", "DEC Alpha SRM Boot Block"}; static int num_names = 7; old_type= (xorriso->system_area_options & 0xfc) >> 2; old_options= xorriso->system_area_options & 0x3c03; new_options= options & 0x3c03; if(((options & (1 << 14)) && (xorriso->system_area_options & 2)) || ((options & 2) && (xorriso->system_area_options & (1 << 14)))) goto reject; if(flag & 2) return(1); if((old_type != 0 || old_options != 0) && (old_type != sa_type || (old_options != 0 && old_options != new_options))){ reject:; sprintf(xorriso->info_text, "%s : First sector already occupied by %s", cmd, old_type < num_names ? type_names[old_type] : "other boot facility"); if(old_type == 0 && (old_options & 2)) strcat(xorriso->info_text, " for ISOLINUX isohybrid"); else if (old_type == 0 && (xorriso->system_area_options & (1 << 14))) { strcat(xorriso->info_text, " for GRUB2 patching"); if(old_type == 0 && (old_options & 1)) strcat(xorriso->info_text, " with partition table"); } else if(old_type == 0 && (old_options & 1)) strcat(xorriso->info_text, " for partition table"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto hint_revoke; } if(!(flag & 1)) xorriso->system_area_options= (xorriso->system_area_options & ~0x3cff) | ((sa_type << 2) & 0xfc) | (options & 0x3c03); return(1); hint_revoke:; if(old_type == 0) sprintf(xorriso->info_text, "Revokable by -boot_image any discard"); else if(old_type == 1 || old_type == 2) sprintf(xorriso->info_text, "Revokable by -boot_image any mips_discard"); else if(old_type == 3) sprintf(xorriso->info_text, "Revokable by -boot_image any sparc_discard"); if(old_type < 4) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); return(0); } int Xorriso_gpt_crc(struct XorrisO *xorriso, char *path, int flag) { int ret; char *buf = NULL; FILE *fp = NULL; uint32_t crc; Xorriso_alloc_meM(buf, char, 32 * 1024); ret= Xorriso_afile_fopen(xorriso, path, "rb", &fp, 0); if(ret <= 0) goto ex; ret= fread(buf, 1, 32 * 1024, fp); if(ret == 0) { strcpy(xorriso->info_text, "No bytes readable for GPT CRC from "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); ret= 0; goto ex; } crc= iso_crc32_gpt((unsigned char *) buf, ret, 0); sprintf(xorriso->result_line, "0x%8.8x\n", (unsigned int) crc); Xorriso_result(xorriso, 0); ret= 1; ex:; if(fp != NULL && fp != stdin) fclose(fp); Xorriso_free_meM(buf); return(ret); } static int Xorriso_split_report_line(struct XorrisO *xorriso, char *line, int num_limit, char *name, char **contentpt, double *num, int *num_count, char **textpt, int flag) { int i; char *spt, *ept, *cpt; if(strlen(line) < 21) { undigestible: sprintf(xorriso->info_text, "Undigestible report line with -report_* mode cmd: '%s'", line); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } if(line[19] != ':') goto undigestible; strncpy(name, line, 20); name[20]= 0; for(spt= line + 20; *spt == ' '; spt++); *textpt= *contentpt= spt; *num_count= 0; for(i= 0; i < num_limit; i++) { /* Get word */ for(spt= *textpt; *spt == ' '; spt++); if(*spt == 0) { *textpt= spt; break; } for(ept= spt + 1; *ept != ' ' && *ept != 0; ept++); /* Look for decimal number */ if(ept - spt > 16) break; for(cpt= spt; cpt < ept; cpt++) if(*cpt < '0' || *cpt > '9') break; if(cpt != ept) break; sscanf(spt, "%lf", num + *num_count); (*num_count)++; *textpt= ept; } /* Set *textpt to next non-blank */ for(; **textpt == ' '; (*textpt)++); return(1); } int Xorriso_record_cmd_line(struct XorrisO *xorriso, char *buf, char **cmds, int *cmd_count, int flag) { int ret; if(flag & 1) { (*cmd_count)++; ret= 1; goto ex; } Xorriso_alloc_meM(cmds[*cmd_count], char, strlen(buf) + 1); strcpy(cmds[*cmd_count], buf); (*cmd_count)++; ret= 1; ex:; return(ret); } /* @param flag bit0= zeroize MBR partition table bit1= zeroize GPT bit2= zeroize APM bit30= Source imported_iso rather than local_fs */ int Xorriso_add_intvl_adr(struct XorrisO *xorriso, char *buf, uint64_t start_adr, uint64_t end_adr, char *suffix, int flag) { char *path; sprintf(buf + strlen(buf), "--interval:%s:%.f%s-%.f%s:", ((flag & (1 << 30)) ? "imported_iso" : "local_fs"), (double) start_adr, suffix, (double) end_adr, suffix); if(flag & 1) strcat(buf, "zero_mbrpt,"); if(flag & 2) strcat(buf, "zero_gpt,"); if(flag & 4) strcat(buf, "zero_apm,"); if(buf[strlen(buf) - 1] == ',') buf[strlen(buf) - 1] = 0; strcat(buf, ":"); path= xorriso->indev; if(strncmp(path, "stdio:", 6) == 0) path+= 6; Text_shellsafe(path, buf, 1); return(1); } int Xorriso_add_offset_size(struct XorrisO *xorriso, char *buf, off_t byte_offset, off_t byte_size, int flag) { strcat(buf, " "); Sfile_off_t_text(buf + strlen(buf), byte_offset, 0); strcat(buf, " "); Sfile_off_t_text(buf + strlen(buf), byte_size, 0); return(1); } struct elto_img_par { int n, ldsiz, boot_info_table, grub2_boot_info; int do_gpt_basdat, do_gpt_hfsplus, do_apm_hfsplus; unsigned int ld_seg, hdpt, platform_id; unsigned long int lba, extract_size; char pltf[8], b[8], emul[8], boot_image_type[16]; char *path, *id_string, *sel_crit; }; /* @param ptype 0= unknown, 1= gpt-basdat, 2=gpt-hfsplus, 3=EFI @param flag bit0= isohybrid */ static int Xorriso_register_eltorito_gpt(struct XorrisO *xorriso, struct elto_img_par *et_img, int ptype, int *efi_boot_part, int *first_efi, int flag) { if(flag & 1) { if(ptype == 1 || ptype == 3) et_img->do_gpt_basdat= 1; else if(ptype == 2) et_img->do_gpt_hfsplus= 1; return(1); } else if(*first_efi && et_img->platform_id == 0xef) { *efi_boot_part= 1; return(1); } if(et_img->platform_id == 0xef) *first_efi= 0; return(0); } /* @param ptype 0= unknown, 1= gpt-basdat, 2=gpt-hfsplus, 3=EFI @param flag bit0= isohybrid */ static int Xorriso_search_eltorito_path(struct XorrisO *xorriso, struct elto_img_par *et_imgs, int elto_count, char *path, int ptype, int *found, int *efi_boot_part, int flag) { int first_efi= 1, et_idx, ret; for(et_idx= 0; et_idx < elto_count; et_idx++) { if(strcmp(et_imgs[et_idx].path, path) != 0) continue; ret= Xorriso_register_eltorito_gpt(xorriso, et_imgs + et_idx, ptype, efi_boot_part, &first_efi, flag); if(ret > 0) break; } *found= et_idx; if(et_idx < elto_count) return(1); return(0); } static int Xorriso_search_eltorito_lba(struct XorrisO *xorriso, struct elto_img_par *et_imgs, int elto_count, unsigned int lba, int *found, int flag) { int et_idx; for(et_idx= 0; et_idx < elto_count; et_idx++) if(et_imgs[et_idx].lba == lba) break; *found= et_idx; if(et_idx < elto_count) return(1); return(0); } int Xorriso_highest_data_block(struct XorrisO *xorriso, uint32_t *high_block, int flag) { int ret; struct FindjoB *job= NULL; struct stat dir_stbuf; *high_block= 0; ret= Findjob_new(&job, "/", 0); if(ret <= 0) { Xorriso_no_findjob(xorriso, "[internal:last_data_file_block]", 0); {ret= -1; goto ex;} } Findjob_set_action_type(job, 58, 0, 0); ret= Xorriso_findi(xorriso, job, NULL, (off_t) 0, NULL, "/", &dir_stbuf, 0, 0); if(ret <= 0) goto ex; Findjob_get_last_data_file_block(job, high_block, 0); ex:; Findjob_destroy(&job, 0); return(ret); } /* @param flag bit0= do not record but only count bit1= as_mkisofs bit2= no sorry messages */ static int Xorriso_scan_report_lines(struct XorrisO *xorriso, char **et_lines, int et_line_count, char **sa_lines, int sa_line_count, char **cmds, int *cmd_count, char **boot_imgs, int *boot_img_count, int flag) { int ret= 0, i, num_count, mkisofs, line_count, idx, et_idx, isohybrid= 0; int ptype, gpt_idx, j, pad, mbr_idx; int efi_boot_part= 0, full_sparc_part= 0, have_sparc_part= 0, fe_dummy= 1; int appended_as_gpt= 0, have_prep= 0, did_sysarea= 0, cared_for_apm= 0; int cared_for_sparc= 0, have_hfsplus= 0; int have_sysarea= 0, ptable_killer, imported_iso, have_alpha_ldr_path= 0; int have_protective_msdos= 0, part_like_isohybrid= 0; #ifdef Not_any_more_because_padding_is_now_after_partitions int appended_partition= 0; #endif int iso_mbr_part_type= -1, iso_gpt_part_idx= -1; unsigned int prev_pltf= 0; unsigned long int sa_options= 0, partno, id_tag, perms, start_cyl; unsigned long int part_status, part_type, mbr_start_block, mbr_num_blocks; unsigned long int partition_offset= 0; uint32_t high_block= 0, indev_blocks; char name[24], *textpt, *contentpt, *buf= NULL, part_type_text[37]; char **lines= NULL; double num[8]; char *cat_path= ""; struct elto_img_par *et_imgs= NULL; int elto_count= 0; uint32_t mbr_parts_end= 0, extract_size; struct FindjoB *job= NULL; struct stat dir_stbuf; IsoImage *image; char *volid, *crt, *mdt, *ext, *eft, uuid[17], *uuid_time; char **app_pseudo_paths= NULL; struct tm tm_erg; int was_force_bootable= 0, have_mbr_force_bootable= 0; uint64_t gpt_bheader_block= 0, start_block, num_blocks; uint64_t img_blocks= 0, iso_part_blocks; struct mbr_par { uint8_t ptype; uint64_t start_block; uint64_t block_count; int appended; int has_path; }; struct mbr_par *mbrpts= NULL; int mbr_count= 0; struct gpt_par { int ptype; /* 0= unknown, 1= gpt-basdat, 2=gpt-hfsplus, 3=EFI */ uint8_t type_guid[16]; int is_gap; int has_path; char *path; uint64_t start_block; uint64_t block_count; }; struct gpt_par *gpts= NULL; int gpt_count= 0; struct apm_par { int ptype; /* bit0= type Apple_HFS , bit1= name HFSPLUS_Hybrid */ char *path; }; struct apm_par *apms= NULL; int apm_count= 0; #define Xorriso_record_cmd_linE { \ ret= Xorriso_record_cmd_line(xorriso, buf, cmds, cmd_count, flag & 1); \ buf[0]= 0; \ if(ret <= 0) \ goto ex; \ } #define Xorriso_record_boot_imglinE { \ ret= Xorriso_record_cmd_line(xorriso, buf, boot_imgs, boot_img_count, \ flag & 1); \ buf[0]= 0; \ if(ret <= 0) \ goto ex; \ } /* 2 exp 19 blocks = 1 GiB */ #define Xorriso_max_endless_uefi_sizE (1 << 19) mkisofs= !!(flag & 2); imported_iso= (!mkisofs) << 30; *cmd_count= 0; *boot_img_count= 0; line_count= et_line_count + sa_line_count; if(line_count <= 0) {ret= 1; goto ex;} Xorriso_alloc_meM(buf, char, 80 + SfileadrL); Xorriso_alloc_meM(lines, char *, line_count); for(i= 0; i < et_line_count; i++) lines[i]= et_lines[i]; for(i= 0; i < sa_line_count; i++) lines[i + et_line_count]= sa_lines[i]; /* Pre-scan to establish context */ for(i= 0; i < line_count; i++) { ret= Xorriso_split_report_line(xorriso, lines[i], 8, name, &contentpt, num, &num_count, &textpt, 0); if(ret <= 0) goto ex; if(strcmp(name, "System area options:") == 0) { sscanf(contentpt, "%lx", &sa_options); } else if(strcmp(name, "System area summary:") == 0) { have_sysarea= 1; } else if(strcmp(name, "El Torito boot img :") == 0) { if(num[0] > elto_count) elto_count= num[0]; } else if(strcmp(name, "PReP boot partition:") == 0) { have_prep= 1; } else if(strcmp(name, "MBR partition :") == 0) { if(num[0] > mbr_count) mbr_count= num[0]; if(strcmp(textpt, "0x80 0x00 0 1") == 0) have_mbr_force_bootable= 1; } else if(strcmp(name, "GPT partition name :") == 0) { if(num[0] > gpt_count) gpt_count= num[0]; } else if(strcmp(name, "APM partition name :") == 0) { if(num[0] > apm_count) apm_count= num[0]; } else if(strcmp(name, "ISO image size/512 :") == 0) { img_blocks= num[0]; } else if(strcmp(name, "Partition offset :") == 0 && (num[0] == 0 || num[0] == 16)) { partition_offset= num[0]; } } ret= Xorriso_highest_data_block(xorriso, &high_block, 0); if(ret < 0) goto ex; if(ret == 0) high_block = img_blocks / 4 - 1; if(elto_count > 0) { Xorriso_alloc_meM(et_imgs, struct elto_img_par, elto_count); for(et_idx= 0; et_idx < elto_count; et_idx++) { et_imgs[et_idx].path= NULL; et_imgs[et_idx].ldsiz= -1; } Xorriso_alloc_meM(app_pseudo_paths, char *, elto_count); for(i= 0; i < elto_count; i++) app_pseudo_paths[i]= NULL; for(i= 0; i < elto_count; i++) { Xorriso_alloc_meM(app_pseudo_paths[i], char, 80); app_pseudo_paths[i][0]= 0; } } if(mbr_count > 0) Xorriso_alloc_meM(mbrpts, struct mbr_par, mbr_count); if(gpt_count > 0) { Xorriso_alloc_meM(gpts, struct gpt_par, gpt_count); for(gpt_idx= 0; gpt_idx < gpt_count; gpt_idx++) gpts[gpt_idx].path= NULL; } if(apm_count > 0) { Xorriso_alloc_meM(apms, struct apm_par, apm_count); for(i= 0; i < apm_count; i++) apms[i].path= NULL; } ptable_killer= (mbr_count > 0) | ((gpt_count > 0) << 1) | ((apm_count > 0) << 2); /* Report volume id and GRUB2 modification date */; ret= Xorriso_get_volume(xorriso, &image, 0); if(ret <= 0) goto ex; if(mkisofs) sprintf(buf, "-V "); else sprintf(buf, "-volid "); volid= (char *) un0(iso_image_get_volume_id(image)); Text_shellsafe(volid, buf, 1); Xorriso_record_cmd_linE ret= iso_image_get_pvd_times(image, &crt, &mdt, &ext, &eft); if(ret == ISO_SUCCESS) { uuid_time= crt; /* If Creation Time is bad and Modification Time is ok: use the latter */ ret= Decode_ecma119_format(&tm_erg, crt, 0); if(ret <= 0 || strlen(crt) != 16) { ret= Decode_ecma119_format(&tm_erg, mdt, 0); if(!(ret <= 0 || strlen(mdt) != 16)) uuid_time= mdt; } pad= 0; for(j= 0; j < 16; j++) { if(pad) { uuid[j]= '0'; } else if(uuid_time[j] == 0) { pad= 1; uuid[j]= '0'; } else if(uuid_time[j] < '0' || uuid_time[j] > '9') { uuid[j]= '0'; } else { uuid[j]= uuid_time[j]; } } uuid[16]= 0; ret= Decode_ecma119_format(&tm_erg, uuid, 0); if(!(ret <= 0 || strlen(uuid) != 16)) { if(mkisofs) sprintf(buf, "--modification-date="); else sprintf(buf, "-volume_date uuid "); Text_shellsafe(uuid, buf, 1); Xorriso_record_cmd_linE } } /* First pass: set up objects, record El Torito and info needed in 2nd pass */ for(i= 0; i < line_count; i++) { buf[0]= 0; ret= Xorriso_split_report_line(xorriso, lines[i], 8, name, &contentpt, num, &num_count, &textpt, 0); if(ret <= 0) goto ex; if(strcmp(name, "El Torito cat path :") == 0) { cat_path= textpt; } else if(strcmp(name, "El Torito catalog :") == 0) { strcpy(buf, "eltorito_catalog.img/"); Xorriso_add_offset_size(xorriso, buf, ((off_t) num[0]) * 2048, ((off_t) num[1]) * 2048, 0); Xorriso_record_boot_imglinE } else if(strcmp(name, "El Torito boot img :") == 0) { /* Platform Id, bootability, emulation, load segment, Hard disk emulation partition type, Load size */ idx= num[0] - 1; sscanf(contentpt, "%d %s %s %s %x %x %d %lu", &(et_imgs[idx].n), et_imgs[idx].pltf, et_imgs[idx].b, et_imgs[idx].emul, &(et_imgs[idx].ld_seg), &(et_imgs[idx].hdpt), &(et_imgs[idx].ldsiz), &(et_imgs[idx].lba)); if(strcmp(et_imgs[idx].pltf, "BIOS") == 0) et_imgs[idx].platform_id= 0; else if(strcmp(et_imgs[idx].pltf, "PPC") == 0) et_imgs[idx].platform_id= 1; else if(strcmp(et_imgs[idx].pltf, "Mac") == 0) et_imgs[idx].platform_id= 2; else if(strcmp(et_imgs[idx].pltf, "UEFI") == 0) et_imgs[idx].platform_id= 0xef; else sscanf(et_imgs[idx].pltf, "%x", &(et_imgs[idx].platform_id)); strcpy(et_imgs[idx].boot_image_type, "any"); et_imgs[idx].boot_info_table= 0; et_imgs[idx].grub2_boot_info= 0; et_imgs[idx].path= et_imgs[idx].id_string= et_imgs[idx].sel_crit= ""; et_imgs[idx].do_gpt_basdat= et_imgs[idx].do_gpt_hfsplus= 0; et_imgs[idx].do_apm_hfsplus= 0; et_imgs[idx].extract_size= (et_imgs[idx].ldsiz + 3) / 4; } else if(strcmp(name, "El Torito img path :") == 0) { idx= num[0] - 1; et_imgs[idx].path= textpt; ret= Xorriso_iso_lstat(xorriso, et_imgs[idx].path, &dir_stbuf, 0); if(ret == 0) { extract_size = (dir_stbuf.st_size + 2047) / 2048; if(extract_size > et_imgs[idx].extract_size) et_imgs[idx].extract_size= extract_size; } } else if(strcmp(name, "El Torito img blks :") == 0) { idx= num[0] - 1; if(num[1] > et_imgs[idx].extract_size) et_imgs[idx].extract_size= num[1]; } else if(strcmp(name, "El Torito img opts :") == 0) { idx= num[0] - 1; if(strstr(textpt, "boot-info-table") != NULL) et_imgs[idx].boot_info_table= 1; if(strstr(textpt, "isohybrid-suitable") != NULL) strcpy(et_imgs[idx].boot_image_type, "isolinux"); if(strstr(textpt, "grub2-boot-info") != NULL) { strcpy(et_imgs[idx].boot_image_type, "grub"); et_imgs[idx].grub2_boot_info= 1; } } else if(strcmp(name, "El Torito id string:") == 0) { idx= num[0] - 1; et_imgs[idx].id_string= textpt; } else if(strcmp(name, "El Torito sel crit :") == 0) { idx= num[0] - 1; et_imgs[idx].sel_crit= textpt; } else if(strcmp(name, "System area summary:") == 0) { if(strstr(textpt, "protective-msdos-label") != NULL) have_protective_msdos= 1; } else if(strcmp(name, "MBR partition :") == 0) { sscanf(contentpt, "%lu 0x%lx 0x%lx %lu %lu", &partno, &part_status, &part_type, &mbr_start_block, &mbr_num_blocks); idx= partno - 1; mbrpts[idx].ptype= part_type; mbrpts[idx].start_block= mbr_start_block; mbrpts[idx].block_count= mbr_num_blocks; if(mbr_num_blocks > 0 && mbr_start_block + mbr_num_blocks > mbr_parts_end) mbr_parts_end= mbr_start_block + mbr_num_blocks; if(mbr_start_block == partition_offset * 4 && (mbr_start_block + mbr_num_blocks) >= high_block * 4 && iso_mbr_part_type < 0) iso_mbr_part_type = part_type; } else if(strcmp(name, "MBR partition path :") == 0) { idx= num[0] - 1; mbrpts[idx].has_path= 1; } else if(strcmp(name, "GPT lba range :") == 0) { gpt_bheader_block= num[2]; } else if(strcmp(name, "GPT type GUID :") == 0) { idx= num[0] - 1; if(strcmp(textpt, "a2a0d0ebe5b9334487c068b6b72699c7") == 0) gpts[idx].ptype= 1; /* Basic data */ else if(strcmp(textpt, "005346480000aa11aa1100306543ecac") == 0) gpts[idx].ptype= 2; /* HFS+ */ else if(strcmp(textpt, "28732ac11ff8d211ba4b00a0c93ec93b") == 0) gpts[idx].ptype= 3; /* EFI System Partition */ else gpts[idx].ptype= 0; Xorriso_parse_guid(xorriso, textpt, gpts[idx].type_guid, 1); } else if(strcmp(name, "GPT start and size :") == 0) { idx= num[0] - 1; if(num[2] > 0) appended_as_gpt= 1; start_block= gpts[idx].start_block= num[1]; num_blocks= gpts[idx].block_count= num[2]; if(start_block == partition_offset * 4 && (start_block + num_blocks) >= high_block * 4 && iso_gpt_part_idx < 0) iso_gpt_part_idx= idx; } else if(strcmp(name, "GPT partition path :") == 0) { idx= num[0] - 1; gpts[idx].has_path= 1; gpts[idx].path= textpt; } else if(strcmp(name, "GPT partition name :") == 0) { idx= num[0] - 1; if(strstr(contentpt, " 470061007000") != NULL) /* "Gap"... */ gpts[idx].is_gap= 1; } else if(strcmp(name, "APM partition name :") == 0) { idx= num[0] - 1; if(strcmp(textpt, "HFSPLUS_Hybrid") == 0) apms[idx].ptype|= 2; } else if(strcmp(name, "APM partition type :") == 0) { idx= num[0] - 1; if(strcmp(textpt, "Apple_HFS") == 0) apms[idx].ptype|= 1; } else if(strcmp(name, "APM partition path :") == 0) { idx= num[0] - 1; apms[idx].path= textpt; } else if(strcmp(name, "DEC Alpha ldr path :") == 0) { have_alpha_ldr_path= 1; } } if(appended_as_gpt && !have_protective_msdos) { if(mbr_count != 1) { appended_as_gpt= 0; } else if(mbrpts[0].ptype != 0xee || mbrpts[0].start_block != 1) { appended_as_gpt= 0; } else if(gpt_bheader_block != mbrpts[0].block_count) { appended_as_gpt= 0; } } iso_part_blocks= img_blocks; for(mbr_idx = 0; mbr_idx < mbr_count; mbr_idx++) { if(mbrpts[mbr_idx].start_block == partition_offset * 4) { iso_part_blocks= mbrpts[mbr_idx].block_count + partition_offset * 4; break; } } /* Second pass: scan for System Area info */ for(i= 0; i < line_count; i++) { buf[0]= 0; ret= Xorriso_split_report_line(xorriso, lines[i], 8, name, &contentpt, num, &num_count, &textpt, 0); if(ret <= 0) goto ex; if(strcmp(name, "System area options:") == 0) { if((sa_options & 0x3c00) == 0x0400) { if(mkisofs) sprintf(buf, "-chrp-boot-part "); else sprintf(buf, "-boot_image any chrp_boot_part=on "); } } else if(strcmp(name, "System area summary:") == 0) { if(strstr(textpt, "isohybrid") != NULL) { isohybrid= 1; if(mkisofs) sprintf(buf, "-isohybrid-mbr "); else sprintf(buf, "-boot_image isolinux system_area="); Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) 0, (uint64_t) 15, "s", imported_iso | ptable_killer); Xorriso_record_cmd_linE strcpy(buf, "mbr_code_isohybrid.img/"); Xorriso_add_offset_size(xorriso, buf, (off_t) 0, (off_t) 446, 0); Xorriso_record_boot_imglinE did_sysarea= 1; } if(strstr(textpt, "grub2-mbr") != NULL) { if(mkisofs) sprintf(buf, "--grub2-mbr "); else sprintf(buf, "-boot_image grub grub2_mbr="); Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) 0, (uint64_t) 15, "s", imported_iso | ptable_killer); Xorriso_record_cmd_linE strcpy(buf, "mbr_code_grub2.img/"); Xorriso_add_offset_size(xorriso, buf, (off_t) 0, (off_t) 446, 0); Xorriso_record_boot_imglinE did_sysarea= 1; } if(strstr(textpt, "protective-msdos-label") != NULL) { if(mkisofs) sprintf(buf, "--protective-msdos-label"); else sprintf(buf, "-boot_image any partition_table=on"); Xorriso_record_cmd_linE } if(strstr(textpt, "cyl-align-off") != NULL) { if(mkisofs) sprintf(buf, "-partition_cyl_align off"); else sprintf(buf, "-boot_image any partition_cyl_align=off"); } else if(strstr(textpt, "cyl-align-all") != NULL) { if(mkisofs) sprintf(buf, "-partition_cyl_align all"); else sprintf(buf, "-boot_image any partition_cyl_align=all"); } else if(strstr(textpt, "cyl-align-") != NULL) { if(mkisofs) sprintf(buf, "-partition_cyl_align on"); else sprintf(buf, "-boot_image any partition_cyl_align=on"); } else buf[0]= 0; } else if(strcmp(name, "Partition offset :") == 0 && (num[0] == 0 || num[0] == 16)) { if(mkisofs) sprintf(buf, "-partition_offset %.f", num[0]); else sprintf(buf, "-boot_image any partition_offset=%.f", num[0]); } else if(strcmp(name, "MBR heads per cyl :") == 0 && (num[0] > 0 && num[0] <= 255)) { if(mkisofs) sprintf(buf, "-partition_hd_cyl %.f", num[0]); else sprintf(buf, "-boot_image any partition_hd_cyl=%.f", num[0]); } else if(strcmp(name, "MBR secs per head :") == 0 && (num[0] > 0 && num[0] <= 63)) { if(mkisofs) sprintf(buf, "-partition_sec_hd %.f", num[0]); else sprintf(buf, "-boot_image any partition_sec_hd=%.f", num[0]); } else if(strcmp(name, "MBR partition :") == 0) { sscanf(contentpt, "%lu 0x%lx 0x%lx %lu %lu", &partno, &part_status, &part_type, &mbr_start_block, &mbr_num_blocks); if(mbr_num_blocks > 0 && part_type != 0x00 && part_type != 0xee && (iso_part_blocks <= mbr_start_block || (have_protective_msdos && img_blocks == mbr_parts_end && partno > 1))) { if(!appended_as_gpt) { sprintf(buf, "-append_partition %lu 0x%lx ", partno, part_type); Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) mbr_start_block, ((uint64_t) mbr_start_block) + mbr_num_blocks - 1, "d", imported_iso); Xorriso_record_cmd_linE if(partno >= 1 && (int) partno <= mbr_count) mbrpts[partno - 1].appended= 1; #ifdef Not_any_more_because_padding_is_now_after_partitions appended_partition= 1; #endif } if(part_type == 0xef) { sprintf(buf, "mbr_part%lu_efi.img/", partno); Xorriso_add_offset_size(xorriso, buf, ((off_t) mbr_start_block) * 512, ((off_t) mbr_num_blocks) * 512, 0); Xorriso_record_boot_imglinE } } else if(part_type == 0x41 && have_prep) { if(mkisofs) { sprintf(buf, "-prep-boot-part "); } else { sprintf(buf, "-boot_image any prep_boot_part="); } Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) mbr_start_block, ((uint64_t) mbr_start_block) + mbr_num_blocks - 1, "d", imported_iso); Xorriso_record_cmd_linE sprintf(buf, "mbr_part%lu_prep.img/", partno); Xorriso_add_offset_size(xorriso, buf, ((off_t) mbr_start_block) * 512, ((off_t) mbr_num_blocks) * 512, 0); Xorriso_record_boot_imglinE } else if(part_type == 0xef) { sprintf(buf, "mbr_part%lu_efi.img/", partno); Xorriso_add_offset_size(xorriso, buf, ((off_t) mbr_start_block) * 512, ((off_t) mbr_num_blocks) * 512, 0); Xorriso_record_boot_imglinE } if((part_status & 0x80) && !was_force_bootable) { was_force_bootable= 1; if(buf[0]) { Xorriso_record_cmd_linE } if(mkisofs) sprintf(buf, "--mbr-force-bootable"); else sprintf(buf, "-boot_image any mbr_force_bootable=on"); } } else if(strcmp(name, "MBR partition path :") == 0) { idx= num[0] - 1; if(mbrpts[idx].ptype == 0x41) { sprintf(xorriso->info_text, "Cannot make proposal to mark PReP partition by data file: "); Text_shellsafe(textpt, xorriso->info_text, 1); if(!(flag & 5)) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); continue; } ptype= 0; if(mbrpts[idx].ptype == 0xef) ptype= 3; ret= Xorriso_search_eltorito_path(xorriso, et_imgs, elto_count, textpt, ptype, &et_idx, &efi_boot_part, !!isohybrid); if(ret <= 0) { sprintf(xorriso->info_text, "Cannot make proposal to mark data file as MBR partition without being an El Torito boot image : "); Text_shellsafe(textpt, xorriso->info_text, 1); if(!(flag & 5)) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } else { for(gpt_idx= 0; gpt_idx < gpt_count; gpt_idx++) { if(gpts[gpt_idx].path != NULL) if(strcmp(gpts[gpt_idx].path, textpt) == 0) break; } if(gpt_idx >= gpt_count) { sprintf(xorriso->info_text, "Cannot make proposal to mark data file as MBR partition without being in GPT : "); Text_shellsafe(textpt, xorriso->info_text, 1); if(!(flag & 5)) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } } } else if(strcmp(name, "GPT disk GUID :") == 0) { /* >>> ??? need command to set disk GUID */; } else if(strcmp(name, "GPT partition name :") == 0) { /* >>> ??? need command to set partition name for partition number */; } else if(strcmp(name, "GPT partition GUID :") == 0) { /* >>> ??? need command to set partition GUID for partition number */; } else if(strcmp(name, "GPT partition flags:") == 0) { /* >>> check whether 0x1000000000000001 . Else: complain */; } else if(strcmp(name, "GPT partition path :") == 0) { idx= num[0] - 1; ret= Xorriso_search_eltorito_path(xorriso, et_imgs, elto_count, textpt, gpts[idx].ptype, &et_idx, &efi_boot_part, !!isohybrid); if(ret <= 0) { sprintf(xorriso->info_text, "Cannot make proposal to mark data file as GPT partition : "); Text_shellsafe(textpt, xorriso->info_text, 1); if(!(flag & 5)) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } } else if(strcmp(name, "GPT start and size :") == 0) { idx= num[0] - 1; if(gpts[idx].ptype == 3) part_type= 0xef; else part_type= 0xcd; if(high_block * 4 < num[1] && num[2] > 0 && !gpts[idx].is_gap) { for(mbr_idx = 0; mbr_idx < mbr_count; mbr_idx++) { if(mbrpts[mbr_idx].start_block == num[1]) { if(mbrpts[mbr_idx].block_count != num[2] && !(flag & 1)) { sprintf(xorriso->info_text, "GPT partition %d has same start block as MBR partition %d but different block count (%.f <> %.f)", idx + 1, mbr_idx + 1, num[2], (double) mbrpts[mbr_idx].block_count); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } break; } } if(mbr_idx >= mbr_count) { if(appended_as_gpt == 1) { appended_as_gpt= 2; Xorriso__format_guid(gpts[idx].type_guid, part_type_text, 0); } else { sprintf(part_type_text, "0x%lx", part_type); } sprintf(buf, "-append_partition %d %s ", idx + 1, part_type_text); Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) num[1], (uint64_t) (num[1] + num[2] - 1.0), "d", imported_iso); Xorriso_record_cmd_linE #ifdef Not_any_more_because_padding_is_now_after_partitions appended_partition= 1; #endif } /* Check for isohybri-ish MBR and GPT mix */ if((mbr_count == 1 || (mbr_count == 2 && have_mbr_force_bootable)) && mbrpts[0].ptype == 0xee && have_protective_msdos) { /* real GPT (+/- mbr_force_bootable) is not -part_like_isohybrid */ ret= 0; } else { ret= Xorriso_search_eltorito_lba(xorriso, et_imgs, elto_count, (unsigned int) (num[1] / 4.0), &et_idx, 0); } if(ret > 0) { if(!(et_imgs[et_idx].do_gpt_basdat || et_imgs[et_idx].do_gpt_hfsplus || part_like_isohybrid)) { if(mkisofs) sprintf(buf, "-part_like_isohybrid"); else sprintf(buf, "-boot_image any part_like_isohybrid=on"); Xorriso_record_cmd_linE part_like_isohybrid= 1; appended_as_gpt= 0; } /* mark el torito for -isohybrid-gpt-... */ Xorriso_register_eltorito_gpt(xorriso, et_imgs + et_idx, gpts[idx].ptype, &efi_boot_part, &fe_dummy, 1); } } else if(gpts[idx].ptype == 3 && gpts[idx].has_path == 0 && img_blocks >= num[1] + num[2] && !efi_boot_part) { if(mkisofs) sprintf(buf, "-efi-boot-part "); else sprintf(buf, "-boot_image any efi_boot_part="); Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) num[1], (uint64_t) (num[1] + num[2] - 1.0), "d", imported_iso); efi_boot_part= 2; Xorriso_record_cmd_linE } if(gpts[idx].ptype == 2 && (img_blocks / 2 > num[2] || num[1] >= img_blocks)) { /* Obviously not a HFS+ tree covering the ISO */ sprintf(buf, "gpt_part%d_hfsplus.img/", idx + 1); Xorriso_add_offset_size(xorriso, buf, ((off_t) num[1]) * 512, ((off_t) num[2]) * 512, 0); Xorriso_record_boot_imglinE } else if(gpts[idx].ptype == 3) { sprintf(buf, "gpt_part%d_efi.img/", idx + 1); Xorriso_add_offset_size(xorriso, buf, ((off_t) num[1]) * 512, ((off_t) num[2]) * 512, 0); Xorriso_record_boot_imglinE } } else if(strcmp(name, "APM block size :") == 0) { if(mkisofs) sprintf(buf, "-apm-block-size %.f", num[0]); else sprintf(buf, "-boot_image any apm_block_size=%.f", num[0]); } else if(strcmp(name, "APM partition name :") == 0) { /* >>> ??? need command to set APM partition name for partition number */; } else if(strcmp(name, "APM partition path :") == 0) { idx= num[0] - 1; /* Check El Torito EFI boot images for same path */ for(et_idx= 0; isohybrid && et_idx < elto_count; et_idx++) if(strcmp(et_imgs[et_idx].path, textpt) == 0) { if(apms[idx].ptype == 1) { et_imgs[et_idx].do_apm_hfsplus= 1; cared_for_apm= 1; } break; } } else if(strcmp(name, "APM start and size :") == 0) { idx= num[0] - 1; if(num[1] + num[2] <= img_blocks && apms[idx].ptype == 3 && apms[idx].path == NULL && !have_hfsplus) { /* >>> HFS+ magic number */; /* >>> Read byte 1024 and 1025 after partition start Must be {'H', '+'} (0x482b big endian) */; /* ??? >>> Do this recognition in libisofs ? */ if(mkisofs) sprintf(buf, "-hfsplus"); else sprintf(buf, "-hfsplus on"); Xorriso_record_cmd_linE /* Report commands for blessings and creator-type */ ret= Findjob_new(&job, "/", 0); if(ret <= 0) { Xorriso_no_findjob(xorriso, "xorriso", 0); {ret= -1; goto ex;} } Findjob_set_action_target(job, 53, NULL, 0); xorriso->show_hfs_cmd_count= *cmd_count; xorriso->show_hfs_cmds= cmds; xorriso->show_hfs_cmd_flag= (flag & 1) | ((!!mkisofs) << 1); ret= Xorriso_findi(xorriso, job, NULL, (off_t) 0, NULL, "/", &dir_stbuf, 0, 0); *cmd_count= xorriso->show_hfs_cmd_count; if(ret <= 0) goto ex; have_hfsplus= 1; cared_for_apm= 1; } } else if(strcmp(name, "MIPS-BE boot path :") == 0) { if(mkisofs) sprintf(buf, "-mips-boot "); else sprintf(buf, "-boot_image any mips_path="); Text_shellsafe(textpt, buf, 1); } else if(strcmp(name, "MIPS-LE boot path :") == 0) { if(mkisofs) sprintf(buf, "-mipsel-boot "); else sprintf(buf, "-boot_image any mipsel_path="); Text_shellsafe(textpt, buf, 1); } else if(strcmp(name, "SUN SPARC disklabel:") == 0) { if(mkisofs) sprintf(buf, "-sparc-label "); else sprintf(buf, "-boot_image any sparc_label="); Text_shellsafe(textpt, buf, 1); } else if(strcmp(name, "SPARC GRUB2 path :") == 0) { if(mkisofs) { sprintf(buf, "-B ,"); Xorriso_record_cmd_linE sprintf(buf, "--grub2-sparc-core "); } else sprintf(buf, "-boot_image grub grub2_sparc_core="); Text_shellsafe(textpt, buf, 1); cared_for_sparc= 1; } else if(strcmp(name, "SUN SPARC partition:") == 0) { have_sparc_part= 1; partno= id_tag= perms= num_blocks= 0; start_cyl= 0xffffffff; sscanf(contentpt, "%lu 0x%lx 0x%lx %lu %lu", &partno, &id_tag, &perms, &start_cyl, &mbr_num_blocks); if(partno > 0 && partno < 9 && start_cyl == 0 && mbr_num_blocks >= img_blocks - 600 && mbr_num_blocks <= img_blocks && ((partno == 1 && id_tag == 4) || (partno > 1 && id_tag == 2))) full_sparc_part|= (1 << (partno - 1)); } else if(strcmp(name, "PALO header version:") == 0) { if(mkisofs) sprintf(buf, "-hppa-hdrversion %.f", num[0]); else sprintf(buf, "-boot_image any hppa_hdrversion=%.f", num[0]); } else if(strcmp(name, "HP-PA cmdline :") == 0) { if(mkisofs) sprintf(buf, "-hppa-cmdline "); else sprintf(buf, "-boot_image any hppa_cmdline="); Text_shellsafe(textpt, buf, 1); } else if(strcmp(name, "HP-PA 32-bit kernel:") == 0) { if(mkisofs) sprintf(buf, "-hppa-kernel-32 "); else sprintf(buf, "-boot_image any hppa_kernel_32="); Text_shellsafe(textpt, buf, 1); } else if(strcmp(name, "HP-PA 64-bit kernel:") == 0) { if(mkisofs) sprintf(buf, "-hppa-kernel-64 "); else sprintf(buf, "-boot_image any hppa_kernel_64="); Text_shellsafe(textpt, buf, 1); } else if(strcmp(name, "HP-PA ramdisk :") == 0) { if(mkisofs) sprintf(buf, "-hppa-ramdisk "); else sprintf(buf, "-boot_image any hppa_ramdisk="); Text_shellsafe(textpt, buf, 1); } else if(strcmp(name, "HP-PA bootloader :") == 0) { if(mkisofs) sprintf(buf, "-hppa-bootloader "); else sprintf(buf, "-boot_image any hppa_bootloader="); Text_shellsafe(textpt, buf, 1); } else if(strcmp(name, "DEC Alpha ldr adr :") == 0) { if(!have_alpha_ldr_path) { sprintf(xorriso->info_text, "Cannot enable DEC Alpha boot loader because it is not a data file in the ISO filesystem"); if(!(flag & 5)) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } } else if(strcmp(name, "DEC Alpha ldr path :") == 0) { if(mkisofs) sprintf(buf, "-alpha-boot "); else sprintf(buf, "-boot_image any alpha_boot="); Text_shellsafe(textpt, buf, 1); } if(buf[0]) Xorriso_record_cmd_linE } if(appended_as_gpt == 2) { if(mkisofs) sprintf(buf, "-appended_part_as_gpt"); else sprintf(buf, "-boot_image any appended_part_as=gpt"); Xorriso_record_cmd_linE } if(have_sparc_part) { if(full_sparc_part == 255) { if(mkisofs) { sprintf(buf, "-G "); Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) 0, (uint64_t) 15, "s", imported_iso); Xorriso_record_cmd_linE did_sysarea= 1; sprintf(buf, "-B ..."); Xorriso_record_cmd_linE } else { sprintf(buf, "-boot_image any system_area="); Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) 0, (uint64_t) 15, "s", imported_iso); Xorriso_record_cmd_linE did_sysarea= 1; for(i= 2; i <= 8; i++) { sprintf(buf, "-append_partition %d 0x00 .", i); Xorriso_record_cmd_linE } } cared_for_sparc= 1; } else if(!cared_for_sparc) { sprintf(xorriso->info_text, "Cannot enable SUN Disk Label because of non-trivial partition layout"); if(!(flag & 5)) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } } if(have_sysarea && !did_sysarea) { /* Zeroize old partition tables from -indev */ if(mkisofs) sprintf(buf, "-G "); else sprintf(buf, "-boot_image any system_area="); Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) 0, (uint64_t) 15, "s", imported_iso | ptable_killer); Xorriso_record_cmd_linE did_sysarea= 1; } if(have_sysarea) { strcpy(buf, "systemarea.img/"); Xorriso_add_offset_size(xorriso, buf, (off_t) 0, (off_t) 16 * 2048, 0); Xorriso_record_boot_imglinE } if(iso_mbr_part_type >= 0) { if(mkisofs) sprintf(buf, "-iso_mbr_part_type 0x%2.2x", (unsigned int) iso_mbr_part_type); else sprintf(buf, "-boot_image any iso_mbr_part_type=0x%2.2x", (unsigned int) iso_mbr_part_type); Xorriso_record_cmd_linE } else if(iso_gpt_part_idx >= 0) { if(mkisofs) sprintf(buf, "-iso_mbr_part_type "); else sprintf(buf, "-boot_image any iso_mbr_part_type="); Xorriso__format_guid(gpts[iso_gpt_part_idx].type_guid, buf + strlen(buf), 0); Xorriso_record_cmd_linE } /* Issue commands related to El Torito */ if(elto_count <= 0) goto after_el_torito; if(efi_boot_part == 1) { if(mkisofs) sprintf(buf, "-efi-boot-part --efi-boot-image"); else sprintf(buf, "-boot_image any efi_boot_part=--efi-boot-image"); Xorriso_record_cmd_linE } if(cat_path[0]) { if(mkisofs) sprintf(buf, "-c "); else sprintf(buf, "-boot_image any cat_path="); Text_shellsafe(cat_path, buf, 1); } else { if(mkisofs) sprintf(buf, "--boot-catalog-hide"); else sprintf(buf, "-boot_image any cat_hidden=on"); } Xorriso_record_cmd_linE for(idx= 0; idx < elto_count; idx++) { if(strcmp(et_imgs[idx].pltf, "UEFI") == 0 && et_imgs[idx].extract_size <= 0) { ret= Xorriso_obtain_indev_readsize(xorriso, &indev_blocks, 0); if(ret > 0) { if(indev_blocks > et_imgs[idx].lba && indev_blocks - et_imgs[idx].lba <= Xorriso_max_endless_uefi_sizE) et_imgs[idx].extract_size= indev_blocks - et_imgs[idx].lba; } if(et_imgs[idx].extract_size <= 0) continue; } sprintf(buf, "eltorito_img%d_", idx + 1); for(j= 0; j < 4 && et_imgs[idx].pltf[j] != 0; j++) { buf[strlen(buf) + 1]= 0; buf[strlen(buf)]= tolower(et_imgs[idx].pltf[j]); } strcat(buf, ".img/"); Xorriso_add_offset_size(xorriso, buf, ((off_t) et_imgs[idx].lba) * 2048, ((off_t) et_imgs[idx].extract_size) * 2048, 0); Xorriso_record_boot_imglinE if(et_imgs[idx].ld_seg != 0 && et_imgs[idx].ld_seg != 0x07c0) { if(!(flag & 5)) { sprintf(xorriso->info_text, "Cannot enable EL Torito boot image #%d because its Load Segment is neither 0x0 nor 0x7c0", idx + 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } continue; } if(idx > 0) { if(mkisofs) sprintf(buf, "-eltorito-alt-boot"); else sprintf(buf, "-boot_image any next"); Xorriso_record_cmd_linE } if(et_imgs[idx].path[0] == 0) { /* Check whether appended partition */; for(i= 0; i < mbr_count; i++) if((mbrpts[i].appended || !mbrpts[i].has_path) && mbrpts[i].start_block == ((uint64_t) et_imgs[idx].lba) * 4 && (mbrpts[i].block_count == (uint64_t) et_imgs[idx].ldsiz || et_imgs[idx].ldsiz == 0 || et_imgs[idx].ldsiz == 1)) break; if (i < mbr_count) { if(!mbrpts[i].appended) { mbrpts[i].appended= 1; if(!appended_as_gpt) { sprintf(buf, "-append_partition %lu 0x%lx ", (unsigned long) i + 1, (unsigned long) mbrpts[i].ptype); Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) mbrpts[i].start_block, ((uint64_t) mbrpts[i].start_block) + mbrpts[i].block_count - 1, "d", imported_iso); Xorriso_record_cmd_linE #ifdef Not_any_more_because_padding_is_now_after_partitions appended_partition= 1; #endif buf[0]= 0; } } sprintf(app_pseudo_paths[idx], "--interval:appended_partition_%d_start_%lus_size_%lud:all::", i + 1, (unsigned long) et_imgs[idx].lba, (unsigned long) mbrpts[i].block_count); et_imgs[idx].path= app_pseudo_paths[idx]; } if (et_imgs[idx].path[0] == 0 && efi_boot_part != 2) { for(i= 0; i < gpt_count; i++) { if(have_protective_msdos && ( gpts[i].start_block == ((uint64_t) et_imgs[idx].lba) * 4 && (gpts[i].block_count == (uint64_t) et_imgs[idx].ldsiz || et_imgs[idx].ldsiz == 0 || et_imgs[idx].ldsiz == 1))) break; } if (i < gpt_count) { sprintf(app_pseudo_paths[idx], "--interval:appended_partition_%d_start_%lus_size_%lud:all::", i + 1, (unsigned long) et_imgs[idx].lba, (unsigned long) gpts[i].block_count); et_imgs[idx].path= app_pseudo_paths[idx]; } } if (et_imgs[idx].path[0] == 0) { /* >>> need way to exploit .extract_size by cutting out from ISO */; } if (et_imgs[idx].path[0] == 0) { if(!(flag & 5)) { sprintf(xorriso->info_text, "Cannot enable EL Torito boot image #%d because it is not a data file in the ISO filesystem", idx + 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } buf[0]= 0; continue; } } if(et_imgs[idx].platform_id != 0xef) { if(mkisofs) { if(prev_pltf != et_imgs[idx].platform_id) { sprintf(buf, "-eltorito-platform 0x%2.2x", et_imgs[idx].platform_id); Xorriso_record_cmd_linE } prev_pltf= et_imgs[idx].platform_id; sprintf(buf, "-b "); } else { sprintf(buf, "-boot_image %s bin_path=", et_imgs[idx].boot_image_type); } } else { if(mkisofs) sprintf(buf, "-e "); else sprintf(buf, "-boot_image %s efi_path=", et_imgs[idx].boot_image_type); } Text_shellsafe(et_imgs[idx].path, buf, 1); Xorriso_record_cmd_linE if(!mkisofs) { sprintf(buf, "-boot_image any platform_id=0x%2.2x", et_imgs[idx].platform_id); Xorriso_record_cmd_linE } if(strcmp(et_imgs[idx].emul, "none") == 0) { if(mkisofs) sprintf(buf, "-no-emul-boot"); else sprintf(buf, "-boot_image any emul_type=no_emulation"); } else if(strcmp(et_imgs[idx].emul, "hd") == 0) { if(mkisofs) sprintf(buf, "-hard-disk-boot"); else sprintf(buf, "-boot_image any emul_type=hard_disk"); } else { if(mkisofs) buf[0]= 0; else sprintf(buf, "-boot_image any emul_type=diskette"); } if(buf[0]) Xorriso_record_cmd_linE if(et_imgs[idx].ldsiz >= 0) { if(mkisofs) sprintf(buf, "-boot-load-size %d", et_imgs[idx].ldsiz); else sprintf(buf, "-boot_image any load_size=%d", et_imgs[idx].ldsiz * 512); Xorriso_record_cmd_linE } if(et_imgs[idx].boot_info_table) { if(mkisofs) sprintf(buf, "-boot-info-table"); else sprintf(buf, "-boot_image any boot_info_table=on"); Xorriso_record_cmd_linE } if(et_imgs[idx].grub2_boot_info) { if(mkisofs) sprintf(buf, "--grub2-boot-info"); else sprintf(buf, "-boot_image grub grub2_boot_info=on"); Xorriso_record_cmd_linE } if(et_imgs[idx].id_string[0] != 0) { if(mkisofs) sprintf(buf, "-eltorito-id "); else sprintf(buf, "-boot_image any id_string="); Text_shellsafe(et_imgs[idx].id_string, buf, 1); Xorriso_record_cmd_linE } if(et_imgs[idx].sel_crit[0] != 0) { if(mkisofs) sprintf(buf, "-eltorito-selcrit "); else sprintf(buf, "-boot_image any sel_crit="); Text_shellsafe(et_imgs[idx].sel_crit, buf, 1); Xorriso_record_cmd_linE } if(et_imgs[idx].do_gpt_basdat) { if(mkisofs) sprintf(buf, "-isohybrid-gpt-basdat"); else sprintf(buf, "-boot_image isolinux partition_entry=gpt_basdat"); Xorriso_record_cmd_linE } if(et_imgs[idx].do_gpt_hfsplus) { if(mkisofs) sprintf(buf, "-isohybrid-gpt-hfsplus"); else sprintf(buf, "-boot_image isolinux partition_entry=gpt_hfsplus"); Xorriso_record_cmd_linE } if(et_imgs[idx].do_apm_hfsplus) { if(mkisofs) sprintf(buf, "-isohybrid-apm-hfsplus"); else sprintf(buf, "-boot_image isolinux partition_entry=apm_hfsplus"); Xorriso_record_cmd_linE } } after_el_torito: if((apm_count > 0 && !cared_for_apm) && !(flag & 5)) { sprintf(xorriso->info_text, "Cannot make proposal to produce APM of loaded image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } #ifdef Not_any_more_because_padding_is_now_after_partitions if(appended_partition) { if(mkisofs) sprintf(buf, "-no-pad"); else sprintf(buf, "-padding 0"); Xorriso_record_cmd_linE } #endif /* Not_any_more_because_padding_is_now_after_partitions */ ret= 1; ex: xorriso->show_hfs_cmds= NULL; Findjob_destroy(&job, 0); Xorriso_free_meM(apms); Xorriso_free_meM(gpts); Xorriso_free_meM(mbrpts); if(app_pseudo_paths != NULL) { for(i= 0; i < elto_count; i++) if(app_pseudo_paths[i] != NULL) Xorriso_free_meM(app_pseudo_paths[i]); Xorriso_free_meM(app_pseudo_paths); } Xorriso_free_meM(et_imgs); Xorriso_free_meM(lines); Xorriso_free_meM(buf); return(ret); #undef Xorriso_record_cmd_linE #undef Xorriso_record_boot_imglinE #undef Xorriso_max_endless_uefi_sizE } /* @param flag bit0= currently not significant: report is about El Torito rather than System Area bit1= report -as mkisofs options in cmds bit2= no sorry messages bit15= dispose cmds and boot_imgs */ static int Xorriso_report_to_cmd(struct XorrisO *xorriso, char **et_lines, int et_line_count, char **sa_lines, int sa_line_count, char ***cmds, int *cmd_count, char ***boot_imgs, int *boot_img_count, int flag) { int ret= 0, i; if(flag & (1 << 15)) {ret= 1; goto ex;} *cmds= NULL; *cmd_count= 0; /* Count commands */ ret= Xorriso_scan_report_lines(xorriso, et_lines, et_line_count, sa_lines, sa_line_count, *cmds, cmd_count, *boot_imgs, boot_img_count, 1 | (flag & 6)); if(ret <= 0) goto ex; if(*cmd_count <= 0 && *boot_img_count <= 0) {ret= 2; goto ex;} if(*cmd_count > 0) { Xorriso_alloc_meM(*cmds, char *, *cmd_count); for(i= 0; i < *cmd_count; i++) (*cmds)[i]= NULL; } if(*boot_img_count > 0) { Xorriso_alloc_meM(*boot_imgs, char *, *boot_img_count); for(i= 0; i < *boot_img_count; i++) (*boot_imgs)[i]= NULL; } /* Record commands */ ret= Xorriso_scan_report_lines(xorriso, et_lines, et_line_count, sa_lines, sa_line_count, *cmds, cmd_count, *boot_imgs, boot_img_count, flag & 6); if(ret <= 0) goto ex; ret= 1; ex: if(ret <= 0 || (flag & (1 << 15))) { if(*cmds != NULL) { for(i= 0; i < *cmd_count; i++) if((*cmds)[i] != NULL) Xorriso_free_meM((*cmds)[i]); Xorriso_free_meM(*cmds); *cmds= NULL; } if(*boot_imgs != NULL) { for(i= 0; i < *boot_img_count; i++) if((*boot_imgs)[i] != NULL) Xorriso_free_meM((*boot_imgs)[i]); Xorriso_free_meM(*boot_imgs); *boot_imgs= NULL; } } return(ret); } static void Xorriso_report_lines(struct XorrisO *xorriso, char **lines, int line_count) { int i; for(i = 0; i < line_count ; i++) { sprintf(xorriso->result_line, "%s\n", lines[i]); Xorriso_result(xorriso,0); } } /* @param flag bit0= report El Torito rather than System Area bit1= with form "cmd" do not report but rather execute */ int Xorriso_report_system_area(struct XorrisO *xorriso, char *form, int flag) { int ret, line_count, cmd_count= 0, et_line_count= 0, sa_line_count= 0; int do_cmd= 0, as_mkisofs= 0, i, bin_count, boot_img_count= 0; char **lines = NULL, **et_lines= NULL, **sa_lines= NULL, **cmds= NULL; char **boot_imgs= NULL; uint8_t guid[16]; IsoImage *image; if(strcmp(form, "cmd") == 0 || strcmp(form, "as_mkisofs") == 0 || (flag & 2)) do_cmd= 1; if(strcmp(form, "as_mkisofs") == 0) as_mkisofs= 1; if(strcmp(form, "help") == 0) { if(flag & 1) ret= iso_image_report_el_torito(NULL, &et_lines, &et_line_count, 1); else ret= iso_image_report_system_area(NULL, &sa_lines, &sa_line_count, 1); if(ret <= 0) goto ex; sprintf(xorriso->result_line, "------------------------------------------------------------------------------\n"); Xorriso_result(xorriso, 0); if(flag & 1) sprintf(xorriso->result_line, "With -report_el_torito \"plain\":\n"); else sprintf(xorriso->result_line, "With -report_system_area \"plain\":\n"); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "------------------------------------------------------------------------------\n"); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); } else if(strcmp(form, "") == 0 || strcmp(form, "plain") == 0 || do_cmd) { ret= Xorriso_get_volume(xorriso, &image, 0); if(ret <= 0) goto ex; if(do_cmd || (flag & 1)) ret= iso_image_report_el_torito(image, &et_lines, &et_line_count, 0); if(ret < 0) goto ex; if(do_cmd || !(flag & 1)) ret= iso_image_report_system_area(image, &sa_lines, &sa_line_count, 0); if(ret < 0) goto ex; if(do_cmd) { ret= Xorriso_report_to_cmd(xorriso, et_lines, et_line_count, sa_lines, sa_line_count, &cmds, &cmd_count, &boot_imgs, &boot_img_count, (flag & 1) | (as_mkisofs << 1)); if(ret <= 0) goto ex; } } else if(strncmp(form, "gpt_crc_of:", 11) == 0 && !(flag & 1)) { ret = Xorriso_gpt_crc(xorriso, form + 11, 0); goto ex; } else if(strcmp(form, "make_guid") == 0 && !(flag & 1)) { ret= Xorriso_make_guid(xorriso, xorriso->result_line, 0); if(ret < 0) goto ex; strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso,0); goto ex; } else if(strcmp(form, "gpt_disk_guid") == 0 && !(flag & 1)) { ret= Xorriso_get_volume(xorriso, &image, 0); if(ret <= 0) goto ex; ret= iso_image_report_system_area(image, &sa_lines, &sa_line_count, 0); if(ret <= 0) goto ex; for(i= 0; i < sa_line_count; i++) { if(strncmp(sa_lines[i], "GPT disk GUID : ", 26) == 0) { ret= Hex_to_bin(sa_lines[i] + 26, 16, &bin_count, guid, 0); if(ret < 0 || bin_count != 16) break; Xorriso_format_guid(xorriso, guid, xorriso->result_line, 0); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso,0); ret= 1; goto ex; } } ret= 1; goto ex; } else { sprintf(xorriso->info_text, "%s form parameter not recognized: ", flag & 1 ? "-report_el_torito" : "-report_system_area"); Text_shellsafe(form, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(ret < 0) goto ex; if(flag & 1) { lines= et_lines; line_count= et_line_count; } else { lines= sa_lines; line_count= sa_line_count; } if(!do_cmd) { if(lines == NULL || ret == 0) { if(flag & 1) strcpy(xorriso->info_text, "No El Torito information was loaded"); else strcpy(xorriso->info_text, "No System Area was loaded"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= 2; goto ex; } if(line_count == 0) { if(flag & 1) strcpy(xorriso->info_text, "No El Torito information available"); else strcpy(xorriso->info_text, "System Area only contains 0-bytes"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= 2; goto ex; } } if(flag & 2) { if(cmd_count > 0) { ret= Xorriso_execute_option(xorriso, "-boot_image any discard -boot_image any system_area=/dev/zero", 1 | 16); if(ret <= 0) goto ex; for(i= 0; i < cmd_count; i++) { ret= Xorriso_execute_option(xorriso, cmds[i], 1 | 16); if(ret <= 0) goto ex; } sprintf(xorriso->info_text, "Replayed %d boot related commands", cmd_count); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } else { Xorriso_msgs_submit(xorriso, 0, "No proposals available for boot related commands", 0, "NOTE", 0); ret= 2; goto ex; } } else if(do_cmd) { Xorriso_report_lines(xorriso, cmds, cmd_count); } else { Xorriso_report_lines(xorriso, lines, line_count); } ret= 1; ex:; Xorriso_report_to_cmd(xorriso, NULL, 0, NULL, 0, &cmds, &cmd_count, &boot_imgs, &boot_img_count, 1 << 15); if(et_lines != NULL) iso_image_report_el_torito(NULL, &et_lines, &et_line_count, 1 << 15); if(sa_lines != NULL) iso_image_report_system_area(NULL, &sa_lines, &sa_line_count, 1 << 15); return(ret); } /* @param flag bit15= dispose imgs */ int Xorriso_list_boot_images(struct XorrisO *xorriso, char ***imgs, int *img_count, int flag) { int ret, cmd_count= 0, et_line_count= 0, sa_line_count= 0, boot_img_count= 0; char **et_lines= NULL, **sa_lines= NULL, **cmds= NULL, **boot_imgs= NULL; IsoImage *image; if(flag & (1 << 15)) { boot_imgs= *imgs; boot_img_count= *img_count; Xorriso_report_to_cmd(xorriso, NULL, 0, NULL, 0, &cmds, &cmd_count, &boot_imgs, &boot_img_count, 1 << 15); *imgs= NULL; *img_count= 0; return(1); } *imgs= NULL; *img_count= 0; ret= Xorriso_get_volume(xorriso, &image, 0); if(ret <= 0) goto ex; ret= iso_image_report_el_torito(image, &et_lines, &et_line_count, 0); if(ret < 0) goto ex; ret= iso_image_report_system_area(image, &sa_lines, &sa_line_count, 0); if(ret < 0) goto ex; ret= Xorriso_report_to_cmd(xorriso, et_lines, et_line_count, sa_lines, sa_line_count, &cmds, &cmd_count, &boot_imgs, &boot_img_count, 4); if(ret <= 0) goto ex; *imgs= boot_imgs; *img_count= boot_img_count; boot_imgs= NULL; boot_img_count= 0; ret= 1; ex:; Xorriso_report_to_cmd(xorriso, NULL, 0, NULL, 0, &cmds, &cmd_count, &boot_imgs, &boot_img_count, 1 << 15); if(et_lines != NULL) iso_image_report_el_torito(NULL, &et_lines, &et_line_count, 1 << 15); if(sa_lines != NULL) iso_image_report_system_area(NULL, &sa_lines, &sa_line_count, 1 << 15); return(ret); } libisoburn-1.5.4/xorriso/xorriso_buildstamp.h0000644000175700017510000000012613701321754016433 00000000000000#ifndef Xorriso_build_timestamP #define Xorriso_build_timestamP "-none-given-" #endif libisoburn-1.5.4/xorriso/xorriso_buildstamp_none.h0000644000175700017510000000012613701321754017452 00000000000000#ifndef Xorriso_build_timestamP #define Xorriso_build_timestamP "-none-given-" #endif libisoburn-1.5.4/xorriso/xorrisofs.texi0000644000175700017510000034331114005266014015263 00000000000000\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename xorrisofs.info @settitle GNU xorrisofs 1.5.4 @c %**end of header @c @c man-ignore-lines begin @dircategory Archiving @direntry * Xorrisofs: (xorrisofs). Emulates ISO 9660 program mkisofs @end direntry @c man-ignore-lines end @c @c Notes about embedded man page: @c This texinfo code contains the necessary info to produce a man page @c which resembles much the version of xorriso.1 from which this code @c was originally derived in march 2010. @c One can produce the man page by applying the following rules: @c The first line gets discarded. @c Line start "@c man " will become "", the remainder is put out unaltered. @c Lines "@*" will be converted to ".br" @c "@c man-ignore-lines N" will discard N following lines. @c "@c man-ignore-lines begin" discards all following lines @c up to "@c man-ignore-lines end". @c Line blocks of "@menu" "@end menu" will be discarded. @c "@item word words" becomes "\fBword\fR words". @c @b{...}, @command{...}, @dfn{...}, @emph{...}, @strong{...} @c get mapped to \fB...\fR . @c @abbr{...}, @code{...}, @file{...}, @i{...}, @option{...}, @r{...}, @c @ref{...}, @samp{...},@var{...}, get mapped to ... . @c @ref{...}, @xref{...} get mapped to empty text. @c @email{...} gets mapped to <...> . @c Mapped {...} content is subject to the rules except {...} mapping. @c @minus{} will become "-". @c @@ , @{, @} will get stripped of their first @. @c Other lines which begin by "@" will be discarded. @c In lines not stemming from "@c man", "\" becomes "\\" @c "-" which are not preceded by an uneven number of "\" will get @c prepended one "\". @c @c @c man .\" Hey, EMACS: -*- nroff -*- @c man .\" @c man .\" IMPORTANT NOTE: @c man .\" @c man .\" The original of this file is kept in xorriso/xorrisofs.texi @c man .\" This here was generated by program xorriso/make_xorriso_1 @c man .\" @c man .\" @c man .\" First parameter, NAME, should be all caps @c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection @c man .\" other parameters are allowed: see man(7), man(1) @c man .TH XORRISOFS 1 "Version 1.5.4, Jan 30, 2021" @c man .\" Please adjust this date whenever revising the manpage. @c man .\" @c man .\" Some roff macros, for reference: @c man .\" .nh disable hyphenation @c man .\" .hy enable hyphenation @c man .\" .ad l left justify @c man .\" .ad b justify to both left and right margins @c man .\" .nf disable filling @c man .\" .fi enable filling @c man .\" .br insert line break @c man .\" .sp insert n+1 empty lines @c man .\" for manpage-specific macros, see man(7) @c man .nh @c man-ignore-lines begin @copying xorrisofs - Emulation of ISO 9660 program mkisofs by program xorriso Copyright @copyright{} 2011 - 2021 Thomas Schmitt @quotation Permission is granted to distribute this text freely. @end quotation @end copying @c man-ignore-lines end @titlepage @title Manual of GNU xorriso personality xorrisofs 1.5.4 @author Thomas Schmitt @page @vskip 0pt plus 1filll @insertcopying @end titlepage @contents @ifnottex @node Top @top xorrisofs 1.5.4 @c man-ignore-lines 1 @c man .SH NAME xorrisofs - Emulation of ISO 9660 program mkisofs by program xorriso @end ifnottex @menu * Overview:: Overview * Standards:: ISO 9660, Rock Ridge, Joliet * Insert:: Inserting files into the ISO image * Xorriso:: Relation to program xorriso * Options:: Options * Examples:: Examples * Files:: Files * Environ:: Environment * Seealso:: See also * Bugreport:: Reporting bugs * Legal:: Author, Copyright, Credits * CommandIdx:: Alphabetic Command List * ConceptIdx:: Alphabetic List of Concepts and Objects @end menu @node Overview, Standards, Top, Top @chapter Overview @c man .SH SYNOPSIS @c man .B xorrisofs @c man [ options ] [-o filename ] pathspec [pathspecs ...] @c man .br @c man .SH DESCRIPTION @c man .PP @command{xorrisofs} produces Rock Ridge enhanced ISO 9660 filesystems and add-on sessions to such filesystems. Optionally it can produce Joliet directory trees too. @* @sp 1 @c man .PP @command{xorrisofs} understands options of program mkisofs from cdrtools by Joerg Schilling. Its implementation is part of program xorriso which shares no source code with cdrtools. @c man .SS @node Standards, Insert, Overview, Top @chapter ISO 9660, Rock Ridge, Joliet, HFS+ @c man \fBISO 9660, Rock Ridge, Joliet, HFS+:\fR @c man .br @cindex ISO 9660, _definition @cindex ECMA-119, _definition @strong{ISO 9660} (aka @strong{ECMA-119}) is a read-only filesystem that is mainly used for optical media CD, DVD, BD, but may also reside on other storage devices like disk files, USB sticks or disk partitions. It is widely readable by many operating systems and by boot facilities of personal computers. @* ISO 9660 describes directories and data files by very restricted filenames with no distinction of upper case and lower case. Its metadata do not comply to fundamental POSIX specifications. @* @cindex Rock Ridge, _definition @strong{Rock Ridge} is the name of a set of additional information which enhance an ISO 9660 filesystem so that it can represent a POSIX compliant filesystem with ownership, access permissions, symbolic links, and other attributes. Rock Ridge allows filenames of up to 255 bytes and paths of up to 1024 bytes. @* xorrisofs produces Rock Ridge information by default. It is strongly discouraged to disable this feature. @* @cindex Joliet, _definition @strong{Joliet} is the name of an additional directory tree which provides filenames up to 64 characters encoded as UTF-16. A Joliet tree is mainly interesting for reading the ISO image by operating systems of Microsoft Corporation. Production of this directory tree may be enabled by option -J. @* @cindex ISO 9660:1999, _definition @strong{ISO 9660:1999} is the name of an additional directory tree which provides longer filenames. It allows single file names to have up to 207 characters. It might be of use with some older computer system boot facilities which read neither Rock Ridge nor Joliet but need longer filenames nevertheless. Production of this directory tree may be enabled by option -iso-level 4. @* @cindex HFS+, _definition @strong{HFS+} is the name of a filesystem which is normally used for writing and reading on hard disks and similar devices. It is possible to embed a HFS+ partition into the emerging ISO 9660 image and to mark it by Apple Partition Map entries. This interferes with options which copy data into the first 32 KiB of the ISO image, like -G or -isohybrid-mbr. See option -hfsplus. @* The main purpose for having an embedded HFS+ partition is booting of certain models of Apple computers. @c man .SS @sp 1 @c man .B Inserting files into the ISO image: @node Insert, Xorriso, Standards, Top @chapter Inserting files into the ISO image @c man .PP @command{xorrisofs} deals with two kinds of file addresses: @* @cindex disk_path, _definition @strong{disk_path} is a path to an object in the local filesystem tree. @* @cindex iso_rr_path, _definition @strong{iso_rr_path} is the Rock Ridge address of a file object in the ISO image. If no Rock Ridge information shall be stored in an emerging ISO, then the names will get mapped to ISO 9660 names of limited length and character set. @cindex pathspec, _definition @* @sp 1 @c man .PP A program argument is handled as a @strong{pathspec}, if it is not recognized as original mkisofs option or additional @command{xorrisofs} option. A pathspec depicts an input file object by a disk_path. If option -graft-points is not present, then the behavior depends on the file type of disk_path. Directories get merged with the /-directory of the ISO image. Files of other types get copied into the /-directory. @* If -graft-points is present then each pathspec gets split at the first occurrence of the =-character. The part before the = is taken as @strong{target}, i.e. the iso_rr_path for the file object in the ISO image. The part after the first = is taken as @strong{source}, i.e. the disk_path of the input object. @* It is possible to make =-characters part of the iso_rr_path by preceding them with a \-character. The same must be done for \-characters which shall be part of the iso_rr_path. @* @sp 1 @c man .PP If the source part of the pathspec leads to a directory, then all files underneath this directory get inserted into the image, too. It is possible to exclude particular files from being inserted by help of option -m. @* In case that target already exists, the following rules apply: Directories and other files may overwrite existing non-directories. Directories get merged with existing directories. Non-directories may not overwrite existing directories. @c man .SS @node Xorriso, Options, Insert, Top @chapter Relation to program xorriso @c man \fBRelation to program xorriso:\fR @c man .br @cindex xorriso, mkisofs emulation @command{xorrisofs} is actually a command mode of program @strong{xorriso}, which gets entered either by xorriso command "-as mkisofs" or by starting the program by one of the names "xorrisofs", "mkisofs", "genisoimage", or "genisofs". @* This command mode can be left by argument "@minus{}@minus{}" which leads to generic xorriso command mode. See @strong{man xorriso} for its description. @* @sp 1 @c man .PP xorriso performs image reading and writing by help of libburn, which is mainly intended for optical drives, but also operates on all POSIX file types except directories. @* The program messages call any image file a "drive". File types which are not supported for reading are reported as "blank". The reported free media space may be quite fictional. @* Nevertheless @command{xorrisofs} does not operate directly on optical drives, but rather forces libburn to regard them as general device files. So for writing of sequential optical media (CD, DVD-R, DVD+R, BD-R) one will have to use a burn program. E.g the cdrecord emulation of xorriso. See EXAMPLES. @c man .SS @node Options, Examples, Xorriso, Top @chapter Options @cindex xorriso, options @c man .br @c man .SH OPTIONS @c man .br @menu * Loading:: Image loading * SetInsert:: Settings for file insertion * SetProduct:: Settings for image production * SetCompl:: Settings for standards compliance * SetExtras:: Settings for standards extensions * SetHide:: Settings for file hiding * ImageId:: ISO image ID strings * Bootable:: El Torito Bootable ISO images * SystemArea:: System Area, MBR, GPT, APM, other boot blocks * Charset:: Character sets * Jigdo:: Jigdo Template Extraction * Miscellaneous:: Miscellaneous options @end menu @c man .PP @c man .TP @c man .B Image loading: @node Loading, SetInsert, Options, Options @section Influencing the behavior of image loading @c man .PP The following options control loading of an existing ISO image for the purpose of preparing a suitable add-on session. If they are missing then a new image is composed from scratch. @table @asis @sp 1 @c man .TP @item -M disk_path @kindex -M set path for loading existing ISO image @cindex Session, select path, -M, -prev-session, -dev Set the path from which to load the existing ISO image directory tree on which to base the upcoming directory tree as add-on session. The path must lead to a random-access readable file object. On GNU/Linux: regular data files or block device files. @* A special kind of pseudo disk_path has the form "/dev/fd/"number. It depicts the open file descriptor with the given number, regardless whether the operating system supports this feature by file nodes in /dev/fd or not. E.g. /dev/fd/3 is file descriptor 3 which was opened by the program that later started xorriso. @c man .TP @item -prev-session disk_path @kindex -prev-session set path for loading existing ISO image Alias of -M. @c man .TP @item -dev disk_path @kindex -dev set path for loading existing ISO image Alias of -M. @c man .TP @item -C last_session_start,next_writeable_address @kindex -C set load address and write address offset @cindex Session, set load and write address, -C, -cdrecord-params Set the 2 KiB block address last_session_start from where to read the ISO image out of the file given by option -M. @* Separated by a comma, set the next_writeable_address to which the add-on session will finally be written. Decisive is actually the block address which the intended readers will have to use as superblock address on the intended medium. @* Both values can be inquired from optical media by help of burn programs and cdrecord option -msinfo. xorriso itself can obtain it in its cdrecord emulation. @* values=$(xorriso -as cdrecord dev=/dev/... -msinfo) @* echo $values @* @sp 1 Option -C may be used without option -M to create an ISO image from scratch and prepare it for being finally written to a block address other than 0. Parameter last_session_start must then be set to 0. @c man .TP @item -cdrecord-params last_session_start,next_writeable_address @kindex -cdrecord-params set load address and write address offset Alias of -C. @end table @c man .TP @c man .B Settings for file insertion: @node SetInsert, SetProduct, Loading, Options @section Settings for file insertion @table @asis @sp 1 @c man .TP @item -path-list disk_path @kindex -path-list read pathspecs from disk file @cindex pathspec, read list of, -path-list Read pathspecs line-by-line from disk_file and insert the depicted file objects into the ISO image. If disk_path is "-" then read the pathspecs from standard input. @c man .TP @item @minus{}@minus{}quoted_path_list disk_path @kindex @minus{}@minus{}quoted_path_list read pathspecs from disk file @cindex pathspec, read list of, @minus{}@minus{}quoted_path_list Like option -path-list but reading quoted words rather than plain lines. Whitespace outside of quotes will be discarded. On the other hand it is possible to represent pathspecs which contain newline characters. @* The double quotation mark " and the single quotation mark ' can be used to enclose whitespace and make it part of pathspecs. Each mark type can enclose the marks of the other type. A trailing backslash \ outside quotations or an open quotation cause the next input line to be appended. @c man .TP @item -f @kindex -f follow symbolic links on disk @cindex Links, follow on disk, -f, -follow-links @* Resolve symbolic links on disk rather than storing them as symbolic links in the ISO image. @c man .TP @item -follow-links @kindex -follow-links follow symbolic links on disk Alias of -f. @c man .TP @item -graft-points @kindex -graft-points enable target=source pathspecs @cindex pathspec, enable target=source, -graft-points Enable interpretation of input file pathspecs as combination of iso_rr_path and disk_path, separated by a =-character. @c man .TP @item -m disk_pattern @kindex -m exclude disk files from inserting @cindex Disk files, exclude, -m, -exclude, -x, -old-exclude Exclude files from being inserted into the image. Silently ignored are those files of which the disk_path matches the given shell parser pattern. If no /-character is part of the pattern, then it gets matched against the leaf name of the disk file. @* It is possible to give more than one -m option. @c man .TP @item -exclude @kindex -exclude exclude disk files from inserting Alias of -m. @c man .TP @item -x @kindex -x exclude disk files from inserting @* Alias of -m. @c man .TP @item -old-exclude @kindex -old-exclude exclude disk files from inserting Alias of -m. @c man .TP @item -exclude-list disk_path @kindex -exclude-list exclude disk files from inserting @cindex Disk files, exclude, -hide-list Perform -m using each line out of file disk_path as argument disk_pattern. @c man .TP @item -z @kindex -z enable recognition of zisofs files @cindex zisofs file, enable recognition, -z, -transparent-compression @* Enable recognition and proper processing of zisofs compressed files as produced by program mkzftree. These files will get equipped with the necessary meta data so that a Linux kernel will recognize them and deliver their content in uncompressed form. @c man .TP @item -transparent-compression @kindex -transparent-compression enable recognition of zisofs files Alias of -z. @c man .TP @item --zisofs-version-2 @kindex --zisofs-version-2 enable recognition of zisofs2 files @cindex zisofs2 file, enable recognition, --zisofs-version-2 @* Enable the recognition and proper processing of experimental zisofs version 2 compressed files. The Linux kernel (as of 5.9) does not yet know this format and will complain like @* isofs: Unknown ZF compression algorithm: PZ @* This complaint can be prevented by option --zisofs2-susp-z2 . @* The files will be shown by unaware kernels as they were submitted to xorriso, i.e. with zisofs2 header, block pointer list, and compressed data. @* --zisofs-version-2 also enables -z. @c man .TP @item --zisofs2-susp-z2 @kindex --zisofs2-susp-z2 produce Z2 for version 2 instead of ZF @cindex Z2 instead of ZF for version 2, --zisofs2-susp-z2 Enable the production of SUSP entries "Z2" instead of "ZF" with zisofs2 compressed files. Unaware Linux kernels silently ignore "Z2" entries. @c man .TP @item --zisofs2-susp-zf @kindex --zisofs2-susp-zf produce ZF for version 2 instead of Z2 @cindex ZF instead of Z2 for version 2, --zisofs2-susp-zf Enable the production of SUSP entries "ZF" instead of "Z2" with zisofs2 compressed files. Unaware Linux kernels complain about zisofs2 "ZF" by "Unknown ZF compression algorithm" and thus leave a mark in the system log. @c man .TP @item -root iso_rr_path @kindex -root redirect ISO root directory @cindex ISO root directory, redirect, -root Insert all files under the given iso_rr_path. If option -graft-points is given, then iso_rr_path is prepended to each target part of a pathspec. @* The default for -root is "/". @c man .TP @item -old-root iso_rr_path @kindex -old-root enable incremental insertion @cindex Incremental insertion, enable, -old-root Enable incremental insertion of files into the loaded image. The effective target and source addresses of given pathspecs get compared whether the target already exists in the ISO image and is still identical to the source on disk. Metadata in the ISO image will get adjusted, if they differ from those on disk. New files and files with changed content will get newly added. Target files which do not exist in any of the according pathspec sources will get removed from the ISO directory tree. @* If the effective setting of -root differs from the iso_rr_path given with -old-root, then the files underneath the -old-root directory get cloned underneath the -root directory. Cloning happens before file comparison. @c man .TP @item @minus{}@minus{}old-root-no-ino @kindex @minus{}@minus{}old-root-no-ino disable disk ino with -old-root @cindex Incremental insertion, disable disk ino, @minus{}@minus{}old-root-no-ino Disable recording and use of disk inode numbers. If no disk inode numbers are recorded, then option -old-root will have to read disk file content and compare it with the MD5 checksum that is recorded in the ISO image. @* With recorded disk inode numbers and with credible ctime and mtime, it is possible to detect potential changes in the content without actually reading it. A loophole remains if multiple different filesystems may get mounted at the same directory, like it is habit with /mnt. In this case one has to use option @minus{}@minus{}old-root-devno or disable the inode number shortcut by @minus{}@minus{}old-root-no-ino. @c man .TP @item @minus{}@minus{}old-root-devno @kindex @minus{}@minus{}old-root-devno enable disk idevno with -old-root @cindex Incremental insertion, enable disk devno, @minus{}@minus{}old-root-devno Enable comparison of recorded device numbers together with recorded inode numbers. This works only with good old stable device numbers which get out of fashion, regrettably. If the hard disk has a different device number after each reboot, then this comparison will see all files as changed and thus prevent any incremental size saving. @c man .TP @item @minus{}@minus{}old-root-no-md5 @kindex @minus{}@minus{}old-root-no-md5 disable MD5 with -old-root @cindex Incremental insertion, disable MD5, @minus{}@minus{}old-root-no-md5 Disable recording and use of MD5 checksums for data file content. If neither checksums and nor disk inode numbers are recorded, then option -old-root will have to read ISO image file content when comparing it with disk file content. @end table @c man .TP @c man .B Settings for image production: @node SetProduct, SetCompl, SetInsert, Options @section Settings for image production @table @asis @sp 1 @c man .TP @item -o disk_path @kindex -o set output file address @cindex Output file, set address, -o, -output Set the output file address for the emerging ISO image. If the address exists as regular file, it will be truncated to length 0 when image production begins. It may not already exist as directory. If it does not exist yet then its parent directory must exist and a regular file will get created. @* A special kind of pseudo disk_path has the form "/dev/fd/"number. It depicts the open file descriptor with the given number, regardless whether the operating system supports this feature by file nodes in /dev/fd or not. E.g. /dev/fd/4 is file descriptor 4 which was opened by the program that later started xorriso. @* Default is standard output (/dev/fd/1) which may also be set by disk_path "-". @c man .TP @item -output disk_path @kindex -output set output file address Alias of -o. @c man .TP @item @minus{}@minus{}stdio_sync "on"|"off"|"end"|number @kindex @minus{}@minus{}stdio_sync control forced output to disk files @cindex Forced output, control, @minus{}@minus{}stdio_sync Set the number of bytes after which to force output to disk in order to keep the memory from being clogged with lots of pending data for slow devices. "on" is the same as "16m". Forced output can be disabled by "off", or be delayed by "end" until all data are produced. If a number is chosen, then it must be at least 64k. @* The default with xorriso mkisofs emulation is @minus{}@minus{}stdio_sync "off". @* xorriso uses an inner fifo buffer with default size 4 MiB. So forcing the operating system i/o cache to disk does not necessarily block the simultaneous production of more image content. @c man .TP @item @minus{}@minus{}emul-toc @kindex @minus{}@minus{}emul-toc enable table-of-content emulation @cindex Table-of-content, emulation, @minus{}@minus{}emul-toc Write a second superblock with the first session into random-access files. If further sessions get appended and the first superblock gets updated, then the second superblock will not be overwritten. So it is still possible to mount the first session and to find the start blocks of the further sessions. @* The price is 64 KiB extra space consumption. If -partition_offset is non-zero, then it is 128 KiB plus twice the partition setup. @c man .TP @item @minus{}@minus{}no-emul-toc @kindex @minus{}@minus{}no-emul-toc no table-of-content emulation @cindex Table-of-content, emulation off, @minus{}@minus{}no-emul-toc Do not write a second superblock with the first session into random-access files. @* This is the default. @c man .TP @item @minus{}@minus{}sort-weight weight_number iso_rr_path @kindex @minus{}@minus{}sort-weight set block address sorting weight @cindex Block address, set sorting weight, @minus{}@minus{}sort-weight Attribute a LBA weight number to regular files. If iso_rr_path leads to a directory then all regular files underneath will get the weight_number. @* The weight_number may range from -2147483648 to 2147483647. The higher it is, the lower will be the block address of the file data in the emerging ISO image. Currently the El Torito boot catalog has a hardcoded weight of 1 billion. Normally it should occupy the block with the lowest possible address. Data files get added or loaded with initial weight 0. Boot image files have a default weight of 2. @c man .TP @item @minus{}@minus{}sort-weight-list disk_path @kindex @minus{}@minus{}sort-weight-list set block address sorting weight @cindex Block address, set sorting weight, @minus{}@minus{}sort-weight-list Read pairs of weight number and iso_rr_path from a file of the local filesystem. Apply each pair like with @minus{}@minus{}sort-weight. @* Only the last @minus{}@minus{}sort-weight-list or @minus{}@minus{}sort-weight-patterns of a xorrisofs run gets into effect. @* The weight number is read from the start of the line. The iso_rr_path part of an input line begins immediately after the first blank or tab character of the line. @* Notes for the case that this feature is used within a sequence of generic xorriso commands (not an issue with a pure mkisofs emulation run): @* The addressed files must already be in the ISO image model when you execute @* -as mkisofs @minus{}@minus{}sort-weight-list disk_path @minus{}@minus{} @* Several such commands may be used to apply more than one weight file. @* Data files which are loaded by -indev or -dev get a weight between 1 and 2 exp 28 = 268,435,456, depending on their block address. This shall keep them roughly in the same order if the write method of modifying is applied. @c man .TP @item @minus{}@minus{}sort-weight-patterns disk_path @kindex @minus{}@minus{}sort-weight-patterns set block address sorting weight @cindex Block address, set sorting weight, @minus{}@minus{}sort-weight-patterns Like @minus{}@minus{}sort-weight-list , but expanding the iso_rr_paths as shell parser patterns and applying @minus{}@minus{}sort-weight to each matching file. @c man .TP @item -uid number|name @kindex -uid ownership for all files @cindex Ownership, for all files, -uid Use the given number or locally existing user name as owner id of all files and directories in the emerging filesystem. Empty name or name "-" revoke this feature. @c man .TP @item -gid number|name @kindex -gid group assignment for all files @cindex Group, for all files, -gid Use the given number or locally existing group name as group id of all files and directories in the emerging filesystem. Empty name or name "-" revoke this feature. @c man .TP @item -dir-mode mode @kindex -dir-mode permissions for all directories @cindex Permissions, for all directories, -dir-mode Set the access permissions for all directories in the image to the given mode which is either an octal number beginning with "0" or a comma separated list of statements of the form [ugoa]*[+-=][rwxst]* . E.g. ug=rx,a-rwx @c man .TP @item -file-mode mode @kindex -file-mode permissions for all data files @cindex Permissions, for all data files, -file-mode Like -dir-mode but for all regular data files in the image. @c man .TP @item -pad @kindex -pad add 300 KiB of zeros to ISO tree @cindex Padding, 300 KiB, -pad @* Add 300 KiB to the end of the produced ISO image. This circumvents possible read errors from ISO images which have been written to CD media in TAO mode. The additional bytes are claimed as part of the ISO image if not --emul-toc is given. @* Option -pad is the default. @c man .TP @item -no-pad @kindex -no-pad do not add zeros to ISO tree @cindex Padding, disable, -no-pad Disable padding of 300 KiB to the end of the produced ISO image. This is safe if the image is not meant to be written on CD or if it gets written to CD as only track in write mode SAO. @c man .TP @item @minus{}@minus{}old-empty @kindex @minus{}@minus{}old-empty old block addresses for empty files @cindex Padding, disable, @minus{}@minus{}old-empty Use the old way of of giving block addresses in the range of [0,31] to files with no own data content. The new way is to have a dedicated block to which all such files will point. @end table @c man .TP @c man .B Settings for standards compliance: @node SetCompl, SetExtras, SetProduct, Options @section Settings for standards compliance @table @asis @sp 1 @kindex -iso-level define ISO 9660 limitations @cindex ISO level, specify, -iso-level @c man .TP @item -iso-level number @kindex -iso-level define ISO 9660 limitations @cindex ISO level, specify, -iso-level Specify the ISO 9660 version which defines the limitations of file naming and data file size. The naming restrictions do not apply to the Rock Ridge names but only to the low-level ISO 9660 names. There are three conformance levels: @* Level 1 allows ISO names of the form 8.3 and file size up to 4 GiB - 1. @* Level 2 allows ISO names with up to 32 characters and file size up to 4 GiB - 1. @* Level 3 allows ISO names with up to 32 characters and file size of up to 400 GiB - 200 KiB. (This size limitation is set by the xorriso implementation and not by ISO 9660 which would allow nearly 8 TiB.) @* Pseudo-level 4 enables production of an additional ISO 9660:1999 directory tree. @c man .TP @item -disallow_dir_id_ext @kindex -disallow_dir_id_ext enforce ISO level 1 directory names @cindex ISO level 1, enforce directory names, -disallow_dir_id_ext Do not follow a bad habit of mkisofs which allows dots in the ISO names of directories. On the other hand, some bootable GNU/Linux images depend on this bad habit. @c man .TP @item -U @kindex -U very relaxed filename rules @cindex ISO file names, very relaxed rules, -U, -untranslated-filenames @* This option allows ISO file names without dot and up to 37 characters, ISO file paths longer than 255 characters, and all ASCII characters in file names. Further it omits the semicolon and the version numbers at the end of ISO names. @* This all violates ISO 9660 specs. @c man .TP @item -untranslated-filenames @kindex -untranslated-filenames very relaxed filename rules Alias of -U. @c man .TP @item -untranslated_name_len number @kindex -untranslated_name_len untranslated file names @cindex ISO file names, untranslated, -untranslated_name_len Allow ISO file names up to the given number of characters without any character conversion. The maximum number is 96. If a file name has more characters, then image production will fail deliberately. @* This violates ISO 9660 specs. @c man .TP @item -allow-lowercase @kindex -allow-lowercase lowercase in ISO file names @cindex ISO file names, allow lowercase, -allow-lowercase Allow lowercase character in ISO file names. @* This violates ISO 9660 specs. @c man .TP @item -relaxed-filenames @kindex -relaxed-filenames 7-bit special characters in ISO file names @cindex ISO file names, 7-bit special characters, -relaxed-filenames Allow nearly all 7-bit characters in ISO file names. Not allowed are 0x0 and '/'. If not option -allow-lowercase is given, then lowercase letters get converted to uppercase. @* This violates ISO 9660 specs. @c man .TP @item -d @kindex -d omit trailing dot in ISO file names @cindex ISO file names, omit trailing dot, -d, -omit-period @* Do not add trailing dot to ISO file names without dot. @* This violates ISO 9660 specs. @c man .TP @item -omit-period @kindex -omit-period omit trailing dot in ISO file names Alias of -d. @c man .TP @item -l @kindex -l allow 31 characters in ISO file names @cindex ISO file names, allow 31 characters, -l, -full-iso9660-filenames @* Allow up to 31 characters in ISO file names. @c man .TP @item -full-iso9660-filenames @kindex -full-iso9660-filenames allow 31 characters in ISO file names Alias of -l. @c man .TP @item -max-iso9660-filenames @kindex -max-iso9660-filenames allow 37 characters in ISO file names @cindex ISO file names, allow 37 characters, -max-iso9660-filenames Allow up to 37 characters in ISO file names. @* This violates ISO 9660 specs. @c man .TP @item -N @kindex -N omit version number in ISO file names @cindex ISO file names, omit version number, -N, -omit-version-number @* Omit the semicolon and the version numbers at the end of ISO names. @* This violates ISO 9660 specs. @c man .TP @item -omit-version-number @kindex -omit-version-number omit version number in ISO file names Alias of -N. @end table @c man .TP @c man .B Settings for standards extensions: @node SetExtras, SetHide, SetCompl, Options @section Settings for standards extensions @table @asis @sp 1 @c man .TP @item -R @kindex -R Rock Ridge (is enabled by default) @cindex Rock Ridge, (enabled by default), -R, -rock @* With mkisofs this option enables Rock Ridge extensions. @command{xorrisofs} produces them by default. It is strongly discouraged to disable them by option @minus{}@minus{}norock. @c man .TP @item -rock @kindex -rock Rock Ridge (is enabled by default) @* Alias of -R. @c man .TP @item -r @kindex -r Rock Ridge with altered owner and permission @cindex Rock Ridge, altered owner and permission, -r, -rational-rock @* Enable Rock Ridge and set user and group id of all files in the ISO image to 0. Grant r-permissions to all. Deny all w-permissions. If any x-permission is set, grant x-permission to all. Remove s-bit and t-bit. @* These attribute changes stay delayed until mkisofs emulation ends. Within the same -as mkisofs emulation command they can be revoked by a subsequent option @minus{}@minus{}norock. For compatibility reasons, option -R does not revoke the changes ordered by -r. @c man .TP @item -rational-rock @kindex -rational-rock Rock Ridge with altered owner and permission Alias of -r. @c man .TP @item @minus{}@minus{}norock @kindex @minus{}@minus{}norock disable Rock Ridge production @cindex Rock Ridge, disable production, @minus{}@minus{}norock @* This option disables the production of Rock Ridge extensions for the ISO 9660 file objects. The multi-session capabilities of @command{xorrisofs} depend much on the naming fidelity of Rock Ridge. So it is strongly discouraged to disable it by this option, except for the special use case to revoke the effect of -r by: @minus{}@minus{}norock -R @c man .TP @item @minus{}@minus{}set_all_file_dates timestring @kindex @minus{}@minus{}set_all_file_dates set all file timestamps @cindex File timestamps, set all, @minus{}@minus{}set_all_file_dates Set mtime, atime, and ctime of all files and directories to the given time. @* Valid timestring formats are: 'Nov 8 14:51:13 CET 2007', 110814512007.13, 2007110814511300. See also @minus{}@minus{}modification-date= and man xorriso, Examples of input timestrings. @* If the timestring is "set_to_mtime", then the atime and ctime of each file and directory get set to the value found in their mtime. @* These actions stay delayed until actual ISO production begins. Up to then they can be revoked by @minus{}@minus{}set_all_file_dates with empty timestring or timestring "default". @* The timestamps of the El Torito boot catalog file get refreshed when the ISO is produced. They can be influenced by @minus{}@minus{}modification-date=. @c man .TP @item -file_name_limit number @kindex -file_name_limit curbs length of file names @cindex File names, curb length, -file_name_limit Set the maximum permissible length for file names in the range of 64 to 255. Path components which are longer than the given number will get truncated and have their last 33 bytes overwritten by a colon ':' and the hex representation of the MD5 of the first 4095 bytes of the whole oversized name. Potential incomplete UTF-8 characters will get their leading bytes replaced by '_'. @* Linux kernels up to at least 4.1 misrepresent names of length 254 and 255. If you expect such names in or under disk_paths and plan to mount the ISO by such Linux kernels, consider to set -file_name_limit 253. @c man .TP @item -D @kindex -D allow deep directory hierarchies @cindex Deep directories, allow, -D, -disable-deep-relocation The standard ECMA-119 demands that no path in the image shall have more than 8 name components or 255 characters. Therefore it would be necessary to move deeper directory trees to a higher directory. Rock Ridge offers an opportunity to let these relocated directories appear at their original deep position, but this feature might not be implemented properly by operating systems which mount the image. @* Option -D disables this deep directory relocation, and thus violates ISO 9660 specs. @* xorrisofs has -D set by default. If given explicitly then it overrides the options -rr_reloc_dir and -hide-rr-moved. @c man .TP @item -disable-deep-relocation @kindex -disable-deep-relocation allow deep directory hierarchies Alias of -D. @c man .TP @item -rr_reloc_dir name @kindex -rr_reloc_dir set deep directory relocation target @cindex Deep directories, relocation target, -rr_reloc_dir Enable the relocation of deep directories and thus avoid ECMA-119 file paths of more than 8 name components or 255 characters. Directories which lead to such file paths will get moved to a directory in the root directory of the image. Its name gets set by this option. It is permissible to use the root directory itself. @* The overall directory tree will appear originally deep when interpreted as Rock Ridge tree. It will appear as re-arranged if only ECMA-119 information is considered. @* If the given relocation target directory does not already exist when image production begins, then it will get created and marked for Rock Ridge as relocation artefact. At least on GNU/Linux it will not be displayed in mounted Rock Ridge images. @* The name must not contain a '/' character after its first character and it must not be longer than 255 bytes. @* This option has no effect if option -D is present. @c man .TP @item -hide-rr-moved @kindex -hide-rr-moved set deep directory relocation target @cindex Deep directories, relocation target, -hide-rr-moved Alias of -rr_reloc_dir "/.rr_moved" @c man .TP @item @minus{}@minus{}for_backup @kindex @minus{}@minus{}for_backup Enable backup fidelity @cindex Backup, enable fidelity, @minus{}@minus{}for_backup Enable all options which improve backup fidelity: @* @minus{}@minus{}acl, @minus{}@minus{}xattr-any, @minus{}@minus{}md5, @minus{}@minus{}hardlinks. @* If you later restore a backup with xattr from non-user namespaces, then make sure that the target operating system and filesystem know what these attributes mean. Possibly you will need administrator privileges to record or restore such attributes. At recording time, xorriso will try to tolerate missing privileges and just record what is readable. @* Option -xattr after option -for_backup excludes non-user attributes from being recorded. @c man .TP @item @minus{}@minus{}acl @kindex @minus{}@minus{}acl Recording of ACLs @cindex ACL, record and load, @minus{}@minus{}acl @* Enable recording and loading of ACLs from GNU/Linux or FreeBSD (see man getfacl, man acl). They will not be in effect with mounted ISO images. But xorriso can restore them on the same systems when extracting files from the ISO image. @c man .TP @item @minus{}@minus{}xattr @kindex @minus{}@minus{}xattr Recording of user xattr @cindex xattr, record and load, @minus{}@minus{}xattr @* Enable recording and loading of GNU/Linux or FreeBSD extended attributes in user namespace (see man getfattr and man attr, man getextattr and man 9 extattr, respectively). They will not be in effect with mounted ISO images. But xorriso can restore them on the same systems when extracting files from the ISO image. @c man .TP @item @minus{}@minus{}xattr-any @kindex @minus{}@minus{}xattr Recording of any xattr @cindex xattr, record and load, @minus{}@minus{}xattr-any @* Enable recording and loading of GNU/Linux or FreeBSD extended attributes in all namespaces. This might need administrator privileges, even if the owner of the disk file tries to read the attributes. @c man .TP @item @minus{}@minus{}md5 @kindex @minus{}@minus{}md5 Recording of MD5 checksums @cindex MD5, record and load, @minus{}@minus{}md5 @* Enable recording of MD5 checksums for the overall ISO image and for each single data file in the image. xorriso can check the content of an ISO image with these sums and raise alert on mismatch. See man xorriso, options -check_media, check_md5_r. xorriso can print recorded MD5 checksums. E.g. by: @* -find / -exec get_md5 @c man .TP @item @minus{}@minus{}hardlinks @kindex @minus{}@minus{}hardlinks Recording of hardlink relations @cindex Links, record and load hard links, @minus{}@minus{}hardlinks Enable loading and recording of hardlink relations. Search for families of iso_rr files which stem from the same disk file, have identical content filtering and have identical properties. The members of each family get the same inode number in the ISO image. @* Whether these numbers are respected at mount time depends on the operating system. xorriso can create hardlink families when extracting files from the ISO image. @c man .TP @item @minus{}@minus{}scdbackup_tag disk_path record_name @kindex @minus{}@minus{}scdbackup_tag Recording of MD5 checksum @cindex scdbackup, record checksum tag, @minus{}@minus{}scdbackup_tag Append a scdbackup checksum record to the image. This works only if the parameter next_writeable_address of option -C is 0 and --md5 is enabled. If disk_path is not an empty string, then append a scdbackup checksum record to the end of this file. record_name is a word that gets part of tag and record. @* Program scdbackup_verify will recognize and verify tag and file record. @* An empty record_name disables this feature. @c man .TP @item -J @kindex -J enable production of Joliet directory tree @cindex Joliet, enable, -J, -joliet @* Enable the production of an additional Joliet directory tree along with the ISO 9660 Rock Ridge tree. @c man .TP @item -joliet @kindex -joliet enable production of Joliet directory tree Alias of -J. @c man .TP @item -joliet-long @kindex -joliet-long allow longer Joliet names @cindex Joliet, allows longer names, -joliet-long Allow 103 characters in Joliet file names rather than 64 as is prescribed by the specification. Allow Joliet paths longer than the prescribed limit of 240 characters. @* Oversized names get truncated. Without this option, oversized paths get excluded from the Joliet tree. @c man .TP @item -joliet-utf16 @kindex -joliet-utf16 use UTF-16 with Joliet names @cindex UTF-16, for Joliet paths, -joliet-utf16 Encode Joliet file names in UTF-16BE rather than UCS-2. The difference is with characters which are not present in UCS-2 and get encoded in UTF-16 by 2 words of 16 bit each. Both words then stem from a reserved subset of UCS-2. @c man .TP @item -hfsplus @kindex -hfsplus enable production of HFS+ partition @cindex HFS+, enables production Enable the production of an additional HFS+ filesystem inside the ISO 9660 image and mark it by Apple Partition Map (APM) entries in the System Area, the first 32 KiB of the image. @* This may collide with options like -G or -isohybrid-mbr which submit user data for inclusion in the same address range. The first 8 bytes of the System Area get overwritten by @{ 0x45, 0x52, 0x08 0x00, 0xeb, 0x02, 0xff, 0xff @} which can be executed as x86 machine code without negative effects. So if an MBR gets combined with this feature, then its first 8 bytes should contain no essential commands. @* The next blocks of 2 KiB in the System Area will be occupied by APM entries. The first one covers the part of the ISO image before the HFS+ filesystem metadata. The second one marks the range from HFS+ metadata to the end of file content data. If more ISO image data follow, then a third partition entry gets produced. Other features of xorriso might cause the need for more APM entries. @* Be aware that HFS+ is case-insensitive although it can record file names with upper-case and lower-case letters. Therefore, file names from the iso_rr name tree may collide in the HFS+ name tree. In this case they get changed by adding underscore characters and counting numbers. In case of very long names, it might be necessary to map them to "MANGLED_...". @* WARNING: @* The HFS+ implementation in libisofs has a limit of 125,829,120 bytes for the size of the overall directory tree. This suffices for about 300,000 files of normal name length. If the limit gets exceeded, a FAILURE event will be issued and the ISO production will not happen. @c man .TP @item -hfsplus-serial-no @kindex -hfsplus-serial-no set HFS+ serial number @cindex HFS+, set serial number Set a string of 16 digits "0" to "9" and letters "a" to "f", which will be used as unique serial number of an emerging HFS+ filesystem. @c man .TP @item -hfsplus-block-size number @kindex -hfsplus-block-size set HFS+ allocation block size @cindex HFS+, set allocation block size Set the allocation block size to be used when producing HFS+ filesystems. Permissible are 512, 2048, or 0. The latter lets the program decide. @c man .TP @item -apm-block-size number @kindex -hfsplus-block-size set APM block size @cindex HFS+, set APM block size Set the block size to be used when describing partitions by an Apple Partition Map. Permissible are 512, 2048, or 0. The latter lets the program decide. @* Note that size 512 is not compatible with production of GPT, and that size 2048 will not be mountable -t hfsplus at least by older Linux kernels. @c man .TP @item -hfsplus-file-creator-type creator type iso_rr_path @kindex -hfsplus-file-creator-type HFS+ creator-type attribute @cindex HFS+, set creator and type of file, -hfsplus-file-creator-type Set the HFS+ creator and type attributes of a file in the emerging image. These are two codes of 4 characters each. @c man .TP @item -hfs-bless-by blessing iso_rr_path @kindex -hfs-bless-by HFS+ blessing @cindex HFS+, issue blessing, -hfs-bless-by Issue a HFS+ blessing. They are roles which can be attributed to up to four directories and a data file: @* "ppc_bootdir", "intel_bootfile", "show_folder", "os9_folder", "osx_folder". @* They may be abbreviated as "p", "i", "s", "9", and "x". @* Each such role can be attributed to at most one file object. "intel_bootfile" is the one that would apply to a data file. All others apply to directories. No file object can bear more than one blessing. @c man .TP @item -hfs-bless disk_path @kindex -hfs-bless HFS+ blessing ppc_bootdir @cindex HFS+, issue blessing ppc_bootdir, -hfs-bless Issue HFS+ blessing "ppc_bootdir" to the directory which stems from the directory disk_path in the local filesystem tree. @* This works only if there is at least one data file underneath the directory. disk_path can become ambiguous if files from different local filesystem sub-trees are put into the same sub-tree of the ISO image. Consider to use -hfs-bless-by "p" for unambiguous addressing via iso_rr_path. @end table @c man .TP @c man .B Settings for file hiding: @node SetHide, ImageId, SetExtras, Options @section Settings for file hiding @table @asis @sp 1 @c man .TP @item -hide disk_path_pattern @kindex -hide keep matching files invisible in ISO tree @cindex Hiding, from ISO and Rock Ridge, -hide Make files invisible in the directory tree of ISO 9660 and Rock Ridge, if their disk_path matches the given shell parser pattern. The data content of such hidden files will be included in the resulting image, even if they do not show up in any directory. But you will need own means to find nameless data in the image. @* This command does not apply to the boot catalog. @c man .TP @item -hide-list disk_path @kindex -hide-list keep matching files invisible in ISO tree @cindex Hiding, from ISO and Rock Ridge, -hide-list Perform -hide using each line out of file disk_path as argument disk_path_pattern. @c man .TP @item -hide-joliet disk_path_pattern @kindex -hide-joliet keep matching files invisible in Joliet tree @cindex Hiding, from Joliet, -hide-joliet Like option -hide but making files invisible in the directory tree of Joliet, if their disk_path matches the given shell parser pattern. @c man .TP @item -hide-joliet-list disk_path @kindex -hide-joliet-list keep matching files invisible in Joliet tree @cindex Hiding, from Joliet, -hide-joliet-list Perform -hide-joliet using each line out of file disk_path as argument disk_path_pattern. @c man .TP @item -hide-hfsplus disk_path_pattern @kindex -hide-hfsplus keep matching files invisible in HFS+ tree @cindex Hiding, from HFS+, -hide-hfsplus Like option -hide but making files invisible in the directory tree of HFS+, if their disk_path matches the given shell parser pattern. @c man .TP @item -hide-hfsplus-list disk_path @kindex -hide-hfsplus-list keep matching files invisible in HFS+ tree @cindex Hiding, from HFS+, -hide-hfsplus-list Perform -hide-hfsplus using each line out of file disk_path as argument disk_path_pattern. @end table @c man .TP @c man .B ISO image ID strings: @node ImageId, Bootable, SetHide, Options @section ISO image ID strings @c man .PP The following strings and file addresses get stored in the Primary Volume Descriptor of the ISO9660 image. The file addresses are ISO 9660 paths. These files should have iso_rr_paths which consist only of the characters [A-Z0-9_] and exactly one dot which separates at most 8 characters from at most 3 characters. @table @asis @sp 1 @c man .TP @item -V text @kindex -V set Volume Id @cindex Volume Id, set, -V, -volid Set the Volume Id of the ISO image. xorriso accepts any text up to 32 characters, but according to rarely obeyed specs stricter rules apply: @* Conformant are ASCII characters out of [A-Z0-9_]. Like: "IMAGE_23" @* Joliet allows 16 UCS-2 characters. Like: "Windows name" @* Be aware that the volume id might get used automatically as name of the mount point when the medium is inserted into a playful computer system. @c man .TP @item -volid text @kindex -volid set Volume Id Alias of -V. @c man .TP @item -volset text @kindex -volset set Volume Set Id @cindex Volume Set Id, set, -volset Set the Volume Set Id of the ISO image. Permissible are up to 128 characters. @c man .TP @item -P text @kindex -P set Publisher Id @cindex Publisher Id, set, -P, -publisher Set the Publisher Id of the ISO image. This may identify the person or organisation who specified what shall be recorded. Permissible are up to 128 characters. @c man .TP @item -publisher text @kindex -publisher set Publisher Id Alias of -P. @c man .TP @item -A text @kindex -A set Application Id @cindex Application Id, set, -A, -appid Set the Application Id of the ISO image. This may identify the specification of how the data are recorded. Permissible are up to 128 characters. @* The special text "@@xorriso@@" gets converted to the id string of xorriso which is normally written as Preparer Id. It is a wrong tradition to write the program id as Application Id. @c man .TP @item -appid text @kindex -appid set Application Id Alias of -A. @c man .TP @item -sysid text @kindex -sysid set System Id @cindex System Id, set, -sysid Set the System Id of the ISO image. This may identify the system which can recognize and act upon the content of the System Area in image blocks 0 to 15. Permissible are up to 32 characters. @c man .TP @item -p text @kindex -p set Preparer Id @cindex Preparer Id, set, -p Set the Preparer Id of the ISO image. This may identify the person or other entity which controls the preparation of the data which shall be recorded. Normally this should be the id of xorriso and not of the person or program which operates xorriso. Please avoid to change it. Permissible are up to 128 characters. @* The special text "@@xorriso@@" gets converted to the id string of xorriso which is default at program startup. @c man .TP @item -preparer text @kindex -preparer set Preparer Id Alias of -p. @c man .TP @item -abstract iso_path @kindex -abstract set Abstract File path @cindex Abstract File, set path, -abstract Set the address of the Abstract File of the ISO image. This should be the ISO 9660 path of a file in the image which contains an abstract statement about the image content. Permissible are up to 37 characters. @c man .TP @item -biblio iso_path @kindex -biblio set Biblio File path @cindex Biblio File, set path, -biblio Set the address of the Biblio File of the ISO image. This should be the ISO 9660 path of a file in the image which contains bibliographic records. Permissible are up to 37 characters. @c man .TP @item -copyright iso_path @kindex -copyright set Copyright File path @cindex Copyright File, set path, -copyright Set the address of the Copyright File of the ISO image. This should be the ISO 9660 path of a file in the image which contains a copyright statement. Permissible are up to 37 characters. @c man .TP @item @minus{}@minus{}modification-date=YYYYMMDDhhmmsscc @kindex @minus{}@minus{}modification-date set ISO image timestamps @cindex ISO image, set timestamps, @minus{}@minus{}modification-date= Set a timestring that overrides ISO image creation and modification timestamps literally. It must consist of 16 decimal digits which form YYYYMMDDhhmmsscc, with YYYY between 1970 and 2999. Time zone is GMT. It is supposed to match this GRUB line: @* search @minus{}@minus{}fs-uuid @minus{}@minus{}set YYYY-MM-DD-hh-mm-ss-cc @* E.g. 2010040711405800 is 7 Apr 2010 11:40:58 (+0 centiseconds). @* Among the influenced timestamps are: isohybrid MBR id, El Torito boot catalog file, HFS+ superblock. @c man .TP @item @minus{}@minus{}application_use character|0xXY|disk_path @kindex @minus{}@minus{}application_use set Application Use field @cindex ISO image, set Application Use field, @minus{}@minus{}application_use Specify the content of the Application Use field which can take at most 512 bytes. @* If the parameter of this command is empty, then the field is filled with 512 0-bytes. If it is a single character, then it gets repeated 512 times. If it begins by "0x" followed by two hex digits [0-9a-fA-F], then the digits are read as byte value which gets repeated 512 times. @* Any other parameter text is used as disk_path to open a data file and to read up to 512 bytes from it. If the file is smaller than 512 bytes, then the remaining bytes in the field get set to binary 0. @end table @c man .TP @c man .B El Torito Bootable ISO images: @node Bootable, SystemArea, ImageId, Options @section El Torito Bootable ISO images @c man .PP The precondition for a bootable ISO image is to have in the ISO image the files of a boot loader. The boot facilities of computers get directed to such files, which usually execute further program files from the ISO image. @command{xorrisofs} can produce several kinds of boot block or boot record, which become part of the ISO image, and get interpreted by the according boot facility. @* @c man .PP @sp 1 @cindex El Torito, _definition An @strong{El Torito} boot record points the bootstrapping facility to a boot catalog with one or more boot images, which are binary program files stored in the ISO image. The content of the boot image files is not in the scope of El Torito. @* xorriso composes the boot catalog according to the boot image files given and structured by options -b, -e, -eltorito-alt-boot, and @minus{}@minus{}efi-boot. Often it contains only one entry. @* Normally the boot images are data files inside the ISO filesystem. By special path "--interval:appended_partition_NNN:all::" it is possible to refer to an appended partition. The number NNN gives the partition number as used with the corresponding option -append_partition. E.g.: @* -append_partition 2 0xef /tmp/efi.img @* -e --interval:appended_partition_2:all:: @* El Torito gets interpreted by boot facilities PC-BIOS and EFI. Most bootable GNU/Linux CDs are equipped with ISOLINUX or GRUB boot images for PC-BIOS. @* @command{xorrisofs} supports the example options out of the ISOLINUX wiki, the options used in GRUB script grub-mkrescue, and the example in the FreeBSD AvgLiveCD wiki. @* @c man .PP @sp 1 For CD booting via boot facilities other than PC-BIOS and EFI, and for booting from USB sticks or hard disks, see the next section about the System Area. @* @table @asis @sp 1 @c man .TP @item -b iso_rr_path @kindex -b El Torito PC-BIOS boot image @cindex Bootability, control, -b, -eltorito-boot Specify the boot image file which shall be mentioned in the current entry of the El Torito boot catalog. It will be marked as suitable for PC-BIOS. @* With boot images from ISOLINUX and GRUB this option should be accompanied by options -c , -no-emul-boot , -boot-load-size 4 , -boot-info-table. @c man .TP @item -eltorito-boot iso_rr_path @kindex -eltorito-boot El Torito PC-BIOS boot image Alias of -b. @c man .TP @item -eltorito-alt-boot @kindex -eltorito-alt-boot begin next boot catalog entry @cindex Bootability, next entry, -eltorito-alt-boot Finalize the current El Torito boot catalog entry and begin a new one. A boot image file and all its necessary options shall be specified before option -eltorito-alt-boot. All further El Torito boot options apply to the new catalog entry. Up to 32 catalog entries are possible. @c man .TP @item -e iso_rr_path @kindex -e El Torito EFI boot image @cindex Bootability, control, -e Specify the boot image file which shall be mentioned in the current entry of the El Torito boot catalog. It will be marked as suitable for EFI. @* Option -e should be followed by option -no-emul-boot and no other El Torito options before an eventual -eltorito-alt-boot. @c man .TP @item @minus{}@minus{}efi-boot iso_rr_path @kindex @minus{}@minus{}efi-boot El Torito EFI boot image @cindex Bootability, control, @minus{}@minus{}efi-boot Perform -eltorito-alt-boot, option -e with the given iso_rr_path, -no-emul-boot, and again -eltorito-alt-boot. This gesture is used for achieving EFI-bootability of the GRUB2 rescue CD. @c man .TP @item -eltorito-platform "x86"|"PPC"|"Mac"|"efi"|0xnn|nnn @kindex -eltorito-platform El Torito Platform Id @cindex Bootability, control, -eltorito-platform Set the Platform Id number for the next option -b or -eltorito-boot. The number may be chosen by a platform name or by a number between 0 and 255 (0x00 and 0xFF). "x86" = 0 is for PC-BIOS, "PPC" = 1 for some PowerPC systems, "Mac" = 2 for some MacIntosh systems, "efi" = 0xEF for EFI on modern PCs with x86 compatible CPUs or others. @* If the new platform id differs from the previous one, -eltorito-alt-boot gets performed. @c man .TP @item -boot-load-size number|"full" @kindex -boot-load-size El Torito boot image load size @cindex Bootability, boot image load size, -boot-load-size Set the number of 512-byte blocks to be loaded at boot time from the boot image in the current catalog entry. @* Non-emulating BIOS bootimages usually need a load size of 4. Nevertheless the default setting of mkisofs is to use the full size of the boot image rounded up to a multiple of 4 512-byte blocks. This default may be explicitly enforced by the word "full" instead of a number. @* EFI boot images usually get set the number of blocks occupied by the boot image file. @* El Torito cannot represent load sizes higher than 65535. @c man .TP @item -hard-disk-boot @kindex -hard-disk-boot El Torito boot image emulation @cindex Bootability, boot image emulation, -hard-disk-boot Mark the boot image in the current catalog entry as emulated hard disk. (Not suitable for any known boot loader.) @c man .TP @item -no-emul-boot @kindex -no-emul-boot El Torito boot image emulation @cindex Bootability, no boot image emulation, -no-emul-boot Mark the boot image in the current catalog entry as not emulating floppy or hard disk. (This is to be used with all known boot loaders.) @* If neither -hard-disk-boot nor -no-emul-boot is given, then the boot image will be marked as emulating a floppy. (Not suitable for any known boot loader.) @c man .TP @item -eltorito-id text|56_hexdigits @kindex -eltorito-id El Torito boot section id string @cindex Bootability, El Torito section id string, -eltorito-id Define the ID string of the boot catalog section where the boot image will be listed. If the value consists of 56 characters [0-9A-Fa-f] then it is converted into 28 bytes, else the first 28 characters become the ID string. The ID string of the first boot image becomes the overall catalog ID. It is limited to 24 characters. Other id_strings become section IDs. @c man .TP @item -eltorito-selcrit hexdigits @kindex -eltorito-selcrit El Torito boot selection criteria @cindex Bootability, El Torito selection criteria, -eltorito-selcrit Define the Selection Criteria of the boot image. Up to 20 bytes get read from the given characters [0-9A-Fa-f]. They get attributed to the boot image entry in the catalog. @c man .TP @item -boot-info-table @kindex -boot-info-table Patch El Torito boot image @cindex Bootability, boot image patching, -boot-info-table Overwrite bytes 8 to 63 in the current boot image. The information will be supplied by xorriso in the course of image production: Block address of the Primary Volume Descriptor, block address of the boot image file, size of the boot image file. @c man .TP @item @minus{}@minus{}grub2-boot-info @kindex @minus{}@minus{}grub2-boot-info Patch El Torito boot image @cindex Bootability, boot image patching, @minus{}@minus{}grub2-boot-info Overwrite bytes 2548 to 2555 in the current boot image by the address of that boot image. The address is written as 64 bit little-endian number. It is the 2KB block address of the boot image content, multiplied by 4, and then incremented by 5. @c man .TP @item -c iso_rr_path @kindex -c El Torito boot catalog name @cindex Bootability, boot catalog name, -c, -eltorito-catalog Set the address of the El Torito boot catalog file within the image. This file address is not significant for the booting PC-BIOS or EFI, but it may later be read by other programs in order to learn about the available boot images. @c man .TP @item -eltorito-catalog iso_rr_path @kindex -eltorito-catalog El Torito boot catalog name Alias of -c. @c man .TP @item @minus{}@minus{}boot-catalog-hide @kindex @minus{}@minus{}boot-catalog-hide Hide El Torito boot catalog @cindex Bootability, boot catalog hidden, @minus{}@minus{}boot-catalog-hide Prevent the El Torito boot catalog from appearing as file in the directory trees of the image. @end table @c man .TP @c man .B System Area, MBR, GPT, APM, other boot blocks: @node SystemArea, Charset, Bootable, Options @section System Area, MBR, GPT, APM, other boot blocks @c man .PP @cindex System Area, _definition The first 16 blocks of an ISO image are the System Area. It is reserved for system dependent boot software. This may be the boot facilities and partition tables of various hardware architectures. @* @cindex MBR, _definition A @strong{MBR} (Master Boot Record) contains boot code and a partition table. It is read by PC-BIOS when booting from USB stick or hard disk, and by PowerPC CHRP or PReP when booting. An MBR partition with type 0xee indicates the presence of GPT. @* @cindex GPT, _definition A @strong{GPT} (GUID Partition Table) marks partitions in a more modern way. It is read by EFI when booting from USB stick or hard disk, and may be used for finding and mounting a HFS+ partition inside the ISO image. @* @cindex APM, _definition An @strong{APM} (Apple Partition Map) marks the HFS+ partition. It is read by Macs for booting and for mounting. @* MBR, GPT and APM are combinable. APM occupies the first 8 bytes of MBR boot code. All three do not hamper El Torito booting from CDROM. @* @command{xorrisofs} supports further boot facilities: MIPS Big Endian (SGI), MIPS Little Endian (DEC), SUN SPARC, HP-PA, DEC Alpha. Those are mutually not combinable and also not combinable with MBR, GPT, or APM. @c man .PP @sp 1 @cindex Interval reader for system area and partitions Several of the following options expect disk paths as input but also accept description strings for the libisofs interval reader, which is able to cut out data from disk files or -indev and to zeroize parts of the content: -G, -generic-boot, @minus{}@minus{}embedded-boot, @minus{}@minus{}grub2-mbr, -isohybrid-mbr, -efi-boot-part, -prep-boot-part, -B, -sparc-boot, -append_partition. @* The description string consists of the following components, separated by colon ':' @* "@minus{}@minus{}interval:"Flags":"Interval":"Zeroizers":"Source @* The component "@minus{}@minus{}interval" states that this is not a plain disk path but rather a interval reader description string. @* The component Flags modifies the further interpretation: @* "local_fs" demands to read from a file depicted by the path in Source. @* "imported_iso" demands to read from the -indev. This works only if -outdev is not the same as -indev. The Source component is ignored. @* "appended_partition_NNN" with a decimal number NNN works only for options which announce El Torito boot image paths: -b, -e, --efi-boot. The number gives the partition number as used with the corresponding option -append_partition. @* The component Interval consists of two byte address numbers separated by a "-" character. E.g. "0-429" means to read bytes 0 to 429. @* The component Zeroizers consists of zero or more comma separated strings. They define which part of the read data to zeroize. Byte number 0 means the byte read from the Interval start address. Each string may be one of: @* "zero_mbrpt" demands to zeroize the MBR partition table if bytes 510 and 511 bear the MBR signature 0x55 0xaa. @* "zero_gpt" demands to check for a GPT header in bytes 512 to 1023, to zeroize it and its partition table blocks. @* "zero_apm" demands to check for an APM block 0 and to zeroize its partition table blocks. @* Start_byte"-"End_byte demands to zeroize the read-in bytes beginning with number Start_byte and ending after End_byte. @* The component Source is the file path with flag "local_fs", and ignored with flag "imported_iso". @* Byte numbers may be scaled by a suffix out of @{k,m,g,t,s,d@} meaning multiplication by @{1024, 1024k, 1024m, 1024g, 2048, 512@}. A scaled value end number depicts the last byte of the scaled range. @* E.g. "0d-0d" is "0-511". @* Examples: @* "local_fs:0-32767:zero_mbrpt,zero_gpt,440-443:/tmp/template.iso" @* "imported_iso:45056d-47103d::" @* @table @asis @sp 1 @c man .TP @item -G disk_path @kindex -G Fill System Area e.g. by MBR @cindex Bootability, fill System Area e.g. by MBR, -G, @minus{}@minus{}embedded-boot, -generic-boot Copy at most 32768 bytes from the given disk file to the very start of the ISO image. @* Other than a El Torito boot image, the file disk_path needs not to be added to the ISO image. It will not show up as file in the directory trees. @* In multi-session situations, the special disk_path "." prevents reading of a disk file but nevertheless causes the adjustments in the existing MBR, which were ordered by other options. @c man .TP @item -generic-boot disk_path @kindex -generic-boot Fill System Area e.g. by MBR Alias of -G. @c man .TP @item @minus{}@minus{}embedded-boot disk_path @kindex @minus{}@minus{}embedded-boot Fill System Area e.g. by MBR Alias of -G. @c man .TP @item @minus{}@minus{}grub2-mbr disk_path @kindex @minus{}@minus{}grub2-mbr Install modern GRUB2 MBR @cindex Bootability, install modern GRUB2 MBR, @minus{}@minus{}grub2-mbr Install disk_path in the System Area and treat it as modern GRUB2 MBR. The content start address of the first boot image is converted to a count of 512 byte blocks, and an offset of 4 is added. The result is written as 64 bit little-endian number to byte address 0x1b0. @c man .TP @item -isohybrid-mbr disk_path @kindex -isohybrid-mbr Install ISOLINUX isohybrid MBR @cindex Bootability, install ISOLINUX isohybrid MBR, -isohybrid-mbr Install disk_path as ISOLINUX isohybrid MBR which makes the boot image given by option -b bootable from USB sticks and hard disks via PC-BIOS. This preparation is normally done by ISOLINUX program isohybrid on the already produced ISO image. @* The disk path should lead to one of the Syslinux files isohdp[fp]x*.bin . The MBR gets patched according to isohybrid needs. The first partition describes the range of the ISO image. Its start is at block 0 by default, but may be set to 64 disk blocks by option -partition_offset 16. @* For the meaning of special disk_path "." see option -G. @c man .TP @item -isohybrid-gpt-basdat @kindex -isohybrid-gpt-basdat Mark boot image in GPT @cindex Bootability, mark boot image in GPT, -isohybrid-gpt-basdat Mark the current El Torito boot image (see options -b and -e) in an actually invalid GPT as partition of type Basic Data. This works only with -isohybrid-mbr and has the same impact on the system area as -efi-boot-part. It cannot be combined with -efi-boot-part or -hfsplus. @* The first three boot images which are marked by GPT will also show up as partition entries in MBR. The MBR partition of type 0xEF is what actually is used by EFI firmware for booting from USB stick. The MBR partition for PC-BIOS gets type 0x00 rather than 0x17 in this case. Often the further MBR entries are the ones which actually get used by EFI. @c man .TP @item -isohybrid-gpt-hfsplus @kindex -isohybrid-gpt-hfsplus Mark boot image in GPT @cindex Bootability, mark boot image in GPT, -isohybrid-gpt-hfsplus Mark the current El Torito boot image (see options -b and -e) in GPT as partition of type HFS+. Impact and restrictions are like with -isohybrid-gpt-basdat. @c man .TP @item -isohybrid-apm-hfsplus @kindex -isohybrid-apm-hfsplus Mark boot image in APM @cindex Bootability, mark boot image in APM, -isohybrid-apm-hfsplus Mark the current El Torito boot image (see options -b and -e) in Apple Partition Map as partition of type HFS+. This works only with -isohybrid-mbr and has a similar impact on the system area as -hfsplus. It cannot be combined with -efi-boot-part or -hfsplus. @* The ISOLINUX isohybrid MBR file must begin by a known pattern of 32 bytes of x86 machine code which essentially does nothing. It will get overwritten by 32 bytes of APM header mock-up. @c man .TP @item -part_like_isohybrid @kindex -part_like_isohybrid Mark partitions like with isohybrid @cindex Bootability, partitions like with isohybrid, -part_like_isohybrid Control whether -isohybrid-gpt-basdat, -isohybrid-gpt-hfsplus, and -isohybrid-apm-hfsplus apply even if not -isohybrid-mbr is present. No MBR partition of type 0xee emerges, even if GPT gets produced. Gaps between GPT and APM partitions will not be filled by more partitions. Appended partitions get mentioned in APM if other APM partitions emerge. @c man .TP @item -iso_mbr_part_type "default"|number|type_guid @kindex -iso_mbr_part_type Set type of ISO MBR partition @cindex Bootability, type of ISO MBR partition, -iso_mbr_part_type Set the partition type of the MBR or GPT partition which represents the ISO or at least protects it. @* Number may be 0x00 to 0xff. The text "default" re-enables the default types of the various occasions to create an ISO MBR partition. This is without effect if no such partition emerges by other settings or if the partition type is prescribed mandatorily like 0xee for GPT protective MBR or 0x96 for CHRP. @* If instead a type_guid is given by a 32-digit hex string like a2a0d0ebe5b9334487c068b6b72699c7 or by a structured text like EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, then it will be used as partition type if the ISO filesystem appears as partition in GPT. In MBR, C12A7328-F81F-11D2-BA4B-00A0C93EC93B will be mapped to 0xef. Any other GUID will be mapped to 0x83. @c man .TP @item @minus{}@minus{}protective-msdos-label @kindex @minus{}@minus{}protective-msdos-label Patch System Area partition table @cindex Bootability, patch System Area partition table, @minus{}@minus{}protective-msdos-label Patch the System Area by a simple PC-DOS partition table where partition 1 claims the range of the ISO image but leaves the first block unclaimed. This is mutally exclusive to option -isohybrid-mbr. @c man .TP @item @minus{}@minus{}mbr-force-bootable @kindex @minus{}@minus{}mbr-force-bootable Enforce MBR bootable/active flag @cindex Bootability, bootable MBR partition, @minus{}@minus{}mbr-force-bootable Enforce an MBR partition with "bootable/active" flag if options like @minus{}@minus{}protective-msdos-label or @minus{}@minus{}grub2-mbr are given. These options normally cause the flag to be set if there is an MBR partition of type other than 0xee or 0xef. If no such partition exists, then no bootflag is set, unless @minus{}@minus{}mbr-force-bootable forces creation of a dummy partition of type 0x00 which covers only the first block of the ISO image. @* If no bootable MBR is indicated by other options and a partition gets created by -append_partition, then @minus{}@minus{}mbr-force-bootable causes a bootflag like it would do with e.g. @minus{}@minus{}protective-msdos-label. @c man .TP @item -partition_offset 2kb_block_adr @kindex -partition_offset Make mountable by partition 1 @cindex Mountability, by non-trivial partition 1, -partition_offset Cause a partition table with a single partition that begins at the given block address. This is counted in 2048 byte blocks, not in 512 byte blocks. If the block address is non-zero then it must be at least 16. Values larger than 16 are hardly of use. A non-zero partition offset causes two superblocks to be generated and two sets of directory trees. The image is then mountable from its absolute start as well as from the partition start. @* The offset value of an ISO image gets preserved when a new session is added to a loaded image. So the value defined here is only in effect if a new ISO image gets written. @c man .TP @item -partition_hd_cyl number @kindex -partition_hd_cyl MBR heads per cylinder @cindex MBR, sectors per head, -partition_sec_hd Set the number of heads per cylinder for the MBR partition table. 0 chooses a default value. Maximum is 255. @c man .TP @item -partition_sec_hd number @kindex -partition_sec_hd MBR sectors per head @cindex MBR, sectors per head, -partition_sec_hd Set the number of sectors per head for the MBR partition table. 0 chooses a default value. Maximum is 63. @* The product partition_sec_hd * partition_hd_cyl * 512 is the cylinder size. It should be divisible by 2048 in order to make exact alignment possible. With appended partitions and -appended_part_as_gpt there is no limit for the number of cylinders. Else there may be at most 1024 of them. If the cylinder size is too small to stay below the limit, then appropriate values of partition_hd_cyl are chosen with partition_sec_hd 32 or 63. If the image is larger than 8,422,686,720 bytes, then the cylinder size constraints cannot be fulfilled for MBR. They seem not overly important anyway. Flat block addresses in partition tables are good for 1 TiB. @c man .TP @item -partition_cyl_align mode @kindex -partition_cyl_align Image size alignment @cindex Image size, alignment, -partition_cyl_align Control image size alignment to an integer number of cylinders. It is prescribed by isohybrid specs and it seems to please program fdisk. Cylinder size must be divisible by 2048. Images larger than 8,323,596,288 bytes cannot be aligned in MBR partition table. @* Mode "auto" is default. Alignment by padding happens only if option -isohybrid-mbr is given. @* Mode "on" causes alignment by padding with option @minus{}@minus{}protective-msdos-label too. Mode "all" is like "on" but also pads up partitions from -append_partition to an aligned size. @* Mode "off" disables alignment unconditionally. @c man .TP @item -append_partition partition_number type_code disk_path @kindex -append_partition Append MBR or GPT partition after image @cindex MBR, GPT, append partition, -append_partition Cause a prepared filesystem image to be appended to the ISO image and to be described by a partition table entry in a boot block at the start of the emerging ISO image. The partition entry will bear the size of the submitted file rounded up to the next multiple of 2048 bytes or to the next multiple of the cylinder size. @* Beware of subsequent multi-session runs. The appended partition will get overwritten. @* partition_number may be 1 to 4. Number 1 will put the whole ISO image into the unclaimed space before partition 1. So together with most xorriso MBR or GPT features, number 2 would be the most natural choice. @* The type_code may be "FAT12", "FAT16", "Linux", or a hexadecimal number between 0x00 and 0xff. Not all those numbers will yield usable results. For a list of codes search the Internet for "Partition Types" or run fdisk command "L". If the partition appears in GPT then type_code 0xef is mapped to the EFI System Partition Type GUID. All others get mapped to Basic Data Type GUID. @* type_code may also be a type GUID as plain hex string like a2a0d0ebe5b9334487c068b6b72699c7 or as structured text like EBD0A0A2-B9E5-4433-87C0-68B6B72699C7. It will be used if the partition is mentioned in GPT. In MBR, C12A7328-F81F-11D2-BA4B-00A0C93EC93B will be mapped to 0xef. Any other GUID will be mapped to 0x83. In APM, 48465300-0000-11AA-AA11-00306543ECAC will be mapped to partition type "Apple_HFS", any other to "Data". @* If some other command causes the production of GPT, then the appended partitions will be mentioned there too, even if not -appended_part_as_gpt is given. @c man .TP @item -appended_part_as_gpt @kindex -appended_part_as_gpt Appended partitions in GPT @cindex GPT, mark appended partitions, -appended_part_as_gpt Marks partitions from -append_partition in GPT rather than in MBR. In this case the MBR shows a single partition of type 0xee which covers the whole output data. @* By default, appended partitions get marked in GPT only if GPT is produced because of other options. @c man .TP @item -appended_part_as_apm @kindex -appended_part_as_apm Appended partitions in APM @cindex APM, mark appended partitions, -appended_part_as_apm Marks partitions from -append_partition in Apple Partition Map, too. @* By default, appended partitions get marked in APM only if APM is produced because of other options and -part_like_isohybrid is enabled. @c man .TP @item -efi-boot-part disk_path @kindex -efi-boot-part EFI boot partition @cindex Bootability, for EFI, -efi-boot-part Copy a file from disk into the emerging ISO image and mark it by a GPT entry as EFI System Partition. EFI boot firmware is supposed to use a FAT filesystem image in such a partition for booting from USB stick or hard disk. @* Instead of a disk_path, the word @minus{}@minus{}efi-boot-image may be given. It exposes in GPT the content of the first El Torito EFI boot image as EFI system partition. EFI boot images are introduced by options -e or @minus{}@minus{}efi-boot. The affected EFI boot image cannot show up in HFS+ because it is stored outside the HFS+ partition. @c man .TP @item @minus{}@minus{}gpt_disk_guid value @kindex @minus{}@minus{}gpt_disk_guid GPT GUID @cindex Disk GUID, for GPT, @minus{}@minus{}gpt_disk_guid Control whether an emerging GPT shall get a randomly generated disk GUID or whether the GUID is supplied by the user. Value "random" is default. Value "modification-date" produces a low quality GUID from the value set by option @minus{}@minus{}modification-date=. @* A string of 32 hex digits, or a RFC 4122 compliant GUID string may be used to set the disk GUID directly. UEFI prescribes the first three components of a RFC 4122 GUID string to be byte-swapped in the binary representation: @* E.g. @minus{}@minus{}gpt_disk_guid 2303cd2a-73c7-424a-a298-25632da7f446 equals @minus{}@minus{}gpt_disk_guid 2acd0323c7734a42a29825632da7f446 @* The partition GUIDs get generated by minimally varying the disk GUID. @c man .TP @item -chrp-boot-part @kindex -chrp-boot-part CHRP partition @cindex Bootability, for CHRP, -chrp-boot-part Mark the block range of the whole emerging ISO image as MBR partition of type 0x96. This is not compatible with any other feature that produces MBR partition entries. It makes GPT unrecognizable. @* CHRP is often used in conjunction with HFS. It is not yet tested whether HFS+ filesystems produced with option -hfsplus would boot on any CHRP capable machine which does not boot pure ISO 9660 as well. @c man .TP @item -chrp-boot @kindex -chrp-boot CHRP partition Alias of -chrp-boot-part. @c man .TP @item -prep-boot-part disk_path @kindex -prep-boot-part PReP partition @cindex Bootability, for PReP, -prep-boot-part Copy a file from disk into the emerging ISO image and mark it by a MBR partition entry of type 0x41. PReP boot firmware is supposed to read the content of the partition as single ELF executable file. This option is compatible with other MBR partitions and with GPT. @c man .TP @item -mips-boot iso_rr_path @kindex -mips-boot MIPS Big Endian boot image @cindex Bootability, control, -mips-boot Declare a data file in the image to be a MIPS Big Endian boot file and cause production of a MIPS Big Endian Volume Header. This is mutually exclusive with production of other boot blocks like MBR. It will overwrite the first 512 bytes of any data provided by -G. Up to 15 boot files can be declared by multiple -mips-boot options. @c man .TP @item -mipsel-boot iso_rr_path @kindex -mipsel-boot MIPS Little Endian boot image @cindex Bootability, control, -mipsel-boot Declare a data file in the image to be the MIPS Little Endian boot file. This is mutually exclusive with other boot blocks. It will overwrite the first 512 bytes of any data provided by -G. Only a single boot file can be declared by -mipsel-boot. @c man .TP @item -B disk_path[,disk_path ...] @kindex -B SUN SPARC boot images @cindex Bootability, control, -B, -sparc-boot Cause one or more data files on disk to be written after the end of the ISO image. A SUN Disk Label will be written into the first 512 bytes of the ISO image which lists this image as partition 1 and the given disk_paths as partition 2 up to 8. @* The disk files should contain suitable boot images for SUN SPARC systems. @* The pseudo disk_path "..." causes that all empty partition entries become copies of the last non-empty entry. If no other disk_path is given before "..." then all partitions describe the ISO image. In this case, the boot loader code has to be imported by option -G. @c man .TP @item -sparc-boot disk_path[,disk_path ...] @kindex -sparc-boot SUN SPARC boot images Alias of -B. @c man .TP @item -sparc-label text @kindex -sparc-label SUN Disk Label text @cindex Bootability, SUN Disk Label text, -sparc-label Set the ASCII label text of a SUN Disk Label. @c man .TP @item @minus{}@minus{}grub2-sparc-core iso_rr_path @kindex @minus{}@minus{}grub2-sparc-core SUN SPARC core file @cindex Bootability, control, @minus{}@minus{}grub2-sparc-core Cause the content address and size of the given data file in the image to be written after the SUN Disk Label. Both numbers are counted in bytes. The address is written as 64 bit big-endian number to byte 0x228. The size is written as 32 bit big-endian number to byte 0x230. @c man .TP @item -hppa-cmdline text @kindex -hppa-cmdline HP-PA PALO command line @cindex Bootability, control, -hppa-cmdline Set the PALO command line for HP-PA. Up to 1023 characters are permitted by default. With -hppa-hdrversion 4 the limit is 127. @* Note that the first five -hppa options are mandatory, if any of the -hppa options is given. Only option -hppa-hdrversion is allowed to be missing. @c man .TP @item -hppa-bootloader iso_rr_path @kindex -hppa-bootloader HP-PA bootloader file @cindex Bootability, control, -hppa-bootloader Designate the given path as HP-PA bootloader file. @c man .TP @item -hppa-kernel-32 iso_rr_path @kindex -hppa-kernel_32 HP-PA kernel_32 file @cindex Bootability, control, -hppa-kernel_32 Designate the given path as HP-PA 32 bit kernel file. @c man .TP @item -hppa-kernel-64 iso_rr_path @kindex -hppa-kernel_64 HP-PA kernel_64 file @cindex Bootability, control, -hppa-kernel_64 Designate the given path as HP-PA 64 bit kernel file. @c man .TP @item -hppa-ramdisk iso_rr_path @kindex -hppa-ramdisk HP-PA ramdisk file @cindex Bootability, control, -hppa-ramdisk Designate the given path as HP-PA RAM disk file. @c man .TP @item -hppa-hdrversion number @kindex -hppa-hdrversion HP-PA PALO header version @cindex Bootability, control, -hppa-hdrversion Choose between PALO header version 5 (default) and version 4. For the appropriate value see in PALO source code: PALOHDRVERSION. @c man .TP @item -alpha-boot iso_rr_path @kindex -alpha-boot DEC Alpha SRM bootloader @cindex Bootability, control, -alpha-boot Declare a data file in the image to be the DEC Alpha SRM Secondary Bootstrap Loader and cause production of a boot sector which points to it. This is mutually exclusive with production of other boot blocks like MBR. @end table @c man .TP @c man .B Character sets: @node Charset, Jigdo, SystemArea, Options @section Character sets @c man .PP @cindex Character sets, _definition Character sets should not matter as long as only english alphanumeric characters are used for file names or as long as all writers and readers of the medium use the same character set. Outside these constraints it may be necessary to let xorriso convert byte codes. @* A conversion from input character set to the output character set is performed when an ISO image gets written. Vice versa there is a conversion from output character set to the input character set when an ISO image gets loaded. The sets can be defined by options -input-charset and -output-charset, if needed. @* @table @asis @sp 1 @c man .TP @item -input-charset character_set_name @kindex -input-charset set character set of disk file names @cindex Character Set, for disk file names, -input-charset Set the character set from which to convert disk file names when inserting them into the ISO image. @sp 1 @c man .TP @item -output-charset character_set_name @kindex -output-charset set character set of ISO file names @cindex Character Set, for ISO file names, -output-charset Set the character set from which to convert names of loaded ISO images and to which to convert names when writing ISO images. @end table @c man .TP @c man .B Jigdo Template Extraction: @node Jigdo, Miscellaneous, Charset, Options @section Jigdo Template Extraction @c man .PP @cindex Jigdo Template Extraction, _definition From man genisoimage: "Jigdo is a tool to help in the distribution of large files like CD and DVD images; see http://atterer.net/jigdo/ for more details. Debian CDs and DVD ISO images are published on the web in jigdo format to allow end users to download them more efficiently." @* If the use of libjte was enabled at compile time of xorriso, then @command{xorrisofs} can produce a .jigdo and a .template file together with a single-session ISO image. If not, then Jigdo options will cause a FAILURE event, which normally leads to program abort. @* One may determine the ability for Jigdo by: @* @sp 1 $ xorrisofs -version 2>&1 | grep '^libjte' && echo YES @* @sp 1 @c man .PP The .jigdo file contains checksums and symbolic file addresses. The .template file contains the compressed ISO image with reference tags instead of the content bytes of the listed files. @* Input for this process are the normal arguments for a @command{xorrisofs} session with no image loaded, and a checksum file which lists those data files which may be listed in the .jigdo file and externally referenced in the .template file. Each designated file is represented in the checksum file by a single text line: @* Checksum as hex digits, 2 blanks, size as 12 decimal digits or blanks, 2 blanks, symbolic file address @* The kind of checksum is chosen by -jigdo "checksum_algorithm" with values "md5" (32 hex digits) or "sha256" (64 hex digits). It will also be used for the file address lines in the .jigdo file. The default is "md5". @* The file address in a checksum file line has to bear the same basename as the disk_path of the file which it shall match. The directory path of the file address is decisive for To=From mapping, not for file recognition. After To=From mapping, the file address gets written into the .jigdo file. Jigdo restore tools will convert these addresses into really reachable data source addresses from which they can read. @* If the list of jigdo parameters is not empty, then padding will be counted as part of the ISO image. @* @table @asis @sp 1 @c man .TP @item -jigdo-checksum-algorithm "md5"|"sha256" @kindex -jigdo-checksum-algorithm set data file checksum algorithm @cindex Jigdo Template Extraction, -jigdo-checksum-algorithm Set the checksum algorithm which shall be used for the data file entries in the .jigdo file and is expected in the checksum file. Default is "md5". @c man .TP @item -jigdo-jigdo disk_path @kindex -jigdo-jigdo set name of .jigdo file @cindex Jigdo Template Extraction, -jigdo-jigdo Set the disk_path for the .jigdo file with the checksums and download addresses for filling the holes in .template. @c man .TP @item -jigdo-template disk_path @kindex -jigdo-template set name of .template file @cindex Jigdo Template Extraction, -jigdo-template Set the disk_path for the .template file with the holed and compressed ISO image copy. @c man .TP @item -jigdo-min-file-size size @kindex -jigdo-min-file-size set minimum extract size @cindex Jigdo Template Extraction, -jigdo-min-file-size Set the minimum size for a data file to be listed in the .jigdo file and being a hole in the .template file. size may be a plain number counting bytes, or a number with appended letter "k", "m", "g" to count KiB (1024 bytes), MiB (1024 KiB), or GiB (1024 MiB). @c man .TP @item -jigdo-force-checksum disk_path_pattern @kindex -jigdo-force-checksum add check pattern for checksum file @cindex Jigdo Template Extraction, -jigdo-force-checksum adds a regular expression pattern which will get compared with the absolute disk_path of any data file that was not found in the checksum file. A match causes a MISHAP event, which normally does not abort the program run but finally causes a non-zero exit value of the program. @c man .TP @item -jigdo-force-md5 disk_path_pattern @kindex -jigdo-force-md5 add check pattern for checksum file @cindex Jigdo Template Extraction, -jigdo-force-md5 Outdated alias of -jigdo-force-checksum. @c man .TP @item -jigdo-exclude disk_path_pattern @kindex -jigdo-exclude add exclusion pattern for checksum file @cindex Jigdo Template Extraction, -jigdo-exclude Add a regular expression pattern which will get compared with the absolute disk_path of any data file. A match causes the file to stay in .template in any case. @c man .TP @item -jigdo-map To=From @kindex -jigdo-map add address translation for .jigdo @cindex Jigdo Template Extraction, -jigdo-map Add a string pair of the form To=From to the parameter list. If a data file gets listed in the .jigdo file, then it is referred by the file address from its line in the checksum file. This file address gets checked whether it begins with the From string. If so, then this string will be replaced by the To string and a ':' character, before it goes into the .jigdo file. The From string should end by a '/' character. @c man .TP @item -checksum-list disk_path @kindex -checksum-list set path of input checksum file @cindex Jigdo Template Extraction, -checksum-list Set the disk_path where to find the checksum file file with symbolic file addresses and checksums according to -jigdo-checksum-algorithm. @c man .TP @item -md5-list disk_path @kindex -md5-list set path of input checksum file @cindex Jigdo Template Extraction, -md5-list Outdated alias of -checksum-list. @c man .TP @item -jigdo-template-compress "gzip"|"bzip2" @kindex -jigdo-template-compress choose compression algorithm @cindex Jigdo Template Extraction, -jigdo-template-compress Choose one of "bzip2" or "gzip" for the compression of the template file. The jigdo file is put out uncompressed. @c man .TP @item -checksum_algorithm_iso list_of_names @kindex -checksum_algorithm_iso choose .jigdo checksums @cindex Jigdo Template Extraction, -checksum_algorithm_iso Choose one or more of "md5", "sha1", "sha256", "sha512" for the auxiliary "# Image Hex" checksums in the .jigdo file. The list_of_names may e.g. look like "md5,sha1,sha512". Value "all" chooses all available algorithms. Note that MD5 stays always enabled. @c man .TP @item -checksum_algorithm_template list_of_names @kindex -checksum_algorithm_template choose .template checksums @cindex Jigdo Template Extraction, -checksum_algorithm_template Choose the algorithms for the "# Template Hex" checksums in the .jigdo file. The rules for list_of_names are the same as with -checksum_algorithm_iso. @end table @c man .TP @c man .B Miscellaneous options: @node Miscellaneous, ExSimple, Jigdo, Options @section Miscellaneous options @table @asis @sp 1 @c man .TP @item -print-size @kindex -print-size predict ISO image size @cindex ISO image size, predict, -print-size Print to stdandard output the foreseeable number of 2048 byte blocks in the emerging ISO image. Do not produce this image. @* The result depends on several settings. @* If option --emul-toc is given, then padding (see -pad) is not counted as part of the image size. In this case either use -no-pad or add 150 (= 300 KiB) to the resulting number. @* If mkisofs emulation ends after option -print-size, then the properties of the most recently specified boot image file cannot be edited by subsequent xorriso commands. @c man .TP @item @minus{}@minus{}no_rc @kindex @minus{}@minus{}no_rc do not execute startup files @cindex Startup files, suppress, @minus{}@minus{}no_rc Only if used as first argument this option prevents reading and interpretation of startup files. See section FILES below. @c man .TP @item -help @kindex -help list supported options @cindex Options, list, -help @* List supported options to stderr. Original mkisofs options bear their original mkisofs description texts. @c man .TP @item -quiet @kindex -quiet suppress most messages @cindex Message output, suppress, -quiet @* Suppress most messages of the program run, except those which indicate problems or errors. @c man .TP @item -gui @kindex -gui increase frequency of pacifier messages @cindex Message output, increase frequency, -gui @* Increase the frequency of pacifier messages while writing an ISO image. @c man .TP @item -log-file disk_path @kindex -log-file redirect stderr messages @cindex Message output, redirect stderr, -log-file @* Truncate file disk_path to 0 size and redirect to it all messages which would normally appear on stderr. -log-file with empty text as disk_path re-enables output to stderr. @c man .TP @item -v @kindex -v enable verbose messages @cindex Verbosity, high, -v, -verbose @* Enable the output of informational program messages. @c man .TP @item -verbose @kindex -verbose enable verbose messages Alias of -v. @c man .TP @item -version @kindex -version report program version @cindex Program version, report, -version Print to standard output a text that begins with @* "mkisofs 2.01-Emulation Copyright (C)" @* and to standard error the version information of xorriso. @end table @c man .br @node Examples, Files, Options, Top @chapter Examples @c man .SH EXAMPLES @c man .SS @c man .B Overview of examples: @c man A simple image production run @c man .br @c man Set ISO image paths by -graft-points @c man .br @c man Perform multi-session runs @c man .br @c man Let xorrisofs work underneath growisofs @c man .br @c man Incremental backup of a few directory trees @c man .br @c man Incremental backup with accumulated trees @c man .br @c man Create bootable images for PC-BIOS and EFI @c man .br @cindex Examples @menu * ExSimple:: A simple image production run * ExGraft:: Set ISO image paths by -graft-points * ExMkisofs:: Perform multi-session runs * ExGrowisofs:: Let xorriso work underneath growisofs * ExIncBackup:: Incremental backup of a few directory trees * ExIncBckAcc:: Incremental backup with accumulated trees * ExBootable:: Create bootable images for PC-BIOS and EFI @end menu @c man .SS @c man .B A simple image production run @node ExSimple, ExGraft, Miscellaneous, Examples @section A simple image production run A prepared file tree in directory ./for_iso gets copied into the root directory of the ISO image. File permissions get set to read-only for everybody. Joliet attributes for Microsoft systems get added. The resulting image gets written as data file ./image.iso on disk. @* @sp 1 $ xorrisofs -r -J -o ./image.iso ./for_iso @c man .SS @c man .B Set ISO image paths by -graft-points @node ExGraft, ExMkisofs, ExSimple, Examples @section Set ISO image paths by -graft-points Without option -graft-points each given disk file is copied into the root directory of the ISO image, maintaining its name. If a directory is given, then its files and sub-directories are copied into the root directory, maintaining their names. @* @sp 1 $ xorrisofs ... /home/me/datafile /tmp/directory @* @sp 1 yields in the ISO image root directory: @* @sp 1 /datafile @* /file_1_from_directory @* ... @* /file_N_from_directory @* @sp 1 @c man .sp 1 With option -graft-points it is possible to put files and directories to arbitrary paths in the ISO image. @* @sp 1 $ xorrisofs ... -graft-points /home/me/datafile /dir=/tmp/directory @* @sp 1 yields in the ISO image root directory: @* @sp 1 /datafile @* /dir @* @sp 1 Eventually needed parent directories in the image will be created automatically: @* @sp 1 /datafiles/file1=/home/me/datafile @* @sp 1 yields in the ISO image: @sp 1 @* /datafiles/file1 @* @sp 1 The attributes of directory /datafiles get copied from /home/me on disk. @* @sp 1 @c man .sp 1 Normally one should avoid = and \ characters in the ISO part of a pathspec. But if it must be, one may escape them: @sp 1 @* /with_\=_and_\\/file=/tmp/directory/file @* @sp 1 yields in the ISO image: @* @sp 1 /with_=_and_\/file @c man .SS @c man .B Perform multi-session runs @node ExMkisofs, ExGrowisofs, ExGraft, Examples @section Perform multi-session runs This example works for multi-session media only: CD-R[W], DVD-R[W], DVD+R, BD-R. Add cdrskin option @minus{}@minus{}grow_overwriteable_iso to all -as cdrecord runs in order to enable multi-session emulation on overwritable media. @* The first session is written like this: @* @sp 1 $ xorrisofs -graft-points \ @* /tree1=prepared_for_iso/tree1 \ @* | xorriso -as cdrecord -v dev=/dev/sr0 blank=fast -multi -eject - @* @sp 1 Follow-up sessions are written like this (the run of dd is only to give demons a chance to spoil it): @* @sp 1 $ m=$(xorriso -as cdrecord dev=/dev/sr0 -msinfo) @* $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 @* $ xorrisofs -M /dev/sr0 -C $m -graft-points \ @* /tree2=prepared_for_iso/tree2 \ @* | xorriso -as cdrecord -v dev=/dev/sr0 -waiti -multi -eject - @* @sp 1 Always eject the drive tray between sessions. @* The run of xorriso -as mkisofs will read old sessions via the CD-ROM driver of /dev/sr0. This driver might not be aware of the changed content as long as the medium is not loaded again. In this case the previous session would not be properly assessed by xorriso and the new session would contain only the newly added files. @* Some systems have not enough patience with automatic tray loading and some demons may interfere with a first CD-ROM driver read attempt from a freshly loaded medium. @* When loading the tray manually, wait 10 seconds after the drive has stopped blinking. @* A safe automatic way seems to be a separate run of xorriso for loading the tray with proper waiting, and a subsequent run of dd which shall offer itself to any problems caused by demons assessing the changed drive status. If this does not help, insert a run of "sleep 10" between xorriso and dd. @c man .SS @c man .B Let xorrisofs work underneath growisofs @node ExGrowisofs, ExIncBackup, ExMkisofs, Examples @section Let xorriso work underneath growisofs growisofs expects an ISO formatter program which understands options -C and -M. A variable is defined to override the hardcoded default name. @* @sp 1 $ export MKISOFS="xorrisofs" @* $ growisofs -Z /dev/dvd /some/files @* $ growisofs -M /dev/dvd /more/files @* @sp 1 If no "xorrisofs" is available on your system, then you will have to create a link pointing to the xorriso binary and tell growisofs to use it. E.g. by: @* @sp 1 $ ln -s $(which xorriso) "$HOME/xorrisofs" @* $ export MKISOFS="$HOME/xorrisofs" @* @sp 1 One may quit mkisofs emulation by argument "@minus{}@minus{}" and make use of all xorriso commands. growisofs dislikes options which start with "-o" but -outdev must be set to "-". So use "outdev" instead: @* @sp 1 $ growisofs -Z /dev/dvd @minus{}@minus{}for_backup @minus{}@minus{} \ @* outdev - -update_r /my/files /files @* $ growisofs -M /dev/dvd @minus{}@minus{}for_backup @minus{}@minus{} \ @* outdev - -update_r /my/files /files @* Note that @minus{}@minus{}for_backup is given in the mkisofs emulation. To preserve the recorded extra data it must already be in effect, when the emulation loads the image. @c man .SS @c man .B Incremental backup of a few directory trees @node ExIncBackup, ExIncBckAcc, ExGrowisofs, Examples @section Incremental backup of a few directory trees This changes the directory trees /open_source_project and /personal_mail in the ISO image so that they become exact copies of their disk counterparts. ISO file objects get created, deleted or get their attributes adjusted accordingly. @* ACL, xattr, hard links and MD5 checksums will be recorded. It is expected that inode numbers in the disk filesystem are persistent over cycles of mounting and booting. Files with names matching *.o or *.swp get excluded explicitly. @* @sp 1 @c man .sp 1 To be used several times on the same medium, whenever an update of the two disk trees to the medium is desired. Begin with a blank medium and update it until he run fails gracefully due to lack of remaining space on the old one. @* Always eject the drive tray between sessions. A run of dd shall give demons a chance to spoil the first read on freshly loaded media. @* @sp 1 $ msinfo=$(xorriso -as cdrecord dev=/dev/sr0 -msinfo) @* $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 @* $ load_opts= @* $ test -n "$msinfo" && load_opts="-M /dev/sr0 -C $msinfo" @* $ xorrisofs $load_opts -o - @minus{}@minus{}for_backup -m '*.o' -m '*.swp' \ @* -V PROJ_MAIL_"$(date '+%Y_%m_%d_%H%M%S')" -graft-points \ @* -old-root / \ @* /projects=/home/thomas/projects \ @* /personal_mail=/home/thomas/personal_mail \ @* | xorriso -as cdrecord dev=/dev/sr0 -v -multi -waiti -eject - @* @sp 1 @c man .sp 1 This makes sense if the full backup leaves substantial remaining capacity on media and if the expected changes are much smaller than the full backup. @* @sp 1 @c man .sp 1 @strong{Better do not use your youngest backup for -old-root}. Have at least two media which you use alternatingly. So only older backups get endangered by the new write operation, while the newest backup is stored safely on a different medium. @* Always have a blank medium ready to perform a full backup in case the update attempt fails due to insufficient remaining capacity. This failure will not spoil the old medium, of course. @* @sp 1 @c man .sp 1 If inode numbers on disk are not persistent, then use option @minus{}@minus{}old-root-no-ino . In this case an update run will compare recorded MD5 sums against the current file content on hard disk. @* @sp 1 @c man .sp 1 With @strong{mount} option @strong{-o "sbsector="} on GNU/Linux or @strong{-s} on FreeBSD or NetBSD it is possible to access the session trees which represent the older backup versions. With CD media, GNU/Linux mount accepts session numbers directly by its option "session=". @* Multi-session media and most overwritable media written by xorriso can tell the sbsectors of their sessions by xorriso option -toc: @* @sp 1 $ xorriso -dev /dev/sr0 -toc @* @sp 1 xorriso can print the matching mount command for a session number: @* @sp 1 $ xorriso -mount_cmd /dev/sr0 session 12 /mnt @* @sp 1 or for a volume id that matches a search expression: @* @sp 1 $ xorriso -mount_cmd /dev/sr0 volid '*2008_12_05*' /mnt @* @sp 1 Both yield on standard output something like: @* mount -t iso9660 -o nodev,noexec,nosuid,ro,sbsector=1460256 '/dev/sr0' '/mnt' @* @sp 1 The superuser may let xorriso execute the mount command directly: @* @sp 1 # osirrox -mount /dev/sr0 "volid" '*2008_12_05*' /mnt @c man .SS @c man .B Incremental backup with accumulated trees @node ExIncBckAcc, ExBootable, ExIncBackup, Examples @section Incremental backup with accumulated trees Solaris does not offer the option to mount older sessions. In order to keep them accessible, one may map all files to a file tree under a session directory and accumulate those directories from session to session. The -root tree is cloned from the -old-root tree before it gets compared with the appropriate trees on disk. @* This demands to know the previously used session directory name. @* With the first session: @* @sp 1 $ xorrisofs -root /session1 \ @* -o - @minus{}@minus{}for_backup -m '*.o' -m '*.swp' \ @* -V PROJ_MAIL_"$(date '+%Y_%m_%d_%H%M%S')" -graft-points \ @* /projects=/home/thomas/projects \ @* /personal_mail=/home/thomas/personal_mail \ @* | xorriso -as cdrecord dev=/dev/sr0 -v blank=as_needed \ @* -multi -waiti -eject - @* @sp 1 @c man .sp 1 With the second session, option -old-root refers to /session1 and the new -root is /session2. @* Always eject the drive tray between sessions. A run of dd shall give demons a chance to spoil the first read on freshly loaded media. @* @sp 1 $ msinfo=$(xorriso -as cdrecord dev=/dev/sr0 -msinfo) @* $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 @* $ load_opts= @* $ test -n "$msinfo" && load_opts="-M /dev/sr0 -C $msinfo" @* $ xorrisofs $load_opts -root /session2 -old-root /session1 \ @* -o - @minus{}@minus{}for_backup -m '*.o' -m '*.swp' \ @* -V PROJ_MAIL_"$(date '+%Y_%m_%d_%H%M%S')" -graft-points \ @* /projects=/home/thomas/projects \ @* /personal_mail=/home/thomas/personal_mail \ @* | xorriso -as cdrecord dev=/dev/sr0 -v -multi -waiti -eject - @* @sp 1 With the third session, option -old-root refers to /session2. The new -root is /session3. And so on. @c man .SS @c man .B Create bootable images for PC-BIOS and EFI @node ExBootable, , ExIncBckAcc, Examples @section Create bootable images for PC-BIOS and EFI The SYSLINUX/ISOLINUX boot loader suite is popular for booting PC-BIOS. The ISOLINUX wiki prescribes to create on disk a directory ./CD_root and to copy all desired files underneath that directory. Especially file isolinux.bin shall be copied to ./CD_root/isolinux/isolinux.bin . This is the boot image file. @* The prescribed mkisofs options can be used unchanged with @command{xorrisofs}: @* @sp 1 $ xorrisofs -o output.iso \ @* -b isolinux/isolinux.bin -c isolinux/boot.cat \ @* -no-emul-boot -boot-load-size 4 -boot-info-table \ @* ./CD_root @* @sp 1 Put it on CD by a burn program. E.g.: @* @sp 1 $ xorriso -as cdrecord -v dev=/dev/sr0 blank=as_needed output.iso @* @sp 1 @c man .sp 1 The image from above example will boot from CD, DVD or BD, but not from USB stick or other hard-disk-like devices. This can be done by help of an isohybrid MBR. Syslinux provides matching template files as isohdp[fp]x*.bin . E.g. /usr/lib/syslinux/isohdpfx.bin . @* If a few hundred KB of size do not matter, then option -partition_offset can be used to create a partition table where partition 1 starts not at block 0. This facilitates later manipulations of the USB stick by tools for partitioning and formatting. @* The image from the following example will be prepared for booting via MBR and its first partition will start at hard disk block 64. @* It will also boot from optical media. @* @sp 1 $ xorrisofs -o output.iso \ @* -b isolinux/isolinux.bin -c isolinux/boot.cat \ @* -no-emul-boot -boot-load-size 4 -boot-info-table \ @* -isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \ @* -partition_offset 16 \ @* ./CD_root @* @sp 1 Become superuser and copy the image to the unpartitioned base device file of the USB stick. On GNU/Linux this is e.g. /dev/sdb, not /dev/sdb1. @* CAUTION: This will overwrite any partitioning on the USB stick and make remaining data unaccessible. @* So first make sure you got the correct address of the intended device. E.g. by reading 100 MiB data from it and watching it blinking: @* @sp 1 # dd bs=2K if=/dev/sdb count=50K >/dev/null @* @sp 1 Now copy the image onto it @* @sp 1 # dd bs=2K if=output.iso of=/dev/sdb @* @sp 1 @c man .sp 1 Now for EFI: @* The boot image file has to be the image of an EFI System Partition, i.e. a FAT filesystem with directory /EFI/BOOT and boot files with EFI prescribed names: BOOTIA32.EFI for 32 bit x86, BOOTx64.EFI for 64 bit AMD/x86 (in UEFI-2.4 there is indeed a lower case "x"), BOOTAA64.EFI for 64 bit ARM. The software in the FAT filesystem should be able to find and inspect the ISO filesystem for boot loader configuration and start of operating system. GRUB2 program grub-mkimage can produce such a FAT filesystem with suitable content, which then uses further GRUB2 software from the ISO filesystem. @* EFI boot equipment may be combined with above ISOLINUX isohybrid for PC-BIOS in a not really UEFI-2.4 compliant way, which obviously works well. It yields MBR and GPT partition tables, both with nested partitions. Assumed the EFI System Partition image is ready as ./CD_root/boot/grub/efi.img, add the following options before the directory address ./CD_root: @* @sp 1 -eltorito-alt-boot -e 'boot/grub/efi.img' -no-emul-boot \ @* -isohybrid-gpt-basdat \ @* @sp 1 More compliant with UEFI-2.4 is to decide for either MBR or GPT and to append a copy of the EFI System Partition in order to avoid overlap of ISO partition and EFI partition. Here for MBR: @* @sp 1 -eltorito-alt-boot -e 'boot/grub/efi.img' -no-emul-boot \ -append_partition 2 0xef ./CD_root/boot/grub/efi.img \ @* @sp 1 The resulting ISOs are supposed to boot from optical media and USB stick. One may omit option -eltorito-alt-boot if no option -b is used to make the ISO bootable via PC-BIOS. @* @sp 1 @c man .sp 1 For ISOs with pure GRUB2 boot equipment consider to use GRUB2 tool grub-mkrescue as frontend to xorrisofs. @* @sp 1 @c man .sp 1 If you have a bootable ISO filesystem and want to know its equipment plus a proposal how to reproduce it, try: @* @sp 1 $ xorriso -hfsplus on -indev IMAGE.iso \ -report_el_torito plain -report_system_area plain \ -print "" -print "======= Proposal for xorrisofs options:" \ -report_el_torito as_mkisofs @* @sp 1 @* @sp 1 @c man .SH FILES @node Files, Environ, Examples, Top @chapter Files @c man .SS @c man .B Startup files: @section Startup Files @* If not --no_rc is given as the first argument then @command{xorrisofs} attempts on startup to read and execute lines from the following files: @* @sp 1 /etc/default/xorriso @* /etc/opt/xorriso/rc @* /etc/xorriso/xorriso.conf @* $HOME/.xorrisorc @* @sp 1 The files are read in the sequence given here, but none of them is required to exist. The lines are not interpreted as @command{xorrisofs} options but as generic xorriso commands. See man xorriso. @c man .PP After the xorriso startup files, the program tries one by one to open for reading: @* @sp 1 ./.mkisofsrc @* $MKISOFSRC @* $HOME/.mkisofsrc @* $(dirname $0)/.mkisofsrc @* @sp 1 On success it interprets the file content and does not try further files. The last address is used only if start argument 0 has a non-trivial dirname. @* The reader currently interprets the following NAME=VALUE pairs: @* @sp 1 APPI default for -A @* PUBL default for -publisher @* SYSI default for -sysid @* VOLI default for -V @* VOLS default for -volset @* @sp 1 Any other lines will be silently ignored. @* @sp 1 @c man .SH ENVIRONMENT @node Environ, Seealso, Files, Top @chapter Environ The following environment variables influence the program behavior: @* HOME is used to find xorriso and mkisofs startup files. @* MKISOFSRC may be used to point the program to a mkisofs startup file. @* SOURCE_DATE_EPOCH belongs to the specs of reproducible-builds.org. It is supposed to be either undefined or to contain a decimal number which tells the seconds since january 1st 1970. If it contains a number, then it is used as time value to set the default of @minus{}@minus{}modification-date=. @minus{}@minus{}gpt_disk_guid defaults to "modification-date". The default of @minus{}@minus{}set_all_file_dates is then "set_to_mtime". Further the "now" time for ISO nodes without disk source is then set to the SOURCE_DATE_EPOCH value. @* Startup files and program options can override the effect of SOURCE_DATE_EPOCH. @c man .SS @c man .SH SEE ALSO @c man .TP @c man For generic xorriso command mode @c man .BR xorriso(1) @c man .TP @c man For the cdrecord emulation of xorriso @c man .BR xorrecord(1) @c man .TP @c man For mounting xorriso generated ISO 9660 images (-t iso9660) @c man .BR mount(8) @c man .TP @c man Other programs which produce ISO 9660 images @c man .BR mkisofs(8), @c man .BR genisoimage(8) @c man .TP @c man Programs which burn sessions to optical media @c man .BR growisofs(1), @c man .BR cdrecord(1), @c man .BR wodim(1), @c man .BR cdrskin(1), @c man .BR xorriso(1) @c man .TP @c man ACL and xattr @c man .BR getfacl(1), @c man .BR setfacl(1), @c man .BR getfattr(1), @c man .BR setfattr(1) @c man .TP @c man MD5 checksums @c man .BR md5sum(1) @c man .TP @c man On FreeBSD the commands for xattr and MD5 differ @c man .BR getextattr(8), @c man .BR setextattr(8), @c man .BR md5(1) @c man-ignore-lines begin @node Seealso, Bugreport, Environ, Top @chapter See also @table @asis @item For generic @command{xorriso} command mode xorriso(1) @item For the cdrecord emulation of @command{xorriso} xorrecord(1) @item For mounting xorriso generated ISO 9660 images (-t iso9660) mount(8) @item Other programs which produce ISO 9660 images mkisofs(8), genisoimage(1) @item Programs which burn sessions to optical media growisofs(1), cdrecord(1), wodim(1), cdrskin(1), xorriso(1) @item ACL and xattr getfacl(1), setfacl(1), getfattr(1), setfattr(1) @item MD5 checksums md5sum(1) @item On FreeBSD some commands differ: getextattr(8), setextattr(8), md5(1) @end table @c man-ignore-lines end @c man .SH BUGS @node Bugreport, Legal, Seealso, Top @chapter Reporting bugs @cindex Bugs, reporting @cindex Problems, reporting To report bugs, request help, or suggest enhancements for @command{xorriso}, please send electronic mail to the public list @email{bug-xorriso@@gnu.org}. If more privacy is desired, mail to @email{scdbackup@@gmx.net}. @* @sp 1 Please describe what you expect @command{xorriso} to do, the program arguments or dialog commands by which you tried to achieve it, the messages of @command{xorriso}, and the undesirable outcome of your program run. @* @sp 1 Expect to get asked more questions before solutions can be proposed. @c man .SH AUTHOR @node Legal, CommandIdx, Bugreport, Top @chapter Author, Copyright, Credits @section Author Thomas Schmitt @* for libburnia-project.org @c man .SH COPYRIGHT @section Copyright Copyright (c) 2011 - 2021 Thomas Schmitt @* Permission is granted to distribute this text freely. It shall only be modified in sync with the technical properties of xorriso. If you make use of the license to derive modified versions of xorriso then you are entitled to modify this text under that same license. @c man .SH CREDITS @section Credits @command{xorrisofs} is in part based on work by Vreixo Formoso who provides libisofs together with Mario Danic who also leads the libburnia team. Vladimir Serbinenko contributed the HFS+ filesystem code and related knowledge. @* Compliments towards Joerg Schilling whose cdrtools served me for ten years. @c man-ignore-lines begin @node CommandIdx, ConceptIdx, Legal, Top @chapter Alphabetic Command List @printindex ky @node ConceptIdx,, CommandIdx, Top @chapter Alphabetic List of Concepts and Objects @printindex cp @c man-ignore-lines end @bye libisoburn-1.5.4/xorriso/misc_funct.h0000644000175700017510000001004713750212014014627 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of miscellaneous helper functions of xorriso. */ #ifndef Xorriso_pvt_misc_includeD #define Xorriso_pvt_misc_includeD yes #include #ifdef HAVE_STDINT_H #include #else #ifdef HAVE_INTTYPES_H #include #endif #endif char *Text_shellsafe(char *in_text, char *out_text, int flag); int Sort_argv(int argc, char **argv, int flag); /* @param flag bit0= single letters */ char *Ftypetxt(mode_t st_mode, int flag); /* @param flag bit0=with year and seconds bit1=timestamp format YYYY.MM.DD.hhmmss */ char *Ftimetxt(time_t t, char timetext[40], int flag); int System_uname(char **sysname, char **release, char **version, char **machine, int flag); /** Convert a text into a number of type double and multiply it by unit code [kmgtpe] (2^10 to 2^60) or [s] (2048). (Also accepts capital letters.) @param text Input like "42", "2k", "3.14m" or "-1g" @param flag Bitfield for control purposes: bit0= return -1 rather than 0 on failure @return The derived double value */ double Scanf_io_size(char *text, int flag); /* @flag bit0= do not initialize *diff_count @return <0 error , 0 = mismatch , 1 = match */ int Compare_text_lines(char *text1, char *text2, int *diff_count, int flag); time_t Decode_timestring(char *code, time_t *date, int flag); int Decode_ecma119_format(struct tm *erg, char *text, int flag); int Wait_for_input(int fd, int microsec, int flag); int Fileliste__target_source_limit(char *line, char sep, char **limit_pt, int flag); int Fileliste__escape_source_path(char *line, int size, int flag); int Hex_to_bin(char *hex, int bin_size, int *bin_count, unsigned char *bin_data, int flag); /* bit0= append (text!=NULL) */ int Sregex_string(char **handle, char *text, int flag); /* @param flag bit0= only test expression whether compilable */ int Sregex_match(char *pattern, char *text, int flag); /* vars[][0] points to the variable names, vars[][1] to their contents. start marks the begin of variable names. It must be non-empty. esc before start disables this meaning. start and esc may be equal but else they must have disjoint character sets. end marks the end of a variable name. It may be empty but if non-empty it must not appear in vars[][0]. @param flag bit0= Substitute unknown variables by empty text (else copy start,name,end unaltered to result). Parameter end must be non-empty for that. */ int Sregex_resolve_var(char *form, char *vars[][2], int num_vars, char *start, char *end, char *esc, char *result, int result_size, int flag); /* reg_expr should be twice as large as bourne_expr ( + 2 to be exact) */ /* return: 2= bourne_expr is surely a constant */ int Xorriso__bourne_to_reg(char bourne_expr[], char reg_expr[], int flag); int Xorriso__hide_mode(char *mode, int flag); char *Xorriso__hide_mode_text(int hide_mode, int flag); /* @return 0=truncated, 1=ok */ int Xorriso__to_upper(char *in, char *out, int out_size, int flag); /* @param flag bit0= prepend target_prefix even if source_prefix does not get removed */ int Xorriso__exchange_prefix(char *source_prefix, char *target_prefix, char *eff_source, char *eff_target, int flag); /* @param text takes result, must provide at least 37 characters of storage @param flag bit0= structured text format (else hex string) */ int Xorriso__format_guid(uint8_t guid[16], char *text, int flag); /* @param cpt start of keyword=value string @param key_l length from cpt of keyword= string @param l length from cpt up to end of value string @param num result */ int Xorriso__parse_size_param(char *cpt, int key_l, int l, double *num); #endif /* ! Xorriso_pvt_misc_includeD */ libisoburn-1.5.4/xorriso/read_run.c0000644000175700017510000024531213762645021014307 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains functions which are needed to read data from ISO image. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include /* O_BINARY is needed for Cygwin but undefined elsewhere */ #ifndef O_BINARY #define O_BINARY 0 #endif #include "lib_mgt.h" #include "drive_mgt.h" #include "iso_img.h" #include "iso_tree.h" #include "iso_manip.h" #include "read_run.h" #include "sort_cmp.h" int Xorriso__read_pacifier(IsoImage *image, IsoFileSource *filesource) { struct XorrisO *xorriso; xorriso= (struct XorrisO *) iso_image_get_attached_data(image); if(xorriso==NULL) return(1); Xorriso_process_msg_queues(xorriso,0); xorriso->pacifier_count++; if(xorriso->pacifier_count%10) return(1); Xorriso_pacifier_callback(xorriso, "nodes read", xorriso->pacifier_count, 0, "", 0); return(1); } /* @param flag bit0= open IsoNode *node_pt rather than looking up pathname bit1= dig out the most original stream for reading */ int Xorriso_iso_file_open(struct XorrisO *xorriso, char *pathname, void *node_pt, void **stream, int flag) { int ret; char *eff_path= NULL; IsoNode *node= NULL; IsoFile *filenode= NULL; IsoStream *iso_stream= NULL, *input_stream; Xorriso_alloc_meM(eff_path, char, SfileadrL); *stream= NULL; if(flag&1) { node= (IsoNode *) node_pt; } else { ret= Xorriso_get_node_by_path(xorriso, pathname, eff_path, &node, 0); if(ret<=0) goto ex; } if(!LIBISO_ISREG(node)) { sprintf(xorriso->info_text, "Given path does not lead to a regular data file in the image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } filenode= (IsoFile *) node; iso_stream= iso_file_get_stream(filenode); if(iso_stream==NULL) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "Could not obtain source stream of file in the image for reading"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } if(flag & 2) { /* Dig out the most original stream */ while(1) { input_stream= iso_stream_get_input_stream(iso_stream, 0); if(input_stream == NULL) break; iso_stream= input_stream; } } if(!iso_stream_is_repeatable(iso_stream)) { sprintf(xorriso->info_text, "The data production of the file in the image is one-time only"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } ret= iso_stream_open(iso_stream); if(ret<0) { sprintf(xorriso->info_text, "Could not open data file in the image for reading"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } Xorriso_process_msg_queues(xorriso,0); *stream= iso_stream; #ifdef NIX /* <<< */ { unsigned int fs_id; dev_t dev_id; ino_t ino; iso_stream_get_id(iso_stream, &fs_id, &dev_id, &ino); fprintf(stderr, "xorriso_debug: iso_ino= %ld\n", (long int) ino); } #endif ret= 1; ex:; Xorriso_free_meM(eff_path); return(ret); } int Xorriso_iso_file_read(struct XorrisO *xorriso, void *stream, char *buf, int count, int flag) { int ret, rcnt= 0; IsoStream *stream_pt; stream_pt= (IsoStream *) stream; while(rcntclass->type, 4); iso_stream_get_id(stream, &fs_id, &dev_id, &ino_id); if(flag&2) { sprintf(xorriso->info_text, "%s : fs=%d dev=%.f ino=%.f (%s)", img_path, fs_id, (double) dev_id, (double) ino_id, type_text); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); } ret= stat(disk_path, &stbuf); if(ret==-1) return(0); if(flag&2) { sprintf(xorriso->info_text, "%s : dev=%.f ino=%.f", disk_path, (double) stbuf.st_dev, (double) stbuf.st_ino); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); } if(fs_id!=1) return(2); /* >>> obtain underlying dev_t ino_t of type "cout" */; if(strcmp(type_text, "fsrc")!=0) return(2); if(stbuf.st_dev==dev_id && stbuf.st_ino==ino_id) return(1); return(0); } int Xorriso_iso_file_to_fd(struct XorrisO *xorriso, char *path, int fd, int flag) { int ret, rret, wret, to_write, wanted; void *stream= NULL; char *buffer= NULL, *wpt; off_t todo; static int buffer_size= 64 * 1024; Xorriso_alloc_meM(buffer, char, buffer_size); ret= Xorriso_iso_file_open(xorriso, path, NULL, &stream, 0); if(ret <= 0) goto ex; todo= iso_stream_get_size((IsoStream *) stream); while(todo > 0) { if(todo < buffer_size) wanted= todo; else wanted= buffer_size; rret = Xorriso_iso_file_read(xorriso, stream, buffer, wanted, 0); if(rret <= 0) {ret= -1; goto ex;} todo-= rret; wpt= buffer; for(to_write= rret; to_write > 0;) { wret= write(fd, wpt, to_write); if(wret <= 0) { if(wret == 0) sprintf(xorriso->info_text, "Strange behavior of write(2): return == 0 with "); else sprintf(xorriso->info_text, "Write error with "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, wret == 0 ? 0 : errno, "FAILURE",0); ret= 0; goto ex; } to_write-= wret; wpt+= wret; } } ret= 1; ex:; if(stream != NULL) Xorriso_iso_file_close(xorriso, &stream, 0); Xorriso_free_meM(buffer); return(ret); } /* @param flag bit0= minimal transfer: access permissions only bit1= keep directory open: keep owner, allow rwx for owner and push directory onto xorriso->perm_stack */ int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path, IsoNode *node, int flag) { int ret, is_dir= 0, errno_copy= 0, local_attrs_set= 0, i, err_count; mode_t mode; uid_t uid, disk_uid; gid_t gid, disk_gid; struct utimbuf utime_buffer; struct stat stbuf; size_t num_attrs= 0, *value_lengths= NULL; char **names= NULL, **values= NULL; int *errnos= NULL; ret= lstat(disk_path, &stbuf); if(ret==-1) { sprintf(xorriso->info_text, "Cannot obtain properties of disk file "); Text_shellsafe(disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); {ret= 0; goto ex;} } disk_uid= uid= stbuf.st_uid; disk_gid= stbuf.st_gid; is_dir= S_ISDIR(stbuf.st_mode); mode= iso_node_get_permissions(node); if(xorriso->do_aaip & (2 | 8 | 16)) { ret= iso_node_get_attrs(node, &num_attrs, &names, &value_lengths, &values, (!!(xorriso->do_aaip & 2)) | (!(xorriso->do_aaip & (8 | 16))) << 2); if (ret < 0) { strcpy(xorriso->info_text, "Error with obtaining ACL and xattr for "); Text_shellsafe(disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } if(num_attrs > 0) { Xorriso_alloc_meM(errnos, int, num_attrs); ret= iso_local_set_attrs_errno(disk_path, num_attrs, names, value_lengths, values, errnos, ((!(xorriso->do_strict_acl & 1)) << 6) | ((!!(xorriso->do_aaip & 1024)) << 3) ); if(ret < 0) { cannot_set_xattr:; errno_copy= errno; if(ret != (int) ISO_AAIP_NO_SET_LOCAL) errno_copy= 0; Xorriso_report_iso_error(xorriso, "", ret, "Error on iso_local_set_attrs", 0, "FAILURE", 1 | ((ret == -1)<<2) ); sprintf(xorriso->info_text, "Disk file "); Text_shellsafe(disk_path, xorriso->info_text, 1); err_count= 0; for(i= 0; (unsigned int) i < num_attrs; i++) { if(errnos[i] == 0) continue; if(err_count >= 3) { strcat(xorriso->info_text, " , and more"); break; } err_count++; errno_copy= 0; /* Detail errno overrides final errno */ if(names[i][0] == 0) sprintf(xorriso->info_text + strlen(xorriso->info_text), " , ACL "); else sprintf(xorriso->info_text + strlen(xorriso->info_text), " , xattr %s ", names[i]); if(errnos[i] < 0) Text_shellsafe("Unknown error", xorriso->info_text, 1); else Text_shellsafe(strerror(errnos[i]), xorriso->info_text, 1); } Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno_copy, "FAILURE",0); {ret= 0; goto ex;} } local_attrs_set= 1; } Xorriso_process_msg_queues(xorriso,0); } if(!(xorriso->do_aaip & 2)) mode= iso_node_get_perms_wo_acl(node); if(is_dir && (flag&2)) { ret= Xorriso_fake_stbuf(xorriso, "", &stbuf, &node, 1 | ((!!(xorriso->do_aaip & 2)) << 3)); if(ret<=0) {ret= 0; goto ex;} ret= Permstack_push(&(xorriso->perm_stack), disk_path, &stbuf, 0); if(ret<=0) { Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0); strcpy(xorriso->info_text, "Cannot memorize permissions for disk directory"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } mode|= S_IRUSR|S_IWUSR|S_IXUSR; } ret= chmod(disk_path, mode); if(ret==-1) { cannot_set_perm:; sprintf(xorriso->info_text, "Cannot change access permissions of disk file "); Text_shellsafe(disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); {ret= 0; goto ex;} } if(flag&1) {ret= 1; goto ex;} utime_buffer.actime= iso_node_get_atime(node); utime_buffer.modtime= iso_node_get_mtime(node); ret= utime(disk_path,&utime_buffer); if(ret==-1) { sprintf(xorriso->info_text, "Cannot change atime, mtime of disk file "); Text_shellsafe(disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); {ret= 0; goto ex;} } gid= iso_node_get_gid(node); if(!(S_ISDIR(stbuf.st_mode) && (flag&2))) uid= iso_node_get_uid(node); if(uid != disk_uid || gid != disk_gid) { ret= chown(disk_path, uid, gid); /* don't complain if it fails */ /* Check whether xattr are still set and try to set them again if needed. E.g. Linux 3.16 removes security.capability on chown(2). */ if(local_attrs_set && (xorriso->do_aaip & 1024)) { ret= iso_local_set_attrs_errno(disk_path, num_attrs, names, value_lengths, values, errnos, 1 | ((!!(xorriso->do_aaip & 1024)) << 3) | 128); if(ret < 0) goto cannot_set_xattr; } /* Check whether setuid or setgid bits got reset */ ret= lstat(disk_path, &stbuf); if(ret != -1) { if((mode ^ stbuf.st_mode) & (S_ISUID | S_ISGID)) { ret= chmod(disk_path, mode); if(ret==-1) goto cannot_set_perm; } } } ret= 1; ex:; iso_node_get_attrs(node, &num_attrs, &names, &value_lengths, &values,1 << 15); if(errnos != NULL) free(errnos); return(ret); } /* @param flag bit1= minimal transfer: access permissions only bit2= keep directory open: keep owner, allow rwx for owner push to xorriso->perm_stack */ int Xorriso_restore_implicit_properties(struct XorrisO *xorriso, char *full_disk_path, char *disk_path, char *full_img_path, int flag) { int ret, nfic, ndc, nfdc, d, i; char *nfi= NULL, *nd= NULL, *nfd= NULL, *cpt; struct stat stbuf; IsoNode *node; Xorriso_alloc_meM(nfi, char, SfileadrL); Xorriso_alloc_meM(nd, char, SfileadrL); Xorriso_alloc_meM(nfd, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, full_disk_path, nfd, 1|2|4); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, disk_path, nd, 1|2); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, full_img_path, nfi, 1|2); if(ret<=0) goto ex; nfdc= Sfile_count_components(nfd, 0); ndc= Sfile_count_components(nd, 0); nfic= Sfile_count_components(nfi, 0); d= nfdc-ndc; if(d<0) {ret= -1; goto ex;} if(d>nfic) {ret= 0; goto ex;} for(i= 0; i>1)&3)); if(ret<=0) goto ex; sprintf(xorriso->info_text, "Restored properties for "); Text_shellsafe(nd, xorriso->info_text, 1); strcat(xorriso->info_text, " from "); Text_shellsafe(nfi, xorriso->info_text, 1 | 2); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); ret= 1; ex:; Xorriso_free_meM(nfi); Xorriso_free_meM(nd); Xorriso_free_meM(nfd); return(ret); } /* If defined the position accounting will be done by lseek() and used to * verify the position accounting in struct Xorriso_sparse_statE. * # def ine Xorriso_check_sparsE yes */ struct Xorriso_sparse_statE { int use_lseek; off_t cur_pos; off_t after_last_written; int warnings; }; #ifdef Xorriso_check_sparsE static int Xorriso_sparse_warn(struct XorrisO *xorriso, struct Xorriso_sparse_statE *sparse_state, int occasion, char *msg, int flag) { if(sparse_state->warnings & (1 << occasion)) return(1); sparse_state->warnings|= 1 << occasion; Xorriso_msgs_submit(xorriso, 0, msg, 0, "SORRY", 0); return(1); } #endif /* Xorriso_check_sparsE */ static int Xorriso_sparse_init(struct XorrisO *xorriso, struct Xorriso_sparse_statE **sparse_state, int write_fd, int flag) { struct Xorriso_sparse_statE *o= NULL; off_t cur_pos; struct stat stbuf; int ret; *sparse_state= NULL; /* Check whether sparse writing is disabled */ if(xorriso->sparse_min_gap <= 0) {ret= 0; goto ex;} /* Analyze write_fd */ ret= fstat(write_fd, &stbuf); if(ret == -1) {ret= 0; goto ex;} if(!S_ISREG(stbuf.st_mode)) {ret= 0; goto ex;} cur_pos= lseek(write_fd, (off_t) 0, SEEK_CUR); if(cur_pos < stbuf.st_size) {ret= 0; goto ex;} Xorriso_alloc_meM(o, struct Xorriso_sparse_statE, 1); /* Initialize sparse_state */ o->use_lseek= 1; o->cur_pos= o->after_last_written= cur_pos; o->warnings= 0; ret= 1; ex:; if(ret >= 1) *sparse_state= o; else Xorriso_free_meM(o); return(ret); } static int Xorriso_sparse_zeroize(struct XorrisO *xorriso, struct Xorriso_sparse_statE *sparse_state, int write_fd, off_t start, off_t count, int flag) { int ret, buf_size= 32 * 1024, buf_fill, wret; off_t todo, seek_ret; char *buf= NULL; if(count <= 0) {ret= 2; goto ex;} Xorriso_alloc_meM(buf, char, buf_size); seek_ret= lseek(write_fd, start, SEEK_SET); if(seek_ret == -1) {ret= -1; goto ex;} sparse_state->cur_pos= seek_ret; for(todo= count; todo > 0; ) { if(buf_size < todo) buf_fill= buf_size; else buf_fill= todo; wret= write(write_fd, buf, buf_fill); if(wret <= 0) {ret= wret; goto ex;} todo-= wret; sparse_state->cur_pos+= wret; } ret= 1; ex:; Xorriso_free_meM(buf); return(ret); } /* @param flag bit0= this is the last buffer of the stream */ static int Xorriso_sparse_write(struct XorrisO *xorriso, struct Xorriso_sparse_statE *sparse_state, int write_fd, char *buf, int count, int flag) { int wret, i, ret; off_t cur_pos= -1, seek_ret; static char zero[32]= {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0}; if(sparse_state == NULL) goto do_write; if(!sparse_state->use_lseek) goto do_write; if(flag & 1) goto do_write; #ifdef Xorriso_check_sparsE cur_pos= lseek(write_fd, (off_t) 0, SEEK_CUR); if(cur_pos == -1) goto do_write; if(cur_pos != sparse_state->cur_pos) { Xorriso_sparse_warn(xorriso, sparse_state, 0, "cur_pos deviation in Xorriso_sparse_write:intro", 0); sparse_state->cur_pos= cur_pos; } #else cur_pos= sparse_state->cur_pos; #endif /* Check for all zeros */ if(count % 32) goto do_write; for(i= 0; i < count; i+= 32) if(memcmp(buf + i, zero, 32)) break; if(i < count) goto do_write; /* Omit write() until next non-zero buffer or end of writing */ #ifdef Xorriso_check_sparsE /* Only for debugging: Do real lseek() instead of write() */ seek_ret= lseek(write_fd, cur_pos + count, SEEK_SET); if(seek_ret == -1) return(-1); #endif sparse_state->cur_pos= cur_pos + count; return(count); do_write: if(sparse_state != NULL) { /* Check whether the gap since after_last_written is too small. If so: fill the whole gap by writing zeros. */ if(sparse_state->after_last_written < cur_pos) { if(xorriso->sparse_min_gap > cur_pos - sparse_state->after_last_written) { ret= Xorriso_sparse_zeroize(xorriso, sparse_state, write_fd, sparse_state->after_last_written, cur_pos - sparse_state->after_last_written, 0); if(ret < 0) return(ret); if(ret == 0) { seek_ret= lseek(write_fd, cur_pos, SEEK_SET); if(seek_ret == -1) return(-1); sparse_state->cur_pos= seek_ret; } } } } if(sparse_state != NULL) { #ifdef Xorriso_check_sparsE cur_pos= lseek(write_fd, (off_t) 0, SEEK_CUR); if(cur_pos != sparse_state->cur_pos) { Xorriso_sparse_warn(xorriso, sparse_state, 1, "cur_pos deviation in Xorriso_sparse_write:do_write", 0); sparse_state->cur_pos= cur_pos; } #else /* lseek() has been delayed until now */ if(sparse_state->after_last_written != sparse_state->cur_pos) { seek_ret= lseek(write_fd, sparse_state->cur_pos, SEEK_SET); if(seek_ret == -1) return(-1); } #endif /* ! Xorriso_check_sparsE */ } wret= write(write_fd, buf, count); if(sparse_state != NULL && wret > 0 && cur_pos >= 0) sparse_state->cur_pos= sparse_state->after_last_written= cur_pos + wret; return(wret); } static int Xorriso_sparse_finish(struct XorrisO *xorriso, struct Xorriso_sparse_statE **sparse_state, int write_fd, int flag) { int ret; off_t cur_pos; struct Xorriso_sparse_statE *o; if(sparse_state == NULL) return(0); o= *sparse_state; if(o == NULL) return(1); if(write_fd == -1) {ret= 1; goto ex;} #ifdef Xorriso_check_sparsE cur_pos= lseek(write_fd, (off_t) 0, SEEK_CUR); if(cur_pos == -1) {ret= -1; goto ex;} if(cur_pos != o->cur_pos) { Xorriso_sparse_warn(xorriso, o, 2, "cur_pos deviation in Xorriso_sparse_finish", 0); o->cur_pos= cur_pos; } #else cur_pos= o->cur_pos; #endif /* ! Xorriso_check_sparsE */ if(o->after_last_written < cur_pos) { /* Check whether the gap since after_last_written is too small. If so: fill the whole gap by writing zeros, else: write a last zero byte. */ if(xorriso->sparse_min_gap > cur_pos - o->after_last_written) ret= Xorriso_sparse_zeroize(xorriso, o, write_fd, o->after_last_written, cur_pos - o->after_last_written, 0); else ret= Xorriso_sparse_zeroize(xorriso, o, write_fd, cur_pos - 1, (off_t) 1, 0); if(ret <= 0) goto ex; } ret= 1; ex:; Xorriso_free_meM(o); *sparse_state= NULL; return(ret); } /* @param flag bit0= Minimal transfer: access permissions only bit1= *_offset and bytes are valid for writing to regular file bit2= This is not a parameter. Do not report if ignored bit3= do not restore properties bit4= issue pacifier messages with long lasting copying bit7= return 4 if restore fails from denied permission do not issue error message @return <0 severe error , 0 failure , 1 success , 2 regularly not installed (disallowed device, UNIX domain socket) 4 with bit7: permission to restore was denied */ int Xorriso_tree_restore_node(struct XorrisO *xorriso, IsoNode *node, char *img_path, off_t img_offset, char *disk_path, off_t disk_offset, off_t bytes, int flag) { int ret= 0, write_fd= -1, wanted, wret, open_flags, l_errno= 0; int target_deleted= 0, buf_size= 32 * 1024; char *what= "[unknown filetype]"; char *buf= NULL, type_text[5], *temp_path= NULL, *buf_pt; char *link_target, *open_path_pt= NULL; off_t todo= 0, size, seek_ret, last_p_count= 0, already_done, read_count= 0; void *data_stream= NULL; mode_t mode; dev_t dev= 0; struct stat stbuf; struct utimbuf utime_buffer; IsoImage *volume; IsoBoot *bootcat; uint32_t lba; char *catcontent = NULL; off_t catsize; char disk_md5[16], iso_md5[16]; void *ctx= NULL; int use_md5= 0, i, sparse_ret= 3; struct Xorriso_sparse_statE *sparse_state= NULL; Xorriso_alloc_meM(buf, char, buf_size); Xorriso_alloc_meM(temp_path, char, SfileadrL); if(!(flag & 2)) img_offset= bytes= 0; if(LIBISO_ISDIR(node)) { what= "directory"; ret= mkdir(disk_path, 0777); l_errno= errno; } else if(LIBISO_ISREG(node) || ISO_NODE_IS_BOOTCAT(node)) { if(ISO_NODE_IS_BOOTCAT(node)) { what= "boot catalog"; } else { what= "regular file"; ret= Xorriso_iso_file_open(xorriso, img_path, (void *) node, &data_stream, 1); if(ret<=0) goto ex; if((xorriso->do_md5 & 65) == 65 && !(flag & 2)) { ret= Xorriso_is_plain_image_file(xorriso, (void *) node, img_path, 0); if(ret > 0) { ret= Xorriso_get_md5(xorriso, (void *) node, img_path, iso_md5, 1); if(ret > 0) ret= Xorriso_md5_start(xorriso, &ctx, 0); if(ret > 0) { use_md5= 1; } else if(xorriso->do_md5 & 128) { sprintf(xorriso->info_text, "Cannot obtain any recorded MD5 of file "); Text_shellsafe(img_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= Xorriso_eval_problem_status(xorriso, 0, 1 | 2); if(ret < 0) {ret= 0; goto ex;} } } } } open_path_pt= disk_path; ret= stat(open_path_pt, &stbuf); if(ret == -1 && errno == EACCES && (flag & 128)) {ret= 4; goto ex;} if(flag&2) { if(ret!=-1 && !S_ISREG(stbuf.st_mode)) { sprintf(xorriso->info_text, "Restore offset demanded. But filesystem path leads to non-data file "); Text_shellsafe(disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE",0); l_errno= 0; goto cannot_restore; } } else { /* If source and target are the same disk file then do not copy content */ ret= Xorriso_restore_is_identical(xorriso, (void *) node, img_path, disk_path, type_text, 1); if(ret<0) goto ex; if(ret==1) { /* preliminarily emulate touch (might get overridden later) */ utime_buffer.actime= stbuf.st_atime; utime_buffer.modtime= time(0); utime(disk_path,&utime_buffer); goto restore_properties; } if(ret==2) { /* Extract to temporary file and rename only after copying */ ret= Xorriso_make_tmp_path(xorriso, disk_path, temp_path, &write_fd, 128); if(ret <= 0 || ret == 4) goto ex; open_path_pt= temp_path; } } if(write_fd==-1) { open_flags= O_WRONLY|O_CREAT; if(disk_offset==0 || !(flag&2)) open_flags|= O_EXCL; write_fd= open(open_path_pt, open_flags | O_BINARY, S_IRUSR | S_IWUSR); l_errno= errno; if(write_fd == -1 && errno == EACCES && (flag & 128)) {ret= 4; goto ex;} if(write_fd==-1) goto cannot_restore; } if(ISO_NODE_IS_BOOTCAT(node)) { ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) goto ex; ret= iso_image_get_bootcat(volume, &bootcat, &lba, &catcontent, &catsize); if(ret < 0) goto ex; todo= size= catsize; } else { todo= size= iso_file_get_size((IsoFile *) node); } if(flag&2) { if(bytesinfo_text, "Cannot address byte %.f in filesystem path ", (double) disk_offset); Text_shellsafe(open_path_pt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE",0); goto cannot_restore; } } if(ISO_NODE_IS_FILE(node)) Xorriso_sparse_init(xorriso, &sparse_state, write_fd, 0); while(todo>0) { wanted= buf_size; if(wanted>todo) wanted= todo; if(ISO_NODE_IS_BOOTCAT(node)) { ret= todo; buf_pt= catcontent; } else { ret= Xorriso_iso_file_read(xorriso, data_stream, buf, wanted, 0); buf_pt= buf; } if(ret<=0) { if(xorriso->extract_error_mode == 0 && Xorriso_is_plain_image_file(xorriso, node, "", 0)) { close(write_fd); write_fd= -1; already_done= (size - todo) / (off_t) 2048; already_done*= (off_t) 2048; sprintf(xorriso->info_text, "Starting best_effort handling on ISO file "); Text_shellsafe(img_path, xorriso->info_text, 1); sprintf(xorriso->info_text + strlen(xorriso->info_text), " at byte %.f", (double) already_done); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= Xorriso_read_file_data(xorriso, node, img_path, open_path_pt, already_done, already_done, size - already_done, 2); if(ret >= 0) xorriso->pacifier_byte_count+= todo; if(ret > 0) todo= 0; else todo= -1; } if(ret <= 0) { sprintf(xorriso->info_text, "Cannot read all bytes from ISO file "); Text_shellsafe(img_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } break; } read_count+= ret; if(use_md5) Xorriso_md5_compute(xorriso, ctx, buf_pt, ret, 0); if(img_offset > read_count - ret) { /* skip the desired amount of bytes */ if(read_count <= img_offset) continue; buf_pt= buf_pt + (img_offset - (read_count - ret)); ret= read_count - img_offset; } if(sparse_state == NULL) wret= write(write_fd, buf_pt, ret); else wret= Xorriso_sparse_write(xorriso, sparse_state, write_fd, buf_pt, ret, 0); if(wret>=0) { todo-= wret; xorriso->pacifier_byte_count+= wret; if((flag&16) && xorriso->pacifier_byte_count - last_p_count >= 128*1024) { Xorriso_pacifier_callback(xorriso, "files restored", xorriso->pacifier_count, xorriso->pacifier_total, "", 2 | 4 | 8); last_p_count= xorriso->pacifier_byte_count; } } if(wret != ret) { sprintf(xorriso->info_text, "Cannot write all bytes to disk filesystem path "); Text_shellsafe(open_path_pt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE",0); break; } } if(use_md5) { ret= Xorriso_md5_end(xorriso, &ctx, disk_md5, 0); if(ret <= 0) { sprintf(xorriso->info_text, "Internal problem with obtaining computed MD5 for extracted data of "); goto bad_md5; } else { for(i= 0; i < 16; i++) if(iso_md5[i] != disk_md5[i]) break; if(i < 16) { sprintf(xorriso->info_text, "MD5 of extracted data does not match recorded MD5 of file "); bad_md5:; Text_shellsafe(img_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= Xorriso_eval_problem_status(xorriso, 0, 1 | 2); if(ret < 0) {ret= 0; goto ex;} } } } if(write_fd != -1) { sparse_ret= Xorriso_sparse_finish(xorriso, &sparse_state, write_fd, 0); close(write_fd); } write_fd= -1; if(todo > 0 && xorriso->extract_error_mode == 2) { unlink(open_path_pt); target_deleted= 1; } if(! ISO_NODE_IS_BOOTCAT(node)) Xorriso_iso_file_close(xorriso, &data_stream, 0); data_stream= NULL; if(temp_path==open_path_pt && !target_deleted) { ret= rename(temp_path, disk_path); if(ret==-1) { sprintf(xorriso->info_text, "Cannot rename temporary path "); Text_shellsafe(temp_path, xorriso->info_text, 1); strcat(xorriso->info_text, " to final disk path "); Text_shellsafe(disk_path, xorriso->info_text, 1 | 2); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE",0); unlink(temp_path); ret= 0; goto ex; } } ret= -(todo > 0); l_errno= 0; if(sparse_ret <= 0) { strcpy(xorriso->info_text, "Could not finalize sparse extraction of "); Text_shellsafe(disk_path, xorriso->info_text, 1 | 2); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, sparse_ret < 0 ? errno : 0, "FAILURE", 0); } } else if(LIBISO_ISLNK(node)) { what= "symbolic link"; link_target= (char *) iso_symlink_get_dest((IsoSymlink *) node); ret= symlink(link_target, disk_path); l_errno= errno; } else if(LIBISO_ISCHR(node)) { what= "character device"; if(xorriso->allow_restore!=2) { ignored:; if(!(flag&4)) { sprintf(xorriso->info_text, "Ignored file type: %s ", what); Text_shellsafe(img_path, xorriso->info_text, 1); strcat(xorriso->info_text, " = "); Text_shellsafe(disk_path, xorriso->info_text, 1 | 2); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } {ret= 2; goto ex;} } mode= S_IFCHR | 0777; ret= Xorriso_node_get_dev(xorriso, node, img_path, &dev, 0); if(ret<=0) goto ex; if(dev == (dev_t) 1) { probably_damaged:; sprintf(xorriso->info_text, "Most probably damaged device file not restored: mknod "); Text_shellsafe(disk_path, xorriso->info_text, 1); sprintf(xorriso->info_text + strlen(xorriso->info_text), " %s 0 1", LIBISO_ISCHR(node) ? "c" : "b"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= 0; goto ex; } ret= mknod(disk_path, mode, dev); l_errno= errno; } else if(LIBISO_ISBLK(node)) { what= "block device"; if(xorriso->allow_restore!=2) goto ignored; mode= S_IFBLK | 0777; ret= Xorriso_node_get_dev(xorriso, node, img_path, &dev, 0); if(ret<=0) goto ex; if(dev == (dev_t) 1) goto probably_damaged; ret= mknod(disk_path, mode, dev); l_errno= errno; } else if(LIBISO_ISFIFO(node)) { what= "named pipe"; mode= S_IFIFO | 0777; ret= mknod(disk_path, mode, dev); l_errno= errno; } else if(LIBISO_ISSOCK(node)) { what= "unix socket"; /* Restoring a socket file is not possible. One rather needs to restart the service which temporarily created the socket. */ goto ignored; } else { sprintf(xorriso->info_text, "Cannot restore file type '%s'", what); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 0; goto ex; } if(ret == -1 && l_errno == EACCES && (flag & 128)) {ret= 4; goto ex;} if(ret==-1) { cannot_restore:; sprintf(xorriso->info_text, "Cannot restore %s to disk filesystem: ", what); Text_shellsafe(img_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, l_errno, "FAILURE", 0); ret= 0; goto ex; } restore_properties:; if((flag&8) || LIBISO_ISLNK(node)) ret= 1; else ret= Xorriso_restore_properties(xorriso, disk_path, node, flag&1); if(todo < 0) ret= 0; ex:; if(write_fd != -1) { close(write_fd); if(ret <= 0 && xorriso->extract_error_mode == 2 && open_path_pt != NULL) unlink(open_path_pt); } Xorriso_free_meM(buf); Xorriso_free_meM(temp_path); if(catcontent != NULL) free(catcontent); if(data_stream!=NULL) Xorriso_iso_file_close(xorriso, &data_stream, 0); if(ctx != NULL) Xorriso_md5_end(xorriso, &ctx, disk_md5, 0); if(sparse_state != NULL) Xorriso_sparse_finish(xorriso, &sparse_state, -1, 0); Xorriso_process_msg_queues(xorriso,0); return(ret); } /* Handle overwrite situation in disk filesystem. @param node intended source of overwriting or NULL @param flag bit4= return 3 on rejection by exclusion or user bit6= permission to call Xorriso_make_accessible() */ int Xorriso_restore_overwrite(struct XorrisO *xorriso, IsoNode *node, char *img_path, char *path, char *nominal_path, struct stat *stbuf, int flag) { int ret; char type_text[5]; Xorriso_process_msg_queues(xorriso,0); if(xorriso->do_overwrite==1 || (xorriso->do_overwrite==2 && !S_ISDIR(stbuf->st_mode))) { ret= Xorriso_restore_is_identical(xorriso, (void *) node, img_path, path, type_text, (node!=NULL)); if(ret<0) return(ret); if(ret>0) /* will be handled properly by restore functions */ ret= Xorriso_reassure_restore(xorriso, path, 8); else ret= Xorriso_rmx(xorriso, (off_t) 0, path, 8 | (flag & 64)); if(ret<=0) return(ret); if(ret==3) { sprintf(xorriso->info_text, "User revoked restoring of (ISO) file: "); Text_shellsafe(img_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(3*!!(flag&16)); } return(1); } Xorriso_msgs_submit(xorriso, 0, nominal_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "While restoring "); Text_shellsafe(nominal_path, xorriso->info_text, 1); strcat(xorriso->info_text, " : "); if(strcmp(nominal_path, path) == 0) strcat(xorriso->info_text, "file object"); else Text_shellsafe(path, xorriso->info_text, 1 | 2); strcat(xorriso->info_text, " exists and may not be overwritten"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } /* @return <0 error, bit0= hardlink created bit1= siblings with target NULL found bit2= siblings with non-NULL target found */ int Xorriso_restore_target_hl(struct XorrisO *xorriso, IsoNode *node, char *disk_path, int *node_idx, int flag) { int ret, min_hl, max_hl, i, null_target_sibling= 0, link_sibling= 0; if(xorriso->hln_targets == NULL) return(0); ret= Xorriso_search_hardlinks(xorriso, node, node_idx, &min_hl, &max_hl, 1); if(ret < 0) return(ret); if(ret == 0 || *node_idx < 0 || min_hl == max_hl) return(0); for(i= min_hl; i <= max_hl; i++) { if(xorriso->hln_targets[i] == NULL) { if(i != *node_idx) null_target_sibling= 1; continue; } link_sibling= 1; ret= Xorriso_restore_make_hl(xorriso, xorriso->hln_targets[i], disk_path, !!xorriso->do_auto_chmod); if(ret > 0) return(1); } return((null_target_sibling << 1) | (link_sibling << 2)); } /* @return <0 error, bit0= hardlink created bit2= siblings lower index found */ int Xorriso_restore_prefix_hl(struct XorrisO *xorriso, IsoNode *node, char *disk_path, int node_idx, int flag) { int ret, min_hl, max_hl, i, link_sibling= 0, hflag; char *old_path= NULL, *img_path= NULL; struct Xorriso_lsT *img_prefixes= NULL, *disk_prefixes= NULL; Xorriso_alloc_meM(old_path, char, SfileadrL); Xorriso_alloc_meM(img_path, char, SfileadrL); ret= Xorriso_search_hardlinks(xorriso, node, &node_idx, &min_hl, &max_hl, 2 | 4); if(ret < 0) goto ex; if(ret == 0 || min_hl == max_hl) {ret= 0; goto ex;} for(i= min_hl; i < node_idx; i++) { link_sibling= 1; ret= Xorriso_path_from_node(xorriso, xorriso->node_array[i], img_path, 0); if(ret < 0) goto ex; if(ret == 0) continue; /* Node is deleted from tree (Should not happen here) */ hflag= 1; if(i == min_hl) { hflag= 0; } else if(xorriso->node_array[i] != xorriso->node_array[i - 1]) { hflag= 0; } if(hflag == 0) { img_prefixes= xorriso->node_img_prefixes; disk_prefixes= xorriso->node_disk_prefixes; } ret= Xorriso_make_restore_path(xorriso, &img_prefixes, &disk_prefixes, img_path, old_path, hflag); if(ret <= 0) goto ex; ret= Xorriso_restore_make_hl(xorriso, old_path, disk_path, !!xorriso->do_auto_chmod); if(ret > 0) {ret= 1; goto ex;} } ret= link_sibling << 2; ex:; Xorriso_free_meM(old_path); Xorriso_free_meM(img_path); return(ret); } /* @return <0 = error , 0 = availmem exhausted first time , 1 = ok 2 = availmem exhausted repeated */ int Xorriso_register_node_target(struct XorrisO *xorriso, int node_idx, char *disk_path, int flag) { int l; if(xorriso->node_targets_availmem == 0) return(2); if(xorriso->hln_targets == NULL || node_idx < 0 || node_idx >= xorriso->hln_count) return(0); if(xorriso->hln_targets[node_idx] != NULL) { xorriso->node_targets_availmem+= strlen(xorriso->hln_targets[node_idx]) +1; free(xorriso->hln_targets[node_idx]); } l= strlen(disk_path); if(xorriso->node_targets_availmem <= l + 1) { sprintf(xorriso->info_text, "Hardlink target buffer exceeds -temp_mem_limit. Hardlinks may get divided."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); xorriso->node_targets_availmem= 0; return(0); } xorriso->hln_targets[node_idx]= strdup(disk_path); if(xorriso->hln_targets[node_idx] == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); return(-1); } xorriso->node_targets_availmem-= (l + 1); return(1); } /* @param flag bit0= offset and bytes is valid for writing to regular file bit1= do not report copied files bit2= -follow, -not_*: this is not a command parameter bit3= keep directory open: keep owner, allow rwx for owner bit4= do not look for hardlinks even if enabled bit6= this is a copy action: do not fake times and ownership bit7= return 4 if restore fails from denied permission do not issue error message @return <=0 = error , 1 = added leaf file object , 2 = added directory , 3= regularly not installed (disallowed device, UNIX domain socket) 4 = with bit7: permission to restore was denied */ int Xorriso_restore_disk_object(struct XorrisO *xorriso, char *img_path, IsoNode *node, char *disk_path, off_t offset, off_t bytes, int flag) { int ret, i, split_count= 0, partno, total_parts, leaf_is_split= 0; int record_hl_path= 0, node_idx, cannot_register= 0; off_t total_bytes; char *part_name, *part_path= NULL, *img_path_pt= NULL; IsoImage *volume; IsoNode *part_node, *first_part_node= NULL; struct SplitparT *split_parts= NULL; struct stat stbuf; Xorriso_alloc_meM(part_path, char, SfileadrL); ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) goto ex; if(LIBISO_ISDIR(node) && xorriso->do_concat_split) leaf_is_split= Xorriso_identify_split(xorriso, img_path, node, &split_parts, &split_count, &stbuf, 1 | 4); if(leaf_is_split) { /* map all files in directory img_path into regular file disk_path */ for(i=0 ; itotal_bytes) bytes= total_bytes-offset; ret= Xorriso_tree_restore_node(xorriso, part_node, part_path, (off_t) 0, disk_path, offset, bytes, (!!(flag&64)) | 2 | (flag & (4 | 128)) | 8 | ( 16 * !(flag&2))); if(ret<=0) goto restoring_failed; if(ret == 4) goto ex; } if(first_part_node!=NULL) Xorriso_restore_properties(xorriso, disk_path, first_part_node, !!(flag&64)); goto went_well; } #ifdef Osirrox_not_yeT if(resolve_link) { ret= Xorriso_resolve_link(xorriso, disk_path, resolved_disk_path, 0); if(ret<=0) goto ex; disk_path_pt= resolved_disk_path; } else #endif /* Osirrox_not_yeT */ img_path_pt= img_path; if(!((xorriso->ino_behavior & 4) || (flag & (1 | 16)) || LIBISO_ISDIR(node))){ /* Try to restore as hardlink */ ret= Xorriso_restore_target_hl(xorriso, node, disk_path, &node_idx, !!xorriso->do_auto_chmod); if(ret < 0) { goto ex; } else if(ret & 1) { /* Success, hardlink was created */ goto went_well; } else if(ret & 2) { /* Did not establish hardlink. Hardlink siblings with target NULL found.*/ record_hl_path= 1; } if(ret & 4) { /* Found siblings with non-NULL target, but did not link. */ ret= Xorriso_eval_problem_status(xorriso, 1, 1 | 2); if(ret < 0) {ret= 0; goto ex;} } } ret= Xorriso_tree_restore_node(xorriso, node, img_path_pt, (off_t) 0, disk_path, offset, bytes, (flag&(4 | 8 | 128)) | (!!(flag&64)) | ((flag&1)<<1) | ( 16 * !(flag&2))); if(ret == 4) goto ex; if(ret>0 && (flag&8)) ret= Xorriso_restore_properties(xorriso, disk_path, node, 2 | !!(flag&64)); if(ret<=0) { restoring_failed:; sprintf(xorriso->info_text, "Restoring failed: "); Text_shellsafe(img_path, xorriso->info_text, 1); strcat(xorriso->info_text, " = "); Text_shellsafe(disk_path, xorriso->info_text, 1 | 2); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } if(ret==2) {ret= 3; goto ex;} if(record_hl_path) { /* Start of a disk hardlink family */ ret= Xorriso_register_node_target(xorriso, node_idx, disk_path, 0); if(ret < 0) goto ex; if(ret == 0) cannot_register= 1; } went_well:; xorriso->pacifier_count++; if(!(flag&2)) Xorriso_pacifier_callback(xorriso, "files restored", xorriso->pacifier_count, xorriso->pacifier_total, "", 4 | 8); ret= 1; ex:; if(split_parts!=NULL) Splitparts_destroy(&split_parts, split_count, 0); Xorriso_free_meM(part_path); if(ret > 0 && cannot_register) ret= 0; return(ret); } /* @param flag bit0= source is a directory and not to be restored as split file >>> bit6= permission to call Xorriso_make_accessible() @return <=0 error , 1=collision handled , 2=no collision , 3=revoked by user */ int Xorriso_handle_collision(struct XorrisO *xorriso, IsoNode *node, char *img_path, char *disk_path, char *nominal_disk_path, int *stbuf_ret, int flag) { int ret, target_is_dir= 0, target_is_link= 0, stat_ret, made_accessible= 0; struct stat target_stbuf, lt_stbuf; struct PermiteM *perm_stack_mem; perm_stack_mem= xorriso->perm_stack; /* does a disk file exist with this name ? */ *stbuf_ret= lstat(disk_path, &target_stbuf); if(*stbuf_ret==-1) { if((flag & 64) && errno == EACCES) { ret= Xorriso_make_accessible(xorriso, disk_path, 0); if(ret < 0) goto ex; made_accessible= 1; *stbuf_ret= lstat(disk_path, &target_stbuf); } if(*stbuf_ret==-1) {ret= 2; goto ex;} } target_is_link= S_ISLNK(target_stbuf.st_mode); if(target_is_link) { stat_ret= stat(disk_path, <_stbuf); if(stat_ret == -1) { if((flag & 64) && errno == EACCES && !made_accessible) { ret= Xorriso_make_accessible(xorriso, disk_path, 0); if(ret < 0) goto ex; made_accessible= 1; stat_ret= stat(disk_path, <_stbuf); } } if(stat_ret != -1) target_is_dir= S_ISDIR(lt_stbuf.st_mode); } else { target_is_dir= S_ISDIR(target_stbuf.st_mode); } if(target_is_dir && (!target_is_link) && !(flag&1)) { strcpy(xorriso->info_text, "Attempt to replace DISK directory "); Text_shellsafe(nominal_disk_path, xorriso->info_text+strlen(xorriso->info_text), 0); strcat(xorriso->info_text, " by ISO file "); Text_shellsafe(img_path, xorriso->info_text+strlen(xorriso->info_text), 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(!(target_is_dir && (flag&1))) { Xorriso_process_msg_queues(xorriso,0); ret= Xorriso_restore_overwrite(xorriso, node, img_path, disk_path, nominal_disk_path, &target_stbuf, 16 | (flag & 64)); if(ret==3) {ret= 3; goto ex;} if(ret<=0) goto ex; *stbuf_ret= -1; /* It might still exist but will be handled properly */ } ret= 1; ex:; if(made_accessible) Permstack_pop(&(xorriso->perm_stack), perm_stack_mem, xorriso, 0); return(ret); } /* @param flag bit0= recursion is active bit1= do not report restored files bit6= this is a copy action: do not fake times and ownership bit8= only register non-directory nodes in xorriso->node_array bit7+8= 0= direct operation 1= create only directories, count nodes in xorriso->node_counter 2= only register non-directory nodes in xorriso->node_array 3= count nodes in xorriso->node_counter, create no directory */ int Xorriso_restore_tree(struct XorrisO *xorriso, IsoDir *dir, char *img_dir_path, char *disk_dir_path, off_t boss_mem, struct LinkiteM *link_stack, int flag) { IsoImage *volume; IsoNode *node; IsoDirIter *iter= NULL; IsoNode **node_array= NULL; int node_count= 0, node_idx; int ret, source_is_dir, fret, was_failure= 0; int do_not_dive, source_is_split= 0, len_dp, len_ip, stbuf_ret, hflag, hret; char *name, *disk_name, *leaf_name, *srcpt, *stbuf_src= ""; struct LinkiteM *own_link_stack; char *sfe= NULL, *sfe2= NULL; char *disk_path= NULL, *img_path= NULL, *link_target= NULL; off_t mem; struct PermiteM *perm_stack_mem; struct stat stbuf; int dir_create= 0, node_register= 0, do_node_count= 0, normal_mode= 0; perm_stack_mem= xorriso->perm_stack; switch((flag >> 7) & 3) { case 0: normal_mode= 1; break; case 1: dir_create= 1; break; case 2: node_register= 1; break; case 3: do_node_count= 1; } /* Avoiding large local memory objects in order to save stack space */ sfe= malloc(5*SfileadrL); sfe2= malloc(5*SfileadrL); disk_path= malloc(2*SfileadrL); img_path= malloc(2*SfileadrL); link_target= malloc(SfileadrL); if(sfe==NULL || sfe2==NULL || disk_path==NULL || img_path==NULL || link_target==NULL) { Xorriso_no_malloc_memory(xorriso, &sfe, 0); {ret= -1; goto ex;} } own_link_stack= link_stack; ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) goto ex; stbuf_src= img_dir_path; node= (IsoNode *) dir; ret= Xorriso_fake_stbuf(xorriso, stbuf_src, &stbuf, &node, 1); if(ret<=0) { Xorriso_msgs_submit(xorriso, 0, disk_dir_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text,"Cannot open as (ISO) source directory: %s", Text_shellsafe(img_dir_path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } #ifdef Osirrox_not_yeT dev_t dir_dev; dir_dev= stbuf.st_dev; if(S_ISLNK(stbuf.st_mode)) { if(!(xorriso->do_follow_links || (xorriso->do_follow_param && !(flag&1)))) {ret= 2; goto ex;} stbuf_src= disk_dir_path; if(stat(disk_dir_path, &stbuf)==-1) goto cannot_open_dir; if(dir_dev != stbuf.st_dev && !(xorriso->do_follow_mount || (xorriso->do_follow_param && !(flag&1)))) {ret= 2; goto ex;} } #endif /* Osirrox_not_yeT */ if(!S_ISDIR(stbuf.st_mode)) { Xorriso_msgs_submit(xorriso, 0, disk_dir_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text,"Is not a directory in ISO image: %s", Text_shellsafe(img_dir_path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } mem= boss_mem; ret= Xorriso_findi_iter(xorriso, dir, &mem, &iter, &node_array, &node_count, &node_idx, &node, 1 | 4 * (normal_mode && (xorriso->ino_behavior & 4))); if(ret<=0) goto ex; if(Sfile_str(img_path, img_dir_path,0)<=0) { much_too_long:; Xorriso_much_too_long(xorriso, SfileadrL, 2); {ret= 0; goto ex;} } if(img_path[0]==0 || img_path[strlen(img_path)-1]!='/') strcat(img_path,"/"); name= img_path+strlen(img_path); if(Sfile_str(disk_path, disk_dir_path, 0)<=0) goto much_too_long; if(disk_path[0]==0 || disk_path[strlen(disk_path)-1]!='/') strcat(disk_path,"/"); disk_name= disk_path+strlen(disk_path); len_dp= strlen(disk_path); len_ip= strlen(img_path); while(1) { /* loop over ISO directory content */ stbuf_src= ""; #ifdef Osirrox_not_yeT Linkitem_reset_stack(&own_link_stack, link_stack, 0); #endif srcpt= img_path; Xorriso_process_msg_queues(xorriso,0); ret= Xorriso_findi_iter(xorriso, dir, &mem, &iter, &node_array, &node_count, &node_idx, &node, 0); if(ret<0) goto ex; if(ret==0 || xorriso->request_to_abort) break; leaf_name= (char *) iso_node_get_name(node); if(Xorriso_much_too_long(xorriso, len_dp + strlen(leaf_name)+1, 0)<=0) {ret= 0; goto was_problem;} if(Xorriso_much_too_long(xorriso, len_ip + strlen(leaf_name)+1, 0)<=0) {ret= 0; goto was_problem;} /* name is a pointer into img_path */ strcpy(name, leaf_name); strcpy(disk_name, leaf_name); stbuf_src= srcpt; ret= Xorriso_fake_stbuf(xorriso, img_path, &stbuf, &node, 1); if(ret<=0) goto was_problem; source_is_dir= 0; #ifdef Osirrox_not_yeT /* ??? Link following in the image would cause severe problems with Xorriso_path_from_node() */ int source_is_link; source_is_link= S_ISLNK(stbuf.st_mode); if(xorriso->do_follow_links && source_is_link) { /* Xorriso_hop_link checks for wide link loops */ ret= Xorriso_hop_link(xorriso, srcpt, &own_link_stack, &hstbuf, 0); if(ret<0) goto was_problem; if(ret==1) { ret= Xorriso_resolve_link(xorriso, srcpt, link_target, 0); if(ret<=0) goto was_problem; srcpt= link_target; stbuf_src= srcpt; if(lstat(srcpt, &stbuf)==-1) goto cannot_lstat; } else { if(Xorriso_eval_problem_status(xorriso, 0, 1|2)<0) {ret= 0; goto was_problem;} } } else if (S_ISLNK(stbuf.st_mode)) { ret= Xorriso_resolve_link(xorriso, srcpt, link_target, 1); if(ret<=0) goto was_problem; } #endif /* Osirrox_not_yeT */ do_not_dive= 0; if(S_ISDIR(stbuf.st_mode)) source_is_dir= 1; source_is_split= 0; if(source_is_dir) source_is_split= Xorriso_is_split(xorriso, img_path, node, 1 | 2 | 4); if(source_is_split) do_not_dive= 1; if(source_is_dir || !(dir_create || do_node_count || node_register)) { ret= Xorriso_handle_collision(xorriso, node, img_path, disk_path, disk_path, &stbuf_ret, (source_is_dir && !source_is_split)); if(ret<=0 || ret==3) goto was_problem; } else { stbuf_ret= -1; } if(stbuf_ret!=-1) { /* (Can only happen with directory) */ Xorriso_auto_chmod(xorriso, disk_path, 0); } else { hflag= 4 | (flag & (2|64)); if(source_is_dir && !do_not_dive) hflag|= 8; /* keep directory open for user */ if((dir_create || do_node_count) && !source_is_dir) { xorriso->node_counter++; } else if(node_register && !source_is_dir) { if(xorriso->node_counter < xorriso->node_array_size) { xorriso->node_array[xorriso->node_counter++]= (void *) node; iso_node_ref(node); } } else if(node_register || do_node_count) { ret= 1; } else { ret= Xorriso_restore_disk_object(xorriso, img_path, node, disk_path, (off_t) 0, (off_t) 0, hflag); } if(ret<=0) goto was_problem; } if(source_is_dir && !do_not_dive) { ret= Xorriso_restore_tree(xorriso, (IsoDir *) node, img_path, disk_path, mem, own_link_stack, 1 | (flag & (2 | (3 << 7)))); /* eventually restore exact access permissions of directory */ hret= Permstack_pop(&(xorriso->perm_stack), perm_stack_mem, xorriso, !!(flag&64)); if(hret<=0 && hretperm_stack), perm_stack_mem, xorriso, !!(flag&64)); } ret= 1; ex: Permstack_pop(&(xorriso->perm_stack), perm_stack_mem, xorriso, !!(flag&64)); if(sfe!=NULL) free(sfe); if(sfe2!=NULL) free(sfe2); if(disk_path!=NULL) free(disk_path); if(img_path!=NULL) free(img_path); if(link_target!=NULL) free(link_target); Xorriso_findi_iter(xorriso, dir, &mem, &iter, &node_array, &node_count, &node_idx, &node, (1u<<31)); Xorriso_process_msg_queues(xorriso,0); #ifdef Osirrox_not_yeT Linkitem_reset_stack(&own_link_stack, link_stack, 0); #endif if(ret<=0) return(ret); return(!was_failure); } /* @param flag >>> bit0= mkdir: graft in as empty directory, not as copy from iso bit1= do not report copied files bit2= -follow, -not_*: this is not a command parameter bit3= use offset and cut_size for -paste_in bit4= return 3 on rejection by exclusion or user bit5= if directory then do not add sub tree bit6= this is a copy action: do not fake times and ownership bit7+8= operation mode 0= direct operation 1= create only directories, count nodes in xorriso->node_counter 2= only register non-directory nodes in xorriso->node_array 3= count nodes in xorriso->node_counter, create no directory bit9= with operation mode 1 do net register prefixes @return <=0 = error , 1 = added leaf file object , 2 = added directory , 3 = rejected */ int Xorriso_restore(struct XorrisO *xorriso, char *img_path, char *disk_path, off_t offset, off_t bytes, int flag) { IsoImage *volume; char *path= NULL, *apt, *npt; IsoNode *node= NULL; int done= 0, is_dir= 0, ret, source_is_dir, stbuf_ret, hret; int dir_create= 0, node_count= 0, node_register= 0, path_size; int leaf_is_split= 0, source_is_split= 0, new_dir_made= 0; struct stat stbuf; struct PermiteM *perm_stack_mem; perm_stack_mem= xorriso->perm_stack; path_size= SfileadrL; Xorriso_alloc_meM(path, char, path_size); switch((flag >> 7) & 3) { case 1: dir_create= 1; break; case 2: node_register= 1; break; case 3: node_count= 1; } if(dir_create && !(flag & (1 << 9))) { ret= Xorriso_lst_append_binary(&(xorriso->node_disk_prefixes), disk_path, strlen(disk_path) + 1, 0); if(ret <= 0) goto ex; ret= Xorriso_lst_append_binary(&(xorriso->node_img_prefixes), img_path, strlen(img_path) + 1, 0); if(ret <= 0) goto ex; } ret= Xorriso_path_is_excluded(xorriso, disk_path, !(flag&4)); if(ret<0) goto ex; if(ret>0) {ret= 3*!!(flag&16); goto ex;} ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) goto ex; strncpy(path, disk_path, path_size - 1); path[path_size - 1]= 0; apt= npt= path; if(!(flag&1)) { ret= Xorriso_fake_stbuf(xorriso, img_path, &stbuf, &node, 0); if(ret>0) { if(S_ISDIR(stbuf.st_mode)) is_dir= 1; #ifdef Osirrox_not_yeT /* ??? this would cause severe problems with Xorriso_path_from_node() */ else if((stbuf.st_mode&S_IFMT)==S_IFLNK && (xorriso->do_follow_links || (xorriso->do_follow_param && !(flag&4)))) { resolve_link= 1; ret= Xorriso_iso_lstat(xorriso, img_path, &stbuf, 1|2); if(ret!=-1) { if(S_ISDIR(stbuf.st_mode)) is_dir= 1; } } #endif /* Osirrox_not_yeT */ } else { Xorriso_process_msg_queues(xorriso,0); Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "Cannot determine attributes of (ISO) source file "); Text_shellsafe(img_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= 0; goto ex; } if(is_dir && xorriso->do_concat_split) leaf_is_split= Xorriso_is_split(xorriso, img_path, node, 1 | 2 | 4); } for(npt= apt; !done; apt= npt+1) { npt= strchr(apt, '/'); if(npt==NULL) { npt= apt+strlen(apt); done= 1; } else *npt= 0; if(*apt==0) { *apt= '/'; apt++; if(done) goto attach_source; continue; } source_is_dir= (is_dir || (flag&1) || !done); source_is_split= done && leaf_is_split; stbuf_ret= -1; if((flag&8) && done) { /* ??? move down from Xorriso_paste_in() : check whether target does not exist or both are regular */; } else if(source_is_dir || !(dir_create || node_count || node_register)) { ret= Xorriso_handle_collision(xorriso, node, img_path, path, disk_path, &stbuf_ret, (source_is_dir && !source_is_split)); if(ret<=0 || ret==3) goto ex; } new_dir_made= 0; if(stbuf_ret==-1 && (source_is_dir && !source_is_split) && !(node_count || node_register)) { /* make a directory */ ret= mkdir(path, 0777); if(ret==-1) { Xorriso_process_msg_queues(xorriso,0); Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "While restoring '%s' : could not insert '%s'", disk_path, path); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE",0); {ret= 0; goto ex;} } if(!done) { /* keep rwx for the owner */ Xorriso_restore_implicit_properties(xorriso, disk_path, path, img_path, 4); } new_dir_made= 1; } else if((source_is_dir && !source_is_split)) { if(!(node_count || node_register)) Xorriso_auto_chmod(xorriso, path, 0); } if(done) { attach_source:; if(flag&1) { /* directory was created above */; } else if(is_dir && !source_is_split) { if(!node_register) { if(new_dir_made) { /* keep open and push to Permstack */ ret= Xorriso_restore_properties(xorriso, disk_path, node, 2 | !!(flag&64)); if(ret <= 0) { hret= Xorriso_eval_problem_status(xorriso, ret, 1 | 2); if(hret < 0) goto ex; } } } if(!(flag&32)) { ret= Xorriso_restore_tree(xorriso, (IsoDir *) node, img_path, path, (off_t) 0, NULL, flag & (2 | 64 | (3 << 7))); if(ret <= 0) { hret= Xorriso_eval_problem_status(xorriso, ret, 1 | 2); if(hret < 0) goto ex; } if(new_dir_made && !(flag&64)) /* set timestamps which Permstack_pop() will not set */ Xorriso_restore_properties(xorriso, disk_path, node, 2); } } else { if(dir_create || node_count) { xorriso->node_counter++; } else if(node_register) { if(xorriso->node_counter < xorriso->node_array_size) { xorriso->node_array[xorriso->node_counter++]= (void *) node; iso_node_ref(node); } } else { ret= Xorriso_restore_disk_object(xorriso, img_path, node, path, offset, bytes, (flag & (2|4|64)) | !!(flag&8)); if(ret <= 0) { hret= Xorriso_eval_problem_status(xorriso, ret, 1 | 2); if(hret < 0) goto ex; } } } } else *npt= '/'; } Xorriso_process_msg_queues(xorriso,0); ret= 1 + (is_dir && !leaf_is_split); ex:; /* restore exact access permissions of stacked paths */ hret= Permstack_pop(&(xorriso->perm_stack), perm_stack_mem, xorriso, 2 | !!(flag&64)); if(hret<=0 && hretperm_stack; Xorriso_alloc_meM(img_path, char, SfileadrL); Xorriso_alloc_meM(disk_path, char, SfileadrL); Xorriso_sort_node_array(xorriso, 0); disk_path[0]= 0; for(i= 0; i < xorriso->node_counter; i++) { node= (IsoNode *) xorriso->node_array[i]; ret= Xorriso_path_from_node(xorriso, node, img_path, 0); if(ret < 0) goto ex; if(ret == 0) continue; /* Node is deleted from tree (Should not happen here) */ hflag= 1; if(i == 0) { hflag= 0; } else if(node != xorriso->node_array[i - 1]) { hflag= 0; } if(hflag == 0) { img_prefixes= xorriso->node_img_prefixes; disk_prefixes= xorriso->node_disk_prefixes; } ret= Xorriso_make_restore_path(xorriso, &img_prefixes, &disk_prefixes, img_path, disk_path, hflag); if(ret<=0) goto was_problem; ret= Xorriso_handle_collision(xorriso, node, img_path, disk_path, disk_path, &stbuf_ret, 64); if(ret<=0 || ret==3) goto was_problem; if(xorriso->hln_array != NULL && !(xorriso->ino_behavior & 16)) { /* Eventual lookup of hardlinks will be done in Xorriso_restore_disk_object() */; } else if(i > 0 && !(xorriso->ino_behavior & 4)) { if(Xorriso__findi_sorted_ino_cmp(&(xorriso->node_array[i-1]), &(xorriso->node_array[i])) == 0) { if(faulty_family) { sprintf(xorriso->info_text, "Hardlinking omitted with "); Text_shellsafe(disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } else { /* Try to install hardlink to a sibling */ ret= Xorriso_restore_prefix_hl(xorriso, node, disk_path, i, 0); if(ret < 0) { goto was_problem; } else if(ret & 1) { /* Success, hardlink was created */ xorriso->pacifier_count++; continue; } if(ret & 4) { /* Found elder siblings, but did not link. */ ret= Xorriso_eval_problem_status(xorriso, 1, 1 | 2); if(ret < 0) {ret= 0; goto ex;} } } } else faulty_family= 0; } ret= Xorriso_restore_disk_object(xorriso, img_path, node, disk_path, (off_t) 0, (off_t) 0, 4 | (xorriso->ino_behavior & 16) | 128); if(ret<=0) goto was_problem; if(ret == 4) { /* Failed from lack of permission */ ret= Xorriso_make_accessible(xorriso, disk_path, 0); if(ret < 0) goto ex; ret= Xorriso_restore_disk_object(xorriso, img_path, node, disk_path, (off_t) 0, (off_t) 0, 4 | (xorriso->ino_behavior & 16)); if(ret<=0) goto was_problem; Permstack_pop(&(xorriso->perm_stack), perm_stack_mem, xorriso, 0); } continue; /* regular bottom of loop */ was_problem:; faulty_family= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret<0) goto ex; Permstack_pop(&(xorriso->perm_stack), perm_stack_mem, xorriso, 0); } ret= 1; ex:; Permstack_pop(&(xorriso->perm_stack), perm_stack_mem, xorriso, 0); Xorriso_free_meM(img_path); Xorriso_free_meM(disk_path); return(ret); } /* @param flag bit0= -follow, -not: disk_path is not a command parameter */ int Xorriso_paste_in(struct XorrisO *xorriso, char *disk_path, off_t startbyte, off_t bytecount, char *iso_rr_path, int flag) { int ret; char *eff_source= NULL, *eff_dest= NULL; struct stat stbuf; IsoNode *node; Xorriso_alloc_meM(eff_source, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, disk_path, eff_dest, 2|4); if(ret<=0) goto ex; ret= Xorriso_path_is_excluded(xorriso, disk_path, !(flag&1)); if(ret!=0) {ret= 0; goto ex;} ret= stat(eff_dest, &stbuf); if(ret!=-1 && !S_ISREG(stbuf.st_mode)) { Xorriso_msgs_submit(xorriso, 0, eff_dest, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "-paste_in: DISK file "); Text_shellsafe(eff_source, xorriso->info_text, 1); strcat(xorriso->info_text, " exists and is not a data file"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); {ret= 0; goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, iso_rr_path, eff_source, 2); if(ret<=0) goto ex; ret= Xorriso_fake_stbuf(xorriso, eff_source, &stbuf, &node, 4); if(ret<=0) {ret= 0; goto ex;} if(!S_ISREG(stbuf.st_mode)) { Xorriso_msgs_submit(xorriso, 0, eff_dest, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "-paste_in: ISO file "); Text_shellsafe(eff_source, xorriso->info_text, 1); strcat(xorriso->info_text, " is not a data file"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); {ret= 0; goto ex;} } /* >>> eventually obtain parameters from file name */; ret= Xorriso_restore(xorriso, eff_source, eff_dest, startbyte, bytecount, 8); ex:; Xorriso_free_meM(eff_source); Xorriso_free_meM(eff_dest); return(ret); } int Xorriso_extract_cut(struct XorrisO *xorriso, char *img_path, char *disk_path, off_t img_offset, off_t bytes, int flag) { int ret, stbuf_ret, read_raw; double mem_lut= 0.0; char *eff_img_path= NULL, *eff_disk_path= NULL; IsoImage *volume; IsoNode *node; Xorriso_alloc_meM(eff_img_path, char, SfileadrL); Xorriso_alloc_meM(eff_disk_path, char, SfileadrL); ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, img_path, eff_img_path, 0); if(ret<=0) goto ex; ret= Xorriso_node_from_path(xorriso, volume, eff_img_path, &node, 0); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, disk_path, eff_disk_path, 2 | 4); if(ret<=0) goto ex; Xorriso_pacifier_reset(xorriso, 0); mem_lut= xorriso->last_update_time; ret= Xorriso_handle_collision(xorriso, node, img_path, eff_disk_path, disk_path, &stbuf_ret, 0); if(ret<=0 || ret==3) {ret= 0; goto ex;} /* If it is a non-filtered stream from the ISO image and img_offset is a multiple of 2048 then use Xorriso_read_file_data() for random access offset. */ if(!LIBISO_ISREG(node)) { Xorriso_msgs_submit(xorriso, 0, eff_disk_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "-extract_cut: ISO file "); Text_shellsafe(eff_img_path, xorriso->info_text, 1); strcat(xorriso->info_text, " is not a data file"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } read_raw= 0; if((img_offset % 2048) == 0) { ret= Xorriso_is_plain_image_file(xorriso, node, "", 0); if(ret > 0) read_raw= 1; } if (read_raw) { ret= Xorriso_read_file_data(xorriso, node, eff_img_path, eff_disk_path, img_offset, (off_t) 0, bytes, 0); if(ret<=0) goto ex; } else { ret= Xorriso_tree_restore_node(xorriso, node, eff_img_path, img_offset, eff_disk_path, (off_t) 0, bytes, 2 | 8); if(ret<=0) goto ex; } ret= Xorriso_restore_properties(xorriso, eff_disk_path, node, 0); if(ret<=0) goto ex; if(mem_lut != xorriso->last_update_time) Xorriso_pacifier_callback(xorriso, "blocks read", xorriso->pacifier_count, 0, "", 1 | 8 | 16 | 32); ret= 1; ex:; Xorriso_free_meM(eff_img_path); Xorriso_free_meM(eff_disk_path); return(ret); } /* @param flag bit0= ignore node and img_path, operate on whole medium bit1= for Xorriso_check_interval(): no pacifier messages */ int Xorriso_read_file_data(struct XorrisO *xorriso, IsoNode *node, char *img_path, char *disk_path, off_t img_offset, off_t disk_offset, off_t bytes, int flag) { int ret, i, lba_count= 0, *start_lbas= NULL, *end_lbas= NULL, read_chunk= 16; int lba, count, blocks, quality, spot, bad_extract= 0; int data_to_skip= 0; uint32_t indev_blocks; off_t size= 0, file_base_bytes= 0, file_processed_bytes= 0, img_adr; off_t new_file_base_bytes, upto_file_bytes, start_byte= 0; off_t *section_sizes = NULL; struct SpotlisT *spotlist= NULL; struct CheckmediajoB *job= NULL; upto_file_bytes= img_offset + bytes; data_to_skip= img_offset % (off_t) 2048; if(flag & 1) { lba_count= 1; Xorriso_alloc_meM(start_lbas, int, 1); Xorriso_alloc_meM(end_lbas, int, 1); Xorriso_alloc_meM(section_sizes, off_t, 1); start_lbas[0]= 0; ret= Xorriso_obtain_indev_readsize(xorriso, &indev_blocks, 0); if(ret > 0) end_lbas[0]= indev_blocks - 1; else end_lbas[0]= 0x7ffffffe; size= ((off_t) end_lbas[0]) * 2048; section_sizes[0]= size; } else { ret= Xorriso__start_end_lbas(node, &lba_count, &start_lbas, &end_lbas, §ion_sizes, &size, 0); if(ret <= 0) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "File object "); Text_shellsafe(img_path, xorriso->info_text, 1); strcat(xorriso->info_text, " is currently not a data file from the loaded image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } } if(img_offset + bytes < size && bytes > 0) size= img_offset + bytes; ret= Checkmediajob_new(&job, 0); if(ret <= 0) goto ex; if(xorriso->check_media_default != NULL) Checkmediajob_copy(xorriso->check_media_default, job, 0); job->min_lba= -1; job->max_lba= -1; job->sector_map_path[0]= 0; ret= Spotlist_new(&spotlist, 0); if(ret <= 0) {ret= -1; goto ex;} if(Sfile_str(job->data_to_path, disk_path, 0) <= 0) {ret= -1; goto ex;} ret= Xorriso_open_job_data_to(xorriso, job, 0); if(ret <= 0) goto ex; for(i= 0; i < lba_count && file_base_bytes < upto_file_bytes; i++) { lba= start_lbas[i]; count= end_lbas[i] + 1 - start_lbas[i]; new_file_base_bytes= file_base_bytes + ((off_t) count) * (off_t) 2048; /* skip intervals before img_offset */ if(new_file_base_bytes <= img_offset) { file_base_bytes= new_file_base_bytes; continue; } /* Eventually adjust first interval start */ img_adr= ((off_t) lba) * (off_t) 2048; if(file_base_bytes < img_offset) { img_adr+= img_offset - file_base_bytes; lba= img_adr / (off_t) 2048; count= end_lbas[i] + 1 - lba; file_base_bytes= img_offset; } /* Omit surplus blocks */ if(new_file_base_bytes > upto_file_bytes) count-= (new_file_base_bytes - upto_file_bytes) / (off_t) 2048; /* Adjust job */ job->data_to_offset= file_processed_bytes - img_adr + disk_offset; job->data_to_limit= size - file_base_bytes; job->data_to_skip= data_to_skip; data_to_skip= 0; file_processed_bytes+= ((off_t) count) * (off_t) 2048; ret= Xorriso_check_interval(xorriso, spotlist, job, lba, count, read_chunk, 0, (flag & 2)); if(ret <= 0) goto ex; if (ret == 2) { sprintf(xorriso->info_text, "Attempt aborted to extract data from "); Text_shellsafe(img_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } file_base_bytes= new_file_base_bytes; } /* Use spotlist to evaluate damage */ file_base_bytes= 0; count= Spotlist_count(spotlist, 0); for(spot= 0; spot < count; spot++) { ret= Spotlist_get_item(spotlist, spot, &lba, &blocks, &quality, 0); if(ret <= 0) continue; if(quality < Xorriso_read_quality_valiD) { for(i= 0; i < lba_count; i++) { if(start_lbas[i] <= lba && end_lbas[i] >= lba) { start_byte= (lba - start_lbas[i]) * (off_t) 2048 + file_base_bytes; break; } file_base_bytes+= ((off_t) (end_lbas[i] + 1 - start_lbas[i])) * (off_t) 2048; } if(i < lba_count) { sprintf(xorriso->info_text, "Bad extract : %14.f , %14.f , ", (double) start_byte, ((double) blocks) * 2048.0); Text_shellsafe(disk_path, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso, 0); bad_extract= 1; } } } ret= !bad_extract; ex:; if(start_lbas != NULL) free((char *) start_lbas); if(end_lbas != NULL) free((char *) end_lbas); if(section_sizes != NULL) free((char *) section_sizes); Spotlist_destroy(&spotlist, 0); Checkmediajob_destroy(&job, 0); return(ret); } int Xorriso_extract_boot_images(struct XorrisO *xorriso, char *disk_dir_path, int flag) { int ret, img_count= 0, i, was_problem= 0; char **imgs= NULL, *eff_path= NULL, *cpt, *eff_namept; struct stat stbuf; off_t byte_offset, byte_size; Xorriso_alloc_meM(eff_path, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, disk_dir_path, eff_path, 2 | 4); if(ret <= 0) goto ex; if(strlen(eff_path) > SfileadrL - 80) { sprintf(xorriso->info_text, "-extract_boot_images: disk_path is too long (%lu)\n", (unsigned long int) strlen(eff_path)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } ret= stat(eff_path, &stbuf); if(ret == 0) { if(!S_ISDIR(stbuf.st_mode)) { sprintf(xorriso->info_text, "-extract_boot_images: disk_path is not a directory : "); Text_shellsafe(eff_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } else { ret= mkdir(eff_path, 0777); if(ret == -1) { sprintf(xorriso->info_text, "-extract_boot_images: cannot create directory : "); Text_shellsafe(eff_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= 0; goto ex; } } strcat(eff_path, "/"); eff_namept= eff_path + strlen(eff_path); ret= Xorriso_list_boot_images(xorriso, &imgs, &img_count, 0); if(ret <= 0) goto ex; /* Interpret list and create files */ for(i= 0; i < img_count; i++) { ret= Xorriso_eval_problem_status(xorriso, 1, 1 | 2); if(ret < 0) {ret= 0; goto ex;} cpt= strchr(imgs[i], '/'); if(cpt == NULL) continue; *cpt= 0; cpt+= 2; ret= Sfile_text_to_off_t(cpt, &byte_offset, 0); if(ret <= 0) continue; cpt+= ret; if(*cpt == 0) continue; cpt++; ret= Sfile_text_to_off_t(cpt, &byte_size, 0); if(ret <= 0) continue; strcpy(eff_namept, imgs[i]); sprintf(xorriso->info_text, "%s : offset=%.f size=%.f\n", eff_path, (double) byte_offset, (double) byte_size); Xorriso_info(xorriso, 0); ret= stat(eff_path, &stbuf); if(ret != -1) { sprintf(xorriso->info_text, "-extract_boot_images: File already exists on disk: "); Text_shellsafe(eff_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); continue; } ret= Xorriso_read_file_data(xorriso, NULL, NULL, eff_path, byte_offset, (off_t) 0, byte_size, 1); if(ret <= 0) was_problem= 1; } ret= Xorriso_eval_problem_status(xorriso, 1, 1 | 2); if(ret < 0 || was_problem) {ret= 0; goto ex;} ret= 1; ex:; Xorriso_free_meM(eff_path); Xorriso_list_boot_images(xorriso, &imgs, &img_count, 1 << 15); return(ret); } /* @param node Opaque handle to IsoNode which is to be inquired instead of path if it is not NULL. @param path is used as address if node is NULL. @param flag bit0= do not report to result but only indicate outcome by return value bit1= silently ignore nodes without MD5 bit2= do not only report mismatches but also matches @return 3= not a data file 2= no MD5 attached to node 1= ok, MD5 compared and matching 0= not ok, MD5 mismatch <0= other error */ int Xorriso_check_md5(struct XorrisO *xorriso, void *in_node, char *path, int flag) { int ret, wanted, rret, buffer_size= 64 * 1024; IsoImage *image; IsoNode *node; IsoFile *file; char node_md5[16], data_md5[16], *buffer= NULL; void *stream= NULL, *ctx= NULL; off_t todo; Xorriso_alloc_meM(buffer, char, 64 * 1024); node= (IsoNode *) in_node; if(node == NULL) { ret= Xorriso_get_node_by_path(xorriso, path, NULL, &node, 0); if(ret<=0) {ret= -1; goto ex;} } if(!LIBISO_ISREG(node)) { strcpy(xorriso->info_text, "-check_md5: Not a data file: "); Text_shellsafe(path, xorriso->info_text, 1); if(!(flag & 2)) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= 3; goto ex; } file= (IsoFile *) node; /* obtain MD5 */ ret= Xorriso_get_volume(xorriso, &image, 0); if(ret <= 0) {ret= -1; goto ex;} ret= iso_file_get_md5(image, file, node_md5, 0); Xorriso_process_msg_queues(xorriso,0); if(ret < 0) {ret= -1; goto ex;} if(ret == 0) { strcpy(xorriso->info_text, "-check_md5: No MD5 recorded with file: "); Text_shellsafe(path, xorriso->info_text, 1); if(!(flag & 2)) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= 2; goto ex; } /* Read file and compute MD5 */; ret= Xorriso_iso_file_open(xorriso, path, (void *) node, &stream, 1 | 2); if(ret <= 0) {ret= -1; goto ex;} ret= iso_md5_start(&ctx); if(ret < 0) goto ex; todo= iso_stream_get_size(stream); while(todo > 0) { if(todo < buffer_size) wanted= todo; else wanted= buffer_size; rret = Xorriso_iso_file_read(xorriso, stream, buffer, wanted, 0); if(rret <= 0) {ret= -1; goto ex;} todo-= rret; ret = iso_md5_compute(ctx, buffer, rret); if(ret < 0) goto ex; xorriso->pacifier_count+= rret; xorriso->pacifier_byte_count+= rret; Xorriso_pacifier_callback(xorriso, "content bytes read", xorriso->pacifier_count, 0, "", 8); ret= Xorriso_check_for_abort( xorriso, xorriso->check_media_default != NULL ? xorriso->check_media_default->abort_file_path : "/var/opt/xorriso/do_abort_check_media", Sfile_microtime(0), &xorriso->last_abort_file_time, 0); if(ret == 1) {ret= -2; goto ex;} } ret= iso_md5_end(&ctx, data_md5); if(ret < 0) goto ex; /* Report outcome */ Xorriso_process_msg_queues(xorriso,0); if(! iso_md5_match(node_md5, data_md5)) { sprintf(xorriso->result_line, "MD5 MISMATCH: "); Text_shellsafe(path, xorriso->result_line, 1); strcat(xorriso->result_line, "\n"); if(!(flag & 1)) Xorriso_result(xorriso,0); ret= 0; } else { sprintf(xorriso->result_line, "md5 match : "); Text_shellsafe(path, xorriso->result_line, 1); strcat(xorriso->result_line, "\n"); if(flag & 4) Xorriso_result(xorriso,0); ret= 1; } ex:; Xorriso_process_msg_queues(xorriso,0); Xorriso_iso_file_close(xorriso, &stream, 0); if(ctx != NULL) iso_md5_end(&ctx, data_md5); Xorriso_free_meM(buffer); if(ret < 0) { if(ret == -2) sprintf(xorriso->result_line, "Aborted at: "); else sprintf(xorriso->result_line, "NOT READABLE: "); Text_shellsafe(path, xorriso->result_line, 1); strcat(xorriso->result_line, "\n"); if(!(flag & 1)) Xorriso_result(xorriso,0); if(ret == -2) xorriso->request_to_abort= 1; } return(ret); } libisoburn-1.5.4/xorriso/misc_funct.c0000644000175700017510000007570313750212024014635 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the miscellaneous helper functions of xorriso. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "sfile.h" #include "misc_funct.h" /* --------------------------------- misc --------------------------------- */ int Strcmp(const void *pt1, const void *pt2) { return(strcmp(*((char **) pt1), *((char **) pt2))); } int Sort_argv(int argc, char **argv, int flag) { if(argc<=0) return(2); qsort(argv,(size_t) argc,sizeof(char *),Strcmp); return(1); } static int Text_to_argv(char *text, int *argc, char ***argv, int flag) { char *npt, *cpt; int pass; *argv= NULL; *argc= 0; for(pass= 0; pass < 2; pass++) { if(pass) { if(*argc == 0) return(1); (*argv)= calloc(*argc, sizeof(char *)); if(*argv == NULL) { *argc= 0; return(-1); } *argc= 0; } for(npt= cpt= text; npt != NULL; cpt= npt + 1) { npt= strchr(cpt, '\n'); if(pass) { if(npt != NULL) *npt= 0; (*argv)[*argc]= cpt; } (*argc)++; } } return(1); } static int Count_diffs(int argc1, char **argv1, int argc2, char **argv2, int flag) { int count= 0, i1= 0, i2= 0, cmp, end_corr= 0; Sort_argv(argc1, argv1, 0); Sort_argv(argc2, argv2, 0); while(1) { if(i1 >= argc1) { count+= argc2 - i2 - end_corr; break; } if(i2 >= argc2) { count+= argc1 - i1 - end_corr; break; } cmp= strcmp(argv1[i1], argv2[i2]); if(cmp == 0) { end_corr= 0; i1++; i2++; } else if(cmp > 0) { count++; end_corr= 1; i2++; if(i2 < argc2 && i1 < argc1 - 1) if(strcmp(argv1[i1 + 1], argv2[i2]) == 0) { i1++; end_corr= 0; } } else { count++; end_corr= 1; i1++; if(i1 < argc1 && i2 < argc2 - 1) if(strcmp(argv2[i2 + 1], argv1[i1]) == 0) { i2++; end_corr= 0; } } } return(count); } /* @flag bit0= do not initialize *diff_count @return <0 error , 0 = mismatch , 1 = match */ int Compare_text_lines(char *text1, char *text2, int *diff_count, int flag) { int ret, argc1= 0, argc2= 0; char **argv1= NULL, **argv2= NULL, *copy1= NULL, *copy2= NULL; if(!(flag & 1)) *diff_count= 0; if(text1 == NULL && text2 == NULL) return(1); if(text1 != NULL) { copy1= strdup(text1); if(copy1 == NULL) {ret= -1; goto ex;} ret= Text_to_argv(copy1, &argc1, &argv1, 0); if(ret <= 0) {ret= -1; goto ex;} } if(text2 != NULL) { copy2= strdup(text2); if(copy2 == NULL) {ret= -1; goto ex;} ret= Text_to_argv(copy2, &argc2, &argv2, 0); if(ret <= 0) {ret= -1; goto ex;} } ret= Count_diffs(argc1, argv1, argc2, argv2, 1); if(ret < 0) goto ex; *diff_count+= ret; ret= (*diff_count == 0); ex:; if(argv1 != NULL) free(argv1); if(argv2 != NULL) free(argv2); if(copy1 != NULL) free(copy1); if(copy2 != NULL) free(copy2); return ret; } /** Convert a text into a number of type double and multiply it by unit code [kmgtpe] (2^10 to 2^60) or [s] (2048) or [d] (512). (Also accepts capital letters.) @param text Input like "42", "2k", "3.14m" or "-1g" @param flag Bitfield for control purposes: bit0= return -1 rather than 0 on failure @return The derived double value */ double Scanf_io_size(char *text, int flag) /* bit0= default value -1 rather than 0 */ { int c; double ret= 0.0; if(flag&1) ret= -1.0; if(text[0]==0) return(ret); sscanf(text,"%lf",&ret); c= text[strlen(text)-1]; if(c=='k' || c=='K') ret*= 1024.0; if(c=='m' || c=='M') ret*= 1024.0*1024.0; if(c=='g' || c=='G') ret*= 1024.0*1024.0*1024.0; if(c=='t' || c=='T') ret*= 1024.0*1024.0*1024.0*1024.0; if(c=='p' || c=='P') ret*= 1024.0*1024.0*1024.0*1024.0*1024.0; if(c=='e' || c=='E') ret*= 1024.0*1024.0*1024.0*1024.0*1024.0*1024.0; if(c=='s' || c=='S') ret*= 2048.0; if(c=='d' || c=='D') ret*= 512.0; return(ret); } int Decode_date_input_format(struct tm *erg, char *text, int flag) /* MMDDhhmm[[CC]YY][.ss]] */ { int i,l,year; time_t current_time; struct tm *now; current_time= time(0); now= localtime(¤t_time); for(i= 0; i < (int) sizeof(struct tm); i++) ((char *) erg)[i]= ((char *) now)[i]; l= strlen(text); for(i=0;i'9') break; if(i!=8 && i!=10 && i!=12) return(0); if(text[i]==0) goto decode; if(text[i]!='.' || l!=15) return(0); i++; if(text[i]<'0'||text[i]>'9') return(0); i++; if(text[i]<'0'||text[i]>'9') return(0); decode:; /* MMDDhhmm[[CC]YY][.ss]] */ i= 0; erg->tm_mon= 10*(text[0]-'0')+text[1]-'0'-1; erg->tm_mday= 10*(text[2]-'0')+text[3]-'0'; erg->tm_hour= 10*(text[4]-'0')+text[5]-'0'; erg->tm_min= 10*(text[6]-'0')+text[7]-'0'; erg->tm_sec= 0; if(l==8) return(1); if(l>10){ year= 1000*(text[8]-'0')+100*(text[9]-'0')+10*(text[10]-'0')+(text[11]-'0'); }else{ year= 1900+10*(text[8]-'0')+(text[9]-'0'); if(year<1970) year+= 100; } erg->tm_year= year-1900; if(l<=12) return(1); erg->tm_sec= 10*(text[13]-'0')+text[14]-'0'; return(1); } int Decode_date_weekday(char *text, int flag) { int i; static char days[][4]= {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", ""}; for(i= 0; days[i][0]!=0; i++) if(strncmp(text,days[i],3)==0) return(i); if((strlen(text)==3 || (strlen(text)==4 && text[3]==',')) && isalpha(text[0]) && isalpha(text[1]) && isalpha(text[2])) return(7); return(-1); } int Decode_date_month(char *text, int flag) { int i; static char months[][4]= {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""}; for(i= 0; months[i][0]!=0; i++) if(strncmp(text,months[i],3)==0) return(i); return(-1); } /* @return -1=not a number, -2=not a day , 1 to 31 day of month */ int Decode_date_mday(char *text, int flag) { int ret, i; for(i= 0; text[i]!=0; i++) if(!isdigit(text[i])) return(-1); if(strlen(text)>2 || text[0]==0) return(-2); sscanf(text, "%d", &ret); if(ret<=0 || ret>31) return(-2); return(ret); } int Decode_date_hms(char *text, struct tm *erg, int flag) { int i, hour= -1, minute= -1, second= 0; for(i= 0; i<9; i+= 3) { if(i==6&&text[i]==0) break; if(!isdigit(text[i])) return(-1); if(!isdigit(text[i+1])) return(-1); if(text[i+2]!=':' && !(text[i+2]==0 && i>=3)) return(-1); if(i==0) sscanf(text+i,"%d",&hour); else if(i==3) sscanf(text+i,"%d",&minute); else sscanf(text+i,"%d",&second); } if(hour<0 || hour>23 || minute<0 || minute>59 || second>59) return(-1); erg->tm_hour= hour; erg->tm_min= minute; erg->tm_sec= second; return(1); } /* @return -1=not a number, -2=not a year , >=0 years AD */ int Decode_date_year(char *text, int flag) { int ret, i; for(i= 0; text[i]!=0; i++) if(!isdigit(text[i])) return(-1); if(strlen(text)!=4) return(-2); sscanf(text, "%d", &ret); if(ret<0 || ret>3000) return(-2); return(ret); } int Decode_date_timezone(char *text, struct tm *erg, int flag) { int i; static char tzs[][5]= {"GMT", "CET", "CEST", "0000", ""}; for(i= 0; tzs[i][0]!=0; i++) if(strcmp(text,tzs[i])==0) { /* ??? >>> what to do with timezone info ? Add to ->tm_hour ? */ return(1); } if(text[0]=='+' || text[0]=='-') { for(i= 1; text[i]!=0; i++) if(!isdigit(text[i])) return(-1); if(i!=5) return(-1); /* ??? >>> what to do with timezone info ? Add to ->tm_hour ? */ return(1); } else { for(i= 0; text[i]!=0; i++) if(text[i]<'A' || text[i]>'Z') return(-1); if(i!=3 && i!=4) return(-1); return(2); } } int Decode_date_output_format(struct tm *erg, char *text, int flag) /* Thu Nov 8 09:07:50 CET 2007 */ /* Sat, 03 Nov 2007 08:58:30 +0100 */ /* Nov 7 23:24 */ { int ret, i, argc= 0, seen_year= 0, seen_month= 0, seen_day= 0, seen_time= 0; char **argv= NULL; struct tm *now; time_t timep; memset(erg, 0, sizeof(*erg)); erg->tm_isdst= -1; ret= Sfile_make_argv("xorriso", text, &argc, &argv, 0); if(ret<=0) goto ex; for(i= 1; i=0) { seen_month= 1; erg->tm_mon= ret; continue; } } if(!seen_day) { ret= Decode_date_mday(argv[i], 0); if(ret>0) { seen_day= 1; erg->tm_mday= ret; continue; } if(ret==-2) /* first pure number must be day of month */ {ret= 0; goto ex;} } if(!seen_time) { ret= Decode_date_hms(argv[i], erg, 0); if(ret>0) { seen_time= 1; continue; } } if(!seen_year) { ret= Decode_date_year(argv[i], 0); if(ret>0) { erg->tm_year= ret-1900; seen_year= 1; continue; } } /* ignorants have to stay at the end of the loop */ ret= Decode_date_timezone(argv[i], erg, 0); if(ret>=0) continue; ret= Decode_date_weekday(argv[i], 0); if(ret>=0) continue; /* ignore weekdays */ {ret= 0; goto ex;} /* unrecognizable component */ } if(!(seen_day && seen_month)) {ret= 0; goto ex;} if(!seen_year) { /* then use this year */ timep= time(NULL); now= localtime(&timep); erg->tm_year= now->tm_year; } ret= 1; ex: Sfile_make_argv("", "", &argc, &argv, 2); /* release storage */ return(ret); } int Decode_ecma119_format(struct tm *erg, char *text, int flag) /* YYYYMMDDhhmmsscc[LOC] */ /* 2010040711405800 */ { int i, l, num, utc= 1; struct tm norm_tm; memset(erg, 0, sizeof(*erg)); erg->tm_isdst= -1; l= strlen(text); if(l == 19) { if(strcmp(text + 16, "LOC") != 0) return(0); utc= 0; l= 16; } if(l != 16) return(0); for(i= 0; i < l; i++) if(text[i] < '0' || text[i] > '9') return(0); num= 0; for(i= 0; i < 4; i++) num= num * 10 + text[i] - '0'; if(num < 1970 || num > 3000) return(0); erg->tm_year = num - 1900; erg->tm_mon= 10*(text[4]-'0')+text[5]-'0'-1; if(erg->tm_mon > 12) return(0); erg->tm_mday= 10*(text[6]-'0')+text[7]-'0'; if(erg->tm_mday > 31) return(0); erg->tm_hour= 10*(text[8]-'0')+text[9]-'0'; if(erg->tm_hour > 23) return(0); erg->tm_min= 10*(text[10]-'0')+text[11]-'0'; if(erg->tm_min > 59) return(0); erg->tm_sec= 10*(text[12]-'0')+text[13]-'0'; if(erg->tm_sec > 59) return(0); /* Let mktime(3) compute erg->tm_wday and erg->tm_yday */ memcpy(&norm_tm, erg, sizeof(struct tm)); mktime(&norm_tm); erg->tm_wday= norm_tm.tm_wday; erg->tm_yday= norm_tm.tm_yday; return(1 + !utc); } int Decode_xorriso_timestamp(struct tm *erg, char *code, int flag) /* 2007.11.07.225624 */ { char buf[20]; int year,month,day,hour= 0,minute= 0,second= 0, i, l, mem; memset(erg, 0, sizeof(*erg)); erg->tm_isdst= -1; l= strlen(code); if(l>17 || l<10) return(0); strcpy(buf, code); for(i= 0; buf[i]!=0 && i<4; i++) if(!isdigit(buf[i])) return(0); if(buf[4]!='.') return(0); buf[4]= 0; sscanf(buf, "%d", &year); if(year<1900 || year>3000) return(0); if(!(isdigit(buf[5]) && isdigit(buf[6]) && buf[7]=='.')) return(0); buf[7]= 0; sscanf(buf+5, "%d", &month); if(month<1 || month>12) return(0); if(!(isdigit(buf[8]) && isdigit(buf[9]) && (buf[10]=='.' || buf[10]==0))) return(0); buf[10]= 0; sscanf(buf+8, "%d", &day); if(day<1 || day>31) return(0); if(l==10) goto done; if(!(isdigit(buf[11]) && isdigit(buf[12]) && (isdigit(buf[13]) || buf[13]==0))) return(0); mem= buf[13]; buf[13]= 0; sscanf(buf+11, "%d", &hour); buf[13]= mem; if(hour<0 || hour>23) return(0); if(l==13) goto done; if(!(isdigit(buf[13]) && isdigit(buf[14]) && (isdigit(buf[15]) || buf[15]==0))) return(0); mem= buf[15]; buf[15]= 0; sscanf(buf+13, "%d", &minute); buf[15]= mem; if(minute<0 || minute>59) return(0); if(l==15) goto done; if(!(isdigit(buf[15]) && isdigit(buf[16]) && buf[17]==0)) return(0); sscanf(buf+15, "%d", &second); if(second<0 || second>59) return(0); done:; erg->tm_year= year-1900; erg->tm_mon= month-1; erg->tm_mday= day; erg->tm_hour= hour; erg->tm_min= minute; erg->tm_sec= second; return(1); } time_t Decode_timestring(char *code, time_t *date, int flag) { char scale_chr; double value,seconds; struct tm result_tm; int seconds_valid= 0, ret; *date= 0; if(code[0]=='-' || code[0]=='+' || code[0]=='=' || code[0]=='@'){ if(code[1]==0) return(0); if(!isdigit(code[1])) return(0); value= -1; if(code[0]=='=' || code[0]=='@') { seconds= 0; sscanf(code+1,"%lf",&value); } else { seconds= time(NULL); sscanf(code,"%lf",&value); } scale_chr= code[strlen(code)-1]; if(isalpha(scale_chr)) scale_chr= tolower(scale_chr); if (scale_chr=='s') seconds+= 1.0*value; else if(scale_chr=='h') seconds+= 3600.0*value; else if(scale_chr=='d') seconds+= 86400.0*value; else if(scale_chr=='w') seconds+= 86400.0*7.0*value; else if(scale_chr=='m') seconds+= 86400.0*31.0*value; else if(scale_chr=='y') seconds+= 86400.0*(365.25*value+1.0); else seconds+= 1.0*value; seconds_valid= 1; goto completed; } else if(Sfile_decode_datestr(&result_tm,code,0)>0) { /* YYMMDD[.hhmm[ss]] */ result_tm.tm_isdst= -1; seconds= mktime(&result_tm); seconds_valid= 1; goto completed; } else if(Decode_date_input_format(&result_tm,code,0)>0) { /* MMDDhhmm[[CC]YY][.ss]] */ result_tm.tm_isdst= -1; seconds= mktime(&result_tm); seconds_valid= 1; goto completed; } else if(Decode_xorriso_timestamp(&result_tm, code, 0)>0) { /* 2007.11.07.225624 */ seconds= mktime(&result_tm); seconds_valid= 1; goto completed; } else if(Decode_date_output_format(&result_tm, code, 0)>0) { /* Thu Nov 8 09:07:50 CET 2007 */; /* Sat, 03 Nov 2007 08:58:30 +0100 */; /* Nov 7 23:24 */; seconds= mktime(&result_tm); seconds_valid= 1; goto completed; } else if((ret= Decode_ecma119_format(&result_tm, code, 0)) > 0) { /* YYYYMMDDhhmmsscc[UTC] */ /* 2010040711405800UTC */ seconds= mktime(&result_tm); if(ret == 1) { #ifdef HAVE_TM_GMTOFF seconds+= result_tm.tm_gmtoff; #else if(result_tm.tm_isdst < 0) result_tm.tm_isdst = 0; #ifndef Libburnia_timezonE #define Libburnia_timezonE timezone #endif seconds-= Libburnia_timezonE - result_tm.tm_isdst * 3600; #endif } seconds_valid= 1; goto completed; } return(0); completed:; if(!seconds_valid) return(0); *date= seconds; return(1); } /* @param flag bit0=with year and seconds bit1-3= form 0= ls -l format 1= timestamp format YYYY.MM.DD.hhmmss 2= Wdy Mon Day hh:mm:ss Year 3= Mon Day hh:mm:ss Year 4= YYMMDD.hhmmss */ char *Ftimetxt(time_t t, char timetext[40], int flag) { char *rpt; struct tm tms, *tmpt; static char months[12][4]= { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; static char days[7][4]= {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; int form; form= (flag>>1)&7; tmpt= localtime_r(&t, &tms); rpt= timetext; rpt[0]= 0; if(tmpt==0) sprintf(rpt+strlen(rpt), "%12.f", (double) t); else if (form==1) sprintf(rpt+strlen(rpt), "%4.4d.%2.2d.%2.2d.%2.2d%2.2d%2.2d", 1900+tms.tm_year, tms.tm_mon+1, tms.tm_mday, tms.tm_hour, tms.tm_min, tms.tm_sec); else if (form==2) sprintf(rpt+strlen(rpt), "%s %s %2.2d %2.2d:%2.2d:%2.2d %4.4d", days[tms.tm_wday], months[tms.tm_mon], tms.tm_mday, tms.tm_hour, tms.tm_min, tms.tm_sec, 1900+tms.tm_year); else if (form==3) sprintf(rpt+strlen(rpt), "%s %2.2d %2.2d:%2.2d:%2.2d %4.4d", months[tms.tm_mon], tms.tm_mday, tms.tm_hour, tms.tm_min, tms.tm_sec, 1900+tms.tm_year); else if (form == 4) { if(tms.tm_year>99) sprintf(rpt+strlen(rpt), "%c", 'A' + (tms.tm_year - 100) / 10); else sprintf(rpt+strlen(rpt), "%c", '0' + tms.tm_year / 10); sprintf(rpt+strlen(rpt), "%1.1d%2.2d%2.2d.%2.2d%2.2d%2.2d", tms.tm_year % 10, tms.tm_mon + 1, tms.tm_mday, tms.tm_hour, tms.tm_min, tms.tm_sec); } else if (flag&1) sprintf(rpt+strlen(rpt), "%2d %3s %4.4d %2.2d:%2.2d:%2.2d", tms.tm_mday, months[tms.tm_mon], 1900+tms.tm_year, tms.tm_hour, tms.tm_min, tms.tm_sec); else if(time(NULL)-t < 180*86400 && time(NULL)-t >= 0) sprintf(rpt+strlen(rpt), "%3s %2d %2.2d:%2.2d", months[tms.tm_mon], tms.tm_mday, tms.tm_hour, tms.tm_min); else sprintf(rpt+strlen(rpt), "%3s %2d %4.4d", months[tms.tm_mon], tms.tm_mday, 1900+tms.tm_year); return(timetext); } /* @param flag bit0= single letters */ char *Ftypetxt(mode_t st_mode, int flag) { if(flag&1) goto single_letters; if(S_ISDIR(st_mode)) return("directory"); else if(S_ISREG(st_mode)) return("regular_file"); else if(S_ISLNK(st_mode)) return("symbolic_link"); else if(S_ISBLK(st_mode)) return("block_device"); else if(S_ISCHR(st_mode)) return("char_device"); else if(S_ISFIFO(st_mode)) return("name_pipe"); else if(S_ISSOCK(st_mode)) return("unix_socket"); return("unknown"); single_letters:; if(S_ISDIR(st_mode)) return("d"); else if(S_ISREG(st_mode)) return("-"); else if(S_ISLNK(st_mode)) return("l"); else if(S_ISBLK(st_mode)) return("b"); else if(S_ISCHR(st_mode)) return("c"); else if(S_ISFIFO(st_mode)) return("p"); else if(S_ISSOCK(st_mode)) return("s"); return("?"); } int Wait_for_input(int fd, int microsec, int flag) { struct timeval wt; fd_set rds,wts,exs; int ready; FD_ZERO(&rds); FD_ZERO(&wts); FD_ZERO(&exs); FD_SET(fd,&rds); FD_SET(fd,&exs); wt.tv_sec= microsec/1000000; wt.tv_usec= microsec%1000000; ready= select(fd+1,&rds,&wts,&exs,&wt); if(ready<=0) return(0); if(FD_ISSET(fd,&exs)) return(-1); if(FD_ISSET(fd,&rds)) return(1); return(0); } int System_uname(char **sysname, char **release, char **version, char **machine, int flag) { int ret; static struct utsname uts; static int initialized= 0; if(initialized == 0) { ret= uname(&uts); if(ret != 0) initialized = -1; } if(initialized == -1) return(0); if(sysname != NULL) *sysname= uts.sysname; if(release != NULL) *release= uts.release; if(version != NULL) *version= uts.version; if(machine != NULL) *machine= uts.machine; return(1); } /* ------------------------------------------------------------------------ */ #ifndef Xorriso_sregex_externaL #ifndef Smem_malloC #define Smem_malloC malloc #endif #ifndef Smem_freE #define Smem_freE free #endif int Sregex_string_cut(char **handle, char *text, int len, int flag) /* bit0= append (text!=NULL) */ { int l=0; char *old_handle; if((flag&1)&&*handle!=NULL) l+= strlen(*handle); old_handle= *handle; if(text!=NULL) { l+= len; *handle= TSOB_FELD(char,l+1); if(*handle==NULL) { *handle= old_handle; return(0); } if((flag&1) && old_handle!=NULL) strcpy(*handle,old_handle); else (*handle)[0]= 0; if(len>0) strncat(*handle,text,len); } else { *handle= NULL; } if(old_handle!=NULL) Smem_freE(old_handle); return(1); } int Sregex_string(char **handle, char *text, int flag) /* bit0= append (text!=NULL) */ { int ret,l=0; if(text!=NULL) l= strlen(text); /* #define Sregex_looking_for_contenT 1 */ #ifdef Sregex_looking_for_contenT /* a debugging point if a certain text content has to be caught */ if(text!=NULL) if(strcmp(text,"clear")==0) ret= 0; #endif ret= Sregex_string_cut(handle,text,l,flag&1); return(ret); } /* vars[][0] points to the variable names, vars[][1] to their contents. start marks the begin of variable names. It must be non-empty. esc before start disables this meaning. start and esc may be equal but else they must have disjoint character sets. end marks the end of a variable name. It may be empty but if non-empty it must not appear in vars[][0]. @param flag bit0= Substitute unknown variables by empty text (else copy start,name,end unaltered to result). Parameter end must be non-empty for that. */ int Sregex_resolve_var(char *form, char *vars[][2], int num_vars, char *start, char *end, char *esc, char *result, int result_size, int flag) { int l_e, l_s, l_esc, i, start_equals_esc; char *rpt, *wpt, *spt, *npt, *ept; if(start[0] == 0) /* It is not allowed to have no start marker */ return(-1); l_s= strlen(start); l_e= strlen(end); l_esc= strlen(esc); start_equals_esc= !strcmp(start, esc); rpt= form; wpt= result; wpt[0]= 0; while(1) { /* look for start mark */ spt= strstr(rpt, start); if(spt == NULL) { if((wpt - result) + (int) strlen(rpt) >= result_size) return(0); strcpy(wpt, rpt); wpt+= strlen(wpt); break; } /* copy cleartext part up to next variable */ if((wpt - result) + (spt - rpt) >= result_size) return(0); strncpy(wpt, rpt, spt - rpt); wpt+= spt - rpt; *wpt= 0; rpt= spt; npt= spt + l_s; /* handle eventual escape */ if(start_equals_esc) { if(strncmp(spt + l_s, esc, l_esc) == 0) { /* copy esc and start */ if((wpt - result) + l_esc + l_s >= result_size) return(0); strncpy(wpt, spt, l_esc + l_s); wpt+= l_esc + l_s; rpt+= l_esc + l_s; *wpt= 0; continue; } } else { /* escape would be already copied */ if(l_esc > 0 && spt - form >= l_esc) { if(strncmp(spt - l_esc, esc, l_esc) == 0) { /* copy start */ if((wpt - result) + l_s >= result_size) return(0); strncpy(wpt, spt, l_s); wpt+= l_s; rpt+= l_s; *wpt= 0; continue; } } } /* Memorize eventual end mark for default handling */; ept= NULL; if(l_e > 0) ept= strstr(npt, end); /* Look for defined variable name */ for(i = 0; i < num_vars; i++) { if(strncmp(npt, vars[i][0], strlen(vars[i][0])) == 0 && (l_e == 0 || strncmp(npt + strlen(vars[i][0]), end, l_e) == 0)) break; } if(i < num_vars) { /* substitute found variable */ if((wpt - result) + (int) strlen(vars[i][1]) >= result_size) return(0); strcpy(wpt, vars[i][1]); rpt= npt + strlen(vars[i][0]) + l_e; } else if((flag & 1) && ept != NULL) { /* skip up to end mark */ rpt= ept + l_e; } else if(ept != NULL) { /* copy start,name,end */ if((wpt - result) + (ept - rpt) + l_e >= result_size) return(0); strncpy(wpt, rpt, (ept - rpt) + l_e); rpt= ept + l_e; } else { /* copy start marker only */ if((wpt - result) + l_s >= result_size) return(0); strncpy(wpt, rpt, l_s); rpt= rpt + l_s; } wpt+= strlen(wpt); *wpt= 0; } return(1); } /* @param flag bit0= only test expression whether compilable */ int Sregex_match(char *pattern, char *text, int flag) { int ret; char *re_text= NULL; regex_t re; regmatch_t match[1]; re_text= TSOB_FELD(char, 2 * SfileadrL); if(re_text == NULL) {ret= -1; goto ex;} Xorriso__bourne_to_reg(pattern, re_text, 0); ret= regcomp(&re, re_text, 0); if(ret != 0) {ret= -1; goto ex;} if(flag & 1) { regfree(&re); {ret= 1; goto ex;} } ret= regexec(&re, text, 1, match, 0); regfree(&re); if(ret != 0) {ret= 0; goto ex;} ret= 1; ex:; if(re_text != NULL) free(re_text); return(ret); } #endif /* Xorriso_sregex_externaL */ /* @param flag bit0= append to out_text rather than overwrite it bit1= length limit is 10 * SfileadrL rather than 5 * */ char *Text_shellsafe(char *in_text, char *out_text, int flag) { int l,i,w=0, limit= 5 * SfileadrL; if(flag&1) w= strlen(out_text); if(flag & 2) limit= 10 * SfileadrL; /* enclose everything by hard quotes */ l= strlen(in_text); out_text[w++]= '\''; for(i=0;i limit) goto overflow; /* escape hard quote within the text */ out_text[w++]= '\''; out_text[w++]= '"'; out_text[w++]= '\''; out_text[w++]= '"'; out_text[w++]= '\''; } else { if(w + 3 > limit) { overflow:; strcpy(out_text, "'xorriso: TEXT MUCH TOO LONG ... '"); return(out_text); } out_text[w++]= in_text[i]; } } out_text[w++]= '\''; out_text[w++]= 0; return(out_text); } int Hex_to_bin(char *hex, int bin_size, int *bin_count, unsigned char *bin_data, int flag) { int i, l, acc; l= strlen(hex); if(((l % 2) && l < 2 * bin_size) || l == 0) return(-1); /* malformed */ *bin_count= 0; for(i= 0; i < l; i+= 2) { if(*bin_count >= bin_size) return(0); /* overflow */ if(hex[i] >= '0' && hex[i] <= '9') acc= (hex[i] - '0') << 4; else if(hex[i] >= 'A' && hex[i] <= 'F') acc= (hex[i] - 'A' + 10) << 4; else if(hex[i] >= 'a' && hex[i] <= 'f') acc= (hex[i] - 'a' + 10) << 4; else return(-1); if(hex[i + 1] >= '0' && hex[i + 1] <= '9') acc|= (hex[i + 1] - '0'); else if(hex[i + 1] >= 'A' && hex[i + 1] <= 'F') acc|= (hex[i + 1] - 'A' + 10); else if(hex[i + 1] >= 'a' && hex[i + 1] <= 'f') acc|= (hex[i + 1] - 'a' + 10); else return(-1); bin_data[*bin_count]= acc; (*bin_count)++; } return(1); } #ifndef Xorriso_fileliste_externaL /* @param flag bit0= pathspec mode "on" rather than "as_mkisofs" */ int Fileliste__target_source_limit(char *line, char sep, char **limit_pt, int flag) { char *npt; for(npt= line;*npt!=0;npt++) { if(*npt=='\\') { if(*(npt + 1) == '=' || (*(npt + 1) == '\\' && !(flag & 1))) npt++; continue; } if(*npt=='=') break; } if(*npt==0) npt= NULL; (*limit_pt)= npt; return(npt!=NULL); } int Fileliste__escape_source_path(char *line, int size, int flag) { int l, count= 0, i; char *wpt; l= strlen(line); for(i= 0; i < l; i++) if(line[i] == '=' || line[i] == '\\') count++; if(l + count >= size) return(0); wpt= line + l + count; for(i= l; i >= 0; i--) { *(wpt--)= line[i]; if(line[i] == '=' || line[i] == '\\') *(wpt--)= '\\'; } return(1); } int Xorriso__bourne_to_reg(char bourne_expr[], char reg_expr[], int flag) /* reg_expr should be twice as large as bourne_expr ( + 2 to be exact) */ /* return: 2= bourne_expr is surely a constant */ { char *wpt,*lpt; int backslash= 0,is_constant= 1,in_square_brackets= 0; int first_in_square_brackets=0; wpt= reg_expr; lpt= bourne_expr; *(wpt++)= '^'; while(*lpt!=0){ if(first_in_square_brackets>0) first_in_square_brackets--; if(!backslash){ switch(*lpt){ case '?': *(wpt++)= '.'; is_constant= 0; break;case '*': *(wpt++)= '.'; *(wpt++)= '*'; is_constant= 0; break;case '.': *(wpt++)= '\\'; *(wpt++)= '.'; break;case '+': *(wpt++)= '\\'; *(wpt++)= '+'; break;case '[': *(wpt++)= *lpt; first_in_square_brackets= 2; in_square_brackets= 1; is_constant= 0; break;case ']': *(wpt++)= *lpt; in_square_brackets= 0; break;case '!': if(first_in_square_brackets) *(wpt++)= '^'; else if(in_square_brackets) *(wpt++)= '!'; else { *(wpt++)= '\\'; *(wpt++)= '!'; } break;case '^': if(in_square_brackets) { *(wpt++)= '^'; } else { *(wpt++)= '\\'; *(wpt++)= '^'; } break;case '$': *(wpt++)= '\\'; *(wpt++)= '$'; break;case '\\': backslash= 1; *(wpt++)= '\\'; is_constant= 0; break;default: *(wpt++)= *lpt; } } else { backslash= 0; *(wpt++)= *lpt; } lpt++; } *(wpt++)= '$'; *wpt= 0; return(1+(is_constant>0)); } #endif /* ! Xorriso_fileliste_externaL */ int Xorriso__hide_mode(char *mode, int flag) { char *npt, *cpt; int l, value= 0; npt= cpt= mode; for(; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l == 0) continue; if(l == 2 && strncmp(cpt, "on", l) == 0) value= 1 | 2 | 4; else if(l == 6 && strncmp(cpt, "iso_rr", l) == 0) value |= 1; else if(l == 6 && strncmp(cpt, "joliet", l) == 0) value |= 2; else if(l == 7 && strncmp(cpt, "hfsplus", l) == 0) value |= 4; else if(l == 3 && strncmp(cpt, "off", l) == 0) value= 0; else return(-1); } return(value); } char *Xorriso__hide_mode_text(int hide_mode, int flag) { char *acc= NULL; acc = calloc(1, 80); if(acc == NULL) return(NULL); acc[0]= 0; if(hide_mode == 0) { strcat(acc, "off:"); } else if(hide_mode == 7) { strcat(acc, "on:"); } else { if(hide_mode & 1) strcat(acc, "iso_rr:"); if(hide_mode & 2) strcat(acc, "joliet:"); if(hide_mode & 4) strcat(acc, "hfsplus:"); } if(acc[0]) acc[strlen(acc) - 1]= 0; /* cut off last colon */ return acc; } /* @return 0=truncated, 1=ok */ int Xorriso__to_upper(char *in, char *out, int out_size, int flag) { int i; for(i= 0; i < out_size - 1 && in[i] != 0; i++) if(isalpha(in[i])) out[i]= toupper(in[i]); else out[i]= in[i]; out[i]= 0; return(in[i] == 0); } /* @param flag bit0= prepend target_prefix even if source_prefix does not get removed */ int Xorriso__exchange_prefix(char *source_prefix, char *target_prefix, char *eff_source, char *eff_target, int flag) { char *source_pt; strcpy(eff_target, target_prefix); source_pt= eff_source; if(source_prefix[0]) { if(strncmp(source_prefix, eff_source, strlen(source_prefix)) != 0) { if(!(flag & 1)) return(0); } else { source_pt+= strlen(source_prefix); } } strcat(eff_target, source_pt); return(1); } /* @param text takes result, must provide at least 37 characters of storage @param flag bit0= structured text format (else hex string) */ int Xorriso__format_guid(uint8_t guid[16], char *text, int flag) { int i; if(flag & 1) { /* Structured text */ text[0]= 0; for(i= 3; i >= 0; i--) sprintf(text + strlen(text), "%-2.2x", (unsigned int) guid[i]); sprintf(text + strlen(text), "-"); for(i= 5; i >= 4; i--) sprintf(text + strlen(text), "%-2.2x", (unsigned int) guid[i]); sprintf(text + strlen(text), "-"); for(i= 7; i >= 6; i--) sprintf(text + strlen(text), "%-2.2x", (unsigned int) guid[i]); sprintf(text + strlen(text), "-"); for(i= 8; i <= 9; i++) sprintf(text + strlen(text), "%-2.2x", (unsigned int) guid[i]); sprintf(text + strlen(text), "-"); for(i= 10; i <= 15; i++) sprintf(text + strlen(text), "%-2.2x", (unsigned int) guid[i]); } else { /* Plain hex string */ for(i= 0; i < 16; i++) sprintf(text + i * 2, "%-2.2x", (unsigned int) guid[i]); } return(1); } int Xorriso__parse_size_param(char *cpt, int key_l, int l, double *num) { char text[16]; *num= 0.0; if(l <= key_l || l >= key_l + 16) return(0); strncpy(text, cpt + key_l, l - key_l); text[l - key_l]= 0; *num= Scanf_io_size(text, 0); return(1); } libisoburn-1.5.4/xorriso/lib_mgt.h0000644000175700017510000000405013701321754014117 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2010 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of functions which manage the relation between xorriso and the libraries: libburn, libisofs, and libisoburn. */ #ifndef Xorriso_pvt_x_includeD #define Xorriso_pvt_x_includeD yes #ifndef Xorriso_standalonE /* The library which does the ISO 9660 / RockRidge manipulations */ #include /* The library which does MMC optical drive operations */ #include /* The library which enhances overwritable media with ISO 9660 multi-session capabilities via the method invented by Andy Polyakov for growisofs */ #include /* The official xorriso options API. "No shortcuts" */ #include "xorriso.h" /* The inner description of XorrisO */ #include "xorriso_private.h" /* The inner isofs- and burn-library interface */ #include "xorrisoburn.h" #else /* ! Xorriso_standalonE */ #include "../libisofs/libisofs.h" #include "../libburn/libburn.h" #include "../libisoburn/libisoburn.h" #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" #endif /* Xorriso_standalonE */ int Xorriso_abort(struct XorrisO *xorriso, int flag); /* @param flag bit0= suppress messages below UPDATE bit1= suppress messages below FAILURE */ int Xorriso_set_image_severities(struct XorrisO *xorriso, int flag); int Xorriso__sev_to_text(int severity, char **severity_name, int flag); /* @param flag bit0= report libisofs error text bit1= victim is disk_path bit2= do not inquire libisofs, report msg_text and min_severity */ int Xorriso_report_iso_error(struct XorrisO *xorriso, char *victim, int iso_error_code, char msg_text[], int os_errno, char min_severity[], int flag); int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag); #endif /* ! Xorriso_pvt_x_includeD */ libisoburn-1.5.4/xorriso/xorriso_main.c0000644000175700017510000002443314005265555015221 00000000000000 /* xorriso - Command line oriented batch and dialog tool which creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2021 Thomas Schmitt, Initial code of this program was derived from program src/askme.c out of scdbackup-0.8.8, Copyright 2007 Thomas Schmitt, BSD-License. Provided under GPL version 2 or later, with the announcement that this might get changed in future. I would prefer BSD or LGPL as soon as the license situation of the library code allows that. (This announcement affects only future releases of xorriso and it will always be possible to derive a GPLv2+ from the future license.) There is a derived package "GNU xorriso" under GPLv3+ which combines the libburnia libraries and program xorriso to a statically linked binary. Overview of xorriso architecture: libburn provides the ability to read and write data. libisofs interprets and manipulates ISO 9660 directory trees. It generates the output stream which is handed over to libburn. libisoburn by its lower level API encapsulates the connectivity issues between libburn and libisofs. This API also enables multi-session emulation on overwritable media and random access file objects. xorriso is the higher level API of libisoburn which allows to operate all three libraries by a unified set of commands. exposes the public functions. Among these functions are direct equivalents of the xorriso interpreter commands. There are also functions for fundamental management and for handling event messages. This file xorriso_main.c runs the xorriso API as batch and dialog program. One should not mix the use of the xorriso API with the use of the lower level APIs of libburn, libisofs, libisoburn. -------------------------------------------------------------------------- The following overview is relevant for development but not for usage of xorriso. An application programmer should read xorriso.h and man xorriso (or info xorriso), rather than diving into its source code. For examples see the functions main() and check_compatibility() below. -------------------------------------------------------------------------- The xorriso source is divided in two groups: A set of source modules interacts with the lower level library APIs: base_obj.[ch] fundamental operations of the XorrisO object lib_mgt.[ch] manages the relation between xorriso and the libraries drive_mgt.[ch] operates on drives and media iso_img.[ch] operates on ISO images and their global properties iso_tree.[ch] access nodes of the libisofs tree model iso_manip.[ch] manipulates the libisofs tree model sort_cmp.[ch] sorts and compare tree nodes write_run.[ch] functions to write sessions read_run.[ch] functions to read data from ISO image filters.[ch] operates on data filter objects xorrisoburn.h declarations needed by the non-library modules Another set is independent of the lower level APIs: parse_exec.c deals with parsing and interpretation of command input sfile.c functions around files and strings aux_objects.c various helper classes misc_funct.c miscellaneous helper functions findjob.c performs tree searches in libisofs or in POSIX filesystem check_media.c perform verifying runs on media or images text_io.c text i/o functions match.c functions for pattern matching emulators.c emulators for mkisofs and cdrecord disk_ops.c actions on onjects of disk filesystems cmp_update.c compare or update files between disk filesystem and ISO filesystem opts_a_c.c commands -a* to -c* opts_d_h.c commands -d* to -h* opts_i_o.c commands -i* to -o* opts_p_z.c commands -p* to -z* xorriso_private.h contains the definition of struct Xorriso and for convenience includes the .h files of the non-library group. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include /* xorriso_main.c includes the internal copy of the API definition */ /* The official xorriso options API is defined in */ #include "xorriso.h" /* The minimum version of libisoburn xorriso API to be used with this version of xorriso. */ #define Xorriso_req_majoR 1 #define Xorriso_req_minoR 5 #define Xorriso_req_micrO 4 static void yell_xorriso() { fprintf(stderr, "%sxorriso %d.%d.%d%s : RockRidge filesystem manipulator, libburnia project.\n\n", #ifdef Xorriso_GNU_xorrisO "GNU ", #else "", #endif Xorriso_header_version_majoR, Xorriso_header_version_minoR, Xorriso_header_version_micrO, Xorriso_program_patch_leveL); } /* Check whether build configuration and runtime linking are consistent. */ static void check_compatibility() { int lib_major, lib_minor, lib_micro; /* First an ugly compile time check for header version compatibility. If everything matches, then no C code is produced. In case of mismatch, intentionally faulty C code will be inserted. */ /* The minimum requirement of xorriso towards the libisoburn header at compile time is defined above Xorriso_req_majoR Xorriso_req_minoR Xorriso_req_micrO It gets compared against the version macros in xorriso.h : Xorriso_header_version_majoR Xorriso_header_version_minoR Xorriso_header_version_micrO If the header is too old then the following code shall cause failure of cdrskin compilation rather than to allow production of a program with unpredictable bugs or memory corruption. The compiler messages supposed to appear in this case are: error: 'XORRISO_MISCONFIGURATION' undeclared (first use in this function) error: 'INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_xorriso_dot_h_TOO_OLD__SEE_xorriso_main_dot_c' undeclared (first use in this function) error: 'XORRISO_MISCONFIGURATION_' undeclared (first use in this function) */ /* The indentation is an advise of man gcc to help old compilers ignoring */ #if Xorriso_req_majoR > Xorriso_header_version_majoR #define Xorriso_dot_h_too_olD 1 #endif #if Xorriso_req_majoR == Xorriso_header_version_majoR && Xorriso_req_minoR > Xorriso_header_version_minoR #define Xorriso_dot_h_too_olD 1 #endif #if Xorriso_req_minoR == Xorriso_header_version_minoR && Xorriso_req_micrO > Xorriso_header_version_micrO #define Xorriso_dot_h_too_olD 1 #endif #ifdef Xorriso_dot_h_too_olD XORRISO_MISCONFIGURATION = 0; INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_xorriso_dot_h_TOO_OLD__SEE_xorriso_main_dot_c = 0; XORRISO_MISCONFIGURATION_ = 0; #endif /* End of ugly compile time test (scroll up for explanation) */ /* Needed are at least 44 bits in signed type off_t . This is a popular mistake in configuration or compilation. */ if(sizeof(off_t) < 6) { yell_xorriso(); fprintf(stderr, "xorriso : FATAL : Compile time misconfiguration. sizeof(off_t) too small.\n\n"); exit(4); } /* Check whether the linked xorriso code is young enough. */ if(! Xorriso__is_compatible(Xorriso_header_version_majoR, Xorriso_header_version_minoR, Xorriso_header_version_micrO, 0)) { yell_xorriso(); Xorriso__version(&lib_major, &lib_minor, &lib_micro); fprintf(stderr, "xorriso : FATAL : libisoburn/xorriso runtime version mismatch. Found %d.%d.%d, need %d.%d.%d\n\n", lib_major, lib_minor, lib_micro, Xorriso_header_version_majoR, Xorriso_header_version_minoR, Xorriso_header_version_micrO); exit(4); } } int main(int argc, char **argv) { int ret, i; struct XorrisO *xorriso= NULL; char **orig_argv= NULL; check_compatibility(); /* might exit() */ if(argc < 2) { yell_xorriso(); fprintf(stderr,"usage : %s [commands]\n", argv[0]); fprintf(stderr, " More is told by command -help\n"); exit(2); } setlocale(LC_CTYPE, ""); ret= Xorriso_new(&xorriso, argv[0], 0); if(ret <= 0) { fprintf(stderr,"Creation of XorrisO object failed. (not enough memory ?)\n"); exit(3); } /* The prescan of arguments performs actions which have to happen before the normal processing of startup files and arguments. Among them are -help and -prog_help which end the program without yelling its name and version. */ ret= Xorriso_prescan_args(xorriso,argc,argv,0); if(ret == 0) goto end_successfully; /* Put out program name and version to stderr only if not done already now */ yell_xorriso(); if(ret < 0) exit(5); /* After having yelled xorriso, prescan again for unknown arguments */ ret= Xorriso_prescan_args(xorriso, argc, argv, 2); if(ret < 0) exit(5); /* The following command interpreters are allowed only after this initialization. */ ret= Xorriso_startup_libraries(xorriso, 0); if(ret <= 0) {ret= 4; goto emergency_exit;} Xorriso_process_msg_queues(xorriso, 0); /* Interpret startup files */ ret= Xorriso_read_rc(xorriso, 0); if(ret == 3) goto end_successfully; if(ret <= 0) {ret= 5; goto emergency_exit;} /* Interpret program arguments */ orig_argv= argv; ret= Xorriso_program_arg_bsl(xorriso, argc, &argv, 0); if(ret <= 0) {ret= 5; goto emergency_exit;} i= 1; ret= Xorriso_interpreter(xorriso, argc, argv, &i, 2); if(ret == 3) goto end_successfully; if(ret <= 0) {ret= 5; goto emergency_exit;} /* Enter dialog mode if it has been activated meanwhile */ ret= Xorriso_dialog(xorriso, 0); if(ret <= 0) {ret= 6; goto emergency_exit;} end_successfully:; /* normal shutdown, including eventual -commit */ Xorriso_stop_msg_watcher(xorriso, 1); Xorriso_process_msg_queues(xorriso, 0); if(Xorriso_change_is_pending(xorriso, 1)) Xorriso_option_end(xorriso, 2); Xorriso_process_msg_queues(xorriso, 0); ret= Xorriso_make_return_value(xorriso, 0); Xorriso_process_errfile(xorriso, 0, "xorriso end", 0, 1); Xorriso_destroy(&xorriso, 1); if(orig_argv != argv && orig_argv != NULL) { for(i= 0; i < argc; i++) if(argv[i] != NULL) free(argv[i]); free(argv); } exit(ret); emergency_exit:; if(xorriso != NULL) { /* minimal shutdown */ Xorriso_process_msg_queues(xorriso, 0); Xorriso_destroy(&xorriso, 1); } exit(ret); } libisoburn-1.5.4/xorriso/aux_objects.c0000644000175700017510000005463413701321754015020 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2010 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementations of classes: - SplitparT which represents byte intervals of data files. - DirseQ which crawls along a directory's content list. - ExclusionS which manages the list of excluded file paths and leaf patterns. Because of its structural identity it is also used for disk address oriented hiding at insert time as of mkisofs. - Xorriso_lsT which provides a generic double-linked list. - LinkiteM, PermiteM which temporarily record relations and states. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include "xorriso.h" #include "xorriso_private.h" /* ---------------------------- SplitparT ------------------------- */ struct SplitparT { char *name; int partno; int total_parts; off_t offset; off_t bytes; off_t total_bytes; }; static char Splitpart_wordS[][16]= {"part_", "_of_", "_at_", "_with_", "_of_"}; int Splitparts_new(struct SplitparT **o, int count, int flag) { int i; (*o)= TSOB_FELD(struct SplitparT, count); if((*o)==NULL) return(-1); for(i= 0; i 1.0) ept++; *next_pt= ept; return(1); } int Splitpart__parse(char *name, int *partno, int *total_parts, off_t *offset, off_t *bytes, off_t *total_bytes, int flag) { int ret; off_t num; char *cpt, *ept; cpt= name; if(strncmp(cpt, Splitpart_wordS[0], strlen(Splitpart_wordS[0])) != 0) return(0); ret= Splitpart__read_next_num(cpt, &ept, &num, 0); if(ret<=0) return(ret); *partno= num; cpt= ept; if(strncmp(cpt, Splitpart_wordS[1], strlen(Splitpart_wordS[1])) != 0) return(0); ret= Splitpart__read_next_num(cpt, &ept, &num, 0); if(ret<=0) return(ret); *total_parts= num; cpt= ept; if(strncmp(cpt, Splitpart_wordS[2], strlen(Splitpart_wordS[2])) != 0) return(0); ret= Splitpart__read_next_num(cpt, &ept, offset, 0); if(ret<=0) return(ret); cpt= ept; if(strncmp(cpt, Splitpart_wordS[3], strlen(Splitpart_wordS[3])) != 0) return(0); ret= Splitpart__read_next_num(cpt, &ept, bytes, 0); if(ret<=0) return(ret); cpt= ept; if(strncmp(cpt, Splitpart_wordS[4], strlen(Splitpart_wordS[4])) != 0) return(0); ret= Splitpart__read_next_num(cpt, &ept, total_bytes, 0); if(ret<=0) return(ret); if(*ept != 0) return(0); return(1); } int Splitpart__is_part_path(char *path, int flag) { int partno, total_parts, ret; off_t offset, bytes, total_bytes; char *name; name= strrchr(path, '/'); if(name == NULL) name= path; else name++; ret= Splitpart__parse(name, &partno, &total_parts, &offset, &bytes, &total_bytes, 0); return(ret > 0); } /* part_#_of_#_at_#_with_#_of_# */ int Splitpart__compose(char *adr, int partno, int total_parts, off_t offset, off_t bytes, off_t total_bytes, int flag) { sprintf(adr, "%s%d%s%d%s", Splitpart_wordS[0], partno, Splitpart_wordS[1], total_parts, Splitpart_wordS[2]); if((offset % (1024*1024))==0 && offset>0) { Sfile_off_t_text(adr+strlen(adr), offset / (1024*1024), 0); strcat(adr, "m"); } else Sfile_off_t_text(adr+strlen(adr), offset, 0); strcat(adr, Splitpart_wordS[3]); if((bytes % (1024*1024))==0) { Sfile_off_t_text(adr+strlen(adr), bytes / (1024*1024), 0); strcat(adr, "m"); } else Sfile_off_t_text(adr+strlen(adr), bytes, 0); strcat(adr, Splitpart_wordS[4]); Sfile_off_t_text(adr+strlen(adr), total_bytes, 0); return(1); } int Splitparts_cmp(const void *v1, const void *v2) { struct SplitparT *p1, *p2; p1= (struct SplitparT *) v1; p2= (struct SplitparT *) v2; if(p1->partno>p2->partno) return(1); if(p1->partnopartno) return(-1); if(p1->offset>p2->offset) return(1); if(p1->offsetoffset) return(-1); return(0); } int Splitparts_sort(struct SplitparT *o, int count, int flag) { qsort(o, (size_t) count, sizeof(struct SplitparT), Splitparts_cmp); return(1); } /* ---------------------------- End SplitparT ------------------------- */ /* ------------------------------ DirseQ ------------------------------ */ static int Dirseq_buffer_sizE= 100; struct DirseQ { char adr[SfileadrL]; DIR *dirpt; int count; char **buffer; int buffer_size; int buffer_fill; int buffer_rpt; struct DirseQ *next; }; int Dirseq_destroy(struct DirseQ **o, int flag); int Dirseq_next_adrblock(struct DirseQ *o, char *replies[], int *reply_count, int max_replies, int flag); int Dirseq_new(struct DirseQ **o, char *adr, int flag) /* bit0= with non-fatal errors do not complain about failed opendir() */ { int ret,i,severe_error; struct DirseQ *m; m= *o= TSOB_FELD(struct DirseQ,1); if(m==NULL) return(-1); m->adr[0]= 0; m->dirpt= NULL; m->count= 0; m->buffer= NULL; m->buffer_size= 0; m->buffer_fill= 0; m->buffer_rpt= 0; m->next= NULL; if(Sfile_str(m->adr, adr, 0)<=0) {ret= -1; goto failed;} m->buffer= TSOB_FELD(char *,Dirseq_buffer_sizE); if(m->buffer==NULL) {ret= -1; goto failed;} m->buffer_size= Dirseq_buffer_sizE; for(i= 0;ibuffer_size;i++) m->buffer[i]= NULL; if(adr[0]==0) m->dirpt= opendir("."); else m->dirpt= opendir(adr); if(m->dirpt==NULL) { severe_error= (errno && errno!=ENOENT && errno!=EACCES && errno!=ENOTDIR); if(severe_error || !(flag&1)) fprintf(stderr,"opendir(%s) failed : %s\n",adr,strerror(errno)); ret= -severe_error; goto failed; } return(1); failed:; Dirseq_destroy(o,0); return(ret); } int Dirseq_destroy(struct DirseQ **o, int flag) { int i; if(*o==NULL) return(0); if((*o)->dirpt!=NULL) closedir((*o)->dirpt); if((*o)->buffer!=NULL) { for(i=0;i<(*o)->buffer_size;i++) if((*o)->buffer[i]!=NULL) free((*o)->buffer[i]); free((char *) (*o)->buffer); } free((char *) *o); (*o)= NULL; return(1); } int Dirseq_set_next(struct DirseQ *o, struct DirseQ *next, int flag) { o->next= next; return(1); } int Dirseq_get_next(struct DirseQ *o, struct DirseQ **next, int flag) { *next= o->next; return(1); } int Dirseq_get_adr(struct DirseQ *o, char **adrpt, int flag) { *adrpt= o->adr; return(1); } int Dirseq_rewind(struct DirseQ *o, int flag) { rewinddir(o->dirpt); return(1); } int Dirseq_next_adr(struct DirseQ *o, char reply[SfileadrL], int flag) /* flag: bit0= permission to use buffer bit1= do not increment counter bit2= ignore buffer in any case bit3= do not exclude '.' and '..' bit4= sort buffer bit5= sort only incomplete last buffer return: <0 error 0= no more entries available 1= ok, reply is valid */ { int ret; struct dirent *entry; char *name; static int override_flag_0= 0,override_flag_1= 32; flag= (flag&~override_flag_0)|override_flag_1; if((flag&1) && o->buffer_rpt>=o->buffer_fill) { /* permission to buffer and buffer empty : load a buffer */ ret= Dirseq_next_adrblock(o,o->buffer,&(o->buffer_fill), o->buffer_size,2|4|(flag&16)); if(ret<=0) return(ret); o->buffer_rpt= 0; if((flag&32) && o->buffer_fillbuffer_size && o->buffer_fill>0) Sort_argv(o->buffer_fill,o->buffer,0); } if(o->buffer_rptbuffer_fill && !(flag&4)) { ret= Sfile_str(reply,o->buffer[o->buffer_rpt],0); Sregex_string(&(o->buffer[o->buffer_rpt]),NULL,0); if(ret<=0) return(-1); (o->buffer_rpt)++; if(!(flag&2)) o->count++; return(1); } do { entry= readdir(o->dirpt); if(entry==NULL) { /* >>> how to distinguish error from EOF , do i need a (FILE *) ? */ return(0); } if(strlen(entry->d_name)>=SfileadrL) { fprintf(stderr,"--- oversized directory entry (number %d) :\n %s", o->count+1,entry->d_name); return(-1); } name= entry->d_name; if(flag&8) break; /* skip "." and ".." */ } while(name[0]=='.' && ((name[1]=='.' && name[2]==0) || name[1]==0)); if(Sfile_str(reply,name,0)<=0) return(-1); if(!(flag&2)) o->count++; return(1); } int Dirseq_next_adrblock(struct DirseQ *o, char *replies[], int *reply_count, int max_replies, int flag) /* @param replies A vector of Sregex_string pointers */ /* flag: bit0= permission to use buffer bit1= do not increment counter bit2= ignore buffer in any case bit4= sort replies return: <0 error 0= no more entries available 1= ok, reply is valid */ { int i,ret; char *reply= NULL; reply= TSOB_FELD(char, SfileadrL); if(reply == NULL) return(-1); *reply_count= 0; for(i=0;itext= NULL; s->next= s->prev= NULL; if(flag & 4) { s->text= data; } else { if(data_len<=0) goto failed; s->text= Smem_malloC(data_len); if(s->text==NULL) goto failed; if(!(flag&2)) memcpy(s->text,data,data_len); } if(link==NULL) { ; } else if(flag&1) { s->next= link; s->prev= link->prev; if(link->prev!=NULL) link->prev->next= s; link->prev= s; } else { s->prev= link; s->next= link->next; if(link->next!=NULL) link->next->prev= s; link->next= s; } *lstring= s; return(1); failed:; *lstring= s; Xorriso_lst_destroy(lstring,0); return(-1); } /* @param flag Bitfield for control purposes see Xorriso_lst_new_binary() */ int Xorriso_lst_new(struct Xorriso_lsT **lstring, char *text, struct Xorriso_lsT *link, int flag) { int ret; ret= Xorriso_lst_new_binary(lstring,text,strlen(text)+1,link,flag); return(ret); } /* @param flag Bitfield for control purposes bit0= do not set *lstring to NULL */ int Xorriso_lst_destroy(struct Xorriso_lsT **lstring, int flag) { struct Xorriso_lsT *s; s= *lstring; if(s==NULL) return(0); if(s->prev!=NULL) s->prev->next= s->next; if(s->next!=NULL) s->next->prev= s->prev; if(s->text!=NULL) Smem_freE(s->text); Smem_freE((char *) s); if(!(flag&1)) *lstring= NULL; return(1); } int Xorriso_lst_destroy_all(struct Xorriso_lsT **lstring, int flag) { struct Xorriso_lsT *s,*next; if(lstring==NULL) return(-1); if((*lstring)==NULL) return(0); for(s= *lstring; s->prev!=NULL; s= s->prev); for(;s!=NULL;s= next){ next= s->next; Xorriso_lst_destroy(&s,0); } *lstring= NULL; return(1); } int Xorriso_lst_append_binary(struct Xorriso_lsT **entry, char *data, int data_len, int flag) { struct Xorriso_lsT *target= NULL,*newby; if(*entry!=NULL) for(target= *entry; target->next!=NULL; target= target->next); if(Xorriso_lst_new_binary(&newby, data, data_len, target, flag & ~1)<=0) return(-1); if(*entry==NULL || (flag & 1)) *entry= newby; return(1); } struct Xorriso_lsT *Xorriso_lst_get_next(struct Xorriso_lsT *entry, int flag) { return(entry->next); } struct Xorriso_lsT *Xorriso_lst_get_prev(struct Xorriso_lsT *entry, int flag) { return(entry->prev); } char *Xorriso_lst_get_text(struct Xorriso_lsT *entry, int flag) { return(entry->text); } int Xorriso_lst_detach_text(struct Xorriso_lsT *entry, int flag) { entry->text= NULL; return(1); } int Xorriso_lst_get_last(struct Xorriso_lsT *entry, struct Xorriso_lsT **last, int flag) { *last= NULL; if(entry != NULL) for((*last)= entry; (*last)->next != NULL; (*last)= (*last)->next); return(1); } int Xorriso_lst_concat(struct Xorriso_lsT *first, struct Xorriso_lsT *second, int flag) { struct Xorriso_lsT *last; Xorriso_lst_get_last(first, &last, 0); if(last != NULL) last->next= second; if(second != NULL) second->prev= last; return(1); } /* --------------------------- End Xorriso_lsT ---------------------------- */ /* ------------------------------ ExclusionS ------------------------------ */ struct ExclusionS { /* Absolute input patterns which lead to not_paths */ struct Xorriso_lsT *not_paths_descr; /* Actually banned absolute paths */ struct Xorriso_lsT *not_paths; /* Input patterns which lead to not_leafs */ struct Xorriso_lsT *not_leafs_descr; /* Compiled not_leaf patterns. Caution: not char[] but regex_t */ struct Xorriso_lsT *not_leafs; }; int Exclusions_new(struct ExclusionS **o, int flag) { struct ExclusionS *m; m= *o= TSOB_FELD(struct ExclusionS, 1); if(m==NULL) return(-1); m->not_paths_descr= NULL; m->not_paths= NULL; m->not_leafs_descr= NULL; m->not_leafs= NULL; return(1); } int Exclusions_destroy(struct ExclusionS **o, int flag) { struct Xorriso_lsT *s,*next; if((*o)==NULL) return(0); Xorriso_lst_destroy_all(&((*o)->not_paths_descr), 0); Xorriso_lst_destroy_all(&((*o)->not_paths), 0); Xorriso_lst_destroy_all(&((*o)->not_leafs_descr), 0); for(s= (*o)->not_leafs; s!=NULL; s= next){ next= s->next; regfree((regex_t *) s->text); Xorriso_lst_destroy(&s, 0); } free((char *) *o); (*o)= NULL; return(1); } int Exclusions_add_not_paths(struct ExclusionS *o, int descrc, char **descrs, int pathc, char **paths, int flag) { struct Xorriso_lsT *s, *new_s; int i, ret; s= NULL; if(o->not_paths_descr!=NULL) for(s= o->not_paths_descr; s->next!=NULL; s= s->next); for(i= 0; inot_paths_descr==NULL) o->not_paths_descr= new_s; s= new_s; } s= NULL; if(o->not_paths!=NULL) for(s= o->not_paths; s->next!=NULL; s= s->next); for(i= 0; inot_paths==NULL) o->not_paths= new_s; s= new_s; } return(1); } /* @return -1=cannot store , 0=cannot compile regex , 1=ok */ int Exclusions_add_not_leafs(struct ExclusionS *o, char *not_leafs_descr, regex_t *re, int flag) { int ret; ret= Xorriso_lst_append_binary(&(o->not_leafs_descr), not_leafs_descr, strlen(not_leafs_descr)+1, 0); if(ret<=0) return(-1); ret= Xorriso_lst_append_binary(&(o->not_leafs), (char *) re, sizeof(regex_t), 0); if(ret<=0) return(-1); return(1); } /* @param flag bit0= whole subtree is banned with -not_paths @return 0=no match , 1=not_paths , 2=not_leafs, <0=error */ int Exclusions_match(struct ExclusionS *o, char *abs_path, int flag) { struct Xorriso_lsT *s; char *leaf= NULL, *leaf_pt; regmatch_t match[1]; int ret, was_non_slash, l; /* test abs_paths */ if(flag&1) { for(s= o->not_paths; s!=NULL; s= s->next) { l= strlen(s->text); if(strncmp(abs_path, s->text, l)==0) if(abs_path[l]=='/' || abs_path[l]==0) {ret= 1; goto ex;} } } else { for(s= o->not_paths; s!=NULL; s= s->next) if(strcmp(abs_path, s->text)==0) {ret= 1; goto ex;} } /* determine leafname */ was_non_slash= 0; for(leaf_pt= abs_path+strlen(abs_path); leaf_pt >= abs_path; leaf_pt--) { if(*leaf_pt=='/') { if(was_non_slash) { leaf_pt++; break; } } else if(*leaf_pt!=0) was_non_slash= 1; } if(strlen(leaf_pt)>=SfileadrL) {ret= -1; goto ex;} leaf= strdup(leaf_pt); leaf_pt= strchr(leaf, '/'); if(leaf_pt!=NULL) *leaf_pt= 0; /* test with leaf expressions */ for(s= o->not_leafs; s!=NULL; s= s->next) { ret= regexec((regex_t *) s->text, leaf, 1, match, 0); if(ret==0) {ret= 2; goto ex;} } ret= 0; ex: if(leaf != NULL) free(leaf); return(ret); } int Exclusions_get_descrs(struct ExclusionS *o, struct Xorriso_lsT **not_paths_descr, struct Xorriso_lsT **not_leafs_descr, int flag) { *not_paths_descr= o->not_paths_descr; *not_leafs_descr= o->not_leafs_descr; return(1); } /* ---------------------------- End ExclusionS ---------------------------- */ /* ------------------------------ LinkiteM -------------------------------- */ struct LinkiteM { char *link_path; dev_t target_dev; ino_t target_ino; int link_count; struct LinkiteM *next; }; int Linkitem_new(struct LinkiteM **o, char *link_path, dev_t target_dev, ino_t target_ino, struct LinkiteM *next, int flag) { struct LinkiteM *m; m= *o= TSOB_FELD(struct LinkiteM,1); if(m==NULL) return(-1); m->target_dev= target_dev; m->target_ino= target_ino; m->next= next; m->link_count= 1; if(next!=NULL) m->link_count= m->next->link_count+1; m->link_path= strdup(link_path); if(m->link_path==NULL) goto failed; return(1); failed:; Linkitem_destroy(o, 0); return(-1); } int Linkitem_destroy(struct LinkiteM **o, int flag) { if((*o)==NULL) return(0); if((*o)->link_path!=NULL) free((*o)->link_path); free((char *) (*o)); *o= NULL; return(1); } int Linkitem_reset_stack(struct LinkiteM **o, struct LinkiteM *to, int flag) { struct LinkiteM *m, *m_next= NULL; /* Prevent memory corruption */ for(m= *o; m!=to; m= m->next) if(m==NULL) { /* this may actually not happen */ *o= to; return(-1); } for(m= *o; m!=to; m= m_next) { m_next= m->next; Linkitem_destroy(&m, 0); } *o= to; return(1); } int Linkitem_find(struct LinkiteM *stack, dev_t target_dev, ino_t target_ino, struct LinkiteM **result, int flag) { struct LinkiteM *m; for(m= stack; m!=NULL; m= m->next) { if(target_dev == m->target_dev && target_ino == m->target_ino) { *result= m; return(1); } } return(0); } int Linkitem_get_link_count(struct LinkiteM *item, int flag) { return(item->link_count); } /* ------------------------------ PermstacK ------------------------------- */ struct PermiteM { char *disk_path; struct stat stbuf; struct PermiteM *next; }; int Permstack_push(struct PermiteM **o, char *disk_path, struct stat *stbuf, int flag) { struct PermiteM *m; m= TSOB_FELD(struct PermiteM,1); if(m==NULL) return(-1); m->disk_path= NULL; memcpy(&(m->stbuf), stbuf, sizeof(struct stat)); m->next= *o; m->disk_path= strdup(disk_path); if(m->disk_path==NULL) goto failed; *o= m; return(1); failed:; if(m->disk_path!=NULL) free(m->disk_path); free((char *) m); return(-1); } /* @param flag bit0= minimal transfer: access permissions only bit1= do not set timestamps */ int Permstack_pop(struct PermiteM **o, struct PermiteM *stopper, struct XorrisO *xorriso, int flag) { int ret; struct utimbuf utime_buffer; struct PermiteM *m, *m_next; if((*o)==stopper) return(1); for(m= *o; m!=NULL; m= m->next) if(m->next==stopper) break; if(m==NULL) { sprintf(xorriso->info_text, "Program error: Permstack_pop() : cannot find stopper"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); return(-1); } for(m= *o; m!=stopper; m= m_next) { ret= chmod(m->disk_path, m->stbuf.st_mode); if(ret==-1) { if(xorriso!=NULL) { sprintf(xorriso->info_text, "Cannot change access permissions of disk directory: chmod %o ", (unsigned int) (m->stbuf.st_mode & 07777)); Text_shellsafe(m->disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); } } if(!(flag&1)) { ret= chown(m->disk_path, m->stbuf.st_uid, m->stbuf.st_gid); /* don't complain if it fails */ if(!(flag&2)) { utime_buffer.actime= m->stbuf.st_atime; utime_buffer.modtime= m->stbuf.st_mtime; ret= utime(m->disk_path,&utime_buffer); if(ret==-1 && xorriso!=NULL) { sprintf(xorriso->info_text, "Cannot change timestamps of disk directory: "); Text_shellsafe(m->disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); } } } m_next= m->next; free(m->disk_path); free((char *) m); *o= m_next; } return(1); } /* ---------------------------- End PermstacK ----------------------------- */ libisoburn-1.5.4/xorriso/iso_tree.h0000644000175700017510000000772213701321754014324 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2016 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of functions which access nodes of the libisofs tree model. */ #ifndef Xorriso_pvt_iso_tree_includeD #define Xorriso_pvt_iso_tree_includeD yes #define LIBISO_ISDIR(node) (iso_node_get_type(node) == LIBISO_DIR) #define LIBISO_ISREG(node) (iso_node_get_type(node) == LIBISO_FILE) #define LIBISO_ISLNK(node) (iso_node_get_type(node) == LIBISO_SYMLINK) #define LIBISO_ISCHR(node) (iso_node_get_type(node) == LIBISO_SPECIAL && \ S_ISCHR(iso_node_get_mode(node))) #define LIBISO_ISBLK(node) (iso_node_get_type(node) == LIBISO_SPECIAL && \ S_ISBLK(iso_node_get_mode(node))) #define LIBISO_ISFIFO(node) (iso_node_get_type(node) == LIBISO_SPECIAL && \ S_ISFIFO(iso_node_get_mode(node))) #define LIBISO_ISSOCK(node) (iso_node_get_type(node) == LIBISO_SPECIAL && \ S_ISSOCK(iso_node_get_mode(node))) #define LIBISO_ISBOOT(node) (iso_node_get_type(node) == LIBISO_BOOT) int Xorriso_node_from_path(struct XorrisO *xorriso, IsoImage *volume, char *path, IsoNode **node, int flag); int Xorriso_get_node_by_path(struct XorrisO *xorriso, char *in_path, char *eff_path, IsoNode **node, int flag); int Xorriso_dir_from_path(struct XorrisO *xorriso, char *purpose, char *path, IsoDir **dir_node, int flag); int Xorriso_node_get_dev(struct XorrisO *xorriso, IsoNode *node, char *path, dev_t *dev, int flag); int Xorriso_fake_stbuf(struct XorrisO *xorriso, char *path, struct stat *stbuf, IsoNode **node, int flag); int Xorriso_node_is_valid(struct XorrisO *xorriso, IsoNode *in_node, int flag); int Xorriso_path_from_node(struct XorrisO *xorriso, IsoNode *in_node, char path[SfileadrL], int flag); int Xorriso_path_from_lba(struct XorrisO *xorriso, IsoNode *node, int lba, char path[SfileadrL], int flag); int Xorriso_get_attr_value(struct XorrisO *xorriso, void *in_node, char *path, char *name, size_t *value_length, char **value, int flag); int Xorriso_stream_type(struct XorrisO *xorriso, IsoNode *node, IsoStream *stream, char type_text[], int flag); int Xorriso_show_du_subs(struct XorrisO *xorriso, IsoDir *dir_node, char *abs_path, char *rel_path, off_t *size, off_t boss_mem, int flag); int Xorriso_sorted_dir_i(struct XorrisO *xorriso, IsoDir *dir_node, int *filec, char ***filev, off_t boss_mem, int flag); int Xorriso_obtain_pattern_files_i( struct XorrisO *xorriso, char *wd, IsoDir *dir, int *filec, char **filev, int count_limit, off_t *mem, int *dive_count, int flag); int Xorriso__start_end_lbas(IsoNode *node, int *lba_count, int **start_lbas, int **end_lbas, off_t **section_sizes, off_t *size, int flag); int Xorriso__file_start_lba(IsoNode *node, int *lba, int flag); int Xorriso_file_eval_damage(struct XorrisO *xorriso, IsoNode *node, off_t *damage_start, off_t *damage_end, int flag); int Xorriso_report_lba(struct XorrisO *xorriso, char *show_path, IsoNode *node, uint32_t *last_block, int flag); int Xorriso_report_damage(struct XorrisO *xorriso, char *show_path, IsoNode *node, int flag); int Xorriso_getfname(struct XorrisO *xorriso, char *path, int flag); int Xorriso_retrieve_disk_path(struct XorrisO *xorriso, IsoNode *node, char disk_path[SfileadrL], int flag); #endif /* ! Xorriso_pvt_iso_tree_includeD */ libisoburn-1.5.4/xorriso/read_run.h0000644000175700017510000000505313701321754014305 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2010 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of functions which */ #ifndef Xorriso_pvt_read_run_includeD #define Xorriso_pvt_read_run_includeD yes int Xorriso__read_pacifier(IsoImage *image, IsoFileSource *filesource); int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path, IsoNode *node, int flag); int Xorriso_restore_implicit_properties(struct XorrisO *xorriso, char *full_disk_path, char *disk_path, char *full_img_path, int flag); int Xorriso_tree_restore_node(struct XorrisO *xorriso, IsoNode *node, char *img_path, off_t img_offset, char *disk_path, off_t disk_offset, off_t bytes, int flag); int Xorriso_restore_overwrite(struct XorrisO *xorriso, IsoNode *node, char *img_path, char *path, char *nominal_path, struct stat *stbuf, int flag); int Xorriso_restore_target_hl(struct XorrisO *xorriso, IsoNode *node, char *disk_path, int *node_idx, int flag); int Xorriso_restore_prefix_hl(struct XorrisO *xorriso, IsoNode *node, char *disk_path, int node_idx, int flag); int Xorriso_register_node_target(struct XorrisO *xorriso, int node_idx, char *disk_path, int flag); int Xorriso_restore_disk_object(struct XorrisO *xorriso, char *img_path, IsoNode *node, char *disk_path, off_t offset, off_t bytes, int flag); int Xorriso_handle_collision(struct XorrisO *xorriso, IsoNode *node, char *img_path, char *disk_path, char *nominal_disk_path, int *stbuf_ret, int flag); int Xorriso_restore_tree(struct XorrisO *xorriso, IsoDir *dir, char *img_dir_path, char *disk_dir_path, off_t boss_mem, struct LinkiteM *link_stack, int flag); int Xorriso_read_file_data(struct XorrisO *xorriso, IsoNode *node, char *img_path, char *disk_path, off_t img_offset, off_t disk_offset, off_t bytes, int flag); #endif /* ! Xorriso_pvt_read_run_includeD */ libisoburn-1.5.4/xorriso/drive_mgt.c0000644000175700017510000035034113763670503014473 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains functions which operate on drives and media. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include "xorriso.h" #include "xorriso_private.h" #include "lib_mgt.h" #include "drive_mgt.h" #include "iso_img.h" #include "sort_cmp.h" #include "write_run.h" #include "read_run.h" static const char *un0(const char *text) { if(text == NULL) return(""); return(text); } int Xorriso_auto_driveadr(struct XorrisO *xorriso, char *adr, char *result, int flag) { int ret, is_known_mmc= 0, does_exist= 0; char *path_pt, *libburn_adr= NULL; char *abs_pt, *abs_adr= NULL; struct stat stbuf; Xorriso_alloc_meM(libburn_adr, char, BURN_DRIVE_ADR_LEN + SfileadrL); Xorriso_alloc_meM(abs_adr, char, SfileadrL); path_pt= adr; if(strncmp(adr, "stdio:", 6) == 0) path_pt= adr + 6; else if(strncmp(adr, "mmc:", 4) == 0) path_pt= adr + 4; /* <<< replace by Xorriso_normalize_img_path() ? */; if(path_pt[0] != '/') { abs_pt= getcwd(abs_adr, SfileadrL - 1); if(abs_pt == NULL) { Xorriso_msgs_submit(xorriso, 0, "Relative drive path given. Cannot determine working directory.", errno, "FAILURE", 0); {ret= -1; goto ex;} } ret= Sfile_add_to_path(abs_adr, path_pt, 0); if(ret <= 0) {ret= -1; goto ex;} } is_known_mmc= burn_drive_convert_fs_adr(path_pt, libburn_adr); does_exist= (stat(path_pt, &stbuf) != -1); Xorriso_process_msg_queues(xorriso,0); ret= Xorriso_is_in_patternlist(xorriso, xorriso->drive_whitelist, path_pt, 0); if(ret > 0) goto ok; ret= Xorriso_is_in_patternlist(xorriso, xorriso->drive_blacklist, path_pt, 0); if(ret < 0) goto ex; if(ret) { strcpy(xorriso->info_text, "Drive address "); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, " rejected because: -drive_class 'banned' "); Text_shellsafe(Xorriso_get_pattern(xorriso, xorriso->drive_blacklist, ret - 1, 0), xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } /* if in greylist and not MMC and not stdio prefix: reject */ if(is_known_mmc < 0) goto ex; if(adr == path_pt && !is_known_mmc) { /* no prefix, no MMC */ ret= Xorriso_is_in_patternlist(xorriso, xorriso->drive_greylist, path_pt,0); if(ret < 0) goto ex; if(ret) { strcpy(xorriso->info_text, "Drive address "); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, " rejected because: "); if(does_exist) strcat(xorriso->info_text, "not MMC"); else strcat(xorriso->info_text, "not existing"); strcat(xorriso->info_text, " and -drive_class 'caution' "); Text_shellsafe(Xorriso_get_pattern(xorriso,xorriso->drive_greylist, ret - 1, 0), xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); sprintf(xorriso->info_text, "If the address is a legitimate %s, prepend \"stdio:\"", does_exist ? "target" : "address for a new regular file"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); {ret= 0; goto ex;} } } ok:; if(strncmp(adr, "mmc:", 4) == 0) { if(Sfile_str(result, path_pt, 0) <= 0) {ret= 0; goto ex;} } else if(adr == path_pt && is_known_mmc <= 0) { Sfile_str(result, "stdio:", 0); if(Sfile_str(result, adr, 1) <= 0) {ret= 0; goto ex;} } else { if(Sfile_str(result, adr, 0) <= 0) {ret= 0; goto ex;} } if(strncmp(result, "stdio:", 6)==0) { if(xorriso->ban_stdio_write) { strcpy(xorriso->info_text, "Drive address banned by -ban_stdio_write : "); Text_shellsafe(result, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } ret= 1; ex:; Xorriso_free_meM(libburn_adr); Xorriso_free_meM(abs_adr); return(ret); } static int Xorriso_grasp_loaded_aaip(struct XorrisO *xorriso, IsoImage *volset, int flag) { int ret, change_pending_rec; IsoNode *root_node; size_t value_length; char *value= NULL; double num; struct FindjoB *job= NULL; struct stat dir_stbuf; /* To be re-instated at function end */ change_pending_rec= xorriso->volset_change_pending; /* Look for isofs.st and put it into xorriso->isofs_st_in */ root_node= (IsoNode *) iso_image_get_root(volset); ret= iso_node_lookup_attr(root_node, "isofs.st", &value_length, &value, 0); if(ret > 0) { if(value_length > 0) { sscanf(value, "%lf", &num); if(num > 0) xorriso->isofs_st_in= num; } free(value); } if(xorriso->do_hfsplus) { /* Bring isofs.hx to iso_hfsplus_xinfo_func, isofs.hb to IsoImage blessings */ ret= Findjob_new(&job, "/", 0); if(ret<=0) { Xorriso_no_findjob(xorriso, "xorriso", 0); {ret= -1; goto ex;} } Findjob_set_action_target(job, 49, NULL, 0); ret= Xorriso_findi(xorriso, job, NULL, (off_t) 0, NULL, "/", &dir_stbuf, 0, 0); if(ret <= 0) goto ex; } ret= 1; ex:; xorriso->volset_change_pending= change_pending_rec; Findjob_destroy(&job, 0); return(ret); } /* @param flag: bit0= set read speed bit1= set write speed */ int Xorriso_set_speed(struct XorrisO *xorriso, struct burn_drive *drive, int read_speed, int write_speed, int flag) { int r_speed = 0, w_speed = 0, ret = 0, profile_no= 0; char profile_name[80]; if((flag & 3) == 0) return(0); if(xorriso->read_speed == -2) { if(!(flag & 2)) return(0); } if(flag & 1) r_speed= read_speed; if(flag & 2) w_speed= write_speed; ret= burn_disc_get_profile(drive, &profile_no, profile_name); if(ret <= 0) profile_no= 0; if((r_speed > 0 || w_speed > 0) && profile_no >= 0x10) { ret= burn_drive_set_speed_exact(drive, r_speed, w_speed); if(ret > 0) goto ex; } burn_drive_set_speed(drive, r_speed, w_speed); ret= 2; ex:; Xorriso_process_msg_queues(xorriso,0); return(ret); } /* @param flag bit0= acquire as isoburn input drive bit1= acquire as libburn output drive (as isoburn drive if bit0) bit2= regard overwritable media as blank bit3= if the drive is a regular disk file: truncate it to the write start address bit5= do not print toc bit6= do not calm down drive after acquiring it bit7= re-assess rather than acquire: Do not give up drives, use isoburn_drive_aquire() with re-assessment bit @return <=0 failure , 1= ok 2=success, but not writeable with bit1 3=success, but not blank and not ISO with bit0 */ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr, int flag) { int ret, hret, not_writeable= 0, has_what, aquire_flag, load_lba, ext; int lba, track, session, params_flag, adr_mode, read_ret, start_lba; int truncate_mode; uint32_t size, offst; struct burn_drive_info *dinfo= NULL, *out_dinfo= NULL, *in_dinfo= NULL; struct burn_drive *drive= NULL, *out_drive= NULL, *in_drive= NULL; enum burn_disc_status state; IsoImage *volset = NULL; struct isoburn_read_opts *ropts= NULL; char *libburn_adr= NULL, *off_adr= NULL, *boot_fate, *sev; char volid[33], *adr_data= NULL, *adr_pt; Xorriso_alloc_meM(libburn_adr, char, SfileadrL); Xorriso_alloc_meM(off_adr, char, SfileadrL); Xorriso_alloc_meM(adr_data, char, 163); if(show_adr == NULL) { show_adr= adr; ret= burn_drive_convert_fs_adr(adr, off_adr); if(ret > 0) adr= off_adr; } if((flag&3)==0) { sprintf(xorriso->info_text, "XORRISOBURN program error : Xorriso_aquire_drive bit0+bit1 not set"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } if(!(flag & 128)) { ret= Xorriso_give_up_drive(xorriso, (flag&3)|8); if(ret<=0) goto ex; } if(flag & 1) xorriso->isofs_st_out= time(0) - 1; ret= Xorriso_auto_driveadr(xorriso, adr, libburn_adr, 0); if(ret <= 0) goto ex; if(strcmp(libburn_adr,"stdio:/dev/fd/1")==0) { if(xorriso->dev_fd_1<0) { sprintf(xorriso->info_text, "-*dev \"stdio:/dev/fd/1\" was not a start argument. Cannot use it now."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } else { sprintf(libburn_adr, "stdio:/dev/fd/%d", xorriso->dev_fd_1); } } if(flag & 128) { if(flag & 1) Xorriso_get_drive_handles(xorriso, &in_dinfo, &in_drive, "", 16); if(flag & 2) Xorriso_get_drive_handles(xorriso, &out_dinfo, &out_drive, "", 2 | 16); if(in_dinfo != NULL && (out_dinfo == NULL || out_dinfo == in_dinfo)) { dinfo= in_dinfo; if(flag & 2) { xorriso->outdev_is_exclusive= xorriso->indev_is_exclusive; xorriso->outdev_access= xorriso->indev_access; } } else if(out_dinfo != NULL && in_dinfo == NULL) { dinfo= out_dinfo; if(flag & 1) { xorriso->indev_is_exclusive= xorriso->outdev_is_exclusive; xorriso->indev_access= xorriso->outdev_access; } } else if(out_dinfo != NULL || in_dinfo != NULL) { sprintf(xorriso->info_text, "Two different drives shall be re-assed in one call"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= 0; goto ex;} } else { sprintf(xorriso->info_text, "No drive acquired on re-assessment"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= 0; goto ex;} } } else if((flag&3)==1 && xorriso->out_drive_handle!=NULL) { ret= Xorriso_get_drive_handles(xorriso, &out_dinfo, &out_drive, "on attempt to compare new indev with outdev", 2); if(ret<=0) goto ex; ret= burn_drive_equals_adr(out_drive, libburn_adr, 1); if(ret==1) { dinfo= out_dinfo; xorriso->indev_is_exclusive= xorriso->outdev_is_exclusive; xorriso->indev_access= xorriso->outdev_access; } } else if((flag&3)==2 && xorriso->in_drive_handle!=NULL) { ret= Xorriso_get_drive_handles(xorriso, &in_dinfo, &in_drive, "on attempt to compare new outdev with indev", 0); if(ret<=0) goto ex; ret= burn_drive_equals_adr(in_drive, libburn_adr, 1); if(ret==1) { dinfo= in_dinfo; xorriso->outdev_is_exclusive= xorriso->indev_is_exclusive; xorriso->outdev_access= xorriso->indev_access; } } if(dinfo == NULL || (flag & 128)) { aquire_flag= 1 | ((flag&(8|4))>>1) | ((xorriso->toc_emulation_flag & 3)<<3); if(xorriso->toc_emulation_flag & 4) aquire_flag|= 128; if(xorriso->toc_emulation_flag & 8) aquire_flag|= 512; if(!(xorriso->do_aaip & 1)) aquire_flag|= 32; if((xorriso->ino_behavior & (1 | 2)) && !(xorriso->do_aaip & (4 | 32))) { aquire_flag|= 64; } else if(xorriso->do_aaip & 1024) { aquire_flag|= 1024; } if(flag & 128) aquire_flag|= 256; burn_preset_device_open(xorriso->drives_exclusive | (xorriso->linux_scsi_dev_family << 2), 0, 0); burn_allow_drive_role_4(1 | (xorriso->early_stdio_test & 14)); ret= isoburn_drive_aquire(&dinfo, libburn_adr, aquire_flag); burn_preset_device_open(1 | (xorriso->linux_scsi_dev_family << 2), 0, 0); Xorriso_process_msg_queues(xorriso,0); if(ret<=0) { if(flag & 128) sprintf(xorriso->info_text,"Cannot re-assess drive '%s'", adr); else sprintf(xorriso->info_text,"Cannot acquire drive '%s'", adr); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } xorriso->use_immed_bit_default= burn_drive_get_immed(dinfo[0].drive) > 0 ? 1 : -1; if(xorriso->use_immed_bit != 0) burn_drive_set_immed(dinfo[0].drive, xorriso->use_immed_bit > 0); state= isoburn_disc_get_status(dinfo[0].drive); ret= isoburn_get_img_partition_offset(dinfo[0].drive, &offst); if((state == BURN_DISC_APPENDABLE || state == BURN_DISC_FULL) && ret == 1) { sprintf(xorriso->info_text, "ISO image bears MBR with -boot_image any partition_offset=%lu", (unsigned long) offst); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } if(flag&1) if(xorriso->image_start_mode&(1u<<31)) /* used up setting */ xorriso->image_start_mode= 0; /* no need to perform auto setting */ if(flag & 1) { xorriso->indev_is_exclusive= xorriso->drives_exclusive; xorriso->indev_access= xorriso->drives_access; } if(flag & 2) { xorriso->outdev_is_exclusive= xorriso->drives_exclusive; xorriso->outdev_access= xorriso->drives_access; } } drive= dinfo[0].drive; volset= isoburn_get_attached_image(drive); if(volset != NULL) { ret= iso_image_set_truncate_mode(volset, 1, xorriso->file_name_limit); iso_image_unref(volset); volset= NULL; Xorriso_process_msg_queues(xorriso,0); if(ret < 0) {ret= 0; goto ex;} } state= isoburn_disc_get_status(drive); Xorriso_process_msg_queues(xorriso,0); if(flag&1) { if(xorriso->image_start_mode&(1u<<31)) /* used up setting */ xorriso->image_start_mode&= ~0xffff; /* perform auto setting */ if((xorriso->image_start_mode&(1<<30))) { /* if enabled at all */ adr_pt= xorriso->image_start_value; adr_mode= xorriso->image_start_mode & 0xffff; if(adr_mode == 4 && strlen(adr_pt) <= 80) { /* Convert volid search expression into lba */ params_flag= 0; ret= Xorriso__bourne_to_reg(xorriso->image_start_value, adr_data, 0); if(ret == 1) params_flag|= 4; ret= isoburn_get_mount_params(drive, 4, adr_data, &lba, &track, &session, volid, params_flag); Xorriso_process_msg_queues(xorriso,0); if(ret <= 0) goto ex; if(session <= 0 || track <= 0 || ret == 2) { Xorriso_msgs_submit(xorriso, 0, "-load : Given address does not point to an ISO 9660 session", 0, "FAILURE", 0); ret= 0; goto ex; } sprintf(volid, "%d", lba); adr_pt= volid; adr_mode= 3; } ret= isoburn_set_msc1(drive, adr_mode, adr_pt, !!(xorriso->image_start_mode & (1<<16))); if(ret<=0) goto ex; if(xorriso->image_start_mode&(1u<<31)) xorriso->image_start_mode= 0; /* disable msc1 setting completely */ else xorriso->image_start_mode|= (1u<<31); /* mark as used up */ } } if(flag&1) { volset= isoburn_get_attached_image(drive); if(volset != NULL) { /* The image object is already created */ iso_image_unref(volset); volset= NULL; } } if(flag&2) { xorriso->out_drive_handle= dinfo; if(Sfile_str(xorriso->outdev, show_adr, 0)<=0) {ret= -1; goto ex;} ret= burn_drive_convert_fs_adr(adr, xorriso->outdev_off_adr); if(ret <= 0) xorriso->outdev_off_adr[0]= 0; if(state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE) { sprintf(xorriso->info_text, "Disc status unsuitable for writing"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); not_writeable= 1; } } if(flag&1) { xorriso->in_drive_handle= dinfo; if(Sfile_str(xorriso->indev, show_adr, 0)<=0) {ret= -1; goto ex;} ret= burn_drive_convert_fs_adr(adr, xorriso->indev_off_adr); if(ret <= 0) xorriso->indev_off_adr[0]= 0; } else if(flag&2) { if(xorriso->in_volset_handle==NULL) { /* No volume loaded: create empty one */ ret= Xorriso_create_empty_iso(xorriso, 0); if(ret<=0) goto ex; } else { iso_image_ref((IsoImage *) xorriso->in_volset_handle); start_lba= -1; ret= Xorriso_get_drive_handles(xorriso, &in_dinfo, &in_drive, "on attempt to attach ISO image object to outdev", 16); if(ret > 0) start_lba= isoburn_get_attached_start_lba(in_drive); ret= isoburn_attach_image(drive, (IsoImage *) xorriso->in_volset_handle); if(ret<=0) { sprintf(xorriso->info_text, "Failed to attach ISO image object to outdev"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } if(start_lba >= 0) isoburn_attach_start_lba(drive, lba, 0); } if(!(flag&32)) Xorriso_toc(xorriso, 1 | 2 | 8); {ret= 1+not_writeable; goto ex;} } if(xorriso->in_volset_handle!=NULL) iso_image_unref((IsoImage *) xorriso->in_volset_handle); xorriso->in_volset_handle= NULL; Sectorbitmap_destroy(&(xorriso->in_sector_map), 0); Xorriso_destroy_hln_array(xorriso, 0); Xorriso_destroy_di_array(xorriso, 0); xorriso->boot_count= 0; xorriso->system_area_clear_loaded= (strcmp(xorriso->system_area_disk_path, "/dev/zero") == 0); /* check for invalid state */ if(state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE && state != BURN_DISC_FULL) { sprintf(xorriso->info_text, "Disc status not blank and unsuitable for reading"); sev= "FAILURE"; if(xorriso->img_read_error_mode==2) sev= "FATAL"; Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, sev, 0); Xorriso_give_up_drive(xorriso, 1|((flag&32)>>2)); ret= 3; goto ex; } /* fill read opts */ ret= isoburn_ropt_new(&ropts, 0); if(ret<=0) goto ex; ret= Xorriso_set_data_cache(xorriso, ropts, xorriso->cache_num_tiles, xorriso->cache_tile_blocks, xorriso->cache_default); if(ret<=0) goto ex; ext= isoburn_ropt_noiso1999; if(xorriso->read_fs & 1) ext|= isoburn_ropt_norock; if(xorriso->read_fs & 2) ext|= isoburn_ropt_nojoliet; if((xorriso->ino_behavior & (1 | 2)) && !(xorriso->do_aaip & (1 | 4 | 32)) && !(xorriso->do_md5 & 1) && !(xorriso->do_hfsplus)) ext|= isoburn_ropt_noaaip; if(!(xorriso->do_aaip & 1)) ext|= isoburn_ropt_noacl; if(!(xorriso->do_aaip & 4)) ext|= isoburn_ropt_noea; if(xorriso->ino_behavior & 1) ext|= isoburn_ropt_noino; if(!(xorriso->do_md5 & 1)) ext|= isoburn_ropt_nomd5; if(xorriso->do_md5 & 32) ext|= isoburn_ropt_nomd5tag; if(xorriso->ecma119_map == 0) ext|= isoburn_ropt_map_unmapped; else if(xorriso->ecma119_map == 2) ext|= isoburn_ropt_map_uppercase; else if(xorriso->ecma119_map == 3) ext|= isoburn_ropt_map_lowercase; else ext|= isoburn_ropt_map_stripped; if(xorriso->joliet_map == 0) ext|= isoburn_ropt_joliet_unmapped; else ext|= isoburn_ropt_joliet_stripped; isoburn_ropt_set_extensions(ropts, ext); isoburn_ropt_set_default_perms(ropts, (uid_t) 0, (gid_t) 0, (mode_t) 0555); isoburn_ropt_set_input_charset(ropts, xorriso->in_charset); isoburn_ropt_set_auto_incharset(ropts, !!(xorriso->do_aaip & 512)); isoburn_ropt_set_displacement(ropts, xorriso->displacement, xorriso->displacement_sign); isoburn_ropt_set_truncate_mode(ropts, 1, xorriso->file_name_limit); Xorriso_set_image_severities(xorriso, 1); /* No DEBUG messages */ Xorriso_pacifier_reset(xorriso, 0); isoburn_set_read_pacifier(drive, Xorriso__read_pacifier, (void *) xorriso); /* <<< Trying to work around too much tolerance on bad image trees. Better would be a chance to instruct libisofs what to do in case of image read errors. There is a risk to mistake other SORRYs. */ if(xorriso->img_read_error_mode>0) iso_set_abort_severity("SORRY"); if(state != BURN_DISC_BLANK) { ret= isoburn_disc_get_msc1(drive, &load_lba); if(ret > 0) { sprintf(xorriso->info_text, "Loading ISO image tree from LBA %d", load_lba); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } ret= Xorriso_assert_volid(xorriso, load_lba, 0); if(ret <= 0) goto ex; } Xorriso_set_speed(xorriso, drive, xorriso->read_speed, 0, 1); read_ret= ret= isoburn_read_image(drive, ropts, &volset); /* <<< Resetting to normal thresholds */ if(xorriso->img_read_error_mode>0) Xorriso_set_abort_severity(xorriso, 0); if(ret<=0) { Xorriso_process_msg_queues(xorriso,0); Xorriso_set_image_severities(xorriso, 0); Xorriso_give_up_drive(xorriso, 1|((flag&32)>>2)); sprintf(xorriso->info_text,"Cannot read ISO image tree"); sev= "FAILURE"; if(xorriso->img_read_error_mode==2) sev= "FATAL"; Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, sev, 0); if(read_ret == (int) ISO_SB_TREE_CORRUPTED && (xorriso->do_md5 & 1)) { Xorriso_msgs_submit(xorriso, 0, "This might be false MD5 alarm if an add-on session was written by growisofs.", 0, "HINT", 0); Xorriso_msgs_submit(xorriso, 0, "In this case you get an ISO image tree by option -md5 'load_check_off'", 0, "HINT", 0); } else if(xorriso->img_read_error_mode!=0) { Xorriso_msgs_submit(xorriso, 0, "You might get a partial or altered ISO image tree by option -error_behavior 'image_loading' 'best_effort' if -abort_on is set to be tolerant enough.", 0, "HINT", 0); } ret= 3; goto ex; } Xorriso_pacifier_callback(xorriso, "nodes read", xorriso->pacifier_count, 0, "", 1); /* report end count */ xorriso->in_volset_handle= (void *) volset; xorriso->in_sector_map= NULL; Xorriso_set_image_severities(xorriso, 0); /* Might have changed due to isofs.nt */ iso_image_get_truncate_mode(volset, &truncate_mode, &(xorriso->file_name_limit)); Xorriso_process_msg_queues(xorriso,0); Xorriso_update_volid(xorriso, 0); strncpy(xorriso->application_id, un0(iso_image_get_application_id(volset)), 128); xorriso->application_id[128]= 0; strncpy(xorriso->publisher, un0(iso_image_get_publisher_id(volset)), 128); xorriso->publisher[128]= 0; strncpy(xorriso->system_id, un0(iso_image_get_system_id(volset)), 32); xorriso->system_id[32]= 0; strncpy(xorriso->volset_id, un0(iso_image_get_volset_id(volset)), 128); xorriso->volset_id[128]= 0; strncpy(xorriso->copyright_file, un0(iso_image_get_copyright_file_id(volset)), 37); xorriso->copyright_file[37]= 0; strncpy(xorriso->biblio_file, un0(iso_image_get_biblio_file_id(volset)), 37); xorriso->biblio_file[37]= 0; strncpy(xorriso->abstract_file, un0(iso_image_get_abstract_file_id(volset)), 37); xorriso->abstract_file[37]= 0; if(xorriso->out_drive_handle != NULL && xorriso->out_drive_handle != xorriso->in_drive_handle) { start_lba= -1; ret= Xorriso_get_drive_handles(xorriso, &in_dinfo, &in_drive, "on attempt to attach ISO image volset to outdev", 16); if(ret > 0) start_lba= isoburn_get_attached_start_lba(in_drive); ret= Xorriso_get_drive_handles(xorriso, &out_dinfo, &out_drive, "on attempt to attach ISO image volset to outdev", 2); if(ret<=0) goto ex; iso_image_ref((IsoImage *) xorriso->in_volset_handle); isoburn_attach_image(out_drive, xorriso->in_volset_handle); if(start_lba >= 0) isoburn_attach_start_lba(out_drive, ret, 0); } Xorriso_process_msg_queues(xorriso,0); isoburn_ropt_get_size_what(ropts, &size, &has_what); xorriso->isofs_size= size; xorriso->isofs_has_what= has_what; isoburn_ropt_get_tree_loaded(ropts, &(xorriso->tree_loaded), &(xorriso->rr_loaded)); if(has_what & isoburn_ropt_has_el_torito) { if(xorriso->boot_image_bin_path[0]) boot_fate= "replaced by new boot image"; else if(xorriso->patch_isolinux_image & 1) boot_fate= "patched at boot info table"; else if(xorriso->keep_boot_image) boot_fate= "kept unchanged"; else boot_fate= "discarded"; sprintf(xorriso->info_text, "Detected El-Torito boot information which currently is set to be %s", boot_fate); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); Xorriso_record_boot_info(xorriso, 0); } if(flag & 1) { ret= Xorriso_grasp_loaded_aaip(xorriso, volset, 0); if(ret <= 0) goto ex; } if(!(flag&32)) { Xorriso_toc(xorriso, 1 | 8); if(xorriso->loaded_volid[0] != 0 && (state == BURN_DISC_APPENDABLE || state == BURN_DISC_FULL)) { sprintf(xorriso->info_text,"Volume id : '%s'\n", xorriso->loaded_volid); Xorriso_info(xorriso, 0); } if(strcmp(xorriso->loaded_volid, xorriso->volid) != 0 && !xorriso->volid_default) { sprintf(xorriso->info_text, "New volume id: '%s'\n", xorriso->volid); Xorriso_info(xorriso, 0); } } ret= 1+not_writeable; ex: Xorriso_process_msg_queues(xorriso,0); if(ret<=0) { hret= Xorriso_give_up_drive(xorriso, (flag&3)|((flag&32)>>2)); if(hretdo_calm_drive & 1) && !(flag & 64)) burn_drive_snooze(drive, 0); /* No need to make noise from start */ } if(ropts!=NULL) isoburn_ropt_destroy(&ropts, 0); Xorriso_free_meM(off_adr); Xorriso_free_meM(libburn_adr); Xorriso_free_meM(adr_data); return(ret); } /* @param flag bit0=input drive bit1=output drive bit2=eject bit3=no info message or toc */ int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag) { int in_is_out_too, ret, do_eject; struct burn_drive_info *dinfo; struct burn_drive *drive; in_is_out_too= (xorriso->in_drive_handle == xorriso->out_drive_handle); if((flag&4) && in_is_out_too && (flag&(1|2))) { if((flag&3)!=3) { sprintf(xorriso->info_text,"Giving up for -eject whole -dev "); Text_shellsafe(xorriso->indev, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } flag|= 3; /* give up in/out drive to eject it */ } if((flag&1) && xorriso->in_drive_handle != NULL) { Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to give up drive", 0); if(!in_is_out_too) { do_eject= !!(flag&4); if((flag & 4) && xorriso->indev_access == 0) { sprintf(xorriso->info_text, "Will not eject medium in readonly acquired input drive."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); do_eject= 0; } if(drive!=NULL) isoburn_drive_release(drive, do_eject); if(dinfo!=NULL) burn_drive_info_free(dinfo); } xorriso->in_drive_handle= NULL; xorriso->indev[0]= 0; if(xorriso->in_volset_handle!=NULL) iso_image_unref((IsoImage *) xorriso->in_volset_handle); xorriso->in_volset_handle= NULL; Sectorbitmap_destroy(&(xorriso->in_sector_map), 0); Xorriso_destroy_di_array(xorriso, 0); Xorriso_destroy_hln_array(xorriso, 0); xorriso->loaded_volid[0]= 0; xorriso->isofs_st_out= time(0) - 1; xorriso->isofs_st_in= 0; xorriso->volset_change_pending= 0; xorriso->no_volset_present= 0; xorriso->loaded_boot_bin_lba= 0; xorriso->loaded_boot_cat_path[0]= 0; xorriso->boot_count= 0; in_is_out_too= 0; } if((flag&2) && xorriso->out_drive_handle!=NULL) { do_eject= !!(flag&4); if((flag & 4) && xorriso->outdev_access == 0) { sprintf(xorriso->info_text, "Will not eject medium in readonly acquired drive."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); do_eject= 0; } ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to give up drive", 2); if(ret >= 0 && !in_is_out_too) { if(drive!=NULL) isoburn_drive_release(drive, do_eject); if(dinfo!=NULL) burn_drive_info_free(dinfo); } xorriso->out_drive_handle= NULL; xorriso->outdev[0]= 0; xorriso->outdev_off_adr[0]= 0; } else if((flag&1) && xorriso->out_drive_handle!=NULL) { ret= Xorriso_create_empty_iso(xorriso, 0); if(ret<=0) return(ret); if(!(flag&8)) { sprintf(xorriso->info_text, "Only the output drive remains. Created empty ISO image.\n"); Xorriso_info(xorriso, 0); Xorriso_toc(xorriso, 1 | 2 | 8); } } Xorriso_process_msg_queues(xorriso,0); return(1); } int Xorriso_may_burn(struct XorrisO *xorriso, int flag) { if(xorriso->outdev_access == 1) return(1); sprintf(xorriso->info_text, "The output drive was acquired readonly."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); sprintf(xorriso->info_text, "Possible remedy: -drive_access \"exclusive:unrestricted\"."); strcat(xorriso->info_text," Then give up and re-acquire the drive."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); if(!xorriso->outdev_is_exclusive) { sprintf(xorriso->info_text, "If you insist in -drive_access \"shared:unrestricted\", first read man xorriso about the risks."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); } return(0); } /* @param flag bit1=report about output drive rather than input drive bit2=do not try to read ISO heads */ int Xorriso_toc_to_string(struct XorrisO *xorriso, char **toc_text, int flag) { int ret, stack_handle, toc_ret, l; struct Xorriso_lsT *results= NULL, *infos= NULL, *lpt; *toc_text= NULL; ret= Xorriso_push_outlists(xorriso, &stack_handle, 1); if(ret <= 0) goto ex; toc_ret= Xorriso_toc(xorriso, flag & (2 | 4)); ret= Xorriso_pull_outlists(xorriso, stack_handle, &results, &infos, 0); if(ret <= 0) goto ex; if(toc_ret <= 0) {ret= toc_ret; goto ex;} l= 0; for(lpt= results; lpt != NULL; lpt= Xorriso_lst_get_next(lpt, 0)) l+= strlen(Xorriso_lst_get_text(lpt, 0)); *toc_text= calloc(l + 1, 1); l= 0; for(lpt= results; lpt != NULL; lpt= Xorriso_lst_get_next(lpt, 0)) { strcpy((*toc_text) + l, Xorriso_lst_get_text(lpt, 0)); l+= strlen(Xorriso_lst_get_text(lpt, 0)); } ex:; Xorriso_lst_destroy_all(&results, 0); Xorriso_lst_destroy_all(&infos, 0); return(ret); } /* @param flag bit0+1= what to give up and/or re-assess in what role 0=give up outdev 1=give up indev if not outdev, re-assess outdev as indev 2=re-assess outdev as outdev 3=give up indev if not outdev, re-assess outdev as dev */ int Xorriso_reaquire_outdev(struct XorrisO *xorriso, int flag) { int ret, aq_flag; char *drive_name= NULL, *off_name= NULL; Xorriso_alloc_meM(drive_name, char, SfileadrL); Xorriso_alloc_meM(off_name, char, SfileadrL); aq_flag= flag&3; strcpy(drive_name, xorriso->outdev); if(xorriso->outdev_off_adr[0]) strcpy(off_name, xorriso->outdev_off_adr); else strcpy(off_name, drive_name); if(aq_flag == 0) { Xorriso_give_up_drive(xorriso, 2); sprintf(xorriso->info_text,"Gave up -outdev "); Text_shellsafe(xorriso->indev, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); {ret= 1; goto ex;} } /* Only give up indev, and only if it is not outdev */; if(xorriso->in_drive_handle != xorriso->out_drive_handle && xorriso->in_drive_handle != NULL && (aq_flag & 1)) Xorriso_give_up_drive(xorriso, 1 | 8); sprintf(xorriso->info_text,"Re-assessing -outdev "); Text_shellsafe(drive_name, xorriso->info_text, 1); if(strcmp(drive_name, off_name) != 0) { strcat(xorriso->info_text, " ("); Text_shellsafe(off_name, xorriso->info_text, 1); strcat(xorriso->info_text, ")"); } Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); /* Re-assess outdev */ ret= Xorriso_aquire_drive(xorriso, off_name, drive_name, aq_flag | 128); if(ret<=0) { sprintf(xorriso->info_text,"Could not re-assess -outdev "); Text_shellsafe(drive_name, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } ret= 1; ex:; Xorriso_free_meM(drive_name); Xorriso_free_meM(off_name); return(ret); } /* @param flag bit3=report to info channel (else to result channel) */ int Xorriso_toc_line(struct XorrisO *xorriso, int flag) { if(!(flag & 8)) { Xorriso_result(xorriso,0); return(1); } strcpy(xorriso->info_text, xorriso->result_line); Xorriso_info(xorriso, 0); return(1); } /* @param flag bit1=report about output drive bit3=report to info channel (else to result channel) bit4=do no report failure if no drive acquired */ int Xorriso_media_product(struct XorrisO *xorriso, int flag) { int ret, profile_no; struct burn_drive_info *dinfo; struct burn_drive *drive; char *product_id= NULL, *media_code1= NULL, *media_code2= NULL; char *book_type= NULL, *manuf= NULL, profile_name[80], *respt; respt= xorriso->result_line; ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to print media product info", flag & (2 | 16)); if(ret <= 0) return(ret); ret= burn_disc_get_media_id(drive, &product_id, &media_code1, &media_code2, &book_type, 0); if(ret > 0) { ret= burn_disc_get_profile(drive, &profile_no, profile_name); if(ret <= 0) return(ret); sprintf(respt, "Media product: %s , ", product_id); manuf= burn_guess_manufacturer(profile_no, media_code1, media_code2, 0); if(manuf != NULL) { if(strncmp(manuf, "Unknown ", 8) == 0) sprintf(respt + strlen(respt), "(not found in manufacturer list)\n"); else sprintf(respt + strlen(respt), "%s\n", manuf); } else sprintf(respt + strlen(respt), "(error during manufacturer lookup)\n"); free(product_id); free(media_code1); free(media_code2); if(book_type != NULL) free(book_type); if(manuf != NULL) free(manuf); Xorriso_toc_line(xorriso, flag & 8); } Xorriso_process_msg_queues(xorriso,0); return(1); } /* @param flag bit0=short report form bit1=report about output drive bit2=do not try to read ISO heads bit3=report to info channel (else to result channel) bit4=do no report failure if no drive acquired bit5=only report "Drive current" and "Drive type" bit6=report "Media product" with bit0 bit7=only report "Drive current" */ int Xorriso_toc(struct XorrisO *xorriso, int flag) { int num_sessions= 0, num_tracks= 0, lba= 0, nwa= -1, ret; int track_count= 0, session_no, track_no, profile_no= -1, track_size; int session_size, first_track_start= 0; int num_session_data, num_session_other; int num_data= 0, other_data= 0, is_data= 0; int is_inout_drive= 0, drive_role, status, num_formats, emul_lba; int not_recognizable= 0, start_lba, end_lba; int sessions_seen, open_sessions= 0, have_real_open_session= 0; char profile_name[80],*respt,*devadr, *typetext= ""; struct burn_toc_entry toc_entry; struct burn_drive_info *dinfo; struct burn_multi_caps *caps= NULL; struct burn_drive *drive; enum burn_disc_status s; char mem_text[80], *num_free_text; off_t start_byte= 0, num_free= 0, size; unsigned dummy; struct isoburn_toc_disc *disc= NULL; struct isoburn_toc_session **sessions; struct isoburn_toc_track **tracks; int image_blocks= 0; char volume_id[33]; struct burn_toc_entry next_toc_entry; int disk_category, part_version, num_layers, num_blocks; char *book_name; int num_data_from_format= 0; char *sno = NULL; int sno_len, i, is_bdr_pow= 0; ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to print Table Of Content", flag & (2 | 16)); if(ret<=0) {ret= 0; goto ex;} respt= xorriso->result_line; if(strcmp(xorriso->indev, xorriso->outdev)==0) is_inout_drive= 1; if(flag&2) devadr= xorriso->outdev; else devadr= xorriso->indev; sprintf(respt, "Drive current: %s '%s'\n", (is_inout_drive ? "-dev" : (flag&2 ? "-outdev" : "-indev")), devadr); Xorriso_toc_line(xorriso, flag & 8); if(flag & 128) {ret= 1; goto ex;} /* Report -drive_access if non-default or if long form */ respt[0]= 0; if(flag & 2) { if(xorriso->outdev_is_exclusive == 0 || xorriso->outdev_access == 0 || !(flag & 33)) { sprintf(respt, "Drive access : %s:%s\n", xorriso->outdev_is_exclusive ? "exclusive" : "shared", xorriso->outdev_access == 0 ? "readonly" : "unrestricted"); } } else { if(xorriso->indev_is_exclusive == 0 || xorriso->indev_access == 0 || !(flag & 33)) { sprintf(respt, "Drive access : %s:%s\n", xorriso->indev_is_exclusive ? "exclusive" : "shared", xorriso->indev_access == 0 ? "readonly" : "unrestricted"); } } if(respt[0]) Xorriso_toc_line(xorriso, flag & 8); sprintf(respt, "Drive type : vendor '%s' product '%s' revision '%s'\n", dinfo[0].vendor, dinfo[0].product, dinfo[0].revision); if((flag & 32) || !(flag & 1)) Xorriso_toc_line(xorriso, flag & 8); if(flag & 32) {ret= 1; goto ex;} if(!(flag & 1)) { burn_drive_get_serial_no(drive, &sno, &sno_len); if(sno_len > 0) { sprintf(respt, "Drive id : '%s'\n", sno); Xorriso_toc_line(xorriso, flag & 8); } if(sno != NULL) free(sno); sno= NULL; } ret= burn_disc_get_profile(drive, &profile_no, profile_name); s= isoburn_disc_get_status(drive); if(profile_no == 0x0002 && s == BURN_DISC_EMPTY) profile_no= 0; is_bdr_pow= burn_drive_get_bd_r_pow(drive); sprintf(respt, "Media current: "); drive_role= burn_drive_get_drive_role(drive); if (profile_no > 0 && ret > 0) { if (profile_name[0]) sprintf(respt+strlen(respt), "%s", profile_name); else sprintf(respt+strlen(respt), "%4.4Xh", profile_no); if(is_bdr_pow) sprintf(respt+strlen(respt), ", Pseudo Overwrite formatted"); else if(drive_role==2) sprintf(respt+strlen(respt), ", overwriteable"); else if(drive_role == 4) sprintf(respt+strlen(respt), ", random read-only"); else if(drive_role == 5) sprintf(respt+strlen(respt), ", random write-only"); else if(drive_role==0 || drive_role==3) sprintf(respt+strlen(respt), ", sequential"); strcat(respt, "\n"); } else { sprintf(respt+strlen(respt), "is not recognizable\n"); not_recognizable= 1; } Xorriso_toc_line(xorriso, flag & 8); if((flag & 64) || !(flag & 1)) { Xorriso_media_product(xorriso, flag & (2 | 8 | 16)); if(xorriso->request_to_abort) {ret= 1; goto ex;} } sprintf(respt, "Media status : "); if(is_bdr_pow) { sprintf(respt+strlen(respt), "is unsuitable , is POW formatted"); } else if (s == BURN_DISC_FULL) { if(not_recognizable) sprintf(respt+strlen(respt), "is not recognizable\n"); else sprintf(respt+strlen(respt), "is written , is closed"); } else if (s == BURN_DISC_APPENDABLE) { sprintf(respt+strlen(respt), "is written , is appendable"); } else if (s == BURN_DISC_BLANK) { sprintf(respt+strlen(respt), "is blank"); } else if (s == BURN_DISC_EMPTY) sprintf(respt+strlen(respt), "is not present"); else sprintf(respt+strlen(respt), "is not recognizable"); if(s == BURN_DISC_APPENDABLE || s == BURN_DISC_BLANK) { ret= burn_disc_next_track_is_damaged(drive, 0); if(ret & 1) sprintf(respt+strlen(respt), " , but next track is damaged"); else if(ret & 2) sprintf(respt+strlen(respt), " , but no writable address"); else if(profile_no == 0x14) { /* DVD-RW sequential */ ret= burn_disc_get_multi_caps(drive, BURN_WRITE_TAO, &caps, 0); if(ret == 0) sprintf(respt+strlen(respt), " , but will need -close on"); if(caps != NULL) burn_disc_free_multi_caps(&caps); } else if(profile_no == 0x15) { /* DVD-RW DL */ sprintf(respt+strlen(respt), " , but will need -close \"on\""); } } strcat(respt, "\n"); Xorriso_toc_line(xorriso, flag & 8); if((s == BURN_DISC_FULL || s == BURN_DISC_APPENDABLE || s == BURN_DISC_BLANK) && !(flag & 1)) { burn_drive_get_media_sno(drive, &sno, &sno_len); if(sno_len > 0) { sprintf(respt, "Media id : "); respt+= strlen(respt); for(i= 0; i < sno_len && i < 1024; i++) { sprintf(respt, "%2.2X", (unsigned int) ((unsigned char *) sno)[i]); respt+= 2; } if(i < sno_len) strcat(respt, "..."); strcat(respt, "\n"); Xorriso_toc_line(xorriso, flag & 8); } if(sno != NULL) free(sno); sno= NULL; respt= xorriso->result_line; ret= burn_get_read_capacity(drive, &num_data, 0); if(ret != 1 || s == BURN_DISC_BLANK) num_data= 0; num_free= isoburn_disc_available_space(drive, NULL) / 2048; nwa= -1; if (s == BURN_DISC_APPENDABLE) { ret= isoburn_disc_track_lba_nwa(drive, NULL, 0, &lba, &nwa); if(ret <= 0) nwa= -1; } else if(s == BURN_DISC_BLANK) { ret= isoburn_disc_track_lba_nwa(drive, NULL, 0, &lba, &nwa); if(ret == 1) { num_free+= nwa; nwa= 0; } } lba= num_data + num_free; if(nwa >= 0) { lba= nwa + num_free; if(nwa < num_data) num_data= nwa; } /* If closed CD-RW : obtain ATIP lead out address */ if(profile_no == 0x0a) { ret= burn_disc_read_atip(drive); if(ret < 0) goto ex; ret= burn_drive_get_start_end_lba(drive, &start_lba, &end_lba, 0); if(s == BURN_DISC_FULL && ret == 1) { lba= end_lba - 2; } else { if(ret == 1 && end_lba - 2 > lba) { sprintf(xorriso->info_text, "ATIP end_lba %d > overall %d", end_lba, lba); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } } } else if(profile_no == 0x14) { ret= burn_disc_get_phys_format_info(drive, &disk_category, &book_name, &part_version, &num_layers, &num_blocks, 0); if(ret == 1 && num_blocks > lba) lba= num_blocks; } if(drive_role == 4 || is_bdr_pow) num_free_text = "unused"; else num_free_text = "writable"; sprintf(respt, "Media blocks : %d readable , %d %s , %d overall\n", num_data, (int) num_free, num_free_text, lba); Xorriso_toc_line(xorriso, flag & 8); } if(s == BURN_DISC_BLANK) { sprintf(respt, "Media summary: 0 sessions, 0 data blocks, 0 data"); num_free= isoburn_disc_available_space(drive, NULL); Sfile_scale((double) num_free, mem_text,5,1e4,1); sprintf(respt+strlen(respt), ", %s free\n", mem_text); Xorriso_toc_line(xorriso, flag & 8); } if(s != BURN_DISC_FULL && s != BURN_DISC_APPENDABLE) {ret= 1; goto ex;} if(xorriso->request_to_abort) {ret= 1; goto ex;} if(is_bdr_pow) { sprintf(respt, "Media summary: unsuitable Pseudo Overwrite formatted BD-R\n"); Xorriso_toc_line(xorriso, flag & 8); {ret= 1; goto ex;} } if(!(flag & 2)) Xorriso_show_boot_info(xorriso, 1 | (flag & 8) | ((flag & 1) << 1)); if(xorriso->isofs_size > 0 && !(flag & 3)) { sprintf(respt, "ISO offers :%s%s%s%s\n", xorriso->isofs_has_what & 1 ? " Rock_Ridge" : "", xorriso->isofs_has_what & 2 ? " Joliet" : "", xorriso->isofs_has_what & 4 ? " ISO_9660_1999" : "", xorriso->isofs_has_what & 7 ? "" : " Only_ECMA_119"); Xorriso_toc_line(xorriso, flag & 8); sprintf(respt, "ISO loaded : %s\n", xorriso->tree_loaded == 1 ? "Joliet" : xorriso->tree_loaded == 2 ? "ISO_9660_1999" : xorriso->rr_loaded > 0 ? "Rock_Ridge" : "Only_ECMA_119"); Xorriso_toc_line(xorriso, flag & 8); } disc= isoburn_toc_drive_get_disc(drive); if(flag & 4) sprintf(respt, "TOC layout : %3s , %9s , %10s\n", "Idx", "sbsector", "Size"); else sprintf(respt, "TOC layout : %3s , %9s , %10s , %s\n", "Idx", "sbsector", "Size", "Volume Id"); if(!(flag&1)) Xorriso_toc_line(xorriso, flag & 8); if (disc==NULL) { Xorriso_process_msg_queues(xorriso,0); if(drive_role == 5 && s == BURN_DISC_APPENDABLE) { ret= burn_disc_track_lba_nwa(drive, NULL, 0, &lba, &nwa); if(ret != 1) lba= 0; } else { ret= isoburn_get_min_start_byte(drive, &start_byte, 0); nwa= start_byte / 2048; if(ret<=0) { Xorriso_process_msg_queues(xorriso,0); if(flag&1) {ret= 1; goto ex;} sprintf(xorriso->info_text, "Cannot obtain Table Of Content"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } } /* fabricate TOC */ typetext= "Other session"; if(flag & 4) { ret= 0; typetext= "Session "; } else ret= isoburn_read_iso_head(drive, 0, &image_blocks, volume_id, 1); if(ret>0) { sprintf(respt, "ISO session : %3d , %9d , %9ds , %s\n", 1, 0, image_blocks, volume_id); nwa= image_blocks; } else { ret= burn_disc_get_formats(drive, &status, &size, &dummy, &num_formats); if(ret <= 0 || status != BURN_FORMAT_IS_FORMATTED) size= 0; if(size <= 0) { ret= burn_get_read_capacity(drive, &num_data, 0); if(ret == 1) size= ((off_t) num_data) * (off_t) 2048; } else { num_data_from_format= 1; } nwa= lba + size / 2048; num_data= nwa - lba; sprintf(respt, "%13s: %3d , %9d , %9ds , \n", typetext, 1, lba, num_data); } if(!(flag&1)) Xorriso_toc_line(xorriso, flag & 8); num_sessions= 1; } else { num_data= other_data= 0; sessions= isoburn_toc_disc_get_sessions(disc, &num_sessions); open_sessions= isoburn_toc_disc_get_incmpl_sess(disc); for (session_no= 0; session_no < num_sessions + open_sessions && !(xorriso->request_to_abort); session_no++) { num_session_data= num_session_other= 0; tracks= isoburn_toc_session_get_tracks(sessions[session_no], &num_tracks); if (tracks == NULL || num_tracks <= 0) continue; if(session_no == num_sessions + open_sessions - 1 && open_sessions > 0) have_real_open_session= 1; for(track_no= 0; track_norequest_to_abort); track_no++) { track_count++; is_data= 0; isoburn_toc_track_get_entry(tracks[track_no], &toc_entry); if((toc_entry.control & 7) >= 4) /* data track */ is_data= 1; if (toc_entry.extensions_valid & 1) { /* DVD extension valid */ lba= toc_entry.start_lba; track_size= toc_entry.track_blocks; } else { lba= burn_msf_to_lba(toc_entry.pmin, toc_entry.psec, toc_entry.pframe); if(track_no==num_tracks-1) { isoburn_toc_session_get_leadout_entry(sessions[session_no], &next_toc_entry); } else { isoburn_toc_track_get_entry(tracks[track_no+1], &next_toc_entry); } track_size= burn_msf_to_lba(next_toc_entry.pmin, next_toc_entry.psec, next_toc_entry.pframe) - lba; } if((flag & (1 | 4)) || !is_data) { ret= 0; } else { ret= isoburn_toc_track_get_emul(tracks[track_no], &emul_lba, &image_blocks, volume_id, 0); if(ret <= 0) ret= isoburn_read_iso_head(drive, lba, &image_blocks, volume_id, 1); if(image_blocks > track_size) { sprintf(xorriso->info_text, "Session %d bears ISO image size %ds larger than track size %ds", session_no + 1, image_blocks, track_size); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); image_blocks= track_size; } } if(session_no >= num_sessions && track_no == 0) { if(ret <= 0) volume_id[0]= 0; sprintf(respt, "Incmp session: %3d , %9d , %9ds , %s\n", session_no+1, lba, image_blocks, volume_id); } else if(ret>0 && track_no==0) { sprintf(respt, "ISO session : %3d , %9d , %9ds , %s\n", session_no+1, lba, image_blocks , volume_id); } else if(ret>0) { sprintf(respt, "ISO track : %3d , %9d , %9ds , %s\n", track_count, lba, image_blocks , volume_id); } else if(track_no==0) { typetext= "Other session"; if(flag & 4) typetext= "Session "; sprintf(respt, "%13s: %3d , %9d , %9ds , \n", typetext, session_no+1, lba, track_size); } else { typetext= "Other track "; if(flag & 4) typetext= "Track "; sprintf(respt, "%13s: %3d , %9d , %9ds , \n", typetext, track_count, lba, track_size); } if(!(flag&1)) Xorriso_toc_line(xorriso, flag & 8); if(is_data) num_session_data+= track_size; else num_session_other+= track_size; if(track_no == 0) first_track_start= lba; } isoburn_toc_session_get_leadout_entry(sessions[session_no], &toc_entry); if (toc_entry.extensions_valid & 1) { lba= toc_entry.start_lba; } else { lba= burn_msf_to_lba(toc_entry.pmin, toc_entry.psec, toc_entry.pframe); } session_size= lba - first_track_start; if(num_session_data > 0 && num_session_other > 0) { num_data+= num_session_data; other_data+= num_session_other; } else if(is_data) { num_data+= session_size; } else { other_data+= session_size; } } } if(xorriso->request_to_abort) {ret= 1; goto ex;} Sfile_scale(((double) num_data) * 2048.0, mem_text,5,1e4,1); sessions_seen= num_sessions + open_sessions; if(open_sessions > 0 && !have_real_open_session) sessions_seen--; sprintf(respt, "Media summary: %d session%s, %d data blocks, %s data", sessions_seen, (sessions_seen == 1 ? "" : "s"), num_data, mem_text); if(num_data_from_format) num_free= 0; else num_free= isoburn_disc_available_space(drive, NULL); Sfile_scale((double) num_free, mem_text,5,1e4,1); sprintf(respt+strlen(respt), ", %s free", mem_text); sprintf(respt+strlen(respt), "\n"); Xorriso_toc_line(xorriso, flag & 8); if(other_data > 0) { sprintf(respt, "Non-data blks: %d\n", other_data); Xorriso_toc_line(xorriso, flag & 8); } if (s==BURN_DISC_APPENDABLE && nwa!=0) { ret= isoburn_disc_track_lba_nwa(drive, NULL, 0, &lba, &nwa); if(ret>0) { sprintf(respt, "Media nwa : %ds\n", nwa); if(!(flag&1)) Xorriso_toc_line(xorriso, flag & 8); } } if(profile_no == 0x41 && sessions_seen >= 300) { sprintf(xorriso->info_text, "Sequential BD-R medium now contains %d sessions. It is likely to soon fail writing.", sessions_seen); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } if(have_real_open_session) { sprintf(xorriso->info_text, "Incomplete session encountered !"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } ret= 1; ex:; Xorriso_process_msg_queues(xorriso,0); if (disc!=NULL) isoburn_toc_disc_free(disc); return(ret); } /* @param flag bit0= try to find 'meaningful' links for enumerated devices */ int Xorriso_show_devices(struct XorrisO *xorriso, int flag) { char *adr= NULL, *link_adr= NULL, *adrpt; int i, j, max_dev_len= 1, pad, ret; struct burn_drive_info *drive_list= NULL; unsigned int drive_count; char *respt, perms[8]; struct stat stbuf; Xorriso_alloc_meM(adr, char, BURN_DRIVE_ADR_LEN); Xorriso_alloc_meM(link_adr, char, BURN_DRIVE_ADR_LEN); sprintf(xorriso->info_text, "Beginning to scan for devices ...\n"); Xorriso_info(xorriso,0); burn_drive_clear_whitelist(); while(!burn_drive_scan(&drive_list, &drive_count)) { Xorriso_process_msg_queues(xorriso,0); usleep(100000); } Xorriso_process_msg_queues(xorriso,0); if(drive_count == 0) { /* >>> was a drive_list created at all ? */ /* >>> must it be freed ? */ sprintf(xorriso->info_text, "No drives found"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } sprintf(xorriso->info_text, "Full drive scan done\n"); Xorriso_info(xorriso,0); sprintf(xorriso->info_text, "-----------------------------------------------------------------------------\n"); Xorriso_info(xorriso,0); respt= xorriso->result_line; for(i= 0; i < (int) drive_count && !(xorriso->request_to_abort); i++) { if(burn_drive_get_adr(&(drive_list[i]), adr)<=0) strcpy(adr, "-get_adr_failed-"); Xorriso_process_msg_queues(xorriso,0); adrpt= adr; if(flag & 1) { ret= burn_lookup_device_link(adr, link_adr, "/dev", NULL, 0, 0); if(ret < 0) goto ex; if(ret == 1) adrpt= link_adr; } if((int) strlen(adrpt) > max_dev_len) max_dev_len= strlen(adrpt); } for(i= 0; i < (int) drive_count && !(xorriso->request_to_abort); i++) { if(burn_drive_get_adr(&(drive_list[i]), adr)<=0) strcpy(adr, "-get_adr_failed-"); Xorriso_process_msg_queues(xorriso,0); if(stat(adr,&stbuf)==-1) { sprintf(perms,"errno=%d",errno); } else { strcpy(perms,"------"); if(stbuf.st_mode&S_IRUSR) perms[0]= 'r'; if(stbuf.st_mode&S_IWUSR) perms[1]= 'w'; if(stbuf.st_mode&S_IRGRP) perms[2]= 'r'; if(stbuf.st_mode&S_IWGRP) perms[3]= 'w'; if(stbuf.st_mode&S_IROTH) perms[4]= 'r'; if(stbuf.st_mode&S_IWOTH) perms[5]= 'w'; } adrpt= adr; if(flag & 1) { ret= burn_lookup_device_link(adr, link_adr, "/dev", NULL, 0, 0); if(ret < 0) goto ex; if(ret == 1) adrpt= link_adr; } sprintf(respt, "%d -dev '%s' ", i, adrpt); pad= max_dev_len-strlen(adrpt); if(pad>0) for(j= 0; jinfo_text, "-----------------------------------------------------------------------------\n"); Xorriso_info(xorriso,0); burn_drive_info_free(drive_list); ret= 1; ex:; Xorriso_process_msg_queues(xorriso,0); Xorriso_free_meM(adr); Xorriso_free_meM(link_adr); return(ret); } int Xorriso_tell_media_space(struct XorrisO *xorriso, int *media_space, int *free_space, int flag) { int ret; struct burn_drive_info *dinfo; struct burn_drive *drive; struct burn_write_opts *burn_options; (*free_space)= (*media_space)= 0; ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to -tell_media_space", 2); if(ret<=0) return(0); ret= Xorriso_make_write_options(xorriso, drive, &burn_options, 0); if(ret<=0) return(-1); (*free_space)= (*media_space)= isoburn_disc_available_space(drive, burn_options) / (off_t) 2048; burn_write_opts_free(burn_options); if(Xorriso_change_is_pending(xorriso, 0)) { ret= Xorriso_write_session(xorriso, 1); if(ret>0) { (*free_space)-= ret; } else { Xorriso_process_msg_queues(xorriso,0); return(0); } } Xorriso_process_msg_queues(xorriso,0); return(1); } /* @return <=0 error, 1 success */ int Xorriso_list_formats(struct XorrisO *xorriso, int flag) { int ret, i, status, num_formats, profile_no, type, alloc_blocks, free_blocks; off_t size; unsigned dummy; char status_text[80], profile_name[90], *respt; struct burn_drive_info *dinfo; struct burn_drive *drive; respt= xorriso->result_line; ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to obtain format descriptor list", 1 | 2); if(ret<=0) return(0); if(ret == 2) goto ex; ret = burn_disc_get_formats(drive, &status, &size, &dummy, &num_formats); if(ret<=0) { sprintf(xorriso->info_text, "Cannot obtain format list info"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 0; goto ex; } ret= Xorriso_toc(xorriso, 3); if(ret<=0) goto ex; ret= burn_disc_get_profile(drive, &profile_no, profile_name); if(ret<=0) goto ex; if(status == BURN_FORMAT_IS_UNFORMATTED) sprintf(status_text, "unformatted, up to %.1f MiB", ((double) size) / 1024.0 / 1024.0); else if(status == BURN_FORMAT_IS_FORMATTED) { if(profile_no==0x12 || profile_no==0x13 || profile_no==0x1a || profile_no==0x43) sprintf(status_text, "formatted, with %.1f MiB", ((double) size) / 1024.0 / 1024.0); else sprintf(status_text, "written, with %.1f MiB", ((double) size) / 1024.0 / 1024.0); } else if(status == BURN_FORMAT_IS_UNKNOWN) { if (profile_no > 0) sprintf(status_text, "intermediate or unknown"); else sprintf(status_text, "no media or unknown media"); } else sprintf(status_text, "illegal status according to MMC-5"); sprintf(respt, "Format status: %s\n", status_text); Xorriso_result(xorriso,0); ret= burn_disc_get_bd_spare_info(drive, &alloc_blocks, &free_blocks, 0); if(ret == 1) { sprintf(respt, "BD Spare Area: %d blocks consumed, %d blocks available\n", alloc_blocks - free_blocks, free_blocks); Xorriso_result(xorriso,0); } for (i= 0; i < num_formats; i++) { ret= burn_disc_get_format_descr(drive, i, &type, &size, &dummy); if (ret <= 0) continue; sprintf(respt, "Format idx %-2d: %2.2Xh , %.fs , %.1f MiB\n", i, type, ((double) size) / 2048.0, ((double) size) / 1024.0/1024.0); Xorriso_result(xorriso,0); } ret= 1; ex:; return(ret); } /* @param flag bit0= This is write speed. Consider the existence of combo drives (e.g. DVD-ROM/CD-RW or BD-ROM/DVD+-RW) */ int Xorriso_choose_speed_factor(struct XorrisO *xorriso, int speed, int profile, struct burn_drive *drive, double *speed_factor, char **speed_unit, int flag) { int i, no_dvd_read= 1, no_dvd_write= 1, no_bd_read= 1, no_bd_write= 1, ret; int num_profiles, profiles[64]; char is_current[64]; *speed_unit= "D"; *speed_factor= 1385000.0; if((flag & 1) || profile == 0x00) { ret= burn_drive_get_all_profiles(drive, &num_profiles, profiles, is_current); if(ret > 0) { for(i= 0; i < num_profiles; i++) { if(profiles[i] > 0x10 && profiles[i] < 0x30) no_dvd_read= no_dvd_write= 0; else if(profiles[i] == 0x10) no_dvd_read= 0; else if(profiles[i] > 0x40 && profiles[i] <= 0x43) no_bd_read= no_bd_write= 0; else if(profiles[i] == 0x40) no_bd_read= 0; } } } if(profile == 0x00) { /* No medium loaded, guess from profile list */ if(flag & 1) { if(no_bd_write && no_dvd_write) *speed_unit= "C"; else if(!no_bd_write) *speed_unit= "B"; } else { if(no_bd_read && no_dvd_read) *speed_unit= "C"; else if(!no_bd_read) *speed_unit= "B"; } } else if((profile > 0x00 && profile <= 0x0a) || (((no_dvd_write && no_bd_write) && (flag & 1)))) { *speed_unit= "C"; } else if((profile >= 0x40 && profile <= 0x43) && !(no_bd_write && (flag & 1))) { *speed_unit= "B"; } if((*speed_unit)[0] == 'C') *speed_factor= 75.0 * 2352.0; else if((*speed_unit)[0] == 'B') *speed_factor= 4495625.0; return(1); } /* For sorting the int *speeds array */ int Xorriso__reverse_int_cmp(const void *a, const void *b) { int diff; diff= *((int *) a) - *((int *) b); if(diff < 0) return(1); else if(diff > 0) return(-1); return(0); } /* @flag bit0= do not issue TOC bit1= Report about outdev (else indev) bit2= Report about write speed (else read speed) @return <=0 error, 1 success */ int Xorriso_list_speeds_sub(struct XorrisO *xorriso, int flag) { int ret, high= -1, low= 0x7fffffff, is_cd= 0, i, speed, profile= 0; int inout_flag, prev_speed= -1, speed_count= 0; int *speeds= NULL; char *respt, *speed_unit= "D"; double speed_factor= 1385000.0, cd_factor= 75.0 * 2352; struct burn_drive_info *dinfo; struct burn_drive *drive; struct burn_speed_descriptor *speed_list= NULL, *item, *other; respt= xorriso->result_line; inout_flag= (flag & 2); if(inout_flag && xorriso->out_drive_handle == NULL) inout_flag= 0; else if(xorriso->in_drive_handle == NULL) inout_flag= 2; ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to obtain speed descriptor list", 1 | inout_flag); if(ret<=0) return(0); if(ret == 2) goto ex; ret= burn_drive_get_speedlist(drive, &speed_list); if(ret < 0) { sprintf(xorriso->info_text, "Cannot obtain speed list info"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 0; goto ex; } if(!(flag & 1)) { ret= Xorriso_toc(xorriso, 1 | inout_flag); if(ret<=0) { sprintf(xorriso->info_text, "Cannot obtain overview of drive and media content"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 0; goto ex; } } speed_count= 0; for(item= speed_list; item != NULL; item= item->next) speed_count++; if(speed_count > 0) Xorriso_alloc_meM(speeds, int, speed_count); speed_count= 0; for(item= speed_list; item != NULL; item= item->next) { sprintf(xorriso->info_text, "read_speed= %5dk , write_speed= %5dk , source= %d", item->read_speed, item->write_speed, item->source); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); if(item->source == 1) { /* CD mode page 2Ah : report only if not same speed by GET PERFORMANCE */ if(!(flag & 4)) continue; /* 2Ah only tells write speed */ for(other= speed_list; other != NULL; other= other->next) if(other->source == 2 && item->write_speed == other->write_speed) break; if(other != NULL) continue; } if(flag & 4) { if(item->write_speed <= 0) continue; speed= item->write_speed; } else { if(item->read_speed <= 0) continue; speed= item->read_speed; } speeds[speed_count]= speed; if(item->profile_loaded > 0) profile= item->profile_loaded; speed_count++; } if(speed_count > 0) qsort(speeds, (size_t) speed_count, sizeof(int), Xorriso__reverse_int_cmp); if(profile >= 0x08 && profile <= 0x0a) is_cd= profile; for(i= 0; i < speed_count; i++) { speed= speeds[i]; if(speed == prev_speed) continue; prev_speed= speed; if(flag & 4) sprintf(respt, "Write speed : "); else sprintf(respt, "Read speed : "); Xorriso_choose_speed_factor(xorriso, speed, profile, drive, &speed_factor, &speed_unit, !!(flag & 4)); sprintf(respt + strlen(respt), " %5dk , %4.1fx%s\n", speed, ((double) speed) * 1000.0 / speed_factor, speed_unit); Xorriso_result(xorriso,0); if(speed > high) high= speed; if(speed < low) low= speed; } /* Maybe there is ATIP info (about write speed only) */ if(is_cd && (flag & 4)) { ret= burn_disc_read_atip(drive); if(ret < 0) goto ex; if(ret > 0) { for(i= 0; i < 2; i++) { if(i == 0) ret= burn_drive_get_min_write_speed(drive); else ret= burn_drive_get_write_speed(drive); if(ret > 0) { if(ret < low || (i == 0 && ret != low)) { sprintf(respt, "Write speed l: "); sprintf(respt + strlen(respt), " %5dk , %4.1fx%s\n", ret, ((double) ret) * 1000.0 / cd_factor, "C"); Xorriso_result(xorriso,0); low= ret; } if(ret > high || (i == 1 && ret != high)) { sprintf(respt, "Write speed h: "); sprintf(respt + strlen(respt), " %5dk , %4.1fx%s\n", ret, ((double) ret) * 1000.0 / cd_factor, "C"); Xorriso_result(xorriso,0); high= ret; } } } } } if(high > -1) { Xorriso_choose_speed_factor(xorriso, low, profile, drive, &speed_factor, &speed_unit, !!(flag & 4)); if(flag & 4) sprintf(respt, "Write speed L: "); else sprintf(respt, "Read speed L : "); sprintf(respt + strlen(respt), " %5dk , %4.1fx%s\n", low, ((double) low) * 1000.0 / speed_factor, speed_unit); Xorriso_result(xorriso,0); Xorriso_choose_speed_factor(xorriso, low, profile, drive, &speed_factor, &speed_unit, !!(flag & 4)); if(flag & 4) sprintf(respt, "Write speed H: "); else sprintf(respt, "Read speed H : "); sprintf(respt + strlen(respt), " %5dk , %4.1fx%s\n", high, ((double) high) * 1000.0 / speed_factor, speed_unit); Xorriso_result(xorriso,0); ret= burn_drive_get_best_speed(drive, 0, &item, 2); if(ret > 0 && item != NULL && (flag & 4)) if(item->write_speed != high) { sprintf(respt, "Write speed 0: %5dk , %4.1fx%s\n", item->write_speed, ((double) item->write_speed) * 1000.0 / speed_factor, speed_unit); Xorriso_result(xorriso,0); } } else { sprintf(xorriso->info_text, "Could not get any %s speed information from drive", (flag & 4) ? "write" : "read"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= 2; goto ex; } ret= 1; ex:; if(speed_list != NULL) burn_drive_free_speedlist(&speed_list); Xorriso_free_meM(speeds); return(ret); } int Xorriso_list_speeds(struct XorrisO *xorriso, int flag) { int ret; if(xorriso->out_drive_handle == NULL && xorriso->in_drive_handle == NULL) { Xorriso_msgs_submit(xorriso, 0, "No drive acquired on attempt to list speeds", 0, "FAILURE", 0); return(0); } if(xorriso->in_drive_handle != NULL) { ret= Xorriso_list_speeds_sub(xorriso, 0); if(ret <= 0) return(ret); } if(xorriso->out_drive_handle != NULL && xorriso->out_drive_handle != xorriso->in_drive_handle) { ret= Xorriso_list_speeds_sub(xorriso, 2); if(ret <= 0) return(ret); } if(xorriso->out_drive_handle != NULL) { ret= Xorriso_list_speeds_sub(xorriso, 1 | 2 | 4); if(ret <= 0) return(ret); } return(1); } /* @param flag bit0= cdrecord style bit1= obtain outdrive, else indrive @return <=0 error, 1 success */ int Xorriso_list_profiles(struct XorrisO *xorriso, int flag) { int ret, i; struct burn_drive_info *dinfo; struct burn_drive *drive; int num_profiles, profiles[64]; char is_current[64], profile_name[90], *respt; respt= xorriso->result_line; ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to obtain profile list", 1 | (flag & 2)); if(ret<=0) return(0); burn_drive_get_all_profiles(drive, &num_profiles, profiles, is_current); for(i= 0; i < num_profiles; i++) { ret= burn_obtain_profile_name(profiles[i], profile_name); if(ret <= 0) strcpy(profile_name, "unknown"); sprintf(respt, "%s 0x%4.4X (%s)%s\n", flag & 1 ? "Profile:" : "Profile :", (unsigned int) profiles[i], profile_name, is_current[i] ? " (current)" : ""); Xorriso_result(xorriso,0); } return(1); } /* @param flag bit0= -inq bit1= -checkdrive */ int Xorriso_atip(struct XorrisO *xorriso, int flag) { int ret, profile_number= 0, is_bdr_pow= 0; int num_profiles= 0, profiles[64], i, can_write= 0, pf, no_medium= 0; char is_current[64]; char *respt, profile_name[80]; double x_speed_max, x_speed_min= -1.0; struct burn_drive_info *dinfo; struct burn_drive *drive; enum burn_disc_status s; char *manuf= NULL, *media_code1= NULL, *media_code2= NULL; char *book_type= NULL, *product_id= NULL; ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to print drive and media info", 2); if(ret<=0) return(0); respt= xorriso->result_line; sprintf(respt, "Device type : "); ret= burn_drive_get_drive_role(drive); if(ret==0) sprintf(respt+strlen(respt), "%s\n", "Emulated (null-drive)"); else if(ret==2) sprintf(respt+strlen(respt), "%s\n", "Emulated (stdio-drive, 2k random read-write)"); else if(ret==3) sprintf(respt+strlen(respt), "%s\n", "Emulated (stdio-drive, sequential write-only)"); else if(ret == 4) sprintf(respt+strlen(respt), "%s\n", "Emulated (stdio-drive, 2k random read-only)"); else if(ret == 5) sprintf(respt+strlen(respt), "%s\n", "Emulated (stdio-drive, 2k random write-only)"); else if(ret!=1) sprintf(respt+strlen(respt), "%s\n","Emulated (stdio-drive)"); else sprintf(respt+strlen(respt), "%s\n","Removable CD-ROM"); sprintf(respt+strlen(respt), "Vendor_info : '%s'\n",dinfo->vendor); sprintf(respt+strlen(respt), "Identifikation : '%s'\n",dinfo->product); sprintf(respt+strlen(respt), "Revision : '%s'\n",dinfo->revision); Xorriso_result(xorriso,1); if(flag&1) return(1); /* Do not report "Supported modes: SAO TAO" with -ROM drives */ burn_drive_get_all_profiles(drive, &num_profiles, profiles, is_current); if(num_profiles > 0) { for(i= 0; i < num_profiles; i++) { pf= profiles[i]; if(pf == 0x09 || pf == 0x0a || pf == 0x11 || pf == 0x12 || pf == 0x13 || pf == 0x14 || pf == 0x15 || pf == 0x1a || pf == 0x1b || pf == 0x2b || pf == 0x41 || pf == 0x43 || pf == 0xffff) { can_write= 1; break; } } } else can_write= 1; if(can_write) { sprintf(respt, "Driver flags : BURNFREE\n"); sprintf(respt+strlen(respt), "Supported modes: SAO TAO\n"); Xorriso_result(xorriso,1); } else if(flag & 2) { sprintf(xorriso->info_text, "Not a CD/DVD/BD recorder"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } if(flag&2) return(1); is_bdr_pow= burn_drive_get_bd_r_pow(drive); s= burn_disc_get_status(drive); ret= burn_disc_get_profile(drive,&profile_number,profile_name); if(ret<=0) { profile_number= 0; strcpy(profile_name, "-unidentified-"); } if(s != BURN_DISC_UNSUITABLE) { ret= burn_disc_read_atip(drive); if(ret>0) { ret= burn_drive_get_min_write_speed(drive); x_speed_min= ((double) ret)/176.4; } } if(s==BURN_DISC_EMPTY) { sprintf(respt, "Current: none\n"); Xorriso_result(xorriso,1); sprintf(xorriso->info_text, "No recognizable medium found in drive"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); no_medium= 1; } else sprintf(respt, "Current: %s%s\n",profile_name, is_bdr_pow ? ", Pseudo Overwrite formatted" : ""); Xorriso_result(xorriso,1); Xorriso_list_profiles(xorriso, 1 | 2); if(no_medium) return(1); if(strstr(profile_name,"BD")==profile_name) { printf("Mounted Media: %2.2Xh, %s\n", profile_number, profile_name); } else if(strstr(profile_name,"DVD")==profile_name) { sprintf(respt, "book type: %s (emulated booktype)\n", profile_name); Xorriso_result(xorriso,1); if(profile_number == 0x13) { sprintf(respt, "xorriso: message for sdvdbackup: \"(growisofs mode Restricted Overwrite)\"\n"); Xorriso_result(xorriso,1); } } else { sprintf(respt, "ATIP info from disk:\n"); Xorriso_result(xorriso,1); if(burn_disc_erasable(drive)) sprintf(respt, " Is erasable\n"); else sprintf(respt, " Is not erasable\n"); Xorriso_result(xorriso,1); { int start_lba,end_lba,min,sec,fr; ret= burn_drive_get_start_end_lba(drive,&start_lba,&end_lba,0); if(ret>0) { burn_lba_to_msf(start_lba,&min,&sec,&fr); sprintf(respt, " ATIP start of lead in: %d (%-2.2d:%-2.2d/%-2.2d)\n", start_lba,min,sec,fr); Xorriso_result(xorriso,1); burn_lba_to_msf(end_lba,&min,&sec,&fr); sprintf(respt, " ATIP start of lead out: %d (%-2.2d:%-2.2d/%-2.2d)\n", end_lba,min,sec,fr); Xorriso_result(xorriso,1); } } ret= burn_drive_get_write_speed(drive); x_speed_max= ((double) ret)/176.4; if(x_speed_min<0) x_speed_min= x_speed_max; sprintf(respt, " 1T speed low: %.f 1T speed high: %.f\n",x_speed_min,x_speed_max); Xorriso_result(xorriso,1); } ret= burn_disc_get_media_id(drive, &product_id, &media_code1, &media_code2, &book_type, 0); if(ret > 0 && media_code1 != NULL && media_code2 != NULL) manuf= burn_guess_manufacturer(profile_number, media_code1, media_code2, 0); if(product_id != NULL) { sprintf(respt, "Product Id: %s\n", product_id); Xorriso_result(xorriso,1); } if(manuf != NULL) { sprintf(respt, "Producer: %s\n", manuf); Xorriso_result(xorriso, 1); } if(profile_number == 0x09 || profile_number == 0x0a) { sprintf(respt, "Manufacturer: %s\n", manuf); Xorriso_result(xorriso, 1); } else if(product_id != NULL && media_code1 != NULL && media_code2 != NULL){ free(product_id); free(media_code1); free(media_code2); if(book_type != NULL) free(book_type); product_id= media_code1= media_code2= book_type= NULL; ret= burn_disc_get_media_id(drive, &product_id, &media_code1, &media_code2, &book_type, 1); if(ret > 0) { sprintf(respt, "Manufacturer: '%s'\n", media_code1); Xorriso_result(xorriso, 1); if(media_code2[0]) { sprintf(respt, "Media type: '%s'\n", media_code2); Xorriso_result(xorriso, 1); } } } if(manuf != NULL) free(manuf); if(media_code1 != NULL) free(media_code1); if(media_code2 != NULL) free(media_code2); if(book_type != NULL) free(book_type); if(product_id != NULL) free(product_id); return(1); } /* @param flag bit1= outdev rather than indev @return <0 error, 0 = no profile to see , 1= ok , 2= ok, is CD profile 3= ok, is BD profile */ int Xorriso_get_profile(struct XorrisO *xorriso, int *profile_number, char profile_name[80], int flag) { int ret; struct burn_drive_info *dinfo; struct burn_drive *drive; *profile_number= 0; profile_name[0]= 0; if(((flag&2) && xorriso->out_drive_handle==NULL) || ((!(flag&2)) && xorriso->in_drive_handle==NULL)) return(0); ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to determine media type", flag&2); if(ret<=0) return(0); ret=burn_disc_get_profile(drive, profile_number, profile_name); if(ret<=0) return(ret); if(*profile_number==0x08 || *profile_number==0x09 || *profile_number==0x0a) return(2); if(*profile_number == 0x40 || *profile_number == 0x41 || *profile_number == 0x42 || *profile_number == 0x43) return(3); return(0); } /* @param flag bit0= grow_overwriteable_iso bit1= obtain info from outdev bit2= no need to obtain msc2 (NWA) */ int Xorriso_msinfo(struct XorrisO *xorriso, int *msc1, int *msc2, int flag) { int ret, dummy, is_bdr_pow= 0; struct burn_drive *drive; struct burn_drive_info *dinfo; enum burn_disc_status disc_state; *msc1= *msc2= -1; ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to obtain msinfo", flag&2); if(ret<=0) return(ret); is_bdr_pow= burn_drive_get_bd_r_pow(drive); if(is_bdr_pow) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "%s medium is unsuitably POW formatted BD-R. Cannot obtain -msinfo.", (flag&2) ? "Output" : "Input"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(flag&1) disc_state= isoburn_disc_get_status(drive); else disc_state= burn_disc_get_status(drive); if(disc_state != BURN_DISC_APPENDABLE && !(disc_state == BURN_DISC_FULL && (flag & 4))) { Xorriso_process_msg_queues(xorriso,0); if(!(flag & 4)) { sprintf(xorriso->info_text, "%s medium is not appendable. Cannot obtain -msinfo.", (flag&2) ? "Output" : "Input"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } return(0); } ret= isoburn_disc_get_msc1(drive, msc1); if(ret<=0) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "Cannot obtain address of most recent session"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(flag & 4) return(1); ret= isoburn_disc_track_lba_nwa(drive, NULL, 0, &dummy, msc2); if(ret<0) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "Cannot obtain next writeable address on media"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* @param flag bit0=input drive bit1=output drive bit2= wake up rather than calm down */ int Xorriso_drive_snooze(struct XorrisO *xorriso, int flag) { int in_is_out_too, ret; struct burn_drive_info *dinfo; struct burn_drive *drive; in_is_out_too= (xorriso->in_drive_handle == xorriso->out_drive_handle); if((flag & 1) && xorriso->in_drive_handle != NULL) { Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to calm drive", 0); burn_drive_snooze(drive, !!(flag & 4)); if(in_is_out_too) {ret= 1; goto ex;} } if((flag&2) && xorriso->out_drive_handle!=NULL) { Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to calm drive", 2); burn_drive_snooze(drive, !!(flag & 4)); } ret= 1; ex:; Xorriso_process_msg_queues(xorriso,0); return(ret); } /* @param flag bit0= enable SCSI command logging to stderr */ int Xorriso_scsi_log(struct XorrisO *xorriso, int flag) { if(flag == 0) burn_set_scsi_logging(0); else burn_set_scsi_logging(2|4); return(1); } int Xorriso_check_md5_range(struct XorrisO *xorriso, off_t start_lba, off_t end_lba, char md5[16], int flag) { int ret, us_corr = 0; struct burn_drive_info *dinfo= NULL; struct burn_drive *drive= NULL; off_t pos, data_count, to_read, slowdown_count= 0; char *data= NULL, data_md5[16]; void *ctx = NULL; struct timeval prev_time; ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to check session MD5 checksum", 0); if(ret <= 0) goto ex; Xorriso_alloc_meM(data, char, 64 * 1024); ret= iso_md5_start(&ctx); if(ret <= 0) { Xorriso_no_malloc_memory(xorriso, NULL, 0); goto ex; } if(xorriso->read_speed_force > 0) /* initialize forced speed limit */ burn_nominal_slowdown(xorriso->read_speed_force, xorriso->read_speed_corr, &prev_time, &us_corr, (off_t) 0, 1); Xorriso_set_speed(xorriso, drive, xorriso->read_speed, 0, 1); Xorriso_process_msg_queues(xorriso,0); for(pos= start_lba; pos < end_lba; pos+= 32) { to_read= 32; if(pos + to_read > end_lba) to_read= end_lba - pos; ret= burn_read_data(drive, pos * (off_t) 2048, data, to_read * (off_t) 2048, &data_count, 0); if(ret <= 0) goto ex; iso_md5_compute(ctx, data, (int) data_count); if(xorriso->read_speed_force > 0 && pos + to_read <= end_lba) { slowdown_count+= data_count; if(slowdown_count >= 128 * 1024) { burn_nominal_slowdown(xorriso->read_speed_force, xorriso->read_speed_corr, &prev_time, &us_corr, slowdown_count, 0); slowdown_count= 0; } } xorriso->pacifier_count+= data_count; xorriso->pacifier_byte_count+= data_count; Xorriso_pacifier_callback(xorriso, "content bytes read", xorriso->pacifier_count, 0, "", 8); } iso_md5_end(&ctx, data_md5); ret= 1; if(! iso_md5_match(md5, data_md5)) ret= 0; ex:; Xorriso_process_msg_queues(xorriso,0); if(ctx != NULL) iso_md5_end(&ctx, data_md5); Xorriso_free_meM(data); return(ret); } int Xorriso_check_session_md5(struct XorrisO *xorriso, char *severity, int flag) { int ret, i; IsoImage *image; uint32_t start_lba, end_lba; char md5[16], md5_text[33]; ret= Xorriso_get_volume(xorriso, &image, 0); if(ret<=0) return(ret); ret= iso_image_get_session_md5(image, &start_lba, &end_lba, md5, 0); Xorriso_process_msg_queues(xorriso,0); if(ret < 0) return(ret); if(ret == 0) { sprintf(xorriso->info_text, "No session MD5 is recorded with the loaded session"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); return(0); } sprintf(xorriso->info_text, "Checking loaded session by its recorded MD5.\n"); Xorriso_info(xorriso, 0); for(i= 0; i < 16; i++) sprintf(md5_text + 2 * i, "%2.2x", ((unsigned char *) md5)[i]); sprintf(xorriso->result_line, "Session MD5 %s , LBA %.f , %.f blocks\n", md5_text, (double) start_lba, (double) end_lba - start_lba); Xorriso_result(xorriso,0); ret= Xorriso_check_md5_range(xorriso, (off_t) start_lba, (off_t) end_lba, md5, 0); return(ret); } int Xorriso_check_for_abort(struct XorrisO *xorriso, char *abort_file_path, double post_read_time, double *last_abort_file_time, int flag) { struct stat stbuf; if(abort_file_path[0] == 0) return(0); if(post_read_time - *last_abort_file_time >= 0.1) { if(stat(abort_file_path, &stbuf) != -1) { if(stbuf.st_mtime >= xorriso->start_time) { sprintf(xorriso->info_text, "-check_media: Found fresh abort_file=%s", abort_file_path); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(1); } } *last_abort_file_time= post_read_time; } return(0); } struct xorriso_md5_state { /* Resources */ struct XorrisO *xorriso; void *ctx; struct SpotlisT *spotlist; pthread_mutex_t spot_mutex; /* Checksum tag cursor */ uint32_t md5_start; uint32_t next_tag; int chain_broken; int in_track_gap; int was_sb_tag; int md5_spot_value; uint32_t md5_spot_lba; /* Asynchronous operation */ int slave_state; /* Operated by slave 0= not yet started 1= slave is started 2= slave has reached its end 3= slave failed to start */ int chunk_size; int num_chunks; char **chunk; int *chunk_state; /* 0= content invalid (set by boss at creation time), 1= content readable (set by boss), 2= content was read (set by MD5 slave), 3= end-of-processing (set by boss when done) */ int *chunk_fill; /* Actual number of valid bytes in chunk */ uint32_t *chunk_lba; int chunk_w_idx; /* Write index. Operated by boss */ int chunk_r_idx; /* Read index. Operated by MD5 slave */ off_t w_sleeps; off_t r_sleeps; }; int Xorriso__add_spot(struct xorriso_md5_state *state, int start_lba, int blocks, int quality, int flag) { int ret, uret; if(state->chunk != NULL) { ret= pthread_mutex_lock(&(state->spot_mutex)); if(ret != 0) return(0); } ret= Spotlist_add_item(state->spotlist, start_lba, blocks, quality, 0); if(state->chunk != NULL) { uret= pthread_mutex_unlock(&(state->spot_mutex)); if(uret != 0 && ret > 0) ret= 0; } return(ret); } int Xorriso_chunk_md5(struct XorrisO *xorriso, char *data, int to_read, uint32_t from_lba, struct xorriso_md5_state *state, int flag) { int j, ret= 0, valid, tag_type, decode_ret= 0; uint32_t lba, pos, range_start, range_size; char md5[16], tag_md5[16], *tag_type_name= "", *comparison, *sev_text; void *cloned_ctx= NULL; for(j= 0; j < to_read; j++) { lba= j + from_lba; if(lba < state->md5_start) continue; ret= decode_ret= 0; if(lba > state->md5_start + 16 && (state->next_tag == 0 || state->chain_broken || lba == state->next_tag)){ ret= iso_util_decode_md5_tag(data + j * 2048, &tag_type, &pos, &range_start, &range_size, &(state->next_tag), tag_md5, !!state->chain_broken); decode_ret= ret; } valid= (ret == 1 || ret == (int) ISO_MD5_AREA_CORRUPTED) && pos == lba; if(valid && tag_type == 2 && (lba < state->md5_start + 32 || state->in_track_gap)){ tag_type_name= "superblock"; state->was_sb_tag= 1; if(state->in_track_gap && range_start != state->md5_start && range_start < lba && lba - range_start <= (uint32_t) j) { /* Looking for next session : start computing in hindsight. Session start and superblock tag are supposed to be in the same 64 kB chunk. */ iso_md5_end(&(state->ctx), md5); ret= iso_md5_start(&(state->ctx)); if(ret < 0) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } iso_md5_compute(&(state->ctx), data + (j - (lba - range_start)) * 2048, (lba - range_start) * 2048); state->md5_start= range_start; state->in_track_gap= 0; } } else if(valid && tag_type == 4 && lba < 32) { tag_type_name= "relocated 64kB superblock"; }else if(valid && tag_type == 3 && state->was_sb_tag) { tag_type_name= "tree"; }else if(valid && tag_type == 1) { /* >>> ??? allow this without superblock and tree tag ? */ tag_type_name= "session"; } else { tag_type_name= ""; } if (tag_type_name[0]) { if(range_start != state->md5_start) { sprintf(xorriso->info_text, "Found MD5 %s tag which covers different data range", tag_type_name); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE",0); sprintf(xorriso->info_text, " Expected: %u Found: %u", (unsigned int) state->md5_start, range_start); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE",0); state->chain_broken= 1; valid= 0; } else { ret= iso_md5_clone(state->ctx, &cloned_ctx); if(ret <= 0) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } iso_md5_end(&cloned_ctx, md5); if(decode_ret == (int) ISO_MD5_AREA_CORRUPTED) { comparison= "CORRUPTED"; sev_text= "WARNING"; state->md5_spot_value= Xorriso_read_quality_md5_mismatcH; state->chain_broken= 1; } else if(! iso_md5_match(tag_md5, md5)) { comparison= "NON-MATCHING"; sev_text= "WARNING"; state->md5_spot_value= Xorriso_read_quality_md5_mismatcH; state->chain_broken= 1; } else { comparison= "matching"; sev_text= "UPDATE"; state->md5_spot_value= Xorriso_read_quality_md5_matcH; } state->md5_spot_lba= lba; sprintf(xorriso->info_text, "Found %s MD5 %s tag: start=%d size=%d", comparison, tag_type_name, state->md5_start, lba - state->md5_start); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, sev_text, 0); } if(valid && (tag_type == 1 || (tag_type == 4 && pos == lba && lba < 32))){ if(state->md5_spot_value != Xorriso_read_quality_untesteD) { ret= Xorriso__add_spot(state, state->md5_start, state->md5_spot_lba - state->md5_start, state->md5_spot_value, 0); if(ret <= 0) goto ex; } state->md5_spot_value= Xorriso_read_quality_untesteD; state->md5_start = lba + 1; if(state->md5_start % 32) state->md5_start= state->md5_start + (32 - (state->md5_start % 32)); state->next_tag= 0; iso_md5_end(&(state->ctx), md5); ret= iso_md5_start(&(state->ctx)); if(ret < 0) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } if(tag_type == 1) state->in_track_gap= 1; continue; } } iso_md5_compute(state->ctx, data + j * 2048, 2048); } ret= 1; ex:; return(ret); } static void *Xorriso__md5_slave(void *state_pt) { struct xorriso_md5_state *state; int ret, c_state, c_idx; static int u_wait= 1; state= state_pt; state->slave_state= 1; while(1) { c_idx= state->chunk_r_idx; c_state= state->chunk_state[c_idx]; if(c_state == 1) { ret= Xorriso_chunk_md5(state->xorriso, state->chunk[c_idx], state->chunk_fill[c_idx], state->chunk_lba[c_idx], state, 0); if(ret <= 0) goto ex; state->chunk_state[c_idx]= 2; state->chunk_r_idx= (c_idx + 1) % state->num_chunks; } else if(c_state == 3) { goto ex; } else { /* >>> have a timeout ? */; if(u_wait > 0) usleep(u_wait); state->r_sleeps++; } } ex:; state->slave_state= 2; return NULL; } int Xorriso_start_chunk_md5(struct XorrisO *xorriso, struct xorriso_md5_state *state, int flag) { int ret, u_wait= 1000; pthread_attr_t attr; pthread_attr_t *attr_pt = NULL; pthread_t thread; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); attr_pt= &attr; ret= pthread_create(&thread, attr_pt, Xorriso__md5_slave, state); if(ret != 0) { sprintf(xorriso->info_text, "-check_media: Cannot create thread for MD5 computation"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= 0; goto ex; } while(state->slave_state != 1) { /* >>> have a timeout ? */; /* >>> if this fails set state->slave_state= 3 */ usleep(u_wait); } ret= 1; ex:; return(ret); } int Xorriso__wait_chunk_md5(struct xorriso_md5_state *state, int u_wait, int flag) { if(state->chunk_state == NULL) return(1); while(state->chunk_state[state->chunk_w_idx] == 1) { /* >>> have a timeout ? */; usleep(u_wait); state->w_sleeps++; } return(1); } int Xorriso__wait_slave_md5_end(struct xorriso_md5_state *state, int u_wait, int flag) { while(state->slave_state == 1) { /* >>> have a timeout ? */; usleep(u_wait); } return(1); } int Xorriso__end_slave_md5(struct xorriso_md5_state *state, int u_wait, int flag) { int i, ret; /* Tell slave thread to end */ for(i= 0; i < state->num_chunks; i++) { ret= Xorriso__wait_chunk_md5(state, 10000, 0); if(ret <= 0) return(ret); state->chunk_state[state->chunk_w_idx]= 3; state->chunk_w_idx= (state->chunk_w_idx + 1) % state->num_chunks; } /* Wait for slave to end */ ret= Xorriso__wait_slave_md5_end(state, 10000, 0); if(ret <= 0) return(ret); return(1); } /* @param flag bit0= this is a follow-up session (i.e. on CD: TAO) bit1= no pacifier messages bit2= compute stream MD5 and look out for checksum tag @return <=0 error, 1= done, 2= aborted due to limit */ int Xorriso_check_interval(struct XorrisO *xorriso, struct SpotlisT *spotlist, struct CheckmediajoB *job, int from_lba, int block_count, int read_chunk, int md5_start, int flag) { int i, j, ret, total_count= 0, sectors= -1, sector_size= -1, skip_reading; int prev_quality= -1, quality= -1, retry= 0, profile_no, is_cd= 0; int eccb_size= 16, us_corr = 0, data_skip; int start_sec, end_sec, first_value, fret, suspect_tao_end= 0; char profile_name[80]; int start_lba= 0; struct burn_drive *drive; struct burn_drive_info *dinfo; char *data= NULL, *data_pt; off_t data_count, to_read, read_count= 0, write_amount, skipped_to_read; off_t slowdown_count= 0, seek_adr; struct timeval prev_time; double pre_read_time, post_read_time, time_diff, total_time_diff= 0; double last_abort_file_time= 0; void *ctx= NULL; char md5[16]; size_t data_size; struct xorriso_md5_state state; int num_chunks, async_md5; static off_t chunks_limit= 256 * 1024 * 1024; memset(&state, 0, sizeof(state)); state.chunk= NULL; state.chunk_state= NULL; state.chunk_fill= NULL; state.chunk_lba= NULL; state.spotlist= spotlist; if(read_chunk > 1024) read_chunk= 1024; else if(read_chunk < 1) read_chunk= 1; data_skip= job->data_to_skip; num_chunks= job->async_chunks; if(((off_t) num_chunks) * ((off_t) read_chunk) > chunks_limit) num_chunks= chunks_limit / read_chunk; async_md5= (num_chunks >= 2); if(async_md5) data_size= num_chunks * read_chunk * 2048; else data_size= read_chunk * 2048; Xorriso_alloc_meM(data, char, data_size); data_pt= data; ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to check media readability", 2 * !!job->use_dev); if(ret<=0) goto ex; ret= burn_disc_get_profile(drive, &profile_no, profile_name); if(ret > 0) { if(profile_no >= 0x08 && profile_no <= 0x0a) { is_cd= 1; eccb_size= 1; } else if(profile_no >= 0x40 && profile_no <= 0x43) { eccb_size= 32; } else if(burn_drive_get_drive_role(drive) != 1) { eccb_size= 1; } } if(job->sector_map != NULL) { Sectorbitmap_get_layout(job->sector_map, §ors, §or_size, 0); sector_size/= 2048; } if(job->retry > 0) retry= 1; else if(job->retry == 0 && is_cd) retry= 1; if(flag & 4) { ret= iso_md5_start(&ctx); if(ret < 0) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } } state.xorriso= xorriso; state.ctx= ctx; state.spotlist= spotlist; state.md5_start= md5_start; state.next_tag= 0; state.chain_broken= 0; state.in_track_gap= 0; state.was_sb_tag= 0; state.md5_spot_value= Xorriso_read_quality_untesteD; state.md5_spot_lba= 0; state.slave_state= 0; state.chunk_size= read_chunk; if(async_md5) { state.num_chunks= num_chunks; Xorriso_alloc_meM(state.chunk, char *, num_chunks); Xorriso_alloc_meM(state.chunk_state, int, num_chunks); Xorriso_alloc_meM(state.chunk_fill, int, num_chunks); Xorriso_alloc_meM(state.chunk_lba, uint32_t, num_chunks); for(i= 0; i < state.num_chunks; i++) { state.chunk[i]= data + read_chunk * i * 2048; state.chunk_state[i]= 0; state.chunk_fill[i]= 0; state.chunk_lba[i]= 0; } ret= pthread_mutex_init(&(state.spot_mutex), NULL); if(ret != 0) { sprintf(xorriso->info_text, "-check_media: Cannot initialize thread mutex"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); goto ex; } } else state.num_chunks= 0; state.chunk_w_idx= 0; state.chunk_r_idx= 0; state.w_sleeps= 0; state.r_sleeps= 0; if(async_md5) { ret= Xorriso_start_chunk_md5(xorriso, &state, 0); if(ret <= 0) goto ex; } if(xorriso->read_speed_force > 0) /* initialize forced speed limit */ burn_nominal_slowdown(xorriso->read_speed_force, xorriso->read_speed_corr, &prev_time, &us_corr, (off_t) 0, 1); Xorriso_set_speed(xorriso, drive, xorriso->read_speed, 0, 1); Xorriso_process_msg_queues(xorriso,0); start_lba= from_lba; to_read= read_chunk; post_read_time= Sfile_microtime(0); for(i= 0; i < block_count; i+= to_read) { if(i != 0) data_skip= 0; skip_reading= 0; ret= Xorriso_check_for_abort(xorriso, job->abort_file_path, post_read_time, &last_abort_file_time, 0); if(ret == 1) goto abort_check; if(job->item_limit > 0 && Spotlist_count(spotlist, 0) + 2 >= job->item_limit) { sprintf(xorriso->info_text, "-check_media: Reached item_limit=%d", job->item_limit); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); goto abort_check; } pre_read_time= Sfile_microtime(0); if(job->time_limit > 0 && job->start_time + job->time_limit < pre_read_time) { sprintf(xorriso->info_text, "-check_media: Reached time_limit=%d", job->time_limit); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); abort_check:; if(prev_quality >= 0) { ret= Xorriso__add_spot(&state, start_lba, i + from_lba - start_lba, prev_quality, 0); if(ret <= 0) goto ex; } ret= Xorriso__add_spot(&state, i + from_lba, block_count - i, Xorriso_read_quality_untesteD, 0); if(ret > 0) ret= 2; goto ex; } to_read= read_chunk; skipped_to_read= 0; suspect_tao_end= 0; if(i + to_read > block_count) to_read= block_count - i; if(is_cd && i + to_read + 2 >= block_count) { /* Read last 2 blocks of CD track separately, because with TAO tracks they are always unreadable but with SAO tracks they contain data. */ if(to_read > 2) { to_read-= 2; } else { if(to_read > 1) to_read--; suspect_tao_end= 1; } } if(sector_size == read_chunk && from_lba % read_chunk == 0 && !skip_reading) { if(Sectorbitmap_is_set(job->sector_map, (i + from_lba) / sector_size, 0)){ quality= Xorriso_read_quality_valiD; skip_reading= 1; } } else if(sector_size > 0 && !skip_reading) { start_sec= (i + from_lba) / sector_size; end_sec= (i + to_read + from_lba) / sector_size; first_value= Sectorbitmap_is_set(job->sector_map, start_sec, 0); for(j= start_sec; j < end_sec; j++) if(Sectorbitmap_is_set(job->sector_map, j, 0) != first_value) break; to_read= j * sector_size - i - from_lba; skip_reading= !!first_value; if(skip_reading) quality= Xorriso_read_quality_valiD; } if(skip_reading) { pre_read_time= post_read_time= Sfile_microtime(0); skipped_to_read= to_read; } else { data_count= 0; pre_read_time= Sfile_microtime(0); if(async_md5) { ret= Xorriso__wait_chunk_md5(&state, 1, 0); if(ret <= 0) goto ex; data_pt= state.chunk[state.chunk_w_idx]; } ret= burn_read_data(drive, ((off_t) (i + from_lba)) * (off_t) 2048, data_pt, to_read * (off_t) 2048, &data_count, (4 * !retry) | (16 * !!suspect_tao_end)); post_read_time= Sfile_microtime(0); time_diff= post_read_time - pre_read_time; total_time_diff+= time_diff; total_count++; if(ret <= 0) { Xorriso_process_msg_queues(xorriso,0); if(data_count / 2048 < to_read) { if(data_count > 0 && retry) { if(prev_quality >= 0) { ret= Xorriso__add_spot(&state, start_lba, i + from_lba - start_lba, prev_quality, 0); if(ret <= 0) goto ex; } ret= Xorriso__add_spot(&state, i + from_lba, data_count / 2048, Xorriso_read_quality_partiaL, 0); if(ret <= 0) goto ex; start_lba= i + from_lba + data_count / 2048; if(suspect_tao_end && ret == -3) prev_quality= Xorriso_read_quality_tao_enD; else prev_quality= Xorriso_read_quality_unreadablE; } if(suspect_tao_end && ret == -3) quality= Xorriso_read_quality_tao_enD; else quality= Xorriso_read_quality_unreadablE; if(retry) /* skip one eccb_size */ to_read= data_count / 2048 + eccb_size; } else { /* (can hardly happen) */ quality= Xorriso_read_quality_partiaL; } fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret<0) goto ex; } else { quality= Xorriso_read_quality_gooD; if(time_diff > job->slow_threshold_seq && job->slow_threshold_seq > 0 && i > 0) quality= Xorriso_read_quality_sloW; } /* MD5 checksumming */ if(ctx != NULL) { if(async_md5) { state.chunk_fill[state.chunk_w_idx]= to_read; state.chunk_lba[state.chunk_w_idx]= i + from_lba; state.chunk_state[state.chunk_w_idx]= 1; /* The MD5 thread will call Xorriso_chunk_md5() */ state.chunk_w_idx= (state.chunk_w_idx + 1) % state.num_chunks; } else { ret= Xorriso_chunk_md5(xorriso, data_pt, to_read, (uint32_t) (i + from_lba), &state, 0); if(ret <= 0) goto ex; } } write_amount= data_count - data_skip; if(data_count > 0) { read_count+= data_count - data_skip; if(job->data_to_limit >= 0 && read_count > job->data_to_limit) write_amount-= (read_count - job->data_to_limit); } if(xorriso->read_speed_force > 0) { slowdown_count+= data_count; if(slowdown_count >= 128 * 1024) { burn_nominal_slowdown(xorriso->read_speed_force, xorriso->read_speed_corr, &prev_time, &us_corr, slowdown_count, 0); slowdown_count= 0; } } if(write_amount > 0) { if(job->data_to_fd >= 0) { seek_adr= ((off_t) (i + from_lba)) * (off_t) 2048 + job->data_to_skip + job->data_to_offset; if(strcmp(job->data_to_path, "-") != 0) { ret= lseek(job->data_to_fd, seek_adr, SEEK_SET); if(ret == -1) { failed_to_write:; sprintf(xorriso->info_text, "Cannot write %d bytes to position %.f in ", (int) data_count, (double) seek_adr); Text_shellsafe(job->data_to_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); {ret= 0; goto ex;} } } ret= write(job->data_to_fd, data_pt + data_skip, write_amount); if(ret == -1) goto failed_to_write; } } } if(quality != prev_quality) { if(prev_quality >= 0) { ret= Xorriso__add_spot(&state, start_lba, i + from_lba - start_lba, prev_quality, 0); if(ret <= 0) goto ex; } start_lba= i + from_lba; prev_quality= quality; } if(!(flag & 2)) { xorriso->pacifier_count+= to_read - skipped_to_read; if(post_read_time - xorriso->last_update_time >= xorriso->pacifier_interval) Xorriso_pacifier_callback(xorriso, "blocks read", xorriso->pacifier_count, xorriso->pacifier_total, "", 8 | 16 | (128 * (job->use_dev == 1))); } } if(prev_quality >= 0) { ret= Xorriso__add_spot(&state, start_lba, block_count + from_lba - start_lba, prev_quality, 0); if(ret <= 0) goto ex; } /* <<< for calibration of quality */ if(total_count > 0) { sprintf(xorriso->info_text, "Xorriso_check_interval: %.1f s / %d = %f", total_time_diff, total_count, total_time_diff / total_count); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); } /* MD5 checksumming : register result */ if(async_md5) { ret= Xorriso__end_slave_md5(&state, 10000, 0); if(ret <= 0) goto ex; } /* >>> ??? allow chain_broken to be a match ? */ if(state.next_tag > 0) { sprintf(xorriso->info_text, "Missing announced MD5 tag: start=%d pos=%d", state.md5_start, state.next_tag); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); state.md5_spot_value= Xorriso_read_quality_md5_mismatcH; state.md5_spot_lba= state.next_tag; } if(state.md5_spot_value != Xorriso_read_quality_untesteD) { ret= Xorriso__add_spot(&state, state.md5_start, state.md5_spot_lba - state.md5_start, state.md5_spot_value, 0); if(ret <= 0) goto ex; } ret= 1; ex:; if(async_md5) { Xorriso__end_slave_md5(&state, 10000, 0); sprintf(xorriso->info_text, "async_chunks=%d , chunk_size=%ds , w_sleeps: %.f , r_sleeps: %.f", state.num_chunks, read_chunk, (double) state.w_sleeps, (double) state.r_sleeps); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); if(state.chunk != NULL) pthread_mutex_destroy(&(state.spot_mutex)); Xorriso_free_meM(state.chunk); Xorriso_free_meM(state.chunk_state); Xorriso_free_meM(state.chunk_fill); Xorriso_free_meM(state.chunk_lba); } Xorriso_free_meM(data); if(state.ctx != NULL) iso_md5_end(&(state.ctx), md5); return(ret); } int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist, struct CheckmediajoB *job, int flag) { int media_blocks= 0, read_chunk= 32, ret, mode, start_lba= 0; int blocks, os_errno, i, j, last_track_end= -1, track_blocks, track_lba; int num_sessions, num_tracks, declare_untested= 0, md5_start; int read_capacity= -1, end_lba, hret, count, quality, profile_no; int track_bad_claim= 0; char *toc_info= NULL, profile_name[80], msg[160]; struct burn_drive *drive; struct burn_drive_info *dinfo; enum burn_disc_status s; struct isoburn_toc_disc *isoburn_disc= NULL; struct isoburn_toc_session **isoburn_sessions; struct isoburn_toc_track **iso_burn_tracks; struct burn_toc_entry isoburn_entry; struct stat stbuf; struct burn_multi_caps *caps= NULL; *spotlist= NULL; ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to check media readability", 2 * !!job->use_dev); if(ret<=0) goto ex; ret = burn_disc_get_profile(drive, &profile_no, profile_name); if(ret <= 0) profile_no= 0; if(job->min_block_size != 0) read_chunk= job->min_block_size; ret= Spotlist_new(spotlist, 0); if(ret <= 0) {ret= -1; goto ex;} if(job->sector_map_path[0]) { Sectorbitmap_destroy(&(job->sector_map), 0); if(stat(job->sector_map_path, &stbuf) != -1) { ret= Sectorbitmap_from_file(&(job->sector_map), job->sector_map_path, xorriso->info_text, &os_errno, 0); if(ret <= 0) { if(xorriso->info_text[0]) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, os_errno, "FAILURE", 0); goto ex; } } Xorriso_toc_to_string(xorriso, &toc_info, (2 * !!job->use_dev) | (4 * !job->map_with_volid)); } ret= Xorriso_open_job_data_to(xorriso, job, 0); if(ret <= 0) goto ex; Xorriso_pacifier_reset(xorriso, 0); job->start_time= time(NULL); mode= job->mode; if(job->min_lba > 0) { start_lba= job->min_lba; ret= Spotlist_add_item(*spotlist, 0, job->min_lba, Xorriso_read_quality_untesteD, 0); if(ret <= 0) goto ex; } s= isoburn_disc_get_status(drive); if(s != BURN_DISC_APPENDABLE && s != BURN_DISC_FULL) { Xorriso_msgs_submit(xorriso, 0, "-check_media: No readable medium found", 0, "SORRY", 0); ret= 0; goto ex; } ret= burn_get_read_capacity(drive, &read_capacity, 0); if(ret <= 0) read_capacity= -1; if(job->max_lba >= 0) { blocks= job->max_lba + 1 - start_lba; xorriso->pacifier_total= blocks; ret= Xorriso_check_interval(xorriso, *spotlist, job, start_lba, blocks, read_chunk, 0, 0); if(ret <= 0) goto ex; } else if(mode == 0) { /* track by track */ isoburn_disc= isoburn_toc_drive_get_disc(drive); if(isoburn_disc == NULL) goto libburn_whole_disc; isoburn_sessions= isoburn_toc_disc_get_sessions(isoburn_disc, &num_sessions); for(i= 0; i < num_sessions; i++) { iso_burn_tracks= isoburn_toc_session_get_tracks(isoburn_sessions[i], &num_tracks); for(j= 0; j < num_tracks; j++) { isoburn_toc_track_get_entry(iso_burn_tracks[j], &isoburn_entry); if(!(isoburn_entry.extensions_valid & 1)) /* should not happen */ continue; track_lba= isoburn_entry.start_lba; track_blocks= isoburn_entry.track_blocks; /* The last track of an appendable BD-R reports more blocks than the read capacity allows. All BD-R track sizes are multiple of 64 kB. */ if (i == num_sessions - 1 && (track_lba + track_blocks > read_capacity && track_lba + track_blocks < read_capacity + 32 && (profile_no == 0x41 || profile_no == 0x40))) track_blocks= read_capacity - track_lba; if(track_lba + track_blocks > read_capacity) { if(track_bad_claim < track_lba + track_blocks) track_bad_claim= track_lba + track_blocks; if(track_lba >= read_capacity) { sprintf(msg, "-check_media: Track %d of session %d begins after end of readable medium area.", j + 1, i + 1); Xorriso_msgs_submit(xorriso, 0, msg, 0, "WARNING", 0); continue; } else { if(profile_no >= 0x08 && profile_no <= 0x0a && track_lba + track_blocks == read_capacity + 2 && i == num_sessions - 1 && j == num_tracks - 1) { sprintf(msg, "-check_media: Last CD track exceeds readable area by 2 blocks. Assuming TAO."); Xorriso_msgs_submit(xorriso, 0, msg, 0, "DEBUG", 0); } else { sprintf(msg, "-check_media: Track %d of session %d extends over the end of readable medium area.", j + 1, i + 1); Xorriso_msgs_submit(xorriso, 0, msg, 0, "WARNING", 0); } track_blocks= read_capacity - track_lba; } } md5_start= track_lba; if(i == 0 && j == 0) { if(track_lba == 32) { ret= burn_disc_get_multi_caps(drive, BURN_WRITE_NONE, &caps, 0); if(ret > 0) { if(caps->start_adr) { /* block 0 to 31 are the overall mount entry of overwritable */ track_lba= 0; track_blocks+= 32; } } } } if(last_track_end >= 0 && last_track_end < track_lba && last_track_end >= start_lba) { ret= Spotlist_add_item(*spotlist, last_track_end, track_lba - last_track_end, Xorriso_read_quality_off_tracK, 0); if(ret <= 0) goto ex; } last_track_end= track_lba + track_blocks; if(track_lba < start_lba) { track_blocks-= start_lba - track_lba; track_lba= start_lba; } if(track_blocks <= 0) continue; if(declare_untested) { ret= Spotlist_add_item(*spotlist, track_lba, track_blocks, Xorriso_read_quality_untesteD, 0); if(ret <= 0) goto ex; } else { ret= Xorriso_check_interval(xorriso, *spotlist, job, track_lba, track_blocks, read_chunk, md5_start, (i > 0) | (4 * (xorriso->do_md5 & 1))); if(ret <= 0) goto ex; if(ret == 2) declare_untested= 1; } } } if(track_bad_claim > read_capacity) { count= Spotlist_count(*spotlist, 0); Spotlist_get_item(*spotlist, count - 1, &track_lba, &blocks, &quality, 0); if(profile_no >= 0x08 && profile_no <= 0x0a && track_bad_claim - read_capacity == 2 && quality != Xorriso_read_quality_tao_enD) quality= Xorriso_read_quality_tao_enD; else quality= Xorriso_read_quality_unreadablE; ret= Spotlist_add_item(*spotlist, read_capacity, track_bad_claim - read_capacity, quality, 0); if(ret <= 0) goto ex; } } else if(mode == 1) { /* Image range */ /* Default is the emulated disc capacity. */ isoburn_disc= isoburn_toc_drive_get_disc(drive); if(isoburn_disc == NULL) goto libburn_whole_disc; blocks= media_blocks= isoburn_toc_disc_get_sectors(isoburn_disc); /* If possible, determine the end address of the loaded ISO image. */ track_lba= isoburn_get_attached_start_lba(drive); if(track_lba >= 0) { ret= isoburn_read_iso_head(drive, track_lba, &track_blocks, NULL, 0); if(ret > 0) { blocks= media_blocks= track_lba + track_blocks; } } if(start_lba >= 0) blocks-= start_lba; if(media_blocks <= 0) goto libburn_whole_disc; xorriso->pacifier_total= blocks; ret= Xorriso_check_interval(xorriso, *spotlist, job, start_lba, blocks, read_chunk, 0, (4 * (xorriso->do_md5 & 1))); if(ret <= 0) goto ex; } else if(mode == 2) { libburn_whole_disc:; /* single sweep over libburn medium capacity */ ret= burn_get_read_capacity(drive, &blocks, 0); if(ret <= 0) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "No content detected on media"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } blocks-= start_lba; xorriso->pacifier_total= blocks; ret= Xorriso_check_interval(xorriso, *spotlist, job, start_lba, blocks, read_chunk, 0, (4 * (xorriso->do_md5 & 1))); if(ret <= 0) goto ex; } Xorriso_pacifier_callback(xorriso, "blocks read", xorriso->pacifier_count, xorriso->pacifier_total, "", 1 | 8 | 16 | 32 | (128 * (job->use_dev == 1))); ret= 1; ex:; if(job->data_to_fd != -1 && strcmp(job->data_to_path, "-") != 0) close(job->data_to_fd); job->data_to_fd= -1; if(read_capacity >= 0) { count= Spotlist_count(*spotlist, 0); end_lba= 0; for(i= 0; i < count; i++) { Spotlist_get_item(*spotlist, i, &start_lba, &blocks, &quality, 0); if(start_lba + blocks > end_lba) end_lba= start_lba + blocks; } if(read_capacity > end_lba) { hret= Spotlist_add_item(*spotlist, end_lba, read_capacity - end_lba, Xorriso_read_quality_untesteD, 0); if(hret < ret) ret= hret; } } if(ret > 0) ret= Xorriso_update_in_sector_map(xorriso, *spotlist, read_chunk, job, 0); if(ret > 0) { ret= Xorriso_spotlist_to_sectormap(xorriso, *spotlist, read_chunk, &(job->sector_map), 2); if(ret > 0 && job->sector_map_path[0]) { ret= Sectorbitmap_to_file(job->sector_map, job->sector_map_path, toc_info, xorriso->info_text, &os_errno, 0); if(ret <= 0) { if(xorriso->info_text[0]) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, os_errno, "FAILURE", 0); } } } if(toc_info != NULL) free(toc_info); if(ret <= 0) Spotlist_destroy(spotlist, 0); if(caps!=NULL) burn_disc_free_multi_caps(&caps); if(isoburn_disc != NULL) isoburn_toc_disc_free(isoburn_disc); return(ret); } /* @param flag bit0= if not MMC drive print NOTE and return 2 bit1= obtain outdrive, else indrive bit4= do not report failure */ int Xorriso_get_drive_handles(struct XorrisO *xorriso, struct burn_drive_info **dinfo, struct burn_drive **drive, char *attempt, int flag) { int ret; if(flag&2) *dinfo= (struct burn_drive_info *) xorriso->out_drive_handle; else *dinfo= (struct burn_drive_info *) xorriso->in_drive_handle; if(*dinfo==NULL && !(flag & 16)) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "No %s drive acquired %s", (flag&2 ? "output" : "input"), attempt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } if(*dinfo==NULL) return(0); *drive= (*dinfo)[0].drive; if(flag & 1) { ret= burn_drive_get_drive_role(*drive); if(ret != 1) { sprintf(xorriso->info_text, "Output device is not an MMC drive. Desired operation does not apply."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(2); } } return((*drive)!=NULL); } int Xorriso_pretend_full_disc(struct XorrisO *xorriso, int flag) { int ret; struct burn_drive_info *dinfo; struct burn_drive *drive; ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to let libburn pretend having a closed medium", 2); if(ret<=0) return(ret); ret= isoburn_disc_pretend_full_uncond(drive); Xorriso_process_msg_queues(xorriso,0); if(ret <= 0) { sprintf(xorriso->info_text, "Failed to let libburn pretend having a closed medium"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } int Xorriso_scsi_dev_family(struct XorrisO *xorriso, int flag) { burn_preset_device_open(xorriso->drives_exclusive | (xorriso->linux_scsi_dev_family << 2), 0, 0); return(1); } int Xorriso_use_immed_bit(struct XorrisO *xorriso, int flag) { int enable= 1, ret; struct burn_drive_info *dinfo; struct burn_drive *drive; /* It is not an error if no drive is acquired. Xorriso_drive_aquire() will apply use_immed_bit. */ ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to control use of Immed bit", 2 | 16); if(ret<0) return(ret); if(ret == 0) return(1); if(xorriso->use_immed_bit == -1) { enable= 0; } else if(xorriso->use_immed_bit == 1) { enable= 1; } else if(xorriso->use_immed_bit == 0) { /* obtain default value as determined after drive aquiration */ if(xorriso->use_immed_bit_default == 0) return(1); enable= (xorriso->use_immed_bit_default > 0); } burn_drive_set_immed(drive, enable); Xorriso_process_msg_queues(xorriso,0); return(1); } int Xorriso_obtain_indev_readsize(struct XorrisO *xorriso, uint32_t *blocks, int flag) { int ret, num_data; struct burn_drive_info *dinfo; struct burn_drive *drive; enum burn_disc_status s; *blocks= 0; ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "on attempt to determine readable size", 0); if(ret <= 0) return(0); s= isoburn_disc_get_status(drive); if(s == BURN_DISC_BLANK) return(1); ret= burn_get_read_capacity(drive, &num_data, 0); if(ret <= 0) return(0); *blocks= num_data; return(1); } libisoburn-1.5.4/xorriso/xorrisoburn.h0000644000175700017510000006436114005265540015107 00000000000000 /* Adapter to libisoburn, libisofs and libburn for xorriso, a command line oriented batch and dialog tool which creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2021 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the inner isofs- and burn-library interface of xorriso. */ #ifndef Xorrisoburn_includeD #define Xorrisoburn_includeD yes /* The minimum version of libisoburn to be used with this version of xorriso */ #define xorriso_libisoburn_req_major 1 #define xorriso_libisoburn_req_minor 5 #define xorriso_libisoburn_req_micro 4 struct SpotlisT; /* List of intervals with different read qualities */ struct CheckmediajoB; /* Parameters for Xorriso_check_media() */ struct Xorriso_msg_sievE; /* Fishes for info particles in reply messages */ int Xorriso_startup_libraries(struct XorrisO *xorriso, int flag); /* @param flag bit0= global shutdown of libraries */ int Xorriso_detach_libraries(struct XorrisO *xorriso, int flag); int Xorriso_create_empty_iso(struct XorrisO *xorriso, int flag); /* @param flag bit0=acquire as isoburn input drive bit1=acquire as libburn output drive (as isoburn drive if bit0) @return <=0 failure , 1=success , 2=neither readable or writeable */ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr, int flag); int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag); int Xorriso_write_session(struct XorrisO *xorriso, int flag); int Xorriso_retry_write_session(struct XorrisO *xorriso, int flag); /* @param boss_iter Opaque handle to be forwarded to actions in ISO image Set to NULL if calling this function from outside ISO world @param flag bit0= mkdir: graft in as empty directory, not as copy from disk bit1= do not report added files @return <=0 = error , 1 = added simple node , 2 = added directory */ int Xorriso_graft_in(struct XorrisO *xorriso, void *boss_iter, char *disk_path, char *img_path, off_t offset, off_t cut_size, int flag); int Xorriso__text_to_sev(char *severity_name, int *severity_number,int flag); int Xorriso__sev_to_text(int severity, char **severity_name, int flag); /* @param flag bit0=report about output drive bit1=short report form bit2=do not try to read ISO heads bit3=report to info channel (else to result channel) */ int Xorriso_toc(struct XorrisO *xorriso, int flag); /* @param flag bit0= no output if no boot record was found bit3= report to info channel (else to result channel) */ int Xorriso_show_boot_info(struct XorrisO *xorriso, int flag); int Xorriso_show_devices(struct XorrisO *xorriso, int flag); int Xorriso_tell_media_space(struct XorrisO *xorriso, int *media_space, int *free_space, int flag); /* @param flag bit0=fast , bit1=deformat @return 0=failure, did not touch medium , -1=failure, altered medium 1=success, altered medium , 2=success, did not touch medium */ int Xorriso_blank_media(struct XorrisO *xorriso, int flag); /* @param flag bit0= try to achieve faster formatting bit1= use parameter size (else use default size) bit2= do not re-aquire drive bit7= by_index mode: bit8 to bit15 contain the index of the format to use. @return 0=failure, did not touch medium , -1=failure, altered medium 1=success, altered medium , 2=success, did not touch medium */ int Xorriso_format_media(struct XorrisO *xorriso, off_t size, int flag); /* @return <=0 error, 1 success */ int Xorriso_list_formats(struct XorrisO *xorriso, int flag); /* @return <=0 error, 1 success */ int Xorriso_list_speeds(struct XorrisO *xorriso, int flag); /* @param flag bit1= obtain outdrive, else indrive @return <=0 error, 1 success */ int Xorriso_list_profiles(struct XorrisO *xorriso, int flag); /* @param flag bit2= formatting rather than blanking @return 0=failure, did not touch medium , -1=failure, altered medium 1=success, altered medium , 2=success, did not touch medium */ int Xorriso_blank_as_needed(struct XorrisO *xorriso, int flag); /* @param boss_iter Opaque internal handle. Use NULL outside xorrisoburn.c : If not NULL then this is an iterator suitable for iso_dir_iter_remove() which is then to be used instead of iso_node_remove(). @param flag bit0= remove whole sub tree: rm -r bit1= remove empty directory: rmdir bit2= recursion: do not reassure in mode 2 "tree" bit3= this is for overwriting and not for plain removal bit4= count deleted files in xorriso->pacifier_count bit5= with bit0 only remove directory content, not the directory bit6= do not delete eventually existing node from di_array @return <=0 = error 1 = removed simple node 2 = removed directory or tree 3 = did not remove on user revocation */ int Xorriso_rmi(struct XorrisO *xorriso, void *boss_iter, off_t boss_mem, char *path, int flag); /* @param flag bit0= long format bit1= do not print count of nodes bit2= du format bit3= print directories as themselves (ls -d) */ int Xorriso_ls_filev(struct XorrisO *xorriso, char *wd, int filec, char **filev, off_t boss_mem, int flag); /* This function needs less buffer memory than Xorriso_ls_filev() but cannot perform structured pattern matching. @param flag bit0= long format bit1= only check for directory existence bit2= do not apply search pattern but accept any file bit3= just count nodes and return number */ int Xorriso_ls(struct XorrisO *xorriso, int flag); /* @return: <=0 = error, 1= directory tree, 2= path leads to non-directory */ int Xorriso_get_dus(struct XorrisO *xorriso, char *iso_rr_path, off_t *size, off_t boss_mem, int flag); /* @param wd Path to prepend in case img_path is not absolute @param img_path Absolute or relative path to be normalized @param eff_path returns resulting effective path. Must provide at least SfileadrL bytes of storage. @param flag bit0= do not produce problem events (unless faulty path format) bit1= work purely literally, do not use libisofs bit2= (with bit1) this is an address in the disk world @return -1 = faulty path format, 0 = not found , 1 = found simple node , 2 = found directory */ int Xorriso_normalize_img_path(struct XorrisO *xorriso, char *wd, char *img_path, char eff_path[], int flag); /* @param boss_iter Opaque handle to be forwarded to actions in ISO image Set to NULL if calling this function from outside ISO world @param flag bit0= silently ignore attempt of renaming to same path and return 2 */ int Xorriso_rename(struct XorrisO *xorriso, void *boss_iter, char *origin, char *dest, int flag); /* @param flag bit0= do not produce info message on success @return 1=success, 0=was already directory, -1=was other type, -2=bad path */ int Xorriso_mkdir(struct XorrisO *xorriso, char *img_path, int flag); /* @param flag bit0= a match count !=1 is a SORRY event */ int Xorriso_expand_pattern(struct XorrisO *xorriso, int num_patterns, char **patterns, int extra_filec, int *filec, char ***filev, off_t *mem, int flag); int Xorriso_set_st_mode(struct XorrisO *xorriso, char *path, mode_t mode_and, mode_t mode_or, int flag); int Xorriso_set_uid(struct XorrisO *xorriso, char *in_path, uid_t uid, int flag); int Xorriso_set_gid(struct XorrisO *xorriso, char *in_path, gid_t gid, int flag); /* @parm flag bit0= atime, bit1= ctime, bit2= mtime, bit8=no auto ctime */ int Xorriso_set_time(struct XorrisO *xorriso, char *in_path, time_t t, int flag); /* @param flag bit0= recursion bit1= do not count deleted files with rm and rm_r */ int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job, void *boss_iter, off_t boss_mem, void *dir_node_generic, char *dir_path, struct stat *dir_stbuf, int depth, int flag); /* @param flag bit0= do not dive into trees bit1= do not perform job->action on resulting node array */ int Xorriso_findi_sorted(struct XorrisO *xorriso, struct FindjoB *job, off_t boss_mem, int filec, char **filev, int flag); /* @param flag bit0= do not mark image as changed */ int Xorriso_set_volid(struct XorrisO *xorriso, char *volid, int flag); int Xorriso_get_volid(struct XorrisO *xorriso, char volid[33], int flag); int Xorriso_set_abort_severity(struct XorrisO *xorriso, int flag); int Xorriso_report_lib_versions(struct XorrisO *xorriso, int flag); /* @return 0= stbuf content is valid , -1 = path not found , -2 = severe error occurred */ int Xorriso_iso_lstat(struct XorrisO *xorriso, char *path, struct stat *stbuf, int flag); /* @param flag bit0= -inq bit1= -checkdrive */ int Xorriso_atip(struct XorrisO *xorriso, int flag); /* @param write_start_address is valid if >=0 @param tsize is valid if >0 @param flag bit0= grow_overwriteable_iso bit1= do_isosize */ int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address, char *track_source, off_t tsize, int flag); int Xorriso_retry_burn_track(struct XorrisO *xorriso, off_t write_start_address, char *track_source, off_t tsize, int flag); /* @param flag bit1= outdev rather than indev @return <=0 = failure , 1= ok , 2= ok, is CD profile */ int Xorriso_get_profile(struct XorrisO *xorriso, int *profile_number, char profile_name[80], int flag); /* @param flag bit0= open IsoNode *node_pt rather than looking up pathname bit1= dig out the most original stream for reading */ int Xorriso_iso_file_open(struct XorrisO *xorriso, char *pathname, void *node_pt, void **stream, int flag); int Xorriso_iso_file_read(struct XorrisO *xorriso, void *stream, char *buf, int count, int flag); int Xorriso_iso_file_close(struct XorrisO *xorriso, void **stream, int flag); int Xorriso_iso_file_to_fd(struct XorrisO *xorriso, char *path, int fd, int flag); /* @param bit0= copy link target properties rather than link properties */ int Xorriso_copy_properties(struct XorrisO *xorriso, char *disk_path, char *img_path, int flag); int Xorriso_cut_out(struct XorrisO *xorriso, char *disk_path, off_t startbyte, off_t bytecount, char *iso_rr_path, int flag); int Xorriso_paste_in(struct XorrisO *xorriso, char *disk_path, off_t startbyte, off_t bytecount, char *iso_rr_path, int flag); struct SplitparT; /* @param flag bit0= in_node is valid, do not resolve iso_adr */ int Xorriso_identify_split(struct XorrisO *xorriso, char *iso_adr, void *in_node, struct SplitparT **parts, int *count, struct stat *total_stbuf, int flag); /* @param flag bit0= node is valid, do not resolve path bit1= insist in complete collection of part files */ int Xorriso_is_split(struct XorrisO *xorriso, char *path, void *node, int flag); /* @param flag >>> bit0= mkdir: graft in as empty directory, not as copy from iso bit1= do not report copied files bit2= -follow, -not_*: this is not a command parameter bit3= use offset and cut_size for -paste_in bit4= return 3 on rejection by exclusion or user bit5= if directory then do not add sub tree bit6= this is a copy action: do not fake times and ownership @return <=0 = error , 1 = added leaf file object , 2 = added directory , 3 = rejected */ int Xorriso_restore(struct XorrisO *xorriso, char *img_path, char *disk_path, off_t offset, off_t cut_size, int flag); /* @param flag bit0= in_node is valid, do not resolve img_path */ int Xorriso_restore_is_identical(struct XorrisO *xorriso, void *in_node, char *img_path, char *disk_path, char type_text[5], int flag); /* Return the official libburn address of an address string. This may fail if the string does not constitute a valid drive address. @param official_adr must offer SfileadrL bytes of reply buffer @return 1 = success , 0 = failure , -1 = severe error */ int Xorriso_libburn_adr(struct XorrisO *xorriso, char *address_string, char official_adr[], int flag); /* @param flag bit1= obtain info from outdev */ int Xorriso_msinfo(struct XorrisO *xorriso, int *msc1, int *msc2, int flag); /* @param flag bit0= obtain iso_lba from indev bit1= head_buffer already contains a valid head bit2= issue message about success bit3= check whether source blocks are banned by in_sector_map */ int Xorriso_update_iso_lba0(struct XorrisO *xorriso, int iso_lba, int isosize, char *head_buffer, struct CheckmediajoB *job, int flag); int Xorriso_truncate_overwritable(struct XorrisO *xorriso, char *adr_mode, char *adr_value, char *adjust, int flag); int Xorriso_get_local_charset(struct XorrisO *xorriso, char **name, int flag); int Xorriso_set_local_charset(struct XorrisO *xorriso, char *name, int flag); int Xorriso_destroy_node_array(struct XorrisO *xorriso, int flag); int Xorriso_destroy_hln_array(struct XorrisO *xorriso, int flag); int Xorriso_destroy_di_array(struct XorrisO *xorriso, int flag); int Xorriso_new_node_array(struct XorrisO *xorriso, off_t mem_limit, int addon_nodes, int flag); int Xorriso_sort_node_array(struct XorrisO *xorriso, int flag); int Xorriso_new_hln_array(struct XorrisO *xorriso, off_t mem_limit, int flag); /* @param flag bit0= allocate xorriso->node_targets too */ int Xorriso_restore_node_array(struct XorrisO *xorriso, int flag); int Xorriso_check_md5(struct XorrisO *xorriso, void *in_node, char *path, int flag); int Xorriso_check_session_md5(struct XorrisO *xorriso, char *severity, int flag); int Xorriso_image_has_md5(struct XorrisO *xorriso, int flag); int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist, struct CheckmediajoB *job, int flag); int Xorriso_extract_cut(struct XorrisO *xorriso, char *img_path, char *disk_path, off_t img_offset, off_t bytes, int flag); int Xorriso_extract_boot_images(struct XorrisO *xorriso, char *disk_dir_path, int flag); int Xorriso_relax_compliance(struct XorrisO *xorriso, char *mode, int flag); /* @return 1=ok 2=ok, is default setting */ int Xorriso_get_relax_text(struct XorrisO *xorriso, char mode[1024], int flag); /** @param flag bit0= print mount command to result channel rather than performing it */ int Xorriso_mount(struct XorrisO *xorriso, char *dev, int adr_mode, char *adr_value, char *cmd, int flag); int Xorriso_auto_driveadr(struct XorrisO *xorriso, char *adr, char *result, int flag); /* @param node Opaque handle to IsoNode which is to be inquired instead of path if it is not NULL. @param path is used as address if node is NULL. @param acl_text if acl_text is not NULL, then *acl_text will be set to the ACL text (without comments) of the file object. In this case it finally has to be freed by the caller. @param flag bit0= do not report to result but only retrieve ACL text bit1= just check for existence of ACL, do not allocate and set acl_text but return 1 or 2 @return 2 ok, no ACL available, eventual *acl_text will be NULL 1 ok, ACL available, eventual *acl_text stems from malloc() <=0 error */ int Xorriso_getfacl(struct XorrisO *xorriso, void *node, char *path, char **acl_text, int flag); int Xorriso_getfattr(struct XorrisO *xorriso, void *in_node, char *path, char **attr_text, int flag); int Xorriso_list_extattr(struct XorrisO *xorriso, void *in_node, char *path, char *show_path, char *mode, int flag); int Xorriso_append_extattr_comp(struct XorrisO *xorriso, char *comp, size_t comp_len, char *mode, int flag); /* Calls iso_image_set_ignore_aclea() according to xorriso->do_aaip */ int Xorriso_set_ignore_aclea(struct XorrisO *xorriso, int flag); /* @param node Opaque handle to IsoNode which is to be manipulated instead of path if it is not NULL. @param path is used as address if node is NULL. @param access_text "access" ACL in long text form @param default_text "default" ACL in long text form @param flag Unused yet, submit 0 @return >0 success , <=0 failure */ int Xorriso_setfacl(struct XorrisO *xorriso, void *in_node, char *path, char *access_text, char *default_text, int flag); int Xorriso_get_attrs(struct XorrisO *xorriso, void *in_node, char *path, size_t *num_attrs, char ***names, size_t **value_lengths, char ***values, int flag); int Xorriso_setfattr(struct XorrisO *xorriso, void *in_node, char *path, size_t num_attrs, char **names, size_t *value_lengths, char **values, int flag); int Xorriso_perform_attr_from_list(struct XorrisO *xorriso, char *path, struct Xorriso_lsT *lst_start, int flag); int Xorriso_path_setfattr(struct XorrisO *xorriso, void *in_node, char *path, char *name, size_t value_length, char *value, int flag); int Xorriso_perform_acl_from_list(struct XorrisO *xorriso, char *file_path, char *uid, char *gid, char *acl, int flag); int Xorriso_record_dev_inode(struct XorrisO *xorriso, char *disk_path, dev_t dev, ino_t ino, void *in_node, char *iso_path, int flag); int Xorriso_local_getfacl(struct XorrisO *xorriso, char *disk_path, char **text, int flag); int Xorriso_set_filter(struct XorrisO *xorriso, void *in_node, char *path, char *filter_name, int flag); /* @param flag bit0= delete filter with the given name */ int Xorriso_external_filter(struct XorrisO *xorriso, char *name, char *options, char *path, int argc, char **argv, int flag); int Xorriso_status_extf(struct XorrisO *xorriso, char *filter, FILE *fp, int flag); int Xorriso_destroy_all_extf(struct XorrisO *xorriso, int flag); int Xorriso_show_stream(struct XorrisO *xorriso, void *in_node, char *path, int flag); int Xorriso_set_zisofs_params(struct XorrisO *xorriso, int flag); int Xorriso_status_zisofs(struct XorrisO *xorriso, char *filter, FILE *fp, int flag); /* @param flag bit0= overwrite existing di_array (else return 2) */ int Xorriso_make_di_array(struct XorrisO *xorriso, int flag); /* @param flag bit0= overwrite existing hln_array (else return 2) */ int Xorriso_make_hln_array(struct XorrisO *xorriso, int flag); /* @param flag bit2= -follow: this is not a command parameter @return -1= severe error 0= not applicable for hard links 1= go on with processing 2= iso_rr_path is fully updated */ int Xorriso_hardlink_update(struct XorrisO *xorriso, int *compare_result, char *disk_path, char *iso_rr_path, int flag); int Xorriso_finish_hl_update(struct XorrisO *xorriso, int flag); int Xorriso_get_md5(struct XorrisO *xorriso, void *in_node, char *path, char md5[16], int flag); int Xorriso_make_md5(struct XorrisO *xorriso, void *in_node, char *path, int flag); int Xorriso_md5_start(struct XorrisO *xorriso, void **ctx, int flag); int Xorriso_md5_compute(struct XorrisO *xorriso, void *ctx, char *data, int datalen, int flag); int Xorriso_md5_end(struct XorrisO *xorriso, void **ctx, char md5[16], int flag); /* @param flag bit0=input drive bit1=output drive */ int Xorriso_drive_snooze(struct XorrisO *xorriso, int flag); int Xorriso_is_plain_image_file(struct XorrisO *xorriso, void *in_node, char *path, int flag); int Xorriso_pvd_info(struct XorrisO *xorriso, int flag); /* @param flag bit0= do not set hln_change_pending */ int Xorriso_set_change_pending(struct XorrisO *xorriso, int flag); /* @param flag bit0= enable SCSI command logging to stderr */ int Xorriso_scsi_log(struct XorrisO *xorriso, int flag); /* flag bit0= do not increment boot_count and do not reset boot parameters bit1= dispose attached boot images */ int Xorriso_attach_boot_image(struct XorrisO *xorriso, int flag); /* bit0= do only report non-default settings bit1= do only report to fp */ int Xorriso_boot_image_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag); int Xorriso_add_mips_boot_file(struct XorrisO *xorriso, char *path, int flag); int Xorriso_set_hppa_boot_parm(struct XorrisO *xorriso, char *text, char *what, int flag); int Xorriso_set_alpha_boot(struct XorrisO *xorriso, char *path, int flag); int Xorriso_coordinate_system_area(struct XorrisO *xorriso, int sa_type, int options, char *cmd, int flag); /* A pseudo file type for El-Torito bootsectors as in man 2 stat : For now take the highest possible value. */ #define Xorriso_IFBOOT S_IFMT int Exprtest_match(struct XorrisO *xorriso, struct ExprtesT *ftest, void *node_pt, char *name, char *path, struct stat *boss_stbuf, struct stat *stbuf, int flag); int Xorriso_toc_to_string(struct XorrisO *xorriso, char **toc_text, int flag); int Xorriso_reaquire_outdev(struct XorrisO *xorriso, int flag); int Xorriso_set_system_area_path(struct XorrisO *xorriso, char *path, int flag); int Xorriso_set_hidden(struct XorrisO *xorriso, void *in_node, char *path, int hide_state, int flag); /* @param flag bit0= avoid library calls */ int Xorriso_preparer_string(struct XorrisO *xorriso, char xorriso_id[129], int flag); int Xorriso_jigdo_interpreter(struct XorrisO *xorriso, char *aspect, char *arg, int flag); int Xorriso_estimate_file_size(struct XorrisO *xorriso, struct FindjoB *job, char *basename, mode_t st_mode, off_t st_size, int flag); int Xorriso_clone_tree(struct XorrisO *xorriso, void *boss_iter, char *origin, char *dest, int flag); int Xorriso_clone_under(struct XorrisO *xorriso, char *origin, char *dest, int flag); int Xorriso_mark_update_merge(struct XorrisO *xorriso, char *path, void *node, int flag); /* @param flag bit0= asynchronous handling (else catch thread, wait, and exit) */ int Xorriso_set_signal_handling(struct XorrisO *xorriso, int flag); /* @param flag bit0=force burn_disc_close_damaged() */ int Xorriso_close_damaged(struct XorrisO *xorriso, int flag); int Xorriso_list_extras(struct XorrisO *xorriso, char *mode, int flag); int Xorriso_set_data_cache(struct XorrisO *xorriso, void *ropts, int num_tiles, int tile_blocks, int flag); int Xorriso_hfsplus_file_creator_type(struct XorrisO *xorriso, char *path, void *in_node, char *creator, char *hfs_type, int flag); int Xorriso_hfsplus_bless(struct XorrisO *xorriso, char *path, void *in_node, char *blessing, int flag); int Xorriso_pretend_full_disc(struct XorrisO *xorriso, int flag); int Xorriso_scsi_dev_family(struct XorrisO *xorriso, int flag); int Xorriso_use_immed_bit(struct XorrisO *xorriso, int flag); int Xorriso_apply_sort_file(struct XorrisO *xorriso, char *path, int flag); int Xorriso_report_system_area(struct XorrisO *xorriso, char *form, int flag); int Xorriso_list_boot_images(struct XorrisO *xorriso, char ***imgs, int *img_count, int flag); int Xorriso_external_filter_banned(struct XorrisO *xorriso, char *purpose, int flag); int Xorriso_set_file_name_limit(struct XorrisO *xorriso, int value, int flag); int Xorriso_truncate_path_comps(struct XorrisO *xorriso, char *path, char *buffer, char **resultpt, int flag); int Xorriso_graftable_pathspec(struct XorrisO *xorriso, char *in_pathspec, char *pathspec, int flag); int Xorriso_parse_guid(struct XorrisO *xorriso, char *text, uint8_t guid[16], int flag); int Xorriso_parse_gpt_guid(struct XorrisO *xorriso, char *text, int flag); int Xorriso_parse_type_guid(struct XorrisO *xorriso, char *text, uint8_t guid[16], int *mbr_type, int flag); int Xorriso_format_guid(struct XorrisO *xorriso, uint8_t guid[16], char *line, int flag); int Xorriso_make_guid(struct XorrisO *xorriso, char *line, int flag); int Xorriso_set_libisofs_now(struct XorrisO *xorriso, int flag); int Xorriso_obtain_indev_readsize(struct XorrisO *xorriso, uint32_t *blocks, int flag); #endif /* Xorrisoburn_includeD */ libisoburn-1.5.4/xorriso/cmp_update.h0000644000175700017510000000354713701321754014635 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2010 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of class DirseQ which crawls along a directory's content list. */ #ifndef Xorriso_pvt_cmp_includeD #define Xorriso_pvt_cmp_includeD yes int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr, char *iso_adr, char *adr_common_tail, int *result, int flag); int Xorriso_pfx_disk_path(struct XorrisO *xorriso, char *iso_path, char *iso_prefix, char *disk_prefix, char disk_path[SfileadrL], int flag); /* @param boss_iter Opaque handle to be forwarded to actions in ISO image Set to NULL if calling this function from outside ISO world @param node Opaque handle to be forwarded to actions in ISO image Set to NULL if calling this function from outside ISO world @param flag bit0= update rather than compare */ int Xorriso_find_compare(struct XorrisO *xorriso, void *boss_iter, void *node, char *iso_path, char *iso_prefix, char *disk_prefix, int flag); /* @param boss_iter Opaque handle to be forwarded to actions in ISO image Set to NULL if calling this function from outside ISO world @param @node Opaque handle to be forwarded to actions in ISO image Set to NULL if calling this function from outside ISO world */ int Xorriso_update_interpreter(struct XorrisO *xorriso, void *boss_iter, void *node, int compare_result, char *disk_path, char *iso_rr_path, int flag); #endif /* ! Xorriso_pvt_cmp_includeD */ libisoburn-1.5.4/xorriso/parse_exec.h0000644000175700017510000001020613701321754014620 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2014 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of functions which deal with parsing and interpretation of command input. */ #ifndef Xorriso_pvt_cmd_includeD #define Xorriso_pvt_cmd_includeD yes /* @param flag bit0= do not warn of wildcards bit1= these are disk_paths */ int Xorriso_end_idx(struct XorrisO *xorriso, int argc, char **argv, int idx, int flag); int Xorriso_opt_args(struct XorrisO *xorriso, char *cmd, int argc, char **argv, int idx, int *end_idx, int *optc, char ***optv, int flag); int Xorriso_get_problem_status(struct XorrisO *xorriso, char severity[80], int flag); int Xorriso_set_problem_status(struct XorrisO *xorriso, char *severity, int flag); /** @param flag bit0= do not issue own event messages bit1= take xorriso->request_to_abort as reason for abort @return Gives the advice: 2= pardon was given, go on 1= no problem, go on 0= function failed but xorriso would not abort, go on <0= do abort -1 = due to problem_status -2 = due to xorriso->request_to_abort */ int Xorriso_eval_problem_status(struct XorrisO *xorriso, int ret, int flag); int Xorriso_cpmv_args(struct XorrisO *xorriso, char *cmd, int argc, char **argv, int *idx, int *optc, char ***optv, char eff_dest[SfileadrL], int flag); /* @param flag bit0= with adr_mode sbsector: adr_value is possibly 16 too high */ int Xorriso_decode_load_adr(struct XorrisO *xorriso, char *cmd, char *adr_mode, char *adr_value, int *entity_code, char entity_id[81], int flag); int Xorriso_check_thing_len(struct XorrisO *xorriso, char *name, int size, char *cmd, char *thing, int flag); int Xorriso_check_name_len(struct XorrisO *xorriso, char *name, int size, char *cmd, int flag); /* @param flag bit0= prepend wd only if name does not begin by '/' bit2= prepend wd (automatically done if wd[0]!=0) */ int Xorriso_make_abs_adr(struct XorrisO *xorriso, char *wd, char *name, char adr[], int flag); /* @param flag bit0= do not complain in case of error, but set info_text */ int Xorriso_convert_datestring(struct XorrisO *xorriso, char *cmd, char *time_type, char *timestring, int *t_type, time_t *t, int flag); int Xorriso_check_temp_mem_limit(struct XorrisO *xorriso, off_t mem, int flag); int Xorriso_execv(struct XorrisO *xorriso, char *cmd, int in_argc, char **in_argv, char *env_path, int *stdin_pipe, int *stdout_pipe, pid_t *forked_pid, int *status, int flag); int Xorriso_pipe_open(struct XorrisO *xorriso, char *purpose, char *cmd, int in_argc, char **in_argv, char *env_path, int *fd, pid_t *forked_pid, int flag); int Xorriso_wait_child_end(struct XorrisO *xorriso, pid_t child_pid, int *status, int flag); int Xorriso_path_is_excluded(struct XorrisO *xorriso, char *path, int flag); int Xorriso_path_is_hidden(struct XorrisO *xorriso, char *path, int flag); /* Normalize ACL and sort apart "access" ACL from "default" ACL. */ int Xorriso_normalize_acl_text(struct XorrisO *xorriso, char *in_text, char **access_acl_text, char **default_acl_text, int flag); int Xorriso_read_mkisofsrc(struct XorrisO *xorriso, int flag); /* @param flag bit0= list sorting order rather than looking for argv[idx] */ int Xorriso_cmd_sorting_rank(struct XorrisO *xorriso, int argc, char **argv, int idx, int flag); #endif /* ! Xorriso_pvt_cmd_includeD */ libisoburn-1.5.4/xorriso/match.c0000644000175700017510000005376413701321754013611 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2013 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of functions for pattern matching. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" /* @param flag bit0= do not augment relative structured search by xorriso->wdi bit1= return 2 if bonked at start point by .. (caller then aborts or retries without bit0) bit2= eventually prepend wdx rather than wdi @return <=0 error, 1= ok, 2= with bit1: relative pattern exceeds start point */ int Xorriso_prepare_regex(struct XorrisO *xorriso, char *adr, int flag) { int l,ret,i,count,bonked= 0,is_constant,is_still_relative= 0, adr_size; char *cpt,*npt,*adr_part= NULL, *absolute_adr= NULL, *adr_start,*wd; adr_size= 2 * SfileadrL; Xorriso_alloc_meM(adr_part, char, adr_size); Xorriso_alloc_meM(absolute_adr, char, adr_size); if(flag&4) wd= xorriso->wdx; else wd= xorriso->wdi; if(xorriso->search_mode>=2 && xorriso->search_mode<=4) { if(xorriso->search_mode==3 || xorriso->search_mode==4) { l= strlen(adr)+strlen(wd)+1; if(l * 2 + 2 > ((int) sizeof(xorriso->reg_expr)) || l * 2 + 2 > adr_size){ sprintf(xorriso->info_text,"Search pattern too long"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } Xorriso_destroy_re(xorriso,0); if(xorriso->structured_search && xorriso->search_mode==3) { if(adr[0]!='/') is_still_relative= 1; if(is_still_relative && !(flag&1)) { /* relative expression : prepend working directory */ sprintf(absolute_adr,"%s/%s",wd,adr); adr_start= absolute_adr; xorriso->prepended_wd= 1; is_still_relative= 0; } else adr_start= adr; /* count slashes */; cpt= adr_start; while(*cpt=='/') cpt++; for(i= 0;1;i++) { cpt= strchr(cpt,'/'); if(cpt==NULL) break; while(*cpt=='/') cpt++; } count= i+1; xorriso->re= TSOB_FELD(regex_t,count); if(xorriso->re==NULL) {ret= -1; goto ex;} xorriso->re_constants= TSOB_FELD(char *,count); if(xorriso->re_constants==NULL) {ret= -1; goto ex;} for(i= 0;ire_constants[i]= NULL; xorriso->re_count= count; xorriso->re_fill= 0; /* loop over slash chunks*/; cpt= adr_start; xorriso->re_fill= 0; while(*cpt=='/') cpt++; for(i= 0;i= adr_size) {ret= -1; goto ex;} strcpy(adr_part,cpt); } else { if(npt-cpt >= adr_size) {ret= -1; goto ex;} strncpy(adr_part,cpt,npt-cpt); adr_part[npt-cpt]= 0; } if(adr_part[0]==0) goto next_adr_part; if(adr_part[0] == '.' && adr_part[1] == 0) goto next_adr_part; if(adr_part[0]=='.' && adr_part[1]=='.' && adr_part[2]==0) { /* delete previous part */ if(xorriso->re_fill <= 0) { bonked= 1; goto next_adr_part; } if(xorriso->re_constants[xorriso->re_fill-1]!=NULL) { free(xorriso->re_constants[xorriso->re_fill-1]); xorriso->re_constants[xorriso->re_fill-1]= NULL; } else regfree(&(xorriso->re[xorriso->re_fill-1])); (xorriso->re_fill)--; goto next_adr_part; } if(strcmp(adr_part,"*")==0) { adr_part[0]= 0; ret= 2; } else ret= Xorriso__bourne_to_reg(adr_part,xorriso->reg_expr,0); if(ret==2) { if(Sregex_string(&(xorriso->re_constants[xorriso->re_fill]),adr_part,0) <=0) {ret= -1; goto ex;} } else { if(regcomp(&(xorriso->re[xorriso->re_fill]),xorriso->reg_expr,0)!=0) goto cannot_compile; } xorriso->re_fill++; next_adr_part:; if(i==count-1) break; cpt= npt+1; while(*cpt=='/') cpt++; } if(bonked) { if(flag&2) {ret= 2; goto ex;} sprintf(xorriso->info_text, "Your '..' bonked at the %s directory.", is_still_relative ? "working" : "root"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE",0); {ret= 0; goto ex;} } if(xorriso->re_fill == 0 && is_still_relative) { /* "." and its equivalents end up here */ if(Sregex_string(&(xorriso->re_constants[0]), ".", 0) <=0) {ret= -1; goto ex;} xorriso->re_fill= 1; } Xorriso__bourne_to_reg(adr_start,xorriso->reg_expr,0); /* just for show */ } else { is_constant= 0; if(strcmp(adr,"*")==0 || adr[0]==0) { is_constant= 1; } else if(xorriso->search_mode==3 || xorriso->search_mode==4) { ret= Xorriso__bourne_to_reg(adr,xorriso->reg_expr,0); is_constant= (ret==2); } else { if(strlen(adr)>=sizeof(xorriso->reg_expr)) {ret= -1; goto ex;} strcpy(xorriso->reg_expr,adr); } xorriso->re_count= 0; /* tells matcher that this is not structured */ xorriso->re_constants= TSOB_FELD(char *,1); if(xorriso->re_constants==NULL) {ret= -1; goto ex;} xorriso->re_constants[0]= NULL; if(is_constant) { if(strcmp(adr,"*")==0) { if(Sregex_string(&(xorriso->re_constants[0]),"",0)<=0) {ret= -1; goto ex;} } else { if(Sregex_string(&(xorriso->re_constants[0]),adr,0)<=0) {ret= -1; goto ex;} } xorriso->re_fill= 1; } else { xorriso->re= TSOB_FELD(regex_t,1); if(xorriso->re==NULL) {ret= -1; goto ex;} if(regcomp(&(xorriso->re[0]),xorriso->reg_expr,0)!=0) { cannot_compile:; sprintf(xorriso->info_text, "Cannot compile regular expression : %s", xorriso->reg_expr); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE",0); {ret= 0; goto ex;} } } } } ret= 1; ex:; Xorriso_free_meM(adr_part); Xorriso_free_meM(absolute_adr); return(ret); } /* @param flag bit0= do not shortcut last component of to_match bit1= consider match if regex matches parent of path bit2= retry beginning at failed last component @return 0=match , else no match */ int Xorriso_regexec(struct XorrisO *xorriso, char *to_match, int *failed_at, int flag) { int ret,i,re_start= 0,reg_nomatch= -1; char *cpt,*npt, *adr_part= NULL, *mpt; Xorriso_alloc_meM(adr_part, char, SfileadrL); reg_nomatch= REG_NOMATCH; *failed_at= 0; if(!(xorriso->structured_search && xorriso->re_count>0)) { if(xorriso->re_constants!=NULL) if(xorriso->re_constants[0]!=NULL) { if(xorriso->re_constants[0][0]==0) {ret= 0; goto ex;} if(strcmp(xorriso->re_constants[0],to_match)!=0) {ret= reg_nomatch; goto ex;} {ret= 0; goto ex;} } ret= regexec(&(xorriso->re[0]),to_match,1,xorriso->match,0); goto ex; } cpt= to_match; while(*cpt=='/') cpt++; if(flag&4) re_start= xorriso->re_failed_at; if(re_start<0) re_start= 0; for(i= re_start;ire_fill;i++) { *failed_at= i; npt= strchr(cpt,'/'); if(npt==NULL) { if(ire_fill-1 && !(flag&1)) {ret= reg_nomatch; goto ex;} /* this must be the last expression part */ mpt= cpt; } else { strncpy(adr_part,cpt,npt-cpt); adr_part[npt-cpt]= 0; mpt= adr_part; } if(xorriso->re_constants[i]!=NULL) { if(xorriso->re_constants[i][0]!=0) /* empty constant matches anything */ if(strcmp(xorriso->re_constants[i],mpt)!=0) {ret= reg_nomatch; goto ex;} } else { ret= regexec(&(xorriso->re[i]),mpt,1,xorriso->match,0); if(ret!=0) goto ex; } if(npt==NULL) { if(i>=xorriso->re_fill-1) {ret= 0; goto ex;} /* MATCH */ *failed_at= i+1; {ret= reg_nomatch; goto ex;} } cpt= npt+1; while(*cpt=='/') cpt++; } *failed_at= xorriso->re_fill; if(flag & 2) {ret= 0; goto ex;} /* MATCH */ ret= reg_nomatch; ex:; Xorriso_free_meM(adr_part); return(ret); } int Xorriso_is_in_patternlist(struct XorrisO *xorriso, struct Xorriso_lsT *patternlist, char *path, int flag) { int ret, failed_at, i= 0; struct Xorriso_lsT *s; xorriso->search_mode= 3; xorriso->structured_search= 1; for(s= patternlist; s != NULL; s= Xorriso_lst_get_next(s, 0)) { ret= Xorriso_prepare_regex(xorriso, Xorriso_lst_get_text(s, 0), 0); if(ret <= 0) return(-1); /* Match path or parent of path */ ret= Xorriso_regexec(xorriso, path, &failed_at, 2); if(ret == 0) return(i + 1); i++; } return(0); } char *Xorriso_get_pattern(struct XorrisO *xorriso, struct Xorriso_lsT *patternlist, int index, int flag) { int i= 0; struct Xorriso_lsT *s; for(s= patternlist; s != NULL; s= Xorriso_lst_get_next(s, 0)) { if(i == index) return(Xorriso_lst_get_text(s, 0)); i++; } return(NULL); } /* @param flag bit2= this is a disk_pattern @return <=0 failure , 1 pattern ok , 2 pattern needed prepended wd */ int Xorriso_prepare_expansion_pattern(struct XorrisO *xorriso, char *pattern, int flag) { int ret, prepwd= 0; ret= Xorriso_prepare_regex(xorriso, pattern, 1|2|(flag&4)); if(ret==2) { ret= Xorriso_prepare_regex(xorriso, pattern, flag&4); prepwd= 1; } if(ret<=0) { sprintf(xorriso->info_text, "Cannot compile pattern to regular expression: %s", pattern); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1+prepwd); } /* @param flag bit0= count results rather than storing them bit1= unexpected change of number is a FATAL event @return <=0 error , 1 is root (end processing) , 2 is not root (go on processing) */ int Xorriso_check_for_root_pattern(struct XorrisO *xorriso, int *filec, char **filev, int count_limit, off_t *mem, int flag) { if(xorriso->re_fill!=0) return(2); /* This is the empty pattern representing root */ if(flag&1) { (*filec)++; (*mem)+= 8; } else { if(*filec >= count_limit) { sprintf(xorriso->info_text, "Number of matching files changed unexpectedly (> %d)", count_limit); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, (flag&2 ? "FATAL" : "WARNING"), 0); return(flag&2 ? -1 : 0); } filev[*filec]= strdup("/"); if(filev[*filec]==NULL) { Xorriso_no_pattern_memory(xorriso, (off_t) 2, 0); return(-1); } (*filec)++; } return(1); } /* @param flag bit0= count result rather than storing it bit1= unexpected change of number is a FATAL event */ int Xorriso_register_matched_adr(struct XorrisO *xorriso, char *adr, int count_limit, int *filec, char **filev, off_t *mem, int flag) { int l; if(flag&1) { (*filec)++; l= strlen(adr)+1; (*mem)+= sizeof(char *)+l; if(l % sizeof(char *)) (*mem)+= sizeof(char *)-(l % sizeof(char *)); } else { if(*filec >= count_limit) { sprintf(xorriso->info_text, "Number of matching files changed unexpectedly (> %d)", count_limit); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, (flag&2 ? "FATAL" : "WARNING"), 0); return(flag&2 ? -1 : 0); } filev[*filec]= strdup(adr); if(filev[*filec]==NULL) { Xorriso_no_pattern_memory(xorriso, (off_t) (strlen(adr)+1), 0); return(-1); } (*filec)++; } return(1); } /* @param flag bit0= count results rather than storing them bit1= this is a recursion bit2= prepend wd (automatically done if wd[0]!=0) @return <=0 error , 1 ok , 2 could not open directory */ int Xorriso_obtain_pattern_files_x( struct XorrisO *xorriso, char *wd, char *dir_adr, int *filec, char **filev, int count_limit, off_t *mem, int *dive_count, int flag) { int ret, failed_at, follow_mount, follow_links; struct DirseQ *dirseq= NULL; struct stat stbuf; dev_t dir_dev; char *path; char *adr= NULL, *name= NULL, *path_data= NULL; adr= malloc(SfileadrL); name= malloc(SfileadrL); path_data= malloc(SfileadrL); if(adr==NULL || name==NULL || path_data==NULL) { Xorriso_no_malloc_memory(xorriso, &adr, 0); {ret= -1; goto ex;} } follow_mount= (xorriso->do_follow_mount || xorriso->do_follow_pattern); follow_links= (xorriso->do_follow_links || xorriso->do_follow_pattern); if(!(flag&2)) *dive_count= 0; else (*dive_count)++; ret= Xorriso_check_for_root_pattern(xorriso, filec, filev, count_limit, mem, flag&1); if(ret!=2) goto ex; if(lstat(dir_adr, &stbuf)==-1) {ret= 2; goto ex;} dir_dev= stbuf.st_dev; if(S_ISLNK(stbuf.st_mode)) { if(stat(dir_adr, &stbuf)==-1) {ret= 2; goto ex;} if(dir_dev != stbuf.st_dev && !follow_mount) {ret= 2; goto ex;} } ret= Dirseq_new(&dirseq, dir_adr, 1); if(ret<0) { sprintf(xorriso->info_text, "Cannot obtain disk directory iterator"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } if(ret==0) {ret= 2; goto ex;} while(1) { ret= Dirseq_next_adr(dirseq,name,0); if(ret==0) break; if(ret<0) { sprintf(xorriso->info_text,"Failed to obtain next directory entry"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } ret= Xorriso_make_abs_adr(xorriso, wd, name, adr, flag&4); if(ret<=0) goto ex; ret= Xorriso_regexec(xorriso, adr, &failed_at, 1); if(ret>0) { /* no match */ if(failed_at <= *dive_count) /* no hope for a match */ continue; path= adr; if(adr[0]!='/') { path= path_data; ret= Xorriso_make_abs_adr(xorriso, xorriso->wdx, adr, path, 1|4); if(ret<=0) goto ex; } if(follow_links) ret= stat(path,&stbuf); else ret= lstat(path,&stbuf); if(ret==-1) continue; if(!S_ISDIR(stbuf.st_mode)) continue; if(dir_dev != stbuf.st_dev && !follow_mount) continue; /* dive deeper */ ret= Xorriso_obtain_pattern_files_x(xorriso, adr, path, filec, filev, count_limit, mem, dive_count, flag|2); if(ret<=0) goto ex; } else { ret= Xorriso_register_matched_adr(xorriso, adr, count_limit, filec, filev, mem, flag&1); if(ret<0) goto ex; if(ret==0) break; } } ret= 1; ex:; if(adr!=NULL) free(adr); if(name!=NULL) free(name); if(path_data!=NULL) free(path_data); Dirseq_destroy(&dirseq,0); if(flag&2) (*dive_count)--; return(ret); } int Xorriso_eval_nonmatch(struct XorrisO *xorriso, char *pattern, int *nonconst_mismatches, off_t *mem, int flag) { int k,l; /* Is this a constant pattern ? */ for(k= 0; kre_fill; k++) { if(xorriso->re_constants[k]==NULL) break; if(xorriso->re_constants[k][0]==0) break; } if(kre_fill) (*nonconst_mismatches)++; /* it is not */ l= strlen(pattern)+1; (*mem)+= sizeof(char *)+l; if(l % sizeof(char *)) (*mem)+= sizeof(char *)-(l % sizeof(char *)); return(1); } /* @param flag bit0= a match count !=1 is a SORRY event bit1= a match count !=1 is a FAILURE event */ int Xorriso_check_matchcount(struct XorrisO *xorriso, int count, int nonconst_mismatches, int num_patterns, char **patterns, int flag) { if((flag&1) && (count!=1 || nonconst_mismatches)){ if(count-nonconst_mismatches>0) sprintf(xorriso->info_text, "Pattern match with more than one file object"); else sprintf(xorriso->info_text, "No pattern match with any file object"); if(num_patterns==1) sprintf(xorriso->info_text+strlen(xorriso->info_text), ": "); Text_shellsafe(patterns[0], xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, (flag&2 ? "FAILURE" : "SORRY"), 0); return(0); } return(1); } int Xorriso_no_pattern_memory(struct XorrisO *xorriso, off_t mem, int flag) { char mem_text[80]; Sfile_scale((double) mem, mem_text,5,1e4,1); sprintf(xorriso->info_text, "Cannot allocate enough memory (%s) for pattern expansion", mem_text); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); return(1); } int Xorriso_alloc_pattern_mem(struct XorrisO *xorriso, off_t mem, int count, char ***filev, int flag) { char mem_text[80], limit_text[80]; Sfile_scale((double) mem, mem_text,5,1e4,0); sprintf(xorriso->info_text, "Temporary memory needed for pattern expansion : %s", mem_text); if(!(flag&1)) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); if(mem > xorriso->temp_mem_limit) { Sfile_scale((double) xorriso->temp_mem_limit, limit_text,5,1e4,1); sprintf(xorriso->info_text, "List of matching file addresses exceeds -temp_mem_limit (%s > %s)", mem_text, limit_text); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } (*filev)= (char **) calloc(count, sizeof(char *)); if(*filev==NULL) { Xorriso_no_pattern_memory(xorriso, mem, 0); return(-1); } return(1); } /* @param flag bit0= a match count !=1 is a FAILURE event bit1= with bit0 tolerate 0 matches if pattern is a constant bit3= do not add unresolved pattern to filev */ int Xorriso_expand_disk_pattern(struct XorrisO *xorriso, int num_patterns, char **patterns, int extra_filec, int *filec, char ***filev, off_t *mem, int flag) { int ret, count= 0, abs_adr= 0, i, was_count, was_filec; int nonconst_mismatches= 0, dive_count= 0; char *dir_adr= NULL; Xorriso_alloc_meM(dir_adr, char, SfileadrL); *filec= 0; *filev= NULL; xorriso->search_mode= 3; xorriso->structured_search= 1; for(i= 0; iwdx); if(dir_adr[0]==0) strcpy(dir_adr, "/"); ret= Sfile_type(dir_adr, 1|4); if(ret!=2) { Xorriso_msgs_submit(xorriso, 0, dir_adr, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "Address set by -cdx is not a directory: "); Text_shellsafe(dir_adr, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } /* count the matches */ was_count= count; ret= Xorriso_obtain_pattern_files_x(xorriso, "", dir_adr, &count, NULL, 0, mem, &dive_count, 1 | abs_adr); if(ret<=0) goto ex; if(was_count==count && strcmp(patterns[i],"*")!=0 && (flag&3)!=1 && !(flag & 8)) { count++; ret= Xorriso_eval_nonmatch(xorriso, patterns[i], &nonconst_mismatches, mem, 0); if(ret<=0) goto ex; } } ret= Xorriso_check_matchcount(xorriso, count, nonconst_mismatches, num_patterns, patterns, (flag&1)|2); if(ret<=0) goto ex; count+= extra_filec; (*mem)+= extra_filec * sizeof(char *); if(count<=0) {ret= !(flag & 8); goto ex;} ret= Xorriso_alloc_pattern_mem(xorriso, *mem, count, filev, 0); if(ret<=0) goto ex; /* now store addresses */ for(i= 0; iwdx); if(dir_adr[0]==0) strcpy(dir_adr, "/"); } was_filec= *filec; ret= Xorriso_obtain_pattern_files_x(xorriso, "", dir_adr, filec, *filev, count, mem, &dive_count, abs_adr); if(ret<=0) goto ex; if(was_filec == *filec && strcmp(patterns[i],"*")!=0 && (flag & 3) != 1 && !(flag & 8)) { (*filev)[*filec]= strdup(patterns[i]); if((*filev)[*filec]==NULL) { (*mem)= strlen(patterns[i])+1; Xorriso_no_pattern_memory(xorriso, *mem, 0); ret= -1; goto ex; } (*filec)++; } } ret= 1; ex:; if(ret<=0) { if(filev!=NULL) Sfile_destroy_argv(&count, filev, 0); *filec= 0; } Xorriso_free_meM(dir_adr); return(ret); } /* @param flag bit0= command without pattern capability bit1= disk_pattern rather than iso_rr_pattern */ int Xorriso_warn_of_wildcards(struct XorrisO *xorriso, char *path, int flag) { static int count_iso= 0, count_disk= 0, max_iso= 3, max_disk= 3; if(strchr(path,'*')!=NULL || strchr(path,'?')!=NULL || strchr(path,'[')!=NULL) { if(flag & 2) { count_disk++; if(count_disk > max_disk) return(1); } else { count_iso++; if(count_iso > max_iso) return(1); } if(flag&1) { sprintf(xorriso->info_text, "Pattern expansion of wildcards \"*?[\" does not apply to this command"); } else { sprintf(xorriso->info_text, "Pattern expansion of wildcards \"*?[\" is disabled by command %s", (flag&2) ? "-disk_pattern or -pathspecs" : "-iso_rr_pattern"); } Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); sprintf(xorriso->info_text,"Pattern seen: "); Text_shellsafe(path, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); return(1); } return(0); } libisoburn-1.5.4/xorriso/xorriso-tcltk.texi0000644000175700017510000002205214005266152016050 00000000000000\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename xorriso-tcltk.info @settitle GNU xorriso-tcltk 1.5.4 @c %**end of header @c @c man-ignore-lines begin @dircategory Archiving @direntry * Xorriso-tcltk: (xorriso-tcltk). Educational GUI frontend for xorriso @end direntry @c man-ignore-lines end @c @c Notes about embedded man page: @c This texinfo code contains the necessary info to produce a man page @c which resembles much the version of xorriso.1 from which this code @c was originally derived in march 2010. @c One can produce the man page by applying the following rules: @c The first line gets discarded. @c Line start "@c man " will become "", the remainder is put out unaltered. @c Lines "@*" will be converted to ".br" @c "@c man-ignore-lines N" will discard N following lines. @c "@c man-ignore-lines begin" discards all following lines @c up to "@c man-ignore-lines end". @c Line blocks of "@menu" "@end menu" will be discarded. @c "@item word words" becomes "\fBword\fR words". @c @b{...}, @command{...}, @dfn{...}, @emph{...}, @strong{...} @c get mapped to \fB...\fR . @c @abbr{...}, @code{...}, @file{...}, @i{...}, @option{...}, @r{...}, @c @ref{...}, @samp{...},@var{...}, get mapped to ... . @c @ref{...}, @xref{...} get mapped to empty text. @c @email{...} gets mapped to <...> . @c Mapped {...} content is subject to the rules except {...} mapping. @c @minus{} will become "-". @c @@ , @{, @} will get stripped of their first @. @c Other lines which begin by "@" will be discarded. @c In lines not stemming from "@c man", "\" becomes "\\" @c "-" which are not preceded by an uneven number of "\" will get @c prepended one "\". @c @c @c man .\" Hey, EMACS: -*- nroff -*- @c man .\" @c man .\" IMPORTANT NOTE: @c man .\" @c man .\" The original of this file is kept in xorriso/xorriso-tcltk.texi @c man .\" This here was generated by program xorriso/make_xorriso_1 @c man .\" @c man .\" @c man .\" First parameter, NAME, should be all caps @c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection @c man .\" other parameters are allowed: see man(7), man(1) @c man .TH XORRISO-TCLTK 1 "Version 1.5.4, Jan 30, 2021" @c man .\" Please adjust this date whenever revising the manpage. @c man .\" @c man .\" Some roff macros, for reference: @c man .\" .nh disable hyphenation @c man .\" .hy enable hyphenation @c man .\" .ad l left justify @c man .\" .ad b justify to both left and right margins @c man .\" .nf disable filling @c man .\" .fi enable filling @c man .\" .br insert line break @c man .\" .sp insert n+1 empty lines @c man .\" for manpage-specific macros, see man(7) @c man .nh @c man-ignore-lines begin @copying xorriso-tcltk - Educational GUI frontend for xorriso Copyright @copyright{} 2011 - 2021 Thomas Schmitt @quotation Permission is granted to distribute this text freely. @end quotation @end copying @c man-ignore-lines end @titlepage @title Manual of GNU xorriso frontend xorriso-tcltk 1.5.4 @author Thomas Schmitt @page @vskip 0pt plus 1filll @insertcopying @end titlepage @contents @ifnottex @node Top @top xorriso-tcltk 1.5.4 @c man-ignore-lines 1 @c man .SH NAME xorriso-tcltk - Educational GUI frontend for xorriso @end ifnottex @menu * Overview:: Overview * Options:: Options * Examples:: Examples * Files:: Files * Seealso:: See also * Bugreport:: Reporting bugs * Legal:: Author, Copyright, Credits * CommandIdx:: Alphabetic Command List * ConceptIdx:: Alphabetic List of Concepts and Objects @end menu @node Overview, Options, Top, Top @chapter Overview @c man .SH SYNOPSIS @c man .B xorriso-tcltk @c man [ options ] @c man .br @c man .SH DESCRIPTION @c man .PP @command{xorriso-tcltk} demonstrates xorriso use cases by a collection of GUI components. @* @sp 1 @c man .PP It creates a window with buttons, editable text fields, and list boxes. For exploration simply start @command{xorriso-tcltk} without any options. @* @sp 1 @c man .PP Click on the "Help" button at the upper right edge to get an overview help text in a separate window. It explains the three main parts of the GUI window and it gives examples for a few main use cases of xorriso. @* @sp 1 @c man .PP Click by the rightmost mouse button on any button, list box, or text field, to get a specific help text in another window. @* @sp 1 @c man .PP @command{xorriso} is a program which copies file objects from POSIX compliant filesystems into Rock Ridge enhanced ISO 9660 filesystems and performs session-wise manipulation of such filesystems. It can load the management information of existing ISO images and it writes the session results to optical media or to filesystem objects. @* Vice versa @command{xorriso} is able to copy file objects out of ISO 9660 filesystems. @c man .SS @node Options, Examples, Overview, Top @chapter Options @cindex xorriso, options @c man .br @c man .SH OPTIONS @c man .br @c man .PP Normally, no program options are needed when @command{xorriso-tcltk} gets started. Some of the options are for demonstration of program development. This man page lists only those options which may be helpful for end users. @c man .PP @c man .TP @table @asis @item @minus{}@minus{}help @kindex @minus{}@minus{}help print help text to stderr @cindex Help text, print to stderr, @minus{}@minus{}help Print a help text with the complete list of start options and exit. @c man .TP @item @minus{}@minus{}no_extract @kindex @minus{}@minus{}no_extract ban extraction of files to disk @cindex Extraction of files, ban, @minus{}@minus{}no_extract Do not allow extraction of files from ISO filesystem to hard disk. This is not revokable during the program run. @c man .TP @item @minus{}@minus{}geometry @{+|-@}X@{+|-@}Y @kindex @minus{}@minus{}geometry set position of main window @cindex Main window, position, @minus{}@minus{}geometry Set the position of the main window on the screen. +0X is the left edge, -0X is the right edge, +0Y is the upper edge, -0Y is the lower edge. @c man .TP @item @minus{}@minus{}click_to_focus @kindex @minus{}@minus{}click_to_focus click needed before text input @cindex Keyboard focus, change by click, @minus{}@minus{}click_to_focus Chooses that input fields and list boxes get the keyboard focus only when being clicked by the mouse. This is the default. @c man .TP @item @minus{}@minus{}auto_focus @kindex @minus{}@minus{}auto_focus text input where mouse is @cindex Keyboard focus, where mouse is, @minus{}@minus{}auto_focus Chooses that the keyboard focus is where the mouse pointer is. @end table @node Examples, Files, Options, Top @chapter Examples @c man .SH EXAMPLES Just run @command{xorriso-tcltk} in a shell terminal without any further arguments @c man .SH FILES @node Files, Seealso, Examples, Top @chapter Files @c man .SS @c man .B Startup files: @section Startup Files @* When starting xorriso, its normal startup files get read and their text lines get executed as commands. See section FILES in the man page of xorriso or chapter Files in the info document of xorriso. @c man .SH SEE ALSO @c man .TP @c man .BR xorriso(1) @c man-ignore-lines begin @node Seealso, Bugreport, Files, Top @chapter See also info xorriso @c man-ignore-lines end @c man .SH BUGS @node Bugreport, Legal, Seealso, Top @chapter Reporting bugs @cindex Bugs, reporting @cindex Problems, reporting To report bugs, request help, or suggest enhancements for @command{xorriso} or @command{xorriso-tcltk}, please send electronic mail to the public list @email{bug-xorriso@@gnu.org}. If more privacy is desired, mail to @email{scdbackup@@gmx.net}. @* @sp 1 Please describe what you expect the program to do, the program arguments, GUI components, or dialog commands by which you tried to achieve it, the messages of @command{xorriso}, and the undesirable outcome of your program run. @* @sp 1 Expect to get asked more questions before solutions can be proposed. @c man .SH AUTHOR @node Legal, CommandIdx, Bugreport, Top @chapter Author, Copyright, Credits @section Author Thomas Schmitt @* for libburnia-project.org @c man .SH COPYRIGHT @section Copyright Copyright (c) 2011 - 2021 Thomas Schmitt @* Permission is granted to distribute this text freely. It shall only be modified in sync with the technical properties of xorriso-tcltk. If you make use of the license to derive modified versions of xorriso-tcltk then you are entitled to modify this text under that same license. @c man .SH CREDITS @section Credits @command{xorriso} is in part based on work by Vreixo Formoso who provides libisofs together with Mario Danic who also leads the libburnia team. Thanks to Andy Polyakov who invented emulated growing, to Derek Foreman and Ben Jansens who once founded libburn. @* Compliments towards Joerg Schilling whose cdrtools served me for ten years. @c man-ignore-lines begin @node CommandIdx, ConceptIdx, Legal, Top @chapter Alphabetic Options List @printindex ky @node ConceptIdx,, CommandIdx, Top @chapter Alphabetic List of Concepts and Objects @printindex cp @c man-ignore-lines end @bye libisoburn-1.5.4/xorriso/opts_a_c.c0000644000175700017510000026225313735152347014306 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2019 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of commands -a* to -c* as mentioned in man page or info file derived from xorriso.texi. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include /* for -charset */ #include #include #include #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" /* Option -abort_on */ int Xorriso_option_abort_on(struct XorrisO *xorriso, char *in_severity, int flag) { int ret, sev; char severity[20], *official; Xorriso__to_upper(in_severity, severity, (int) sizeof(severity), 0); ret= Xorriso__text_to_sev(severity, &sev, 0); if(ret<=0) { sprintf(xorriso->info_text, "-abort_on: Not a known severity name : "); Text_shellsafe(in_severity, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(ret); } ret= Xorriso__sev_to_text(sev, &official, 0); if(ret <= 0) official= severity; if(Sfile_str(xorriso->abort_on_text, official, 0) <= 0) return(-1); xorriso->abort_on_severity= sev; xorriso->abort_on_is_default= 0; Xorriso_set_abort_severity(xorriso, 0); return(1); } /* Option -abstract_file */ int Xorriso_option_abstract_file(struct XorrisO *xorriso, char *name, int flag) { if(Xorriso_check_name_len(xorriso, name, (int) sizeof(xorriso->abstract_file), "-abstract_file", 0) <= 0) return(0); strcpy(xorriso->abstract_file, name); Xorriso_set_change_pending(xorriso, 1); return(1); } /* Option -acl "on"|"off" */ int Xorriso_option_acl(struct XorrisO *xorriso, char *mode, int flag) { int ret; if(strcmp(mode, "off")==0) xorriso->do_aaip&= ~3; else if(strcmp(mode, "on")==0) xorriso->do_aaip|= (1 | 2); else { sprintf(xorriso->info_text, "-acl: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_set_ignore_aclea(xorriso, 0); if(ret <= 0) return(ret); return(1); } /* @param flag bit3= unescape \\ */ static void unescape_pathspec_part(char *rpt, int flag) { char *wpt; wpt= rpt; for(; *rpt != 0; rpt++) { if(*rpt == '\\') { if(*(rpt + 1) == '=') continue; if((flag & 8) && *(rpt + 1) == '\\') rpt++; } *(wpt++)= *rpt; } *wpt= 0; } /* Option -add */ /* @param flag bit0=do not report the added item bit1=do not reset pacifier, no final pacifier message bit2= prepend ISO working directory in any case */ int Xorriso_option_add(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int i, end_idx, ret, was_failure= 0, fret, optc= 0, split, as_mkisofs= 0; char *target= NULL, *source= NULL, *ept, *eff_path= NULL; char **optv= NULL; ret= Xorriso_opt_args(xorriso, "-add", argc, argv, *idx, &end_idx, &optc, &optv, ((!!xorriso->allow_graft_points)<<2)|2); if(ret<=0) goto ex; Xorriso_alloc_meM(target, char, SfileadrL); Xorriso_alloc_meM(source, char, SfileadrL); Xorriso_alloc_meM(eff_path, char, SfileadrL); if(xorriso->allow_graft_points & 2) as_mkisofs= 8; if(!(flag&2)) Xorriso_pacifier_reset(xorriso, 0); for(i= 0; iallow_graft_points) { ret= Fileliste__target_source_limit(target, '=', &ept, !(xorriso->allow_graft_points & 2)); if(ret>0) { *ept= 0; strcpy(source, ept+1); split= 1; } /* unescape \= */; if(split) { unescape_pathspec_part(target, as_mkisofs); if(as_mkisofs) unescape_pathspec_part(source, as_mkisofs); } else { unescape_pathspec_part(source, as_mkisofs); } } if(split==0) strcpy(target, source); if(flag & 4) { ret= Sfile_prepend_path(xorriso->wdi, target, 0); if(ret<=0) { sprintf(xorriso->info_text, "Effective path gets much too long (%d)", (int) (strlen(xorriso->wdi)+strlen(target)+1)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto problem_handler; } } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, target, eff_path, 2); if(ret<=0) goto problem_handler; strcpy(target, eff_path); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, source,eff_path,2|4); if(ret<=0) goto problem_handler; strcpy(source, eff_path); ret= Xorriso_graft_in(xorriso, NULL, source, target, (off_t)0, (off_t)0, 0); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; sprintf(xorriso->info_text, "Added to ISO image: %s '%s'='%s'\n", (ret>1 ? "directory" : "file"), (target[0] ? target : "/"), source); if(!(flag&1)) Xorriso_info(xorriso, 0); continue; /* regular bottom of loop */ problem_handler:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } if(!(flag&2)) Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 1); ret= 1; ex:; (*idx)= end_idx; Xorriso_free_meM(target); Xorriso_free_meM(source); Xorriso_free_meM(eff_path); Xorriso_opt_args(xorriso, "-add", argc, argv, *idx, &end_idx, &optc, &optv, 256); if(ret<=0) return(ret); return(!was_failure); } /* Option -add_plainly "none"|"unknown" */ int Xorriso_option_add_plainly(struct XorrisO *xorriso, char *mode,int flag) { if(strcmp(mode, "none")==0) xorriso->add_plainly= 0; if(strcmp(mode, "unknown")==0) xorriso->add_plainly= 1; else if(strcmp(mode, "dashed")==0) xorriso->add_plainly= 2; else if(strcmp(mode, "any")==0) xorriso->add_plainly= 3; else { sprintf(xorriso->info_text, "-add_plainly: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -alter_date , -alter_date_r */ /* @param flag bit0=recursive (-alter_date_r) */ int Xorriso_option_alter_date(struct XorrisO *xorriso, char *time_type, char *timestring, int argc, char **argv, int *idx, int flag) { int i, ret, was_failure= 0, t_type= 0, end_idx, fret; time_t t; int optc= 0; char **optv= NULL; struct FindjoB *job= NULL; struct stat dir_stbuf; ret= Xorriso_opt_args(xorriso, "-alter_date", argc, argv, *idx, &end_idx, &optc, &optv, 0); if(ret<=0) goto ex; ret= Xorriso_convert_datestring(xorriso, "-alter_date", time_type, timestring, &t_type, &t, 0); if(ret<=0) goto ex; for(i= 0; i0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } ret= 1; ex:; (*idx)= end_idx; Xorriso_opt_args(xorriso, "-alter_date", argc, argv, *idx, &end_idx, &optc, &optv, 256); Findjob_destroy(&job, 0); if(ret<=0) return(ret); return(!was_failure); } /* Option -append_partition */ int Xorriso_option_append_partition(struct XorrisO *xorriso, char *partno_text, char *type_text, char *image_path, int flag) { int partno = 0, type_code= -1, i, guid_valid= 0, ret; unsigned int unum; char *tpt; uint8_t guid[16]; static char *part_type_names[] = {"FAT12", "FAT16", "Linux", "", NULL}; static int part_type_codes[] = { 0x01, 0x06, 0x83, 0x00}; sscanf(partno_text, "%d", &partno); if(partno < 1 || partno > Xorriso_max_appended_partitionS) { sprintf(xorriso->info_text, "-append_partition: Partition number '%s' is out of range (1...%d)", partno_text, Xorriso_max_appended_partitionS); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } for(i= 0; part_type_names[i] != NULL; i++) if(strcmp(part_type_names[i], type_text) == 0) break; if(part_type_names[i] != NULL) type_code= part_type_codes[i]; if(type_code < 0) { ret= Xorriso_parse_type_guid(xorriso, type_text, guid, &type_code, 0); if(ret > 0) guid_valid= 1; } if(type_code < 0) { tpt= type_text; if(strncmp(tpt, "0x", 2) == 0) tpt+= 2; else goto bad_type; unum= 0xffffffff; sscanf(tpt, "%X", &unum); if(unum > 0xff) { bad_type:; sprintf(xorriso->info_text, "-append_partition: Partition type '%s' is out of range (0x00...0xff or GUID)", type_text); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } type_code= unum; } if(xorriso->appended_partitions[partno - 1] != NULL) free(xorriso->appended_partitions[partno - 1]); xorriso->appended_partitions[partno - 1]= strdup(image_path); if(xorriso->appended_partitions[partno - 1] == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); return(-1); } xorriso->appended_part_types[partno - 1]= type_code; if(guid_valid) { memcpy(xorriso->appended_part_type_guids[partno - 1], guid, 16); xorriso->appended_part_gpt_flags[partno - 1]|= 1; } else { xorriso->appended_part_gpt_flags[partno - 1]&= ~1; } return(1); } /* Option -application_id */ int Xorriso_option_application_id(struct XorrisO *xorriso, char *name, int flag) { if(Xorriso_check_name_len(xorriso, name, (int) sizeof(xorriso->application_id), "-application_id", 0) <= 0) return(0); if(strcmp(name, "@xorriso@") == 0) Xorriso_preparer_string(xorriso, xorriso->application_id, 0); else strcpy(xorriso->application_id,name); Xorriso_set_change_pending(xorriso, 1); return(1); } /* Command -application_use */ int Xorriso_option_application_use(struct XorrisO *xorriso, char *path, int flag) { if(Sfile_str(xorriso->application_use, path, 0) <= 0) { sprintf(xorriso->info_text, "-application_use: parameter string is much too long (%d)", (int) strlen(path)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -as */ /* @param flag bit0=do not report the added item bit1=do not reset pacifier, no final pacifier message */ int Xorriso_option_as(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int end_idx, ret, idx_count; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); idx_count= end_idx-(*idx); if(end_idx<=0 || (*idx)>=argc) { if(idx_count<1) sprintf(xorriso->info_text, "-as : Not enough arguments given. Needed: whom do_what %s", xorriso->list_delimiter); else sprintf(xorriso->info_text, "-as %s : Not enough arguments given. Needed: do_what %s", argv[*idx], xorriso->list_delimiter); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(strcmp(argv[*idx], "cdrecord")==0 || strcmp(argv[*idx], "wodim")==0 || strcmp(argv[*idx], "cdrskin")==0 || strcmp(argv[*idx], "xorrecord")==0) { ret= Xorriso_cdrskin(xorriso, argv[*idx], end_idx-(*idx)-1, argv+(*idx)+1, 0); if(ret<=0) goto ex; } else if(strcmp(argv[*idx], "mkisofs")==0 || strcmp(argv[*idx], "genisoimage")==0 || strcmp(argv[*idx], "genisofs")==0 || strcmp(argv[*idx], "xorrisofs")==0) { ret= Xorriso_genisofs(xorriso, argv[*idx], end_idx-(*idx)-1, argv+(*idx)+1, 0); if(ret<=0) goto ex; } else { sprintf(xorriso->info_text, "-as : Not a known emulation personality: '%s'", argv[*idx]); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } ret= 1; ex:; (*idx)= end_idx; return(ret); } /* Option -assert_volid */ int Xorriso_option_assert_volid(struct XorrisO *xorriso, char *pattern, char *severity, int flag) { int ret, sev; char *sev_text= "", off_severity[20]; if(strlen(pattern)>=sizeof(xorriso->assert_volid)) { sprintf(xorriso->info_text, "Name too long with option -application_id (%d > %d)", (int) strlen(pattern), (int) sizeof(xorriso->assert_volid)-1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } if(pattern[0]) { ret= Sregex_match(pattern, "", 1); if(ret <= 0) { sprintf(xorriso->info_text, "-assert_volid: Cannot use given pattern."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } if(severity[0] != 0 || pattern[0] != 0) { if(severity[0] == 0) sev_text= xorriso->abort_on_text; else sev_text= severity; if(strcmp(sev_text, "NEVER") == 0) sev_text= "ABORT"; Xorriso__to_upper(sev_text, off_severity, (int) sizeof(off_severity), 0); sev_text= off_severity; ret= Xorriso__text_to_sev(sev_text, &sev, 0); if(ret<=0) { sprintf(xorriso->info_text, "-assert_volid: Not a known severity name : "); Text_shellsafe(severity, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(ret); } } if(Sfile_str(xorriso->assert_volid, pattern,0) <= 0) return(-1); strcpy(xorriso->assert_volid_sev, sev_text); return(1); } /* Option -auto_charset "on"|"off" */ int Xorriso_option_auto_charset(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off")==0) xorriso->do_aaip&= ~(256 | 512); else if(strcmp(mode, "on")==0) xorriso->do_aaip|= (256 | 512); else { sprintf(xorriso->info_text, "-auto_charset: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -backslash_codes */ int Xorriso_option_backslash_codes(struct XorrisO *xorriso, char *mode, int flag) { char *npt, *cpt; int l, was; was= xorriso->bsl_interpretation; xorriso->bsl_interpretation= 0; npt= cpt= mode; for(; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l == 0) continue; if(l == 3 && strncmp(cpt, "off", l)==0) { xorriso->bsl_interpretation= 0; } else if(l == 16 && strncmp(cpt, "in_double_quotes", l)==0) { xorriso->bsl_interpretation= (xorriso->bsl_interpretation & ~3) | 1; } else if(l == 9 && strncmp(cpt, "in_quotes", l)==0) { xorriso->bsl_interpretation= (xorriso->bsl_interpretation & ~3) | 2; } else if(l == 17 && strncmp(cpt, "with_quoted_input", l)==0) { xorriso->bsl_interpretation= (xorriso->bsl_interpretation & ~3) | 3; } else if(l == 22 && strncmp(cpt, "with_program_arguments", l)==0) { xorriso->bsl_interpretation= xorriso->bsl_interpretation | 16; } else if(l == 13 && strncmp(cpt, "encode_output", l)==0) { xorriso->bsl_interpretation= xorriso->bsl_interpretation | 32 | 64; } else if(l == 14 && strncmp(cpt, "encode_results", l)==0) { xorriso->bsl_interpretation= xorriso->bsl_interpretation | 32; } else if(l == 12 && strncmp(cpt, "encode_infos", l)==0) { xorriso->bsl_interpretation= xorriso->bsl_interpretation | 64; } else if(l == 2 && strncmp(cpt, "on", l)==0) { xorriso->bsl_interpretation= 3 | 16 | 32 | 64; } else { if(linfo_text, "-backslash_codes: unknown mode '%s'", cpt); else sprintf(xorriso->info_text, "-backslash_codes: oversized mode parameter (%d)", l); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); xorriso->bsl_interpretation= was; return(0); } } return(1); } /* Option -ban_stdio_write */ int Xorriso_option_ban_stdio_write(struct XorrisO *xorriso, int flag) { xorriso->ban_stdio_write= 1; return(1); } /* Option -biblio_file */ int Xorriso_option_biblio_file(struct XorrisO *xorriso, char *name, int flag) { if(Xorriso_check_name_len(xorriso, name, (int) sizeof(xorriso->biblio_file), "-biblio_file", 0) <= 0) return(0); strcpy(xorriso->biblio_file, name); Xorriso_set_change_pending(xorriso, 1); return(1); } /* Option -blank and -format */ /* @param flag bit0= format rather than blank @return <=0 error , 1 success, 2 revoked by -reassure */ int Xorriso_option_blank(struct XorrisO *xorriso, char *in_mode, int flag) { char *cmd= "-blank", *mode; int aq_ret, ret, mode_flag= 0, as_needed= 0, idx, do_force= 0; off_t size= 0; if(flag&1) cmd= "-format"; if(xorriso->out_drive_handle == NULL) { sprintf(xorriso->info_text, "%s: No output drive set by -dev -or -outdev", cmd); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(xorriso->in_drive_handle == xorriso->out_drive_handle) { if(Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text, "%s: Image changes pending. -commit or -rollback first.", cmd); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } ret= Xorriso_reassure(xorriso, cmd, "possibly make unreadable data on outdev", 0); if(ret<=0) return(2); if(strncmp(in_mode, "force:", 6) == 0) { do_force= 1; mode= in_mode + 6; } else mode= in_mode; if(strcmp(mode, "as_needed")==0 || mode[0]==0) as_needed= 1; else if(strcmp(mode, "all")==0 || strcmp(mode, "full")==0) mode_flag= 0; else if((strcmp(mode, "deformat")==0 || strcmp(mode, "deformat_sequential")==0) && !(flag&1)) mode_flag= 2; else if((strcmp(mode, "deformat_quickest")==0 || strcmp(mode, "deformat_sequential_quickest")==0) && !(flag&1)) mode_flag= 3; else if(strcmp(mode, "fast")==0) mode_flag= 1; else if(strncmp(mode, "by_index_", 9)==0 && (flag&1)) { mode_flag= 128; idx= -1; if(strlen(mode)>9) sscanf(mode+9, "%d", &idx); if(idx<0 || idx>255) { unusable_index:; sprintf(xorriso->info_text, "-format: mode '%s' provides unusable index number", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } mode_flag|= (idx<<8); } else if(strncmp(mode, "fast_by_index_", 14)==0 && (flag&1)) { mode_flag= 1 | 128; idx= -1; if(strlen(mode)>14) sscanf(mode+14, "%d", &idx); if(idx<0 || idx>255) goto unusable_index; mode_flag|= (idx<<8); } else if(strncmp(mode, "by_size_", 8) == 0 && (flag & 1)) { size= (off_t) Scanf_io_size(mode + 8, 0); if(size <= 0) { unusable_size:; sprintf(xorriso->info_text, "-format: mode '%s' provides unusable size value", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } mode_flag= 2; } else if(strncmp(mode, "fast_by_size_", 13) == 0 && (flag & 1)) { size= (off_t) Scanf_io_size(mode + 13, 0); if(size <= 0) goto unusable_size; mode_flag= 3; } else if(strcmp(mode, "without_spare") == 0 && (flag & 1)) { mode_flag= 32; } else { sprintf(xorriso->info_text, "%s: Unknown %s mode '%s'", cmd, ((flag&1) ? "-format" : "-blank"), mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(do_force) { ret= Xorriso_pretend_full_disc(xorriso, 0); if(ret <= 0) return(ret); } if(as_needed) ret= Xorriso_blank_as_needed(xorriso, (flag&1)<<2); else if(flag&1) ret= Xorriso_format_media(xorriso, size, mode_flag & 0xffa7); else ret= Xorriso_blank_media(xorriso, mode_flag&3); if(ret==0) return(ret); if(ret <= 0) { /* in case of success, above functions will have re-acquired */ aq_ret= Xorriso_reaquire_outdev(xorriso, 0); /* actually give up drive */ if(retboot_count > 0) { cannot_keep_or_patch:; sprintf(xorriso->info_text, "Loaded boot image has already been replaced. Cannot keep or patch it."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } if(isolinux_grub) goto treatment_patch; xorriso->keep_boot_image= 1; xorriso->patch_isolinux_image= (xorriso->patch_isolinux_image & ~3) | 0; xorriso->boot_image_bin_path[0]= 0; xorriso->patch_system_area= 0; } else if(strcmp(treatpt, "patch")==0) { treatment_patch:; if(xorriso->boot_count > 0) goto cannot_keep_or_patch; xorriso->keep_boot_image= 0; xorriso->patch_isolinux_image= (xorriso->patch_isolinux_image & ~3) | 1; xorriso->boot_image_bin_path[0]= 0; if(strcmp(formpt, "grub") == 0) { xorriso->patch_isolinux_image|= 2; xorriso->patch_system_area= 1; } else if(strcmp(formpt, "isolinux") == 0) xorriso->patch_system_area= 2; else xorriso->patch_system_area= 0; } else if(strcmp(treatpt, "replay")==0) { ret= Xorriso_report_system_area(xorriso, "cmd", 2); if(ret <= 0) goto ex; } else if(strcmp(treatpt, "discard")==0) { xorriso->keep_boot_image= 0; xorriso->patch_isolinux_image= (xorriso->patch_isolinux_image & ~0x3ff) | 0; xorriso->boot_image_bin_path[0]= 0; xorriso->patch_system_area= 0; if((xorriso->system_area_options & 0xfc ) == 0) xorriso->system_area_options= 0; /* Reset eventual type 0 flags */ if(xorriso->boot_count > 0) { ret= Xorriso_attach_boot_image(xorriso, 2); /* dispose boot images */ if(ret <= 0) goto ex; } } else if(strcmp(treatpt, "next") == 0) { ret= Xorriso_attach_boot_image(xorriso, 0); if(ret <= 0) goto ex; } else if(strcmp(treatpt, "show_status")==0) { sprintf(xorriso->result_line, "------------------------------------\n"); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "Status of loaded boot image :\n"); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "------------------------------------\n"); Xorriso_result(xorriso, 0); Xorriso_show_boot_info(xorriso, 0); sprintf(xorriso->result_line, "------------------------------------\n"); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "Boot image settings for next commit:\n"); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "------------------------------------\n"); Xorriso_result(xorriso, 0); Xorriso_status(xorriso, "-boot_image", NULL, 0); sprintf(xorriso->result_line, "------------------------------------\n"); Xorriso_result(xorriso, 0); } else if(strcmp(treatpt, "cat_path=") == 0) { xorriso->boot_image_cat_path[0] = 0; } else if(strncmp(treatpt, "cat_path=", 9) == 0) { ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 9, xorriso->boot_image_cat_path, 2); if(ret <= 0) goto ex; } else if(strncmp(treatpt, "cat_hidden=", 11) == 0) { ret= Xorriso__hide_mode(treatpt + 11, 0); if(ret >= 0) xorriso->boot_image_cat_hidden= ret; else was_ok= 0; } else if(strncmp(treatpt, "dir=", 4) == 0) { if(strcmp(formpt, "isolinux")==0) { /* ISOLINUX */ /* The three locations mentioned in http://syslinux.zytor.com/iso.php */ if(strcmp(treatpt + 4, "/") == 0) strcpy(xorriso->boot_image_bin_path, "/"); else if(strcmp(treatpt + 4, "isolinux") == 0 || strcmp(treatpt + 4, "/isolinux") == 0) strcpy(xorriso->boot_image_bin_path, "/isolinux/"); else if(strcmp(treatpt + 4, "boot/isolinux") == 0 || strcmp(treatpt + 4, "/boot/isolinux") == 0 || strcmp(treatpt + 4, "boot") == 0 || strcmp(treatpt + 4, "/boot") == 0) strcpy(xorriso->boot_image_bin_path, "/boot/isolinux/"); else { sprintf(xorriso->info_text, "Unrecognized keyword with -boot_image %s %s", form, treatment); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); sprintf(xorriso->info_text, "Allowed with dir= are / , /isolinux . /boot/isolinux"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); {ret= 0; goto ex;} } strcpy(xorriso->boot_image_cat_path, xorriso->boot_image_bin_path); strcat(xorriso->boot_image_bin_path, "isolinux.bin"); strcat(xorriso->boot_image_cat_path, "boot.cat"); xorriso->boot_image_load_size= 4 * 512; xorriso->boot_img_size_default= 0; xorriso->keep_boot_image= 0; xorriso->patch_isolinux_image= (xorriso->patch_isolinux_image & ~3) | 1; strcpy(xorriso->boot_image_bin_form, formpt); {ret= 1; goto ex;} } else if(strcmp(formpt, "grub") == 0) { /* >>> GRUB */ was_ok= 0; strcpy(xorriso->boot_image_bin_form, formpt); } else was_ok= 0; } else if(strcmp(treatpt, "bin_path=") == 0) { xorriso->boot_image_bin_path[0] = 0; xorriso->boot_efi_default= 0; } else if(strncmp(treatpt, "bin_path=", 9) == 0) { if(strncmp(treatpt + 9, "--interval:appended_partition_", 30) == 0) { if(strlen(treatpt + 9) >= sizeof(xorriso->boot_image_bin_path)) { interval_text_long:; sprintf(xorriso->info_text, "-boot_image: --interval text is much too long (%d)", (int) strlen(treatpt + 9)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } strcpy(xorriso->boot_image_bin_path, treatpt + 9); } else { ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 9, xorriso->boot_image_bin_path, 2); if(ret <= 0) goto ex; } xorriso->keep_boot_image= 0; if(isolinux_grub) { xorriso->patch_isolinux_image= (xorriso->patch_isolinux_image & ~3) | 1; if(xorriso->boot_image_bin_path[0]) { xorriso->boot_image_load_size= 4 * 512; xorriso->boot_img_size_default= 0; } strcpy(xorriso->boot_image_bin_form, formpt); } else strcpy(xorriso->boot_image_bin_form, "any"); xorriso->boot_efi_default= 0; } else if(strcmp(treatpt, "efi_path=") == 0) { xorriso->boot_image_bin_path[0] = 0; xorriso->boot_efi_default= 0; } else if(strncmp(treatpt, "efi_path=", 9) == 0) { if(strncmp(treatpt + 9, "--interval:appended_partition_", 30) == 0) { if(strlen(treatpt + 9) >= sizeof(xorriso->boot_image_bin_path)) goto interval_text_long; strcpy(xorriso->boot_image_bin_path, treatpt + 9); } else { ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 9, xorriso->boot_image_bin_path, 2); if(ret <= 0) goto ex; } xorriso->keep_boot_image= 0; xorriso->boot_efi_default= 1; } else if(strncmp(treatpt, "mips_path=", 10) == 0) { sprintf(eff_path, "-boot_image %s mips_path=", formpt); ret= Xorriso_coordinate_system_area(xorriso, 1, 0, eff_path, 0); if(ret <= 0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 10, eff_path, 2); if(ret <= 0) goto ex; ret= Xorriso_add_mips_boot_file(xorriso, eff_path, 0); if(ret <= 0) goto ex; } else if(strncmp(treatpt, "mipsel_path=", 12) == 0) { sprintf(eff_path, "-boot_image %s mipsel_path=", formpt); ret= Xorriso_coordinate_system_area(xorriso, 2, 0, eff_path, 0); if(ret <= 0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 12, eff_path, 2); if(ret <= 0) goto ex; ret= Xorriso_add_mips_boot_file(xorriso, eff_path, 2); if(ret <= 0) goto ex; } else if(strcmp(treatpt, "mips_discard") == 0 || strcmp(treatpt, "mipsel_discard") == 0 || strcmp(treatpt, "sparc_discard") == 0 || strcmp(treatpt, "hppa_discard") == 0 || strcmp(treatpt, "alpha_discard") == 0) { xorriso->system_area_options&= ~0xfc; /* system area type 0 */ Xorriso_add_mips_boot_file(xorriso, "", 1); /* give up MIPS boot files */ Xorriso_set_hppa_boot_parm(xorriso, "", "", 1); /* give up HP-PA files */ Xorriso_set_alpha_boot(xorriso, "", 1); /* give up DEC Alpha loader */ } else if(strncmp(treatpt, "sparc_label=", 12) == 0) { sprintf(eff_path, "-boot_image %s sparc_label=", formpt); ret= Xorriso_coordinate_system_area(xorriso, 3, 0, eff_path, 0); if(ret <= 0) goto ex; strncpy(xorriso->ascii_disc_label, treatpt + 12, Xorriso_disc_label_sizE - 1); xorriso->ascii_disc_label[Xorriso_disc_label_sizE - 1] = 0; } else if(strncmp(treatpt, "grub2_sparc_core=", 17) == 0) { ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 17, xorriso->grub2_sparc_core, 2); if(ret <= 0) goto ex; } else if(strncmp(treatpt, "hppa_", 5) == 0) { sprintf(eff_path, "-boot_image %s %s", formpt, treatpt); palohdrversion= (xorriso->system_area_options >> 2) & 0x3f; if(palohdrversion != 4) palohdrversion= 5; ret= Xorriso_coordinate_system_area(xorriso, palohdrversion, 0, eff_path, 0); if(ret <= 0) goto ex; eqpt= strchr(treatpt, '='); if(eqpt == NULL) { sprintf(xorriso->info_text, "No equal sign found in -boot_image %s %s", form, treatment); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } parm_len= (eqpt - treatpt) - 5; if(parm_len > (int) sizeof(parm) - 1) parm_len= sizeof(parm) - 1; strncpy(parm, treatpt + 5, parm_len); parm[parm_len]= 0; ret= Xorriso_set_hppa_boot_parm(xorriso, eqpt + 1, parm, 0); if(ret <= 0) goto ex; } else if(strncmp(treatpt, "alpha_boot=", 11) == 0) { sprintf(eff_path, "-boot_image %s %s", formpt, treatpt); ret= Xorriso_coordinate_system_area(xorriso, 6, 0, eff_path, 0); if(ret <= 0) goto ex; ret = Xorriso_set_alpha_boot(xorriso, treatpt + 11, 0); if(ret <= 0) goto ex; } else if(strncmp(treatpt, "boot_info_table=", 16)==0) { if(strcmp(treatpt + 16, "off") == 0) xorriso->patch_isolinux_image= (xorriso->patch_isolinux_image & ~3) | 0; else if(strcmp(treatpt + 16, "on") == 0) xorriso->patch_isolinux_image= (xorriso->patch_isolinux_image & ~3) | 1 | (2 * (strcmp(treatpt, "grub") == 0)); else was_ok= 0; } else if(strncmp(treatpt, "grub2_boot_info=", 16)==0) { if(strcmp(treatpt + 16, "off") == 0) xorriso->patch_isolinux_image= xorriso->patch_isolinux_image & ~512; else if(strcmp(treatpt + 16, "on") == 0) xorriso->patch_isolinux_image= xorriso->patch_isolinux_image | 512; else was_ok= 0; } else if(strncmp(treatpt, "load_size=", 10) == 0) { if(strcmp(treatpt + 10, "full") == 0) { xorriso->boot_img_full_size= 1; } else { num= Scanf_io_size(treatpt + 10, 0); if(num < 512 && isolinux_grub) { sprintf(xorriso->info_text, "-boot_image %s : load_size too small (%s < 512)", formpt, treatpt + 10); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } xorriso->boot_image_load_size= num; } xorriso->boot_img_size_default= 0; } else if(strncmp(treatpt, "id_string=", 10) == 0) { memset(xorriso->boot_id_string, 0, 29); if(strlen(treatpt + 10) == 56) { ret= Hex_to_bin(treatpt + 10, 28, &count, xorriso->boot_id_string, 0); } else ret= 0; if(ret <= 0) strncpy((char *) xorriso->boot_id_string, treatpt + 10, 28); } else if(strncmp(treatpt, "sel_crit=", 9) == 0) { memset(xorriso->boot_selection_crit, 0, 21); count= 0; ret= Hex_to_bin(treatpt + 9, 20, &count, xorriso->boot_selection_crit, 0); if(ret <= 0) { sprintf(xorriso->info_text, "-boot_image %s sel_crit= : Wrong form. Need even number of hex digits.", formpt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } else if(strncmp(treatpt, "system_area=", 12) == 0) { if(strcmp(formpt, "isolinux")==0) { ret= Xorriso_coordinate_system_area(xorriso, 0, 2, "-boot_image isolinux system_area=", 0); if(ret <= 0) goto ex; } if(strcmp(treatpt + 12, ".") == 0) { ret= Xorriso_set_system_area_path(xorriso, "", 0); } else { ret= Xorriso_set_system_area_path(xorriso, treatpt + 12, 0); } if(ret <= 0) goto ex; xorriso->system_area_options&= ~0x4000; if(strcmp(treatpt + 12, "/dev/zero") == 0) xorriso->system_area_clear_loaded= 1; } else if(strncmp(treatpt, "partition_table=", 16)==0) { if(strcmp(treatpt + 16, "off") == 0) { xorriso->system_area_options&= ~3; } else if(strcmp(treatpt + 16, "on") == 0) { sprintf(eff_path, "-boot_image %s partition_table=", formpt); if(strcmp(formpt, "isolinux")==0) ret= Xorriso_coordinate_system_area(xorriso, 0, 2, eff_path, 0); else ret= Xorriso_coordinate_system_area(xorriso, 0, 1, eff_path, 0); if(ret <= 0) goto ex; } else was_ok= 0; } else if(strncmp(treatpt, "partition_entry=", 16)==0) { if(strcmp(formpt, "isolinux") != 0) { sprintf(xorriso->info_text, "-boot_image %s partition_entry=%s : Wrong type. Need \"isolinux\".", formpt, treatpt + 16); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } if(strcmp(treatpt + 16, "gpt_basdat") == 0) { xorriso->patch_isolinux_image = (xorriso->patch_isolinux_image & ~0x0fc) | (1 << 2); } else if(strcmp(treatpt + 16, "gpt_hfsplus") == 0) { xorriso->patch_isolinux_image = (xorriso->patch_isolinux_image & ~0x0fc) | (2 << 2); } else if(strcmp(treatpt + 16, "apm_hfsplus") == 0) { xorriso->patch_isolinux_image = xorriso->patch_isolinux_image | (1 << 8); } else if(strcmp(treatpt + 16, "off") == 0) { xorriso->patch_isolinux_image = (xorriso->patch_isolinux_image & ~0x1fc); } else was_ok= 0; } else if(strncmp(treatpt, "partition_offset=", 17)==0) { u= 0; sscanf(treatpt + 17, "%u", &u); if(u > 0 && u < 16) { sprintf(xorriso->info_text, "-boot_image %s partition_offset= : Non-zero number too small (<16).", formpt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } xorriso->partition_offset= u; } else if(strncmp(treatpt, "appended_part_as=", 17) == 0) { if(strcmp(treatpt + 17, "gpt") == 0) { xorriso->appended_as_gpt = 1; } else if(strcmp(treatpt + 17, "mbr") == 0) { xorriso->appended_as_gpt = 0; xorriso->appended_as_apm = 0; } else if(strcmp(treatpt + 17, "apm") == 0) { xorriso->appended_as_apm = 1; } else was_ok= 0; } else if(strncmp(treatpt, "gpt_disk_guid=", 14) == 0) { ret= Xorriso_parse_gpt_guid(xorriso, treatpt + 14, 0); if(ret <= 0) goto ex; } else if(strncmp(treatpt, "part_like_isohybrid=", 20) == 0) { if(strcmp(treatpt + 20, "on") == 0) xorriso->part_like_isohybrid= 1; else if(strcmp(treatpt + 20, "off") == 0) xorriso->part_like_isohybrid= 0; else was_ok= 0; } else if(strncmp(treatpt, "iso_mbr_part_type=", 18) == 0) { ret= 256; xorriso->iso_mbr_part_flag&= ~1; if(strncmp(treatpt + 18, "default", 2) == 0) { ret= -1; } else if(strncmp(treatpt + 18, "0x", 2) == 0) { u= 256; sscanf(treatpt + 20, "%x", &u); ret= u; } else { ret= Xorriso_parse_type_guid(xorriso, treatpt + 18, xorriso->iso_gpt_type_guid, &type_code, 0); if(ret > 0) { ret= type_code; xorriso->iso_mbr_part_flag|= 1; } else { sscanf(treatpt + 18, "%d", &ret); } } if(ret < -1 || ret > 0xff) { sprintf(xorriso->info_text, "-boot_image %s : iso_mbr_part_type='%s' wrong (\"default\", 0 ... 255, 0x00 ... 0xff)", formpt, treatpt + 18); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } xorriso->iso_mbr_part_type= ret; } else if(strncmp(treatpt, "partition_hd_cyl=", 17)==0) { u= 0; sscanf(treatpt + 17, "%u", &u); if(u > 255) { sprintf(xorriso->info_text, "-boot_image %s partition_hd_cyl= : Number too large (>255).", formpt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } xorriso->partition_heads_per_cyl= u; } else if(strncmp(treatpt, "partition_sec_hd=", 17)==0) { u= 0; sscanf(treatpt + 17, "%u", &u); if(u > 63) { sprintf(xorriso->info_text, "-boot_image %s partition_sec_hd= : Number too large (>63).", formpt); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } xorriso->partition_secs_per_head= u; } else if(strncmp(treatpt, "partition_cyl_align=", 20)==0) { if(strcmp(treatpt + 20, "auto") == 0) xorriso->system_area_options= (xorriso->system_area_options & ~0x300); else if(strcmp(treatpt + 20, "on") == 0) xorriso->system_area_options= (xorriso->system_area_options & ~0x300) | 0x100; else if(strcmp(treatpt + 20, "off") == 0) xorriso->system_area_options= (xorriso->system_area_options & ~0x300) | 0x200; else if(strcmp(treatpt + 20, "all") == 0) xorriso->system_area_options= (xorriso->system_area_options & ~0x300) | 0x300; else { sprintf(xorriso->info_text, "-boot_image %s partition_cyl_align: unknown mode : %s", formpt, treatpt + 20); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } } else if(strncmp(treatpt, "platform_id=", 12)==0) { u= 256; /* intentionally too large */ if(strncmp(treatpt + 12, "0x", 2) == 0) sscanf(treatpt + 14, "%x", &u); else sscanf(treatpt + 12, "%u", &u); if(u > 0xff) { sprintf(xorriso->info_text, "-boot_image %s : platform_id too large (%s > 0xff)", formpt, treatpt + 12); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } xorriso->boot_platform_id= u; } else if(strncmp(treatpt, "emul_type=", 10)==0) { if(strcmp(treatpt + 10, "none") == 0 || strcmp(treatpt + 10, "no_emulation") == 0) { xorriso->boot_image_emul= 0; xorriso->boot_emul_default= 0; } else if(strcmp(treatpt + 10, "hard_disk") == 0) { xorriso->boot_image_emul= 1; xorriso->boot_emul_default= 0; } else if(strcmp(treatpt + 10, "floppy") == 0 || strcmp(treatpt + 10, "diskette") == 0) { xorriso->boot_image_emul= 2; xorriso->boot_emul_default= 0; } else { sprintf(xorriso->info_text, "-boot_image %s : Unknown media_type : %s", formpt, treatpt + 10); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } else if(strncmp(treatpt, "hfsplus_serial=", 15) == 0) { ret= Hex_to_bin(treatpt + 15, 8, &bin_count, (unsigned char *) sn, 0); if(ret <= 0 || bin_count != 8) { sprintf(xorriso->info_text, "boot_image %s : Malformed hfsplus_serial : %s", formpt, treatpt + 15); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, "Expected is a string of 16 hex digits [0-9a-fA-F]", 0, "HINT", 0); ret= 0; goto ex; } else { memcpy(xorriso->hfsp_serial_number, sn, 8); } } else if(strncmp(treatpt, "hfsplus_block_size=", 19) == 0) { u= 0; sscanf(treatpt + 19, "%u", &u); if(u != 0 && u!= 512 && u != 2048) { sprintf(xorriso->info_text, "boot_image %s : Malformed hfsplus_block_size : %s", formpt, treatpt + 19); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, "Expected are 0, 512, or 2048", 0, "HINT", 0); ret= 0; goto ex; } xorriso->hfsp_block_size= u; } else if(strncmp(treatpt, "apm_block_size=", 15) == 0) { u= 0; sscanf(treatpt + 15, "%u", &u); if(u != 0 && u!= 512 && u != 2048) { sprintf(xorriso->info_text, "boot_image %s : Malformed apm_block_size : %s", formpt, treatpt + 15); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, "Expected are 0, 512, or 2048", 0, "HINT", 0); ret= 0; goto ex; } xorriso->apm_block_size= u; } else if(strncmp(treatpt, "efi_boot_part=", 14) == 0) { if(Sfile_str(xorriso->efi_boot_partition, treatpt + 14, 0) <= 0) {ret= -1; goto ex;} } else if(strncmp(treatpt, "prep_boot_part=", 15) == 0) { if(Sfile_str(xorriso->prep_partition, treatpt + 15, 0) <= 0) {ret= -1; goto ex;} } else if(strncmp(treatpt, "chrp_boot_part=", 15) == 0) { if(strcmp(treatpt + 15, "on") == 0) { xorriso->system_area_options= (xorriso->system_area_options & ~0x3cfc) | 0x400; } else if(strcmp(treatpt + 15, "off") == 0) { xorriso->system_area_options= xorriso->system_area_options & ~0x3c00; } else { sprintf(xorriso->info_text, "-boot_image %s chrp_boot_part: unknown mode : %s", formpt, treatpt + 15); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } } else if(strncmp(treatpt, "isohybrid=", 10) == 0 && strcmp(formpt, "isolinux")==0) { #ifdef Xorriso_with_isohybriD if(strcmp(treatpt + 10, "off") == 0) xorriso->boot_image_isohybrid= 0; else if(strcmp(treatpt + 10, "auto") == 0) xorriso->boot_image_isohybrid= 1; else if(strcmp(treatpt + 10, "on") == 0) xorriso->boot_image_isohybrid= 2; else if(strcmp(treatpt + 10, "force") == 0) xorriso->boot_image_isohybrid= 3; else { sprintf(xorriso->info_text, "Unrecognized keyword with -boot_image %s %s", form, treatment); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); sprintf(xorriso->info_text, "Allowed with isohybrid= are: off , auto , on , force"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); {ret= 0; goto ex;} } #else if(strcmp(treatpt + 10, "off") == 0) { xorriso->boot_image_isohybrid= 0; } else { sprintf(xorriso->info_text, "isohybrid MBR generation has been disabled on request of its inventor H. Peter Anvin on 31 Mar 2010"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); sprintf(xorriso->info_text, "It has been replaced by -boot_image isolinux system_area=External-File"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); } #endif /* ! Xorriso_with_isohybriD */ } else if(strncmp(treatpt, "grub2_mbr=", 10) == 0) { ret= Xorriso_coordinate_system_area(xorriso, 0, (1 << 14), eff_path, 1 | 2); if(ret <= 0) goto ex; if(strcmp(treatpt + 10, ".") == 0) { ret= Xorriso_set_system_area_path(xorriso, "", 0); } else { ret= Xorriso_set_system_area_path(xorriso, treatpt + 10, 0); } if(ret <= 0) goto ex; if(treatpt [10] == 0) xorriso->system_area_options&= ~0x4000; else xorriso->system_area_options|= 0x4000; } else if(strncmp(treatpt, "mbr_force_bootable=", 19) == 0) { if(strcmp(treatpt + 19, "off") == 0) { xorriso->system_area_options&= ~(1 << 15); } else if(strcmp(treatpt + 19, "on") == 0) { xorriso->system_area_options|= (1 << 15); } else { sprintf(xorriso->info_text, "-boot_image %s mbr_force_bootable=: unknown mode : %s", formpt, treatpt + 19); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); {ret= 0; goto ex;} } } else was_ok= 0; if(!was_ok) { sprintf(xorriso->info_text, "Unrecognized options with -boot_image: %s %s", form, treatment); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } ret= 1; ex: Xorriso_free_meM(eff_path); return(ret); } /* Option -calm_drive */ int Xorriso_option_calm_drive(struct XorrisO *xorriso, char *which, int flag) { int gu_flag= 0, ret; if(strcmp(which,"in")==0) gu_flag= 1; else if(strcmp(which,"out")==0) gu_flag= 2; else if(strcmp(which,"on")==0) { xorriso->do_calm_drive|= 1; } else if(strcmp(which,"off")==0) { xorriso->do_calm_drive&= ~1; } else if(strcmp(which,"revoke")==0) { gu_flag= 7; } else gu_flag= 3; ret= Xorriso_drive_snooze(xorriso, gu_flag); return(ret); } /* Option -cd alias -cdi */ int Xorriso_option_cdi(struct XorrisO *xorriso, char *iso_rr_path, int flag) { char *path= NULL, *eff_path= NULL, *namept; int ret; Xorriso_alloc_meM(path, char, SfileadrL); Xorriso_alloc_meM(eff_path, char, SfileadrL); if (strlen(iso_rr_path)>sizeof(xorriso->wdi)) { sprintf(xorriso->info_text,"-cdi: iso_rr_path too long (%d > %d)", (int) strlen(iso_rr_path), (int) sizeof(xorriso->wdi)-1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } Xorriso_warn_of_wildcards(xorriso, iso_rr_path, 1); sprintf(xorriso->info_text,"previous working directory:\n"); Xorriso_info(xorriso,0); Xorriso_esc_filepath(xorriso, xorriso->wdi, xorriso->result_line, 0); if(xorriso->sh_style_result == 0 || xorriso->wdi[0] == 0) strcat(xorriso->result_line, "/"); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso,0); if(strcmp(iso_rr_path,"/")==0 || iso_rr_path[0]==0) { strcpy(xorriso->wdi,""); Xorriso_option_pwdi(xorriso, 0); {ret= 1; goto ex;} } else if(iso_rr_path[0]!='/') { strcpy(path, xorriso->wdi); if(Sfile_add_to_path(path,iso_rr_path,0)<=0) {ret= -1; goto ex;} } else { if(Sfile_str(path,iso_rr_path,0)<=0) {ret= -1; goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 1); if(ret<0) goto ex; if(ret==0) { sprintf(xorriso->info_text, "-cdi: not existing yet in ISO image : "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 2); if(ret<=0) goto ex; } else if(ret!=2) { sprintf(xorriso->info_text, "-cdi: not a directory : "); Text_shellsafe(eff_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } Xorriso_truncate_path_comps(xorriso, eff_path, path, &namept, 0); strcpy(xorriso->wdi, namept); Xorriso_option_pwdi(xorriso, 0); ret= 1; ex:; Xorriso_free_meM(path); Xorriso_free_meM(eff_path); return(ret); } /* Option -cdx */ int Xorriso_option_cdx(struct XorrisO *xorriso, char *disk_path, int flag) { char *path= NULL, *eff_path= NULL; int ret; Xorriso_alloc_meM(path, char, SfileadrL); Xorriso_alloc_meM(eff_path, char, SfileadrL); if (strlen(disk_path)>sizeof(xorriso->wdx)) { sprintf(xorriso->info_text,"-cdx: disk_path too long (%d > %d)", (int) strlen(disk_path), (int) sizeof(xorriso->wdx)-1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } Xorriso_warn_of_wildcards(xorriso, disk_path, 1|2); sprintf(xorriso->info_text,"previous working directory on hard disk:\n"); Xorriso_info(xorriso,0); Xorriso_esc_filepath(xorriso, xorriso->wdx, xorriso->result_line, 0); if(xorriso->sh_style_result == 0 || xorriso->wdx[0] == 0) strcat(xorriso->result_line, "/"); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso,0); if(strcmp(disk_path,"/")==0) { strcpy(xorriso->wdx,""); Xorriso_option_pwdx(xorriso, 0); {ret= 1; goto ex;} } else if(disk_path[0]!='/') { strcpy(path, xorriso->wdx); if(Sfile_add_to_path(path,disk_path,0)<=0) {ret= -1; goto ex;} } else { if(Sfile_str(path,disk_path,0)<=0) {ret= -1; goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, path, eff_path, 2|4); if(ret<=0) goto ex; if(eff_path[0]) { ret= Sfile_type(eff_path,1|4|8); if(ret<0) { Xorriso_msgs_submit(xorriso, 0, eff_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text,"-cdx: file not found : "); Text_shellsafe(eff_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } if(ret!=2) { Xorriso_msgs_submit(xorriso, 0, eff_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "-cdx: not a directory : "); Text_shellsafe(eff_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } if(Sfile_str(xorriso->wdx,eff_path,0)<=0) {ret= -1; goto ex;} Xorriso_option_pwdx(xorriso, 0); ret= 1; ex:; Xorriso_free_meM(path); Xorriso_free_meM(eff_path); return(ret); } /* Option -changes_pending */ int Xorriso_option_changes_pending(struct XorrisO *xorriso, char *state, int flag) { if(strcmp(state, "no") == 0) xorriso->volset_change_pending= 0; else if(strcmp(state, "yes") == 0) xorriso->volset_change_pending= 1; else if(strcmp(state, "mkisofs_printed") == 0) xorriso->volset_change_pending= 2; else if(strcmp(state, "show_status") == 0) { strcpy(xorriso->result_line, "-changes_pending "); if(xorriso->volset_change_pending == 0) strcat(xorriso->result_line, "no"); else if(xorriso->volset_change_pending == 2) strcat(xorriso->result_line, "mkisofs_printed"); else strcat(xorriso->result_line, "yes"); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso,0); } else { sprintf(xorriso->info_text, "-changes_pending: unknown state code '%s'", state); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -charset */ /* @param flag bit0= set in_charset bit1= set out_charset bit2= set local_charset */ int Xorriso_option_charset(struct XorrisO *xorriso, char *name, int flag) { int ret; char *name_pt= NULL, *local_charset; iconv_t iconv_ret= (iconv_t) -1; if(name != NULL) if(name[0] != 0) name_pt= name; if(flag & 4) { ret= Xorriso_set_local_charset(xorriso, name_pt, 0); if(ret <= 0) return(ret); } if(flag & 1) { if(name_pt != NULL) { Xorriso_get_local_charset(xorriso, &local_charset, 0); iconv_ret= iconv_open(local_charset, name_pt); if(iconv_ret == (iconv_t) -1) { sprintf(xorriso->info_text, "-%scharset: Cannot convert from character set ", flag & 2 ? "" : "in_"); Text_shellsafe(name_pt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); return(0); } else iconv_close(iconv_ret); } if(Sregex_string(&(xorriso->in_charset), name_pt, 0) <= 0) { Xorriso_no_malloc_memory(xorriso, NULL, 0); return(-1); } } if(flag & 2) { if(name_pt != NULL) { Xorriso_get_local_charset(xorriso, &local_charset, 0); iconv_ret= iconv_open(local_charset, name_pt); if(iconv_ret == (iconv_t) -1) { sprintf(xorriso->info_text, "-%scharset: Cannot convert to charset ", flag & 1 ? "" : "out_"); Text_shellsafe(name_pt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); return(0); } else iconv_close(iconv_ret); } if(Sregex_string(&(xorriso->out_charset), name_pt, 0) <= 0) { Xorriso_no_malloc_memory(xorriso, NULL, 0); return(-1); } } if(flag & 3) { if(name_pt == NULL) Xorriso_get_local_charset(xorriso, &name_pt, 0); sprintf(xorriso->info_text, "Character set for %sconversion is now: ", (flag & 3) == 1 ? "input " : (flag & 3) == 2 ? "output " : ""); Text_shellsafe(name_pt, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } return(1); } /* Options -check_md5 and -check_md5_r @param flag bit0= issue summary message bit1= do not reset pacifier, no final pacifier message >>> bit2= do not issue pacifier messages at all bit3= recursive: -check_md5_r */ int Xorriso_option_check_md5(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, i, mem_pci, end_idx, fret, sev, do_report= 0; int optc= 0; char **optv= NULL, *cpt, *severity= "ALL", off_severity[20]; struct FindjoB *job= NULL; double mem_lut= 0.0; mem_pci= xorriso->pacifier_interval; ret= Xorriso_opt_args(xorriso, "-check_md5", argc, argv, *idx + 1, &end_idx, &optc, &optv, 128); if(ret<=0) goto ex; /* Interpret argv[*idx] as severity */ if(argc <= *idx) { sprintf(xorriso->info_text, "-check_md5: No event severity given for case of mismatch"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } severity= argv[*idx]; Xorriso__to_upper(severity, off_severity, (int) sizeof(off_severity), 0); severity= off_severity; ret= Xorriso__text_to_sev(severity, &sev, 0); if(ret<=0) { sprintf(xorriso->info_text, "-check_md5: Not a known severity name : "); Text_shellsafe(severity, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } if(!(flag & (2 | 4))) { Xorriso_pacifier_reset(xorriso, 0); mem_lut= xorriso->last_update_time; } xorriso->pacifier_interval= 5.0; xorriso->find_check_md5_result= 0; if(optc == 0) { ret= Xorriso_check_session_md5(xorriso, severity, 0); do_report= 1; goto ex; } for(i= 0; i < optc; i++) { if(flag & 8) { ret= Findjob_new(&job, optv[i], 0); if(ret<=0) { Xorriso_no_findjob(xorriso, "-check_md5_r", 0); {ret= -1; goto ex;} } Findjob_set_action_target(job, 35, severity, 0); cpt= optv[i]; ret= Xorriso_findi_sorted(xorriso, job, (off_t) 0, 1, &cpt, 0); Findjob_destroy(&job, 0); if(ret > 0) ret= xorriso->find_compare_result; else { ret= -1; xorriso->find_check_md5_result|= 2; } } else { ret= Xorriso_check_md5(xorriso, NULL, optv[i], 4); if(ret < 0) xorriso->find_check_md5_result|= 2; else if(ret == 0) xorriso->find_check_md5_result|= 1; else if(ret == 1) xorriso->find_check_md5_result|= 8; else if(ret == 2) xorriso->find_check_md5_result|= 4; } if(ret>0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; ret= 0; goto report_outcome; } ret= 1; report_outcome:; do_report= 1; ex:; if(!(flag & (2 | 4))) { xorriso->pacifier_interval= mem_pci; if(mem_lut!=xorriso->last_update_time && !(flag&2)) Xorriso_pacifier_callback(xorriso, "content bytes read", xorriso->pacifier_count, 0, "", 1 | 8 | 32); } if(do_report) { if(optc == 0) { if(ret <= 0) { sprintf(xorriso->result_line, "MD5 MISMATCH WITH DATA OF LOADED SESSION !\n"); Xorriso_result(xorriso,0); if(strcmp(severity, "ALL") != 0) { sprintf(xorriso->info_text, "Event triggered by MD5 comparison mismatch"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, severity, 0); } } else { sprintf(xorriso->result_line, "Ok, session data match recorded md5.\n"); Xorriso_result(xorriso,0); } } else { Xorriso_report_md5_outcome(xorriso, severity, 0); } } (*idx)= end_idx; Xorriso_opt_args(xorriso, "-getfacl", argc, argv, *idx, &end_idx, &optc, &optv, 256); Findjob_destroy(&job, 0); if(ret <= 0) return(ret); return((xorriso->find_check_md5_result & 3) == 0); } /* Option -check_media */ int Xorriso_option_check_media(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, i, count, lba, blocks, quality, pass, was_md5= 0, was_event= 0; int end_idx, old_idx, os_errno, to_info= 0; char quality_name[80], *head_buffer= NULL; struct SpotlisT *spotlist= NULL; struct CheckmediajoB *job= NULL; struct FindjoB *findjob= NULL; struct stat dir_stbuf; old_idx= *idx; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); (*idx)= end_idx; Xorriso_alloc_meM(head_buffer, char, 64 * 1024); ret= Checkmediajob_new(&job, 0); if(ret <= 0) goto ex; ret= Xorriso_check_media_setup_job(xorriso, job, argv, old_idx, end_idx, 0); if(ret <= 0) goto ex; to_info= (strcmp(job->data_to_path, "-") == 0); if((job->report_mode == 1 || job->report_mode == 2) && job->use_dev == 1) { sprintf(xorriso->info_text, "-check_media: cannot report=*files while use=outdef"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(job->patch_lba0 && job->data_to_path[0] == 0) { sprintf(xorriso->info_text, "-check_media: cannot apply patch_lba0= while data_to= has empty value"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(job->patch_lba0 && to_info) { sprintf(xorriso->info_text, "-check_media: cannot apply patch_lba0= while data_to= is \"-\""); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(job->use_dev == 2) { if(job->sector_map_path[0] == 0) { sprintf(xorriso->info_text, "-check_media: option use=sector_map but sector_map=''"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } ret= Sectorbitmap_from_file(&(job->sector_map), job->sector_map_path, xorriso->info_text, &os_errno, 0); if(ret <= 0) { if(xorriso->info_text[0]) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, os_errno, "FAILURE", 0); goto ex; } ret= Xorriso_sectormap_to_spotlist(xorriso, job, &spotlist, 0); if(ret <= 0) goto ex; Sectorbitmap_destroy(&(xorriso->in_sector_map), 0); ret= Sectorbitmap_clone(job->sector_map, &(xorriso->in_sector_map), 0); if(ret <= 0) goto ex; } else { ret= Xorriso_check_media(xorriso, &spotlist, job, 0); if(ret <= 0) goto ex; } if(job->patch_lba0) { ret= Xorriso_open_job_data_to(xorriso, job, 0); if(ret <= 0) goto ex; if(ret == 1) { ret= Xorriso_update_iso_lba0(xorriso, job->patch_lba0_msc1, 0, head_buffer, job, (8 * (job->patch_lba0 == 1)) | 4 | (job->patch_lba0_msc1 < 0)); if(ret <= 0) goto ex; } } if(job->report_mode == 0 || job->report_mode == 2) { /* report blocks */ for(pass= 0; pass < 2; pass++) { if(pass == 0) { sprintf(xorriso->result_line, "Media checks : lba , size , quality\n"); } else { if(!was_md5) break; sprintf(xorriso->result_line, "MD5 checks : lba , size , result\n"); } if(to_info) { strcpy(xorriso->info_text, xorriso->result_line); Xorriso_info(xorriso, 0); } else { Xorriso_result(xorriso, 0); } count= Spotlist_count(spotlist, 0); for(i= 0; i < count; i++) { ret= Spotlist_get_item(spotlist, i, &lba, &blocks, &quality, 0); if(ret <= 0) continue; if(pass == 0) { if(quality == Xorriso_read_quality_md5_mismatcH || quality == Xorriso_read_quality_unreadablE) { was_event= 1; } if(quality == Xorriso_read_quality_md5_matcH || quality == Xorriso_read_quality_md5_mismatcH) { was_md5= 1; continue; } } else if(pass == 1 && !(quality == Xorriso_read_quality_md5_matcH || quality == Xorriso_read_quality_md5_mismatcH)) continue; sprintf(xorriso->result_line, "%s: %10d , %10d , %s\n", pass == 0 ? "Media region " : "MD5 tag range", lba, blocks, Spotlist__quality_name(quality, quality_name, xorriso->check_media_bad_limit, 0)); if(to_info) { strcpy(xorriso->info_text, xorriso->result_line); Xorriso_info(xorriso, 0); } else { Xorriso_result(xorriso, 0); } } } } if(job->report_mode == 1 || job->report_mode == 2) { /* report files */ ret= Findjob_new(&findjob, "/", 0); if(ret<=0) { Xorriso_no_findjob(xorriso, "-check_media report=files", 0); {ret= -1; goto ex;} } Findjob_set_damage_filter(findjob, 1, 0); Findjob_set_action_target(findjob, 21, NULL, 0); ret= Xorriso_findi(xorriso, findjob, NULL, (off_t) 0, NULL, "/", &dir_stbuf, 0, 0); Findjob_destroy(&findjob, 0); if(ret <= 0) goto ex; } ret= 1; ex:; if(was_event && strcmp(job->event_severity, "ALL") != 0) { sprintf(xorriso->info_text, "Event triggered by media read error or MD5 comparison mismatch"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, job->event_severity, 0); } Spotlist_destroy(&spotlist, 0); Checkmediajob_destroy(&job, 0); Xorriso_free_meM(head_buffer); return(ret); } /* Option -check_media_defaults */ int Xorriso_option_check_media_defaults(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, old_idx, end_idx; struct CheckmediajoB *job= NULL; old_idx= *idx; end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); (*idx)= end_idx; ret= Checkmediajob_new(&job, 0); if(ret <= 0) goto ex; ret= Xorriso_check_media_setup_job(xorriso, job, argv, old_idx, end_idx, 0); if(ret <= 0) goto ex; Checkmediajob_destroy(&(xorriso->check_media_default), 0); xorriso->check_media_default= job; job= NULL; ret= 1; ex:; Checkmediajob_destroy(&job, 0); return(ret); } /* Option -chgrp alias -chgrpi , chgrp_r alias chgrpi */ /* @param flag bit0=recursive (-chgrp_r) */ int Xorriso_option_chgrpi(struct XorrisO *xorriso, char *gid, int argc, char **argv, int *idx, int flag) { int i, ret, was_failure= 0, end_idx, fret; gid_t gid_number; int optc= 0; char **optv= NULL; struct FindjoB *job= NULL; struct stat dir_stbuf; ret= Xorriso_opt_args(xorriso, "-chgrpi", argc, argv, *idx, &end_idx, &optc, &optv, 0); if(ret<=0) goto ex; ret= Xorriso_convert_gidstring(xorriso, gid, &gid_number, 0); if(ret<=0) goto ex; for(i= 0; i0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } ret= 1; ex:; (*idx)= end_idx; Xorriso_opt_args(xorriso, "-chgrpi", argc, argv, *idx, &end_idx, &optc, &optv, 256); /* clean up */ if(ret<=0) return(ret); Findjob_destroy(&job, 0); return(!was_failure); } /* Option -chmod alias -chmodi , -chmod_r alias chmod_ri */ /* @param flag bit0=recursive (-chmod_r) */ int Xorriso_option_chmodi(struct XorrisO *xorriso, char *mode, int argc, char **argv, int *idx, int flag) { int i, ret, was_failure= 0, end_idx, fret; mode_t mode_and= ~0, mode_or= 0; int optc= 0; char **optv= NULL; struct FindjoB *job= NULL; struct stat dir_stbuf; ret= Xorriso_opt_args(xorriso, "-chmodi", argc, argv, *idx, &end_idx, &optc, &optv, 0); if(ret<=0) goto ex; ret= Xorriso_convert_modstring(xorriso, "-chmodi", mode, &mode_and, &mode_or, 0); if(ret<=0) goto ex; for(i= 0; i0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; ret= 0; goto ex; } ret= 1; ex:; (*idx)= end_idx; Xorriso_opt_args(xorriso, "-chmodi", argc, argv, *idx, &end_idx, &optc, &optv, 256); Findjob_destroy(&job, 0); if(ret<=0) return(ret); return(!was_failure); } /* Option -chown alias -chowni , chown_r alias chown_ri */ /* @param flag bit0=recursive (-chown_r) */ int Xorriso_option_chowni(struct XorrisO *xorriso, char *uid, int argc, char **argv, int *idx, int flag) { int i, ret, was_failure= 0, end_idx, fret; uid_t uid_number; int optc= 0; char **optv= NULL; struct FindjoB *job= NULL; struct stat dir_stbuf; ret= Xorriso_opt_args(xorriso, "-chowni", argc, argv, *idx, &end_idx, &optc, &optv, 0); if(ret<=0) goto ex; ret= Xorriso_convert_uidstring(xorriso, uid, &uid_number, 0); if(ret<=0) goto ex; for(i= 0; i0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; ret= 0; goto ex; } ret= 1; ex:; (*idx)= end_idx; Xorriso_opt_args(xorriso, "-chowni", argc, argv, *idx, &end_idx, &optc, &optv, 256); Findjob_destroy(&job, 0); if(ret<=0) return(ret); return(!was_failure); } /* Option -clone */ int Xorriso_option_clone(struct XorrisO *xorriso, char *origin, char *dest, int flag) { int ret; ret= Xorriso_clone_tree(xorriso, NULL, origin, dest, 0); return(ret); } /* Option -close "on"|"off"|"as_needed" */ int Xorriso_option_close(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off") == 0) { xorriso->do_close= 0; xorriso->auto_close= 0; } else if(strcmp(mode, "as_needed") == 0) { xorriso->do_close= 0; xorriso->auto_close= 1; } else { xorriso->do_close= 1; xorriso->auto_close= 0; } return(1); } /* Option -close_damaged */ int Xorriso_option_close_damaged(struct XorrisO *xorriso, char *mode, int flag) { int ret, force= 0; if(strcmp(mode, "as_needed") == 0 || strcmp(mode, "") == 0) force= 0; else if(strcmp(mode, "force") == 0) force= 1; else { sprintf(xorriso->info_text, "-close_damaged: unknown mode "); Text_shellsafe(mode, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_reassure(xorriso, "-close_damaged", "Close damaged track and session", 0); if(ret <= 0) {ret= 2; goto ex;} ret= Xorriso_close_damaged(xorriso, force); if(ret <= 0) goto ex; ret= 1; ex:; return(ret); } /* Option -close_filter_list */ int Xorriso_option_close_filter_list(struct XorrisO *xorriso, int flag) { xorriso->filter_list_closed= 1; return(1); } /* Option -commit */ /* @param flag bit0= leave indrive and outdrive acquired as they were, i.e. do not acquire outdrive as new in-out-drive bit1= do not perform eventual -reassure @return <=0 error , 1 success, 2 revoked by -reassure , 3 no change pending */ int Xorriso_option_commit(struct XorrisO *xorriso, int flag) { int ret; char eternal_problem_status_text_mem[80]; if(!Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text, "-commit: No image modifications pending"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); {ret= 3; goto ex;} } if(!(flag&2)) { ret= Xorriso_reassure(xorriso, "-commit", "write the pending image changes to the medium", 0); if(ret<=0) {ret= 2; goto ex;} } Xorriso_process_errfile(xorriso, 0, "burn session start", 0, 1); Xorriso_get_problem_status(xorriso, eternal_problem_status_text_mem, 1); ret= Xorriso_write_session(xorriso, 0); if(ret == 2) { if(Xorriso__severity_cmp("WARNING", eternal_problem_status_text_mem) > 0) strcpy(eternal_problem_status_text_mem, "WARNING"); Xorriso_set_problem_status(xorriso, eternal_problem_status_text_mem, 1); ret= Xorriso_retry_write_session(xorriso, 0); } Xorriso_process_errfile(xorriso, 0, "burn session end", 0, 1); if(ret<=0) goto ex; Xorriso_write_session_log(xorriso, 0); xorriso->volset_change_pending= 0; xorriso->no_volset_present= 0; if(flag&1) {ret= 1; goto ex;} if(Sregex_string(&(xorriso->in_charset), xorriso->out_charset, 0) <= 0) {ret= -1; goto ex;} if(xorriso->grow_blindly_msc2>=0) ret= Xorriso_option_dev(xorriso, "", 3|4); else { xorriso->displacement= 0; xorriso->displacement_sign= 0; ret= Xorriso_reaquire_outdev(xorriso, 3); if(xorriso->in_drive_handle == NULL) xorriso->image_start_mode= 0; /* session setting is invalid by now */ } ex:; return(ret); } /* Option -commit_eject */ /* @return <=0 error , 1 success, 2 revoked by -reassure */ int Xorriso_option_commit_eject(struct XorrisO *xorriso, char *which, int flag) { int ret, eret; ret= Xorriso_option_commit(xorriso, 1); if(ret<=0 || ret==2 || ret==3) return(ret); if(strcmp(which, "none")==0) eret= 1; else eret= Xorriso_option_eject(xorriso, which, 1); ret= Xorriso_option_dev(xorriso, "", 3|4); if(eretinfo_text, "-compare: Empty disk_path given"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 1); {ret= 0; goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, disk_path, eff_origin, 2|4|8); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, ipth, eff_dest, 2|8); if(ret<=0) goto ex; if(xorriso->disk_excl_mode&8) ret= Xorriso_path_is_excluded(xorriso, eff_origin, 1); else ret= 0; if(ret!=0) goto report_outcome; if(!(flag&2)) { Xorriso_pacifier_reset(xorriso, 0); mem_lut= xorriso->last_update_time; } mem_pci= xorriso->pacifier_interval; xorriso->pacifier_interval= 5.0; if(flag&8) { xorriso->find_compare_result= 1; argv[0]= eff_dest; argv[1]= "-exec"; argv[2]= "compare"; argv[3]= eff_origin; zero= 0; ret= Xorriso_option_find(xorriso, 4, argv, &zero, 2); /* -findi */ if(ret>0) { argv[0]= eff_origin; argv[1]= "-exec"; argv[2]= "not_in_iso"; argv[3]= eff_dest; zero= 0; ret= Xorriso_option_find(xorriso, 4, argv, &zero, 1|2); /* -findx */ if(ret>0 && !xorriso->do_follow_mount) { argv[0]= eff_origin; argv[1]= "-type"; argv[2]= "m"; argv[3]= "-exec"; argv[4]= "is_full_in_iso"; argv[5]= eff_dest; zero= 0; ret= Xorriso_option_find(xorriso, 6, argv, &zero, 1|2); /* -findx */ } if(ret>0) ret= xorriso->find_compare_result; else ret= -1; } else ret= -1; } else { follow_links= (xorriso->do_follow_links || xorriso->do_follow_param) << 28; ret= Xorriso_compare_2_files(xorriso, eff_origin, eff_dest, "", &result, 2 | follow_links | ((flag&4)<<27) | (1<<30)); } xorriso->pacifier_interval= mem_pci; if(mem_lut!=xorriso->last_update_time && !(flag&2)) Xorriso_pacifier_callback(xorriso, "content bytes read", xorriso->pacifier_count, 0, "", 1 | 8 | 32); report_outcome:; if(ret>0) { sprintf(xorriso->result_line, "Both file objects match as far as expectable.\n"); } else if(ret==0) { sprintf(xorriso->result_line, "Differences detected.\n"); } else { sprintf(xorriso->result_line, "Comparison failed due to error.\n"); } if(flag&1) Xorriso_result(xorriso,0); if(ret<0) goto ex; ret= 1; ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); return(ret); } /* Option -compliance */ int Xorriso_option_compliance(struct XorrisO *xorriso, char *mode, int flag) { return(Xorriso_relax_compliance(xorriso, mode, 0)); } /* Command -concat */ int Xorriso_option_concat(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int ret, end_idx, optc= 0, progc= 0, iso_rr_start, prog_end_idx= -1; char **optv= NULL, **progv= NULL, *delimiter_mem= NULL; char *delimiter= NULL; /* Must be done before any goto ex; */ end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1); iso_rr_start= *idx + 2; if(xorriso->allow_restore <= 0) { sprintf(xorriso->info_text, "-concat: image content copies are not enabled by option -osirrox"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(end_idx - *idx < 3) { sprintf(xorriso->info_text, "-concat: Not enough arguments. Need mode, target, iso_rr_path."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(strcmp(argv[*idx], "pipe") == 0) { if(end_idx - *idx < 5) { sprintf(xorriso->info_text, "-concat pipe: Not enough arguments. Need delimiter, program path, delimiter, iso_rr_path."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } ret= Xorriso_check_thing_len(xorriso, argv[*idx + 1], sizeof(xorriso->list_delimiter), "-concat", "Delimiter", 0); if(ret <= 0) goto ex; Xorriso_alloc_meM(delimiter_mem, char, strlen(xorriso->list_delimiter) + 1); Xorriso_alloc_meM(delimiter, char, strlen(argv[*idx + 1]) + 1); strcpy(delimiter_mem, xorriso->list_delimiter); strcpy(delimiter, argv[*idx + 1]); strcpy(xorriso->list_delimiter, delimiter); ret= Xorriso_opt_args(xorriso, "-concat pipe", argc , argv, *idx + 2, &prog_end_idx, &progc, &progv, 4 | 128); strcpy(xorriso->list_delimiter, delimiter_mem); if(ret <= 0) goto ex; if(progc <= 0) { sprintf(xorriso->info_text, "-concat pipe: No program path given."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } iso_rr_start= prog_end_idx + 1; } ret= Xorriso_opt_args(xorriso, "-concat", argc , argv, iso_rr_start, &end_idx, &optc, &optv, 128); if(ret <= 0) goto ex; if(optc <= 0) { sprintf(xorriso->info_text, "-concat: No iso_rr_paths given."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); ret= 0; goto ex; } ret= Xorriso_concat(xorriso, argv[*idx], argv[*idx + 1], progc, progv, optc, optv, 0); ex:; if(progv != NULL) { if(delimiter_mem != NULL && delimiter != NULL) strcpy(xorriso->list_delimiter, delimiter); Xorriso_opt_args(xorriso, "-concat", argc, argv, *idx + 2, &prog_end_idx, &progc, &progv, 256); if(delimiter_mem != NULL && delimiter != NULL) strcpy(xorriso->list_delimiter, delimiter_mem); } Xorriso_opt_args(xorriso, "-concat", argc, argv, iso_rr_start, &end_idx, &optc, &optv, 256); Xorriso_free_meM(delimiter); Xorriso_free_meM(delimiter_mem); *idx= end_idx; return(ret); } /* Option -copyright_file */ int Xorriso_option_copyright_file(struct XorrisO *xorriso, char *name, int flag) { if(Xorriso_check_name_len(xorriso, name, (int) sizeof(xorriso->copyright_file), "-copyright_file", 0) <= 0) return(0); strcpy(xorriso->copyright_file, name); Xorriso_set_change_pending(xorriso, 1); return(1); } /* Option -cp_clone */ int Xorriso_option_cp_clone(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int i, end_idx_dummy, ret, is_dir= 0, was_failure= 0, fret, pass; char *eff_origin= NULL, *eff_dest= NULL, *dest_dir= NULL, *leafname= NULL; int optc= 0; char **optv= NULL; struct stat stbuf; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); Xorriso_alloc_meM(dest_dir, char, SfileadrL); Xorriso_alloc_meM(leafname, char, SfileadrL); ret= Xorriso_cpmv_args(xorriso, "-cp_clone", argc, argv, idx, &optc, &optv, eff_dest, 1); if(ret<=0) goto ex; if(ret == 1 && optc > 1) { nondir_exists:; sprintf(xorriso->info_text, "-cp_clone: Copy address already exists and is not a directory: "); Text_shellsafe(eff_dest, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } strcpy(dest_dir, eff_dest); if(optc == 1) { ret= Xorriso_iso_lstat(xorriso, eff_dest, &stbuf, 0); if(ret >= 0) { if(S_ISDIR(stbuf.st_mode))/* target directory exists */ is_dir= 1; else goto nondir_exists; } } else { is_dir= 1; ret= Xorriso_mkdir(xorriso, dest_dir, 1 | 2); if(ret < 0) {ret= -(ret != -1); goto ex;} } /* Pass 0 checks whether the way is clear, pass 1 does the cloning */ for(pass= 0; pass < 2; pass++) { for(i= 0; iwdi, optv[i], eff_origin, !!pass); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; if(is_dir) { ret= Sfile_leafname(eff_origin, leafname, 0); if(ret<=0) goto problem_handler; strcpy(eff_dest, dest_dir); ret= Sfile_add_to_path(eff_dest, leafname, 0); if(ret<=0) { sprintf(xorriso->info_text, "Effective path gets much too long (%d)", (int) (strlen(eff_dest)+strlen(leafname)+1)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto problem_handler; } } ret= Xorriso_iso_lstat(xorriso, eff_dest, &stbuf, 0); if(pass == 0) { /* It is ok if both are directories */; if(ret >= 0 && S_ISDIR(stbuf.st_mode)) { ret= Xorriso_iso_lstat(xorriso, eff_origin, &stbuf, 0); if (ret >= 0 && S_ISDIR(stbuf.st_mode)) ret= -1; } if(ret >= 0) { sprintf(xorriso->info_text, "Cloning: May not overwrite: "); Text_shellsafe(eff_dest, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto problem_handler; } } else { ret= Xorriso_clone_tree(xorriso, NULL, eff_origin, eff_dest, 1); if(ret <= 0) goto problem_handler; } continue; /* regular bottom of loop */ problem_handler:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } } ret= !was_failure; ex:; Xorriso_opt_args(xorriso, "-cp_clone", argc, argv, *idx, &end_idx_dummy, &optc, &optv, 256); Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); Xorriso_free_meM(dest_dir); Xorriso_free_meM(leafname); return(ret); } /* Option -cpr alias -cpri */ int Xorriso_option_cpri(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int i, ret, is_dir= 0, was_failure= 0, fret, end_idx_dummy; char *eff_origin= NULL, *eff_dest= NULL, *dest_dir= NULL, *leafname= NULL; int optc= 0; char **optv= NULL; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); Xorriso_alloc_meM(dest_dir, char, SfileadrL); Xorriso_alloc_meM(leafname, char, SfileadrL); ret= Xorriso_cpmv_args(xorriso, "-cpri", argc, argv, idx, &optc, &optv, eff_dest, 1|2); if(ret<=0) goto ex; if(ret==2) { is_dir= 1; strcpy(dest_dir, eff_dest); } /* Perform graft-ins */ Xorriso_pacifier_reset(xorriso, 0); for(i= 0; irequest_to_abort; i++) { ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, optv[i], eff_origin, 2|4); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; if(is_dir) { ret= Sfile_leafname(eff_origin, leafname, 0); if(ret<=0) goto problem_handler; strcpy(eff_dest, dest_dir); ret= Sfile_add_to_path(eff_dest, leafname, 0); if(ret<=0) { sprintf(xorriso->info_text, "Effective path gets much too long (%d)", (int) (strlen(eff_dest)+ strlen(leafname)+1)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto problem_handler; } } ret= Xorriso_graft_in(xorriso, NULL, eff_origin, eff_dest, (off_t) 0, (off_t) 0, 0); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; sprintf(xorriso->info_text, "Added to ISO image: %s '%s'='%s'\n", (ret>1 ? "directory" : "file"), (eff_dest[0] ? eff_dest : "/"), eff_origin); if(!(flag&1)) Xorriso_info(xorriso, 0); continue; /* regular bottom of loop */ problem_handler:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 1); ret= !was_failure; ex:; Xorriso_opt_args(xorriso, "-cpri", argc, argv, *idx, &end_idx_dummy, &optc, &optv, 256); Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); Xorriso_free_meM(dest_dir); Xorriso_free_meM(leafname); return(ret); } /* Options -cpx , -cpax, -cp_rx , -cp_rax */ /* @param flag bit0= recursive (-cp_rx, -cp_rax) bit1= full property restore (-cpax, -cp_rax) */ int Xorriso_option_cpx(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int i, ret, is_dir= 0, was_failure= 0, fret, end_idx_dummy, problem_count; char *eff_origin= NULL, *eff_dest= NULL, *dest_dir= NULL, *leafname= NULL; char **eff_src_array= NULL, **eff_tgt_array= NULL; int optc= 0; char **optv= NULL; struct stat stbuf; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); Xorriso_alloc_meM(dest_dir, char, SfileadrL); Xorriso_alloc_meM(leafname, char, SfileadrL); ret= Xorriso_cpmv_args(xorriso, "-cp*x", argc, argv, idx, &optc, &optv, eff_dest, 1|4); if(ret<=0) goto ex; if(ret==2) { is_dir= 1; strcpy(dest_dir, eff_dest); } if(xorriso->allow_restore <= 0) { sprintf(xorriso->info_text, "-cpx: image-to-disk copies are not enabled by option -osirrox"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } if(xorriso->do_restore_sort_lba || !(xorriso->ino_behavior & 4)) { eff_src_array= calloc(optc, sizeof(char *)); eff_tgt_array= calloc(optc, sizeof(char *)); if(eff_src_array == NULL || eff_tgt_array == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } for(i= 0; i < optc; i++) eff_src_array[i]= eff_tgt_array[i]= NULL; } /* Perform copying */ Xorriso_pacifier_reset(xorriso, 0); for(i= 0; irequest_to_abort; i++) { ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, optv[i], eff_origin, 2|8); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; ret= Xorriso_iso_lstat(xorriso, eff_origin, &stbuf, 2|4); if(ret==-1) goto problem_handler; if(S_ISDIR(stbuf.st_mode) && !(flag&1)) { /* only allow directories if they actually represent split data files */ ret= 0; if(xorriso->do_concat_split) ret= Xorriso_is_split(xorriso, eff_origin, NULL, 4); if(ret<0) goto problem_handler; if(ret==0) { sprintf(xorriso->info_text, "-cpx: May not copy directory "); Text_shellsafe(eff_origin, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto problem_handler; } } if(is_dir && strcmp(eff_origin, "/")!=0) { ret= Sfile_leafname(eff_origin, leafname, 0); if(ret<=0) goto problem_handler; strcpy(eff_dest, dest_dir); ret= Sfile_add_to_path(eff_dest, leafname, 0); if(ret<=0) { sprintf(xorriso->info_text, "Effective path gets much too long (%d)", (int) (strlen(eff_dest)+strlen(leafname)+1)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto problem_handler; } } if(eff_src_array != NULL) { eff_src_array[i]= strdup(eff_origin); eff_tgt_array[i]= strdup(eff_dest); if(eff_src_array[i] == NULL || eff_tgt_array[i] == NULL) { Xorriso_no_malloc_memory(xorriso, &(eff_src_array[i]), 0); ret= -1; goto ex; } } else { ret= Xorriso_restore(xorriso, eff_origin, eff_dest, (off_t) 0, (off_t) 0, 16 | ((!(flag&2))<<6)); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; if(ret==3 || (flag&1)) continue; sprintf(xorriso->info_text, "Copied from ISO image to disk: %s '%s' = '%s'\n", (ret>1 ? "directory" : "file"), eff_origin, eff_dest); Xorriso_info(xorriso, 0); } continue; /* regular bottom of loop */ problem_handler:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } if(eff_src_array != NULL) { ret= Xorriso_restore_sorted(xorriso, optc, eff_src_array, eff_tgt_array, &problem_count, 0); if(ret <= 0 || problem_count > 0) was_failure= 1; } if(xorriso->pacifier_count>0) Xorriso_pacifier_callback(xorriso, "files restored",xorriso->pacifier_count, xorriso->pacifier_total, "", 1|4); ret= !was_failure; ex:; i= optc; Sfile_destroy_argv(&i, &eff_src_array, 0); i= optc; Sfile_destroy_argv(&i, &eff_tgt_array, 0); Xorriso_opt_args(xorriso, "-cp*x", argc, argv, *idx, &end_idx_dummy, &optc, &optv, 256); Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); Xorriso_free_meM(dest_dir); Xorriso_free_meM(leafname); return(ret); } /* Option -cut_out */ int Xorriso_option_cut_out(struct XorrisO *xorriso, char *disk_path, char *start, char *count, char *iso_rr_path, int flag) { int ret; double num; off_t startbyte, bytecount; num= Scanf_io_size(start, 0); if(num<0 || num > 1.0e18) { /* 10^18 = 10^3 ^ 6 < 2^10 ^ 6 = 2^60 */ sprintf(xorriso->info_text, "-cut_out: startbyte address negative or much too large (%s)", start); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } startbyte= num; num= Scanf_io_size(count, 0); if(num<=0 || num > 1.0e18) { sprintf(xorriso->info_text, "-cut_out: bytecount zero, negative or much too large (%s)", count); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } bytecount= num; sprintf(xorriso->info_text, "-cut_out from %s , byte %.f to %.f, and graft as %s", disk_path, (double) startbyte, (double) (startbyte+bytecount), iso_rr_path); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); ret= Xorriso_cut_out(xorriso, disk_path, startbyte, bytecount, iso_rr_path, 0); return(ret); } libisoburn-1.5.4/xorriso/base_obj.h0000644000175700017510000000116613701321754014253 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2010 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of functions which perform the fundamental operations of the XorrisO object. */ #ifndef Xorriso_pvt_base_obj_includeD #define Xorriso_pvt_base_obj_includeD yes #ifdef NIX /* <<< */ unsigned long Xorriso_get_di_counteR= 0; #endif /* NIX */ struct XorrisO; int Xorriso_destroy_re(struct XorrisO *m, int flag); int Xorriso__get_signal_behavior(int flag); #endif /* ! Xorriso_pvt_base_obj_includeD */ libisoburn-1.5.4/xorriso/make_docs.sh0000755000175700017510000000125013742571045014621 00000000000000#!/bin/sh # # Produce man page xorriso/xorriso.1 and info file xorriso/xorriso.info # from base file xorriso/xorriso.texi. # Same for xorriso/xorrisofs.texi and xorriso/xorrecord.texi. ( cd xorriso ; makeinfo --no-split ./xorriso.texi ) ( cd xorriso ; makeinfo --no-split ./xorrisofs.texi ) ( cd xorriso ; makeinfo --no-split ./xorrecord.texi ) ( cd xorriso ; makeinfo --no-split ./xorriso-tcltk.texi ) ( cd xorriso-dd-target ; makeinfo --no-split ./xorriso-dd-target.texi ) xorriso/make_xorriso_1 -auto xorriso/make_xorriso_1 -auto -xorrisofs xorriso/make_xorriso_1 -auto -xorrecord xorriso/make_xorriso_1 -auto -xorriso-tcltk xorriso/make_xorriso_1 -auto -xorriso-dd-target libisoburn-1.5.4/xorriso/filters.h0000644000175700017510000000175613701321754014164 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2010 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of functions which operate on data filter objects. */ #ifndef Xorriso_pvt_filters_includeD #define Xorriso_pvt_filters_includeD yes int Xorriso_extf_new(struct XorrisO *xorriso, struct Xorriso_extF **filter, char *path, int argc, char **argv, int behavior, char *suffix, char *name, int flag); int Xorriso_extf_destroy(struct XorrisO *xorriso, struct Xorriso_extF **filter, int flag); int Xorriso_lookup_extf(struct XorrisO *xorriso, char *name, struct Xorriso_lsT **found_lst, int flag); int Xorriso_rename_suffix(struct XorrisO *xorriso, IsoNode *node, char *suffix, char *show_path, char new_name[], int flag); #endif /* ! Xorriso_pvt_filters_includeD */ libisoburn-1.5.4/xorriso/make_xorriso_1.c0000644000175700017510000003216613701321754015430 00000000000000 /* ( cd xorriso ; cc -g -Wall -o make_xorriso_1 make_xorriso_1.c ) */ /* Specialized converter from xorriso/xorriso.texi to xorriso/xorriso.1, or from xorriso/xorrisofs.texi to xorriso/xorrisofs.1, or from xorriso/xorrecord.texi to xorriso/xorrecord.1. or from xorriso/xorriso-tcltk.texi to xorriso/xorriso-tcltk.1. or from xorriso/xorriso-dd-target.texi to xorriso/xorriso-dd-target.1. The conversion rules are described at the beginning of xorriso/xorriso.texi Copyright 2010 - 2019 Thomas Schmitt, Provided under GPL version 2 or later. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include /* The conversion state */ struct Mx1 { char prog[4096]; int count_in; int count_out; int skipping; /* <0 stacked skipping , 0= no , >0 counting down */ }; int Mx1_substitute(struct Mx1 *m, char line_in[256], char line_out[256], int raw, int upto, int flag); int Mx1_init(struct Mx1 *m, char *prog, int flag) { strncpy(m->prog, prog, sizeof(m->prog) - 1); m->prog[sizeof(m->prog) - 1]= 0; m->count_in= 0; m->count_out= 0; m->skipping= 0; return(1); } int Mx1_report_error(struct Mx1 *m, char *text, int flag) { fprintf(stderr, "%s : line %d : %s\n", m->prog, m->count_in, text); return(1); } int Mx1__get_word(char *line, char word[256], char **remainder, int flag) { char *cpt, *start; int l; word[0]= 0; *remainder= NULL; for(cpt= line; *cpt != 0 && isspace(*cpt); cpt++); if(*cpt == 0) return(0); start= cpt; for(cpt= line; *cpt != 0 && ! isspace(*cpt); cpt++); l= cpt - start; if(l > 0) strncpy(word, start, l); word[l]= 0; *remainder= cpt; return(1); } int Mx1_is_wrap(struct Mx1 *m, char wraps[][20], char *start, char **found, int flag) { int i; for(i= 0; wraps[i][0] != 0; i++) if(strncmp(start, wraps[i], strlen(wraps[i])) == 0) break; if(wraps[i][0] != 0) { if(found != NULL) *found= wraps[i]; return(1); } return(0); } int Mx1_is_bold_wrap(struct Mx1 *m, char *start, char **found, int flag) { int ret; static char bold_wraps[][20]= { "@b{", "@dfn{", "@emph{", "@strong{", "@command{", "" }; ret= Mx1_is_wrap(m, bold_wraps, start, found, 0); return(ret); } int Mx1_is_normal_wrap(struct Mx1 *m, char *start, char **found, int flag) { int ret; static char normal_wraps[][20]= { "@var{", "@code{", "@i{", "@abbr{", "@file{", "@option{", "@samp{", "@r{", "" }; ret= Mx1_is_wrap(m, normal_wraps, start, found, 0); return(ret); } int Mx1_is_ignored_wrap(struct Mx1 *m, char *start, char **found, int flag) { int ret; static char ignored_wraps[][20]= { "@ref{", "@xref{", "" }; ret= Mx1_is_wrap(m, ignored_wraps, start, found, 0); return(ret); } int Mx1_is_any_wrap(struct Mx1 *m, char *start, char **found, int flag) { int ret; ret= Mx1_is_bold_wrap(m, start, found, 0); if(ret > 0) return(1); ret= Mx1_is_normal_wrap(m, start, found, 0); if(ret > 0) return(2); ret= Mx1_is_ignored_wrap(m, start, found, 0); if(ret > 0) return(3); return(0); } /* @param flag bit0= recursion bit1= drop content of brackets */ int Mx1_rewrap(struct Mx1 *m, char **read_pt, char **write_pt, char *write_base, char *envelope, char *front, char *back, int flag) { char *rpt, *wpt, *ept, content[256], msg[256]; int l, ret; rpt= *read_pt; wpt= *write_pt; ept= strchr(rpt, '}'); if(ept == NULL) { sprintf(msg, "No closing bracket found for '%s'", envelope); Mx1_report_error(m, msg, 0); return(-1); } /* Mapped {...} content is subject to the rules except {...} mapping. */ l= ept - rpt; if(flag & 2) l= 0; if(l > 0) { ret= Mx1_substitute(m, rpt, content, 0, l, 1); if(ret <= 0) return(ret); l= strlen(content); } if((wpt - write_base) + l + strlen(front) + strlen(back) > 255) { Mx1_report_error(m, "Line length overflow while text substitution", 0); return(-1); } strcpy(wpt, front); wpt+= strlen(front); if(l > 0) memcpy(wpt, content, l); wpt+= l; strcpy(wpt, back); wpt+= strlen(back); (*read_pt)+= ept - rpt; (*write_pt)= wpt; return(1); } /* @param flag bit0= recursion */ int Mx1_substitute(struct Mx1 *m, char line_in[256], char line_out[256], int raw, int upto, int flag) { char *rpt, *wpt, *found; int ret, typ= 0; wpt= line_out; for(rpt= line_in; rpt - line_in < upto && *rpt != 0; rpt++) { if(rpt - line_in < raw) { *(wpt++)= *rpt; continue; } if(*rpt == '@') { typ= 0; if(!(flag & 1)) typ= Mx1_is_any_wrap(m, rpt, &found, 0); if(typ == 1) { /* @b{...}, @command{...}, @dfn{...}, @emph{...}, @strong{...} get mapped to \fB...\fR . */ rpt+= strlen(found); ret= Mx1_rewrap(m, &rpt, &wpt, line_out, found , "\\fB", "\\fR", flag & 1); if(ret <= 0) return(ret); } else if(typ == 2) { /* @abbr{...}, @code{...}, @file{...}, @i{...}, @option{...}, @r{...}, @ref{...}, @samp{...},@var{...}, get mapped to ... . */ rpt+= strlen(found); ret= Mx1_rewrap(m, &rpt, &wpt, line_out, found, "", "", flag & 1); if(ret <= 0) return(ret); } else if(typ == 3) { /* @ref{...}, @xref{...} get mapped to empty text. */ rpt+= strlen(found); ret= Mx1_rewrap(m, &rpt, &wpt, line_out, found , "", "", (flag & 1) | 2); if(ret <= 0) return(ret); } else if(strncmp(rpt, "@email{", 7) == 0 && !(flag & 1)) { /* @email{...} gets mapped to <...> . */ rpt+= 7; ret= Mx1_rewrap(m, &rpt, &wpt, line_out, "@email{", "<", ">", 0); if(ret <= 0) return(ret); } else if(strncmp(rpt, "@minus{}", 8) == 0) { /* @minus{} will become "-". */ if((wpt - line_out) + 1 > 255) goto overflow; *(wpt++)= '-'; rpt+= 7; } else if(strncmp(rpt, "@@", 2) == 0 || strncmp(rpt, "@{", 2) == 0 || strncmp(rpt, "@}", 2) == 0) { /* @@ , @{, @} will get stripped of their first @. */ if((wpt - line_out) + 1 > 255) goto overflow; *(wpt++)= *(rpt + 1); rpt++; } else { if((wpt - line_out) + 1 > 255) goto overflow; *(wpt++)= *(rpt); } } else if(*rpt == '\\') { /* "\" becomes "\\" */ if((wpt - line_out) + 2 > 255) goto overflow; *(wpt++)= '\\'; *(wpt++)= '\\'; } else if((wpt - line_out) + 1 > 255) { overflow:; Mx1_report_error(m, "Line length overflow while text substitution", 0); return(-1); } else *(wpt++)= *rpt; } *wpt= 0; return(1); } /* @return 1= line_out is valid, 0= do not put out line_out, -1 = error */ int Mx1_convert(struct Mx1 *m, char line_in[256], char line_out[256], int flag) { int l, num, keep= 0, ret, raw, i, backslash_count; char word[256], buf[256], *remainder, *wpt; m->count_in++; l= strlen(line_in); if(m->skipping > 0) { m->skipping--; return(0); } /* The first line gets discarded. */ if(m->count_in == 1) return(0); /* Line start "@c man " will become "", the remainder is put out unaltered. */ if(strncmp(line_in, "@c man ", 7) == 0) { strcpy(line_out, line_in + 7); m->count_out++; return(1); } /* Lines "@*" will be converted to ".br" */ if(strcmp(line_in, "@*") == 0) { strcpy(line_out, ".br"); m->count_out++; return(1); } /* @c man-ignore-lines N will discard N following lines. "@c man-ignore-lines begin" discards all following lines up to "@c man-ignore-lines end". */ if(strncmp(line_in, "@c man-ignore-lines ", 20) == 0) { if(strcmp(line_in + 20, "begin") == 0) { m->skipping--; return(0); } else if(strcmp(line_in + 20, "end") == 0) { if(m->skipping < 0) m->skipping++; return(0); } else if(m->skipping == 0) { num= 0; sscanf(line_in + 20, "%d", &num); if(num > 0) { m->skipping= num; return(0); } } Mx1_report_error(m, "Inappropriate use of '@c man-ignore-lines'", 0); return(-1); } /* Line blocks of "@menu" "@end menu" will be discarded. */ if(strcmp(line_in, "@menu") == 0) { m->skipping--; return(0); } if(strcmp(line_in, "@end menu") == 0) { if(m->skipping < 0) m->skipping++; return(0); } if(m->skipping) return(0); /* "@item -word words" becomes "\fB\-word\fR words". */ /* "@item word words" becomes "\fBword\fR words". */ if(strncmp(line_in, "@item ", 6) == 0) { ret= Mx1__get_word(line_in + 6, word, &remainder, 0); if(ret <= 0) { Mx1_report_error(m, "Found no word after @item", 0); return(0); } strcpy(buf, "\\fB"); if(word[0] == '-') { if(l >= 255) { length_overflow:; Mx1_report_error(m, "Line length overflow while converting @item", 0); return(-1); } strcat(buf, "\\"); } /* Substitute option text */ raw= strlen(buf); strcat(buf, word); ret= Mx1_substitute(m, buf, line_out, raw, strlen(buf), 0); if(ret <= 0) return(-1); if(strlen(line_out) + 3 + strlen(remainder) > 255) goto length_overflow; strcpy(buf, line_out); strcat(buf, "\\fR"); raw= strlen(buf); strcat(buf, remainder); /* Substitute arguments text */ ret= Mx1_substitute(m, buf, line_out, raw, strlen(buf), 0); if(ret <= 0) return(-1); m->count_out++; return(1); } /* @strong{... } gets mapped to \fB...\fR . */ /* @command{... } gets mapped to \fB...\fR . */ /* @minus{} will become "-". */ /* Mapped {...} content is subject to the rules except {...} mapping. */ /* @@ , @{, @} will get stripped of their first @. */ /* "\" becomes "\\" */ if(line_in[0] != '@' || Mx1_is_any_wrap(m, line_in, NULL, 0) > 0 || strncmp(line_in, "@minus{}", 8) == 0 || strncmp(line_in, "@@", 2) == 0 || strncmp(line_in, "@{", 2) == 0 || strncmp(line_in, "@}", 2) == 0 ) { keep= 1; ret= Mx1_substitute(m, line_in, line_out, 0, strlen(line_in), 0); if(ret <= 0) return(-1); } /* Other lines which begin by "@" will be discarded. */ if(! keep) { if(line_in[0] == '@') return(0); strcpy(line_out, line_in); } /* "-" which are not preceded by an uneven number of "\" will get prepended one "\". */ l= strlen(line_out); backslash_count= 0; wpt= buf; for(i= 0; i < l; i++) { if(line_out[i] == '\\') backslash_count++; else if(line_out[i] == '-') { if(backslash_count % 2 == 0) *(wpt++)= '\\'; backslash_count= 0; } else backslash_count= 0; *(wpt++)= line_out[i]; } *wpt= 0; strcpy(line_out, buf); m->count_out++; return(1); } int main(int argc, char **argv) { int ret, l, as_filter= 0, i; char line_in[256], line_out[256], *got; static char name_in[1024]= {"xorriso/xorriso.texi"}; static char name_out[1024]= {"xorriso/xorriso.1"}; struct Mx1 m; FILE *fp_in= stdin, *fp_out= stdout; Mx1_init(&m, argv[0], 0); if(argc < 2) { usage:; fprintf(stderr, "usage: %s -auto|-filter [-xorrisofs]\n", argv[0]); fprintf(stderr, " -auto xorriso/xorriso.texi -> xorriso/xorriso.1\n"); fprintf(stderr, " -filter stdin -> stdout\n"); fprintf(stderr, " -xorrisofs process xorriso/xorrisofs.texi\n"); fprintf(stderr, " -xorrecord process xorriso/xorrecord.texi\n"); fprintf(stderr, " -xorriso-tcltk process xorriso/-xorriso-tcltk.texi\n"); fprintf(stderr, " -xorriso-dd-target process xorriso/-xorriso-dd-target.texi\n"); exit(2); } for(i= 1; i < argc; i++) { if(strcmp(argv[i], "-filter") == 0) { as_filter= 1; } else if(strcmp(argv[i], "-auto") == 0) { as_filter= 0; } else if(strcmp(argv[i], "-xorrisofs") == 0) { strcpy(name_in, "xorriso/xorrisofs.texi"); strcpy(name_out, "xorriso/xorrisofs.1"); } else if(strcmp(argv[i], "-xorrecord") == 0) { strcpy(name_in, "xorriso/xorrecord.texi"); strcpy(name_out, "xorriso/xorrecord.1"); } else if(strcmp(argv[i], "-xorriso-tcltk") == 0) { strcpy(name_in, "xorriso/xorriso-tcltk.texi"); strcpy(name_out, "xorriso/xorriso-tcltk.1"); } else if(strcmp(argv[i], "-xorriso-dd-target") == 0) { strcpy(name_in, "xorriso-dd-target/xorriso-dd-target.texi"); strcpy(name_out, "xorriso-dd-target/xorriso-dd-target.1"); } else { fprintf(stderr, "%s : unknown option %s\n", argv[0], argv[i]); goto usage; } } if(!as_filter) { fp_in= fopen(name_in, "r"); if(fp_in == NULL) { fprintf(stderr, "%s : failed to fopen( %s ,r) : %d %s\n", argv[0], name_in, errno, strerror(errno)); exit(3); } fp_out= fopen(name_out, "w"); if(fp_out == NULL) { fprintf(stderr, "%s : failed to fopen( %s ,w) : %d %s\n", argv[0], name_out, errno, strerror(errno)); exit(4); } } while(1) { got= fgets(line_in, sizeof(line_in), fp_in); if(got == NULL) break; l= strlen(line_in); while(l > 0) { if(line_in[l - 1] == '\r' || line_in[l - 1] == '\n') { line_in[l - 1] = 0; l--; } else break; } ret= Mx1_convert(&m, line_in, line_out, 0); if(ret < 0) exit(1); if(ret == 0) continue; fprintf(fp_out, "%s\n", line_out); } exit(0); } libisoburn-1.5.4/xorriso/opts_p_z.c0000644000175700017510000022140213750211515014331 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of options -p* to -z* as mentioned in man page or info file derived from xorriso.texi. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" /* Option -pacifier */ int Xorriso_option_pacifier(struct XorrisO *xorriso, char *style, int flag) { #define Xorriso_pacifier_min_intvL 0.1 #define Xorriso_pacifier_max_intvL 60.0 if(strcmp(style, "xorriso")==0 || strcmp(style, "default")==0) xorriso->pacifier_style= 0; else if(strcmp(style, "mkisofs")==0 || strcmp(style, "genisofs")==0 || strcmp(style, "genisoimage")==0 || strcmp(style, "xorrisofs")==0) xorriso->pacifier_style= 1; else if(strcmp(style, "cdrecord")==0 || strcmp(style, "cdrskin")==0 || strcmp(style, "wodim")==0 || strcmp(style, "xorrecord")==0) xorriso->pacifier_style= 2; else if(strncmp(style, "interval=", 9) == 0) { sscanf(style + 9, "%lf", &(xorriso->pacifier_interval)); if(xorriso->pacifier_interval < Xorriso_pacifier_min_intvL) { sprintf(xorriso->info_text, "-pacifier: interval='%s' is too low. Min: %f", style, Xorriso_pacifier_min_intvL); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); xorriso->pacifier_interval= Xorriso_pacifier_min_intvL; } else if(xorriso->pacifier_interval > Xorriso_pacifier_max_intvL) { sprintf(xorriso->info_text, "-pacifier: interval='%s' is too high. Max: %f", style, Xorriso_pacifier_max_intvL); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); xorriso->pacifier_interval= Xorriso_pacifier_max_intvL; } } else { sprintf(xorriso->info_text, "-pacifier: unknown behavior code '%s'", style); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } return(1); } /* Option -padding */ int Xorriso_option_padding(struct XorrisO *xorriso, char *size, int flag) { double num; if(strcmp(size, "included") == 0) { xorriso->do_padding_by_libisofs= 1; return(1); } else if(strcmp(size, "excluded") == 0 || strcmp(size, "appended") == 0) { xorriso->do_padding_by_libisofs= 0; return(1); } else if(size[0] < '0' || size[0] > '9') { sprintf(xorriso->info_text, "-padding: unrecognized non-numerical mode "); Text_shellsafe(size, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } num= Scanf_io_size(size, 0); if(num < 0 || num > 1024.0 * 1024.0 * 1024.0) { sprintf(xorriso->info_text, "-padding: wrong size %.f (allowed: %.f - %.f)", num, 0.0, 1024.0 * 1024.0 * 1024.0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } xorriso->padding= num; if(xorriso->padding/2048 != num/2048.0) xorriso->padding++; return(1); } /* Option -page */ int Xorriso_option_page(struct XorrisO *xorriso, int len, int width, int flag) { if(len<0 || width<=0) { sprintf(xorriso->info_text, "Improper numeric value of arguments of -page: %d %d", len, width); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } xorriso->result_page_length= len; xorriso->result_page_width= width; return(1); } /* Option -paste_in */ int Xorriso_option_paste_in(struct XorrisO *xorriso, char *iso_rr_path, char *disk_path, char *start, char *count, int flag) { int ret; double num; off_t startbyte, bytecount; num= Scanf_io_size(start, 0); if(num<0 || num > 1.0e18) { /* 10^18 = 10^3 ^ 6 < 2^10 ^ 6 = 2^60 */ sprintf(xorriso->info_text, "-paste_in: startbyte address negative or much too large (%s)", start); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } startbyte= num; num= Scanf_io_size(count, 0); if(num<=0 || num > 1.0e18) { sprintf(xorriso->info_text, "-paste_in : bytecount zero, negative or much too large (%s)", count); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } bytecount= num; sprintf(xorriso->info_text, "-paste_in from %s to %s, byte %.f to %.f", disk_path, iso_rr_path, (double) startbyte, (double) (startbyte+bytecount)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); Xorriso_pacifier_reset(xorriso, 0); ret= Xorriso_paste_in(xorriso, disk_path, startbyte, bytecount, iso_rr_path, 0); Xorriso_pacifier_callback(xorriso, "files restored",xorriso->pacifier_count, xorriso->pacifier_total, "", 1 | 4 | 8 | 32); return(ret); } /* Option -path_list , -quoted_path_list */ /* @param flag bit0= -quoted_path_list bit1= mkisofs mode: Use / as target for pathspecs without = */ int Xorriso_option_path_list(struct XorrisO *xorriso, char *adr, int flag) { int ret,linecount= 0, insertcount= 0, null= 0, was_failure= 0, fret= 0; int was_ferror= 0, argc= 0, i, allow_graft_points_mem; FILE *fp= NULL; char **argv= NULL, *pathspec= NULL; allow_graft_points_mem= xorriso->allow_graft_points; Xorriso_pacifier_reset(xorriso, 0); if(adr[0]==0) { sprintf(xorriso->info_text,"Empty file name given with %s", flag & 1 ? "-quoted_path_list" : "-path_list"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); return(0); } ret= Xorriso_afile_fopen(xorriso, adr, "rb", &fp, 0); if(ret <= 0) return(0); Xorriso_alloc_meM(pathspec, char, 2 * SfileadrL); while(1) { ret= Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 4 | (flag & 1) ); if(ret <= 0) goto ex; if(ret == 2) break; for(i= 0; i < argc; i++) { if(argv[i][0] == 0) continue; null= 0; if(flag & 2) { ret= Xorriso_graftable_pathspec(xorriso, argv[i], pathspec, 0); if(ret <= 0) goto problem_handler; xorriso->allow_graft_points= 3; ret= Xorriso_option_add(xorriso, 1, &pathspec, &null, 1 | 2); xorriso->allow_graft_points= allow_graft_points_mem; } else { ret= Xorriso_option_add(xorriso, 1, argv + i, &null, 1 | 2); } if(ret<=0 || xorriso->request_to_abort) goto problem_handler; insertcount++; continue; /* regular bottom of loop */ problem_handler:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; if(ret > 0) ret= 0; goto ex; } } ret= 1; ex:; xorriso->allow_graft_points= allow_graft_points_mem; Sfile_make_argv("", "", &argc, &argv, 2); Xorriso_free_meM(pathspec); Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 2); if(fp != NULL && fp != stdin) fclose(fp); Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 1); if(ret<=0) { sprintf(xorriso->info_text, "Aborted reading of file "); Text_shellsafe(adr, xorriso->info_text, 1); sprintf(xorriso->info_text + strlen(xorriso->info_text), " in line number %d", linecount); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, (fret==-2 ? "NOTE" : "FAILURE"), 0); } else ret= !was_ferror; sprintf(xorriso->info_text, "Added %d items from file ", insertcount); Text_shellsafe(adr, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso,0); if(ret<=0) return(ret); return(!was_failure); } /* Option -pathspecs */ int Xorriso_option_pathspecs(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off")==0) xorriso->allow_graft_points= 0; else if(strcmp(mode, "on")==0) xorriso->allow_graft_points= 1; else if(strcmp(mode, "as_mkisofs")==0) xorriso->allow_graft_points= 3; else { sprintf(xorriso->info_text, "-pathspecs: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -pkt_output */ int Xorriso_option_pkt_output(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode,"off")==0) xorriso->packet_output= 0; else xorriso->packet_output= 1; return(1); } /* Option -preparer_id */ int Xorriso_option_preparer_id(struct XorrisO *xorriso, char *name, int flag) { if(Xorriso_check_name_len(xorriso, name, (int) sizeof(xorriso->preparer_id), "-preparer_id", 0) <= 0) return(0); if(strcmp(name, "@xorriso@") == 0) Xorriso_preparer_string(xorriso, xorriso->preparer_id, 0); else strcpy(xorriso->preparer_id, name); Xorriso_set_change_pending(xorriso, 1); return(1); } /* Options -print , -print_info , -print_mark */ /* @param flag bit0-1= channel: 0=result, 1=info, 2=mark */ int Xorriso_option_print(struct XorrisO *xorriso, char *text, int flag) { int maxl, l, mode; l= strlen(text); mode= flag & 3; if(mode == 1) maxl= sizeof(xorriso->info_text); else if(mode == 2) maxl= sizeof(xorriso->mark_text); else maxl= sizeof(xorriso->result_line); if(l >= maxl) { sprintf(xorriso->info_text, "Output text too long for -print%s(%d > %d)", mode == 1 ? "_info" : mode == 2 ? "_mark" : "", l, maxl); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); return(0); } if(mode == 1) { sprintf(xorriso->info_text,"%s\n", text); Xorriso_info(xorriso,0); } else if(mode == 2) { strcpy(xorriso->info_text, xorriso->mark_text); strcpy(xorriso->mark_text, text); Xorriso_mark(xorriso,0); strcpy(xorriso->mark_text, xorriso->info_text); } else { sprintf(xorriso->result_line,"%s\n",text); Xorriso_result(xorriso,1); } return(1); } /* Option -print_size @param flag bit0= report in mkisofs compatible form on real stdout (resp. on result channel if xorriso->packet_output) */ int Xorriso_option_print_size(struct XorrisO *xorriso, int flag) { int ret, fd; if(!Xorriso_change_is_pending(xorriso, 0)) { sprintf(xorriso->info_text,"-print_size: No image modifications pending"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); if(!(flag & 1)) { sprintf(xorriso->result_line,"Image size : 0s\n"); Xorriso_result(xorriso,0); } return(2); } ret= Xorriso_write_session(xorriso, 1); if(ret<=0) { sprintf(xorriso->info_text,"-print_size: Failed to set up virtual -commit"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } if(flag&1) { sprintf(xorriso->result_line,"%d\n", ret); if(xorriso->packet_output) { Xorriso_result(xorriso,0); } else { fd= xorriso->dev_fd_1; if(fd<0) fd= 1; ret= write(fd, xorriso->result_line, strlen(xorriso->result_line)); /* (result of write intentionally ignored) */ fsync(fd); } } else { sprintf(xorriso->result_line,"Image size : %ds\n", ret); Xorriso_result(xorriso,0); } return(1); } /* Option -prog */ int Xorriso_option_prog(struct XorrisO *xorriso, char *name, int flag) { if(strlen(name)>=sizeof(xorriso->progname)) { sprintf(xorriso->info_text, "Name too long with option -prog (%d > %d)", (int) strlen(name), (int) sizeof(xorriso->progname)-1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } if(Sfile_str(xorriso->progname,name,0)<=0) return(-1); return(1); } /* Option -prog_help */ int Xorriso_option_prog_help(struct XorrisO *xorriso, char *name, int flag) { int ret; ret= Xorriso_option_prog(xorriso, name, 0); if(ret<=0) return(ret); ret= Xorriso_option_help(xorriso, 0); return(ret); } /* Option -prompt */ int Xorriso_option_prompt(struct XorrisO *xorriso, char *text, int flag) { int ret; char line[80]; strncpy(xorriso->result_line,text,sizeof(xorriso->result_line)-1); xorriso->result_line[sizeof(xorriso->result_line)-1]= 0; Xorriso_result(xorriso,0); ret= Xorriso_dialog_input(xorriso, line, sizeof(line),1); return(ret); } /* Option -publisher */ int Xorriso_option_publisher(struct XorrisO *xorriso, char *name, int flag) { if(Xorriso_check_name_len(xorriso, name, (int) sizeof(xorriso->publisher), "-publisher", 0) <= 0) return(0); strcpy(xorriso->publisher,name); Xorriso_set_change_pending(xorriso, 1); return(1); } /* Option -pvd_info */ int Xorriso_option_pvd_info(struct XorrisO *xorriso, int flag) { return(Xorriso_pvd_info(xorriso, 0)); } /* Option -pwd alias -pwdi */ int Xorriso_option_pwdi(struct XorrisO *xorriso, int flag) { sprintf(xorriso->info_text,"current working directory in ISO image:\n"); Xorriso_info(xorriso,0); Xorriso_esc_filepath(xorriso, xorriso->wdi, xorriso->result_line, 0); if(xorriso->sh_style_result == 0 || xorriso->wdi[0] == 0) strcat(xorriso->result_line, "/"); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso,0); return(1); } /* Option -pwdx */ int Xorriso_option_pwdx(struct XorrisO *xorriso, int flag) { sprintf(xorriso->info_text,"current working directory on hard disk:\n"); Xorriso_info(xorriso,0); Xorriso_esc_filepath(xorriso, xorriso->wdx, xorriso->result_line, 0); if(xorriso->sh_style_result == 0 || xorriso->wdx[0] == 0) strcat(xorriso->result_line, "/"); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso,0); return(1); } /* Command -read_fs */ int Xorriso_option_read_fs(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "any") == 0) { xorriso->read_fs= 0; } else if(strcmp(mode, "norock") == 0) { xorriso->read_fs= 1; } else if(strcmp(mode, "nojoliet") == 0) { xorriso->read_fs= 2; } else if(strcmp(mode, "ecma119") == 0) { xorriso->read_fs= 3; } else { sprintf(xorriso->info_text, "-read_fs: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } int Xorriso_option_read_mkisofsrc(struct XorrisO *xorriso, int flag) { int ret; ret= Xorriso_read_mkisofsrc(xorriso, 0); return(ret); } /* Option -reassure "on"|"tree"|"off" */ int Xorriso_option_reassure(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off")==0) xorriso->do_reassure= 0; else if(strcmp(mode, "on")==0) xorriso->do_reassure= 1; else if(strcmp(mode, "tree")==0) xorriso->do_reassure= 2; else { sprintf(xorriso->info_text, "-reassure: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } return(1); } /* Option -report_about */ int Xorriso_option_report_about(struct XorrisO *xorriso, char *in_severity, int flag) { int ret, sev; char severity[20], *official; Xorriso__to_upper(in_severity, severity, (int) sizeof(severity), 0); ret= Xorriso__text_to_sev(severity, &sev, 0); if(ret<=0) { sprintf(xorriso->info_text, "-report_about: Not a known severity name : "); Text_shellsafe(in_severity, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); return(ret); } ret= Xorriso__sev_to_text(sev, &official, 0); if(ret <= 0) official= severity; if(Sfile_str(xorriso->report_about_text, official, 0) <= 0) return(-1); xorriso->report_about_severity= sev; return(1); } /* Command -report_el_torito */ int Xorriso_option_report_el_torito(struct XorrisO *xorriso, char *form, int flag) { int ret; ret= Xorriso_report_system_area(xorriso, form, 1); return(ret); } /* Command -report_system_area */ int Xorriso_option_report_system_area(struct XorrisO *xorriso, char *form, int flag) { int ret; ret= Xorriso_report_system_area(xorriso, form, 0); return(ret); } /* Option -return_with */ int Xorriso_option_return_with(struct XorrisO *xorriso, char *in_severity, int exit_value, int flag) { int ret, sev; char severity[20], *official; Xorriso__to_upper(in_severity, severity, (int) sizeof(severity), 0); ret= Xorriso__text_to_sev(severity, &sev, 0); if(ret<=0) { sprintf(xorriso->info_text, "-return_with: Not a known severity name : "); Text_shellsafe(in_severity, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(ret); } ret= Xorriso__sev_to_text(sev, &official, 0); if(ret <= 0) official= severity; if(exit_value && (exit_value < 32 || exit_value > 63)) { sprintf(xorriso->info_text, "-return_with: Not an allowed exit_value. Use 0, or 32 to 63."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(Sfile_str(xorriso->return_with_text, official, 0) <= 0) return(-1); xorriso->return_with_severity= sev; xorriso->return_with_value= exit_value; return(1); } /* Options -rm alias -rmi , -rm_r alias -rm_ri , -rmdir alias -rmdiri */ /* @param flag bit0=recursive , bit1= remove empty directory: rmdir */ int Xorriso_option_rmi(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag) { int i, ret, end_idx, was_failure= 0, fret; char *path= NULL, *eff_path= NULL; int optc= 0; char **optv= NULL; ret= Xorriso_opt_args(xorriso, "-rm*i", argc, argv, *idx, &end_idx, &optc, &optv, 0); if(ret<=0) goto ex; Xorriso_alloc_meM(path, char, SfileadrL); Xorriso_alloc_meM(eff_path, char, SfileadrL); for(i= 0; iwdi, path, 0); if(ret<=0) goto problem_handler; } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 1); if(ret<0) goto problem_handler; if(ret==0) { sprintf(xorriso->info_text, "Cannot find path "); Text_shellsafe(path, xorriso->info_text, 1); strcat(xorriso->info_text, " in loaded ISO image for removal"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); goto problem_handler; } strcpy(path, eff_path); ret= Xorriso_rmi(xorriso, NULL, (off_t) 0, path, flag&(1|2)); if(ret<=0 || xorriso->request_to_abort) goto problem_handler; if(ret<3) { sprintf(xorriso->info_text, "Removed from ISO image: %s '%s'\n", ((flag&2) ? "directory" : (ret>1 ? "subtree" : "file")), path); Xorriso_info(xorriso, 0); } continue; /* regular bottom of loop */ problem_handler:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; goto ex; } ret= 1; ex:; (*idx)= end_idx; Xorriso_free_meM(path); Xorriso_free_meM(eff_path); Xorriso_opt_args(xorriso, "-rm*i", argc, argv, *idx, &end_idx, &optc, &optv, 256); if(ret<=0) return(ret); return(!was_failure); } /* Option -rockridge "on"|"off" */ int Xorriso_option_rockridge(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off")==0) xorriso->do_rockridge= 0; else if(strcmp(mode, "on")==0) xorriso->do_rockridge= 1; else { sprintf(xorriso->info_text, "-rockridge: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -rollback */ /* @param flag bit0= do not -reassure @return <=0 error , 1 success, 2 revoked by -reassure */ int Xorriso_option_rollback(struct XorrisO *xorriso, int flag) { int ret; char *indev= NULL, *which_will; Xorriso_alloc_meM(indev, char, SfileadrL); if(Xorriso_change_is_pending(xorriso, 0)) which_will= "revoke the pending image changes"; else which_will= "reload the image"; if(!(flag&1)) { ret= Xorriso_reassure(xorriso, "-rollback", which_will, 0); if(ret<=0) {ret= 2; goto ex;} } if(Sfile_str(indev, xorriso->indev, 0)<=0) {ret= -1; goto ex;} xorriso->volset_change_pending= 0; ret= Xorriso_give_up_drive(xorriso, 1|8); if(ret<=0) goto ex; xorriso->image_start_mode&= ~(1u<<31); /* reactivate eventual -load address */ ret= Xorriso_option_dev(xorriso, indev, 1|4); ex:; Xorriso_free_meM(indev); return(ret); } /* Option -rom_toc_scan */ int Xorriso_option_rom_toc_scan(struct XorrisO *xorriso, char *mode, int flag) { int l; char *cpt, *npt; npt= cpt= mode; for(cpt= mode; npt != NULL; cpt= npt + 1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0) continue; if(strncmp(cpt, "off", l) == 0) xorriso->toc_emulation_flag&= ~5; else if(strncmp(cpt, "on", l) == 0) xorriso->toc_emulation_flag= (xorriso->toc_emulation_flag & ~4) | 1; else if(strncmp(cpt, "force", l) == 0) xorriso->toc_emulation_flag|= 5; else if(strncmp(cpt, "emul_off", l) == 0) xorriso->toc_emulation_flag|= 2; else if(strncmp(cpt, "emul_on", l) == 0) xorriso->toc_emulation_flag&= ~2; else if(strncmp(cpt, "emul_wide", l) == 0) xorriso->toc_emulation_flag|= 8; else if(strncmp(cpt, "emul_narrow", l) == 0) xorriso->toc_emulation_flag&= ~8; else { sprintf(xorriso->info_text, "-rom_toc_scan: unknown mode in '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } } return(1); } /* Command -rr_reloc_dir */ int Xorriso_option_rr_reloc_dir(struct XorrisO *xorriso, char *name, int flag) { if(strlen(name) > 255) { sprintf(xorriso->info_text, "Name too long with -rr_reloc_dir. Max. 255 bytes allowed."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(strchr(name, '/') != NULL) { sprintf(xorriso->info_text, "Name given with -rr_reloc_dir contains '/' character"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } strcpy(xorriso->rr_reloc_dir, name); return(1); } /* Option -scdbackup_tag list_path record_name */ int Xorriso_option_scdbackup_tag(struct XorrisO *xorriso, char *listname, char *recname, int flag) { if(strlen(recname) > 80) { sprintf(xorriso->info_text, "Unsuitable record name given with -scdbackup_tag"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } strcpy(xorriso->scdbackup_tag_name, recname); xorriso->scdbackup_tag_time[0]= 0; if(Sfile_str(xorriso->scdbackup_tag_listname, listname, 0) <= 0) return(-1); return(1); } /* Command -scsi_dev_family */ int Xorriso_option_scsi_dev_family(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "default") == 0) xorriso->linux_scsi_dev_family= 0; else if(strcmp(mode, "sr") == 0) xorriso->linux_scsi_dev_family= 1; else if(strcmp(mode, "scd") == 0) xorriso->linux_scsi_dev_family= 2; else if(strcmp(mode, "sg") == 0) xorriso->linux_scsi_dev_family= 4; else { sprintf(xorriso->info_text, "-scsi_dev_family: unknown family '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } Xorriso_scsi_dev_family(xorriso, 0); return(1); } /* Option -scsi_log */ int Xorriso_option_scsi_log(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "on") == 0) xorriso->scsi_log= 1; else if(strcmp(mode, "off") == 0) xorriso->scsi_log= 0; else { sprintf(xorriso->info_text, "-scsi_log: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } Xorriso_scsi_log(xorriso, !!xorriso->scsi_log); return(1); } /* Option -session_log */ int Xorriso_option_session_log(struct XorrisO *xorriso, char *path, int flag) { if(Sfile_str(xorriso->session_logfile, path, 0)<=0) return(-1); return(1); } /* Option -setfacl_list alias -setfacl_listi */ int Xorriso_option_setfacl_listi(struct XorrisO *xorriso, char *path, int flag) { int ret, eaten, line_size; size_t buf_size= 0, buf_add, l, linecount= 0, diff_buf_wpt; char *line= NULL, *buf= NULL, *wpt, *new_buf, limit_text[80]; char *file_path= NULL, *uid= NULL, *gid= NULL; FILE *fp= NULL; line_size= SfileadrL * 4; buf_add= line_size * 4; Xorriso_alloc_meM(line, char, line_size); Xorriso_alloc_meM(file_path, char, SfileadrL); Xorriso_alloc_meM(uid, char, 161); Xorriso_alloc_meM(gid, char, 161); Xorriso_pacifier_reset(xorriso, 0); if(path[0]==0) { sprintf(xorriso->info_text, "Empty file name given with -setfacl_list"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } ret= Xorriso_afile_fopen(xorriso, path, "rb", &fp, 0); if(ret <= 0) {ret= 0; goto ex;} buf_size= buf_add; buf= calloc(buf_size, 1); if(buf == NULL) goto out_of_mem; wpt= buf; *wpt= 0; uid[0]= gid[0]= 0; while(1) { if(Sfile_fgets_n(line, line_size, fp, 0) == NULL) break; linecount++; if(strncmp(line, "# file: ", 8) ==0) { if(wpt != buf && file_path[0]) { /* Commit previous list */ ret= Xorriso_perform_acl_from_list(xorriso, file_path, uid, gid, buf, 0); if(ret<=0) goto ex; wpt= buf; *wpt= 0; file_path[0]= uid[0]= gid[0]= 0; } /* Unescape line and register as file path */ Sfile_bsl_interpreter(line + 8, strlen(line + 8), &eaten, 0); if(strlen(line + 8) >= SfileadrL) { sprintf(xorriso->info_text, "-setfacl_list: Oversized file path"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } strcpy(file_path, line + 8); continue; } else if(strncmp(line, "# owner: ", 9) == 0) { if(strlen(line + 9) > 160) { sprintf(xorriso->info_text, "-setfacl_list: Oversized owner id"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } strcpy(uid, line + 9); continue; } else if(strncmp(line, "# group: ", 9) == 0) { if(strlen(line + 9) > 160) { sprintf(xorriso->info_text, "-setfacl_list: Oversized group id"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } strcpy(gid, line + 9); continue; } else if(line[0] == '#' || line[0] == 0) { continue; } else if(strcmp(line, "@") == 0) { Xorriso_msgs_submit(xorriso, 0, "-setfacl_list input ended by '@'", 0, "NOTE", 0); break; } else if(strcmp(line, "@@@") == 0) { Xorriso_msgs_submit(xorriso, 0, "-setfacl_list aborted by input line '@@@'", 0, "WARNING", 0); ret= 0; goto ex; } /* Register ACL entry */ l= strlen(line); if(wpt + l + 2 - buf > (int) buf_size) { if((int) (buf_size + buf_add) > xorriso->temp_mem_limit) { Sfile_scale((double) xorriso->temp_mem_limit, limit_text,5,1e4,1); sprintf(xorriso->info_text, "-setfacl_list: List entry for a single file exceeds -temp_mem_limit %s", limit_text); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } diff_buf_wpt= wpt - buf; buf_size+= buf_add; new_buf= realloc(buf, buf_size); if(new_buf == NULL) goto out_of_mem; buf= new_buf; wpt= buf + diff_buf_wpt; } memcpy(wpt, line, l); *(wpt + l)= '\n'; wpt+= l + 1; *wpt= 0; } if(wpt != buf && file_path[0]) { /* Commit last list */ ret= Xorriso_perform_acl_from_list(xorriso, file_path, uid, gid, buf, 0); if(ret<=0) goto ex; } else { sprintf(xorriso->info_text, "-setfacl_list: Unexpected end of file "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } ret= 1; ex:; if(buf != NULL) free(buf); if(fp != NULL && fp != stdin) fclose(fp); if(ret <= 0) { sprintf(xorriso->info_text, "-setfacl_list "); Text_shellsafe(path, xorriso->info_text, 1); sprintf(xorriso->info_text + strlen(xorriso->info_text), " aborted in line %.f\n", (double) linecount); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } Xorriso_free_meM(line); Xorriso_free_meM(file_path); Xorriso_free_meM(uid); Xorriso_free_meM(gid); return(ret); out_of_mem:; Xorriso_no_malloc_memory(xorriso, &buf, 0); ret= -1; goto ex; } /* Options -setfacl alias -setfacli, -setfacl_r alias -setfacl_ri */ /* @param flag bit0=recursive -setfacl_r */ int Xorriso_option_setfacli(struct XorrisO *xorriso, char *acl_text, int argc, char **argv, int *idx, int flag) { int i, ret, was_failure= 0, end_idx, fret; int optc= 0; char **optv= NULL, *access_acl_text= NULL, *default_acl_text= NULL; struct FindjoB *job= NULL; struct stat dir_stbuf; ret= Xorriso_opt_args(xorriso, "-setfacl", argc, argv, *idx, &end_idx, &optc, &optv, 0); if(ret <= 0) goto ex; ret= Xorriso_normalize_acl_text(xorriso, acl_text, &access_acl_text, &default_acl_text, 0); if(access_acl_text != NULL && default_acl_text != NULL) { strcpy(xorriso->info_text, "Access-ACL :\n"); Xorriso_set_info_text(xorriso, access_acl_text, 2000, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); strcpy(xorriso->info_text, "Default-ACL :\n"); Xorriso_set_info_text(xorriso, default_acl_text, 2000, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); } else if(access_acl_text == NULL && default_acl_text == NULL) { sprintf(xorriso->info_text, "Will delete Access-ACL and Default-ACL"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); } if(ret <= 0) goto ex; for(i= 0; i0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; ret= 0; goto ex; } ret= 1; ex:; (*idx)= end_idx; Xorriso_opt_args(xorriso, "-setfacl", argc, argv, *idx, &end_idx, &optc, &optv, 256); Findjob_destroy(&job, 0); if(access_acl_text != NULL) free(access_acl_text); if(default_acl_text != NULL) free(default_acl_text); if(ret<=0) return(ret); return(!was_failure); } /* Options -setfattr alias -setfattri, -setfattr_r alias -setfattr_ri */ /* @param flag bit0=recursive -setfattr_r */ int Xorriso_option_setfattri(struct XorrisO *xorriso, char *name, char *value, int argc, char **argv, int *idx, int flag) { int i, ret, was_failure= 0, end_idx, fret; int optc= 0; char **optv= NULL; struct FindjoB *job= NULL; struct stat dir_stbuf; ret= Xorriso_opt_args(xorriso, "-setfattr", argc, argv, *idx, &end_idx, &optc, &optv, 0); if(ret <= 0) goto ex; /* check input */ ret= Xorriso_path_setfattr(xorriso, NULL, "", name, strlen(value), value, 1); if(ret <= 0) goto ex; for(i= 0; i0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; ret= 0; goto ex; } ret= 1; ex:; (*idx)= end_idx; Xorriso_opt_args(xorriso, "-setfattr", argc, argv, *idx, &end_idx, &optc, &optv, 256); Findjob_destroy(&job, 0); if(ret<=0) return(ret); return(!was_failure); } /* Option -setfattr_list alias -setfattr_listi */ int Xorriso_option_setfattr_listi(struct XorrisO *xorriso, char *path, int flag) { int ret, eaten, line_size= SfileadrL * 4; size_t linecount= 0, mem_used= 0, num_attr= 0, v_len; char *line= NULL, limit_text[80], *ept, *valuept; char *file_path= NULL; FILE *fp= NULL; struct Xorriso_lsT *lst_curr= NULL, *lst_start= NULL; Xorriso_alloc_meM(line, char, line_size); Xorriso_alloc_meM(file_path, char, SfileadrL); Xorriso_pacifier_reset(xorriso, 0); if(path[0]==0) { sprintf(xorriso->info_text, "Empty file name given with -setfattr_list"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } ret= Xorriso_afile_fopen(xorriso, path, "rb", &fp, 0); if(ret <= 0) {ret= 0; goto ex;} while(1) { if(Sfile_fgets_n(line, line_size, fp, 0) == NULL) break; linecount++; if(strncmp(line, "# file: ", 8) ==0) { if(num_attr > 0 && file_path[0]) { /* Commit previous list */ ret= Xorriso_perform_attr_from_list(xorriso, file_path, lst_start, 0); if(ret<=0) goto ex; num_attr= 0; file_path[0]= 0; Xorriso_lst_destroy_all(&lst_start, 0); lst_curr= NULL; } /* Unescape line and register as file path */ Sfile_bsl_interpreter(line + 8, strlen(line + 8), &eaten, 0); if(strlen(line + 8) >= SfileadrL) { sprintf(xorriso->info_text, "-setfattr_list: Oversized file path"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } strcpy(file_path, line + 8); continue; } else if(line[0] == '#' || line[0] == 0) { continue; } else if(strcmp(line, "@") == 0) { Xorriso_msgs_submit(xorriso, 0, "-setfattr_list input ended by '@'", 0, "NOTE", 0); break; } else if(strcmp(line, "@@@") == 0) { Xorriso_msgs_submit(xorriso, 0, "-setfattr_list aborted by input line '@@@'", 0, "WARNING", 0); ret= 1; goto ex; } mem_used+= strlen(line) + 1; if(mem_used > (size_t) xorriso->temp_mem_limit) { Sfile_scale((double) xorriso->temp_mem_limit, limit_text,5,1e4,1); sprintf(xorriso->info_text, "-setfattr_list: List entry for a single file exceeds -temp_mem_limit %s", limit_text); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } /* Register attr pair */ ept= strchr(line, '='); if(ept == NULL) { sprintf(xorriso->info_text, "-setfattr_list: "); Text_shellsafe(path, xorriso->info_text, 1); sprintf(xorriso->info_text + strlen(xorriso->info_text), " : Line %.f : No separator '=' found", (double) linecount); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); continue; } valuept= ept + 1; v_len= strlen(valuept); for(ept= valuept + v_len - 1; ept > valuept; ept--) if(isspace(*ept)) *ept= 0; else break; v_len= strlen(valuept); if(v_len < 2 || *valuept != '"' || *(valuept + v_len -1) != '"') { sprintf(xorriso->info_text, "-setfattr_list: "); Text_shellsafe(path, xorriso->info_text, 1); sprintf(xorriso->info_text + strlen(xorriso->info_text), " : Line %.f : Value not enclosed in quotes", (double) linecount); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); continue; } ret= Xorriso_lst_new(&lst_curr, line, lst_curr, 0); if(ret <= 0) goto out_of_mem; if(lst_start == NULL) lst_start= lst_curr; num_attr++; } if(file_path[0]) { /* Commit last list */ ret= Xorriso_perform_attr_from_list(xorriso, file_path, lst_start, 0); if(ret<=0) goto ex; } else { sprintf(xorriso->info_text, "-setfattr_list: Unexpected end of file "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } ret= 1; ex:; if(fp != NULL && fp != stdin) fclose(fp); Xorriso_lst_destroy_all(&lst_start, 0); Xorriso_free_meM(line); Xorriso_free_meM(file_path); if(ret <= 0) { sprintf(xorriso->info_text, "-setfattr_list "); Text_shellsafe(path, xorriso->info_text, 1); sprintf(xorriso->info_text + strlen(xorriso->info_text), " aborted in line %.f\n", (double) linecount); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } return(ret); out_of_mem:; Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } /* Options -set_filter , -set_filter_r , -show_stream , -show_stream_r */ /* @param flag bit0=recursive -set_filter_r bit1= do not reset pacifier, no final pacifier message bit2= -show_stream rather than -set_filter */ int Xorriso_option_set_filter(struct XorrisO *xorriso, char *name, int argc, char **argv, int *idx, int flag) { int i, ret, was_failure= 0, end_idx, fret; int optc= 0; char **optv= NULL; struct FindjoB *job= NULL; struct stat dir_stbuf; char *cmd= "-set_filter"; switch(flag & 5) { case 0: cmd= "-set_filter"; break; case 1: cmd= "-set_filter_r"; break; case 4: cmd= "-show_stream"; break; case 5: cmd= "-show_stream_r"; } ret= Xorriso_opt_args(xorriso, cmd, argc, argv, *idx, &end_idx, &optc, &optv, 0); if(ret <= 0) goto ex; if(!(flag&2)) Xorriso_pacifier_reset(xorriso, 0); for(i= 0; i0 && !xorriso->request_to_abort) continue; /* regular bottom of loop */ was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; ret= 0; goto ex; } if(!(flag&2)) Xorriso_pacifier_callback(xorriso, "file filters processed", xorriso->pacifier_count, 0, "", 1); ret= 1; ex:; (*idx)= end_idx; Xorriso_opt_args(xorriso, cmd, argc, argv, *idx, &end_idx, &optc, &optv, 256); Findjob_destroy(&job, 0); if(ret<=0) return(ret); return(!was_failure); } /* Option -sh_style_result */ int Xorriso_option_sh_style_result(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "off") == 0) { xorriso->sh_style_result= 0; } else if(strcmp(mode, "on") == 0) { xorriso->sh_style_result= 1; } else { sprintf(xorriso->info_text, "-sh_style_result: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -signal_handling */ /* @param flag bit0= prescan mode: do not yet install the eventual handler else: when switching from other modes to "off": activate mode "sig_dfl" */ int Xorriso_option_signal_handling(struct XorrisO *xorriso, char *mode, int flag) { int ret, behavior; if (strcmp(mode, "off") == 0) { behavior= Xorriso__get_signal_behavior(0); if(flag & 1) { behavior= 0; } else if(behavior != 0) { sprintf(xorriso->info_text, "Signal handling mode \"off\" comes too late. Defaulted to \"sig_dfl\"\n"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); behavior= 2; } } else if(strcmp(mode, "libburn") == 0 || strcmp(mode, "on") == 0) { behavior= 1; } else if (strcmp(mode, "sig_dfl") == 0) { behavior= 2; } else if (strcmp(mode, "sig_ign") == 0) { behavior= 3; } else { sprintf(xorriso->info_text, "-signal_handling: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, "Use one of: \"off\",\"on\",\"sig_dfl\",\"sig_ign\"", 0, "HINT", 0); return(0); } Xorriso__preset_signal_behavior(behavior, 0); if(flag & 1) return(1); ret= Xorriso_set_signal_handling(xorriso, 0); return(ret); } /* Option -sleep */ int Xorriso_option_sleep(struct XorrisO *xorriso, char *duration, int flag) { double dur= 0.0, start_time, end_time, todo, granularity= 0.01; unsigned long usleep_time; sscanf(duration, "%lf", &dur); start_time= Sfile_microtime(0); end_time= start_time + dur; Ftimetxt(time(NULL), xorriso->info_text, 6); sprintf(xorriso->info_text + strlen(xorriso->info_text), " : Will sleep for %f seconds", dur); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0); while(1) { todo= end_time - Sfile_microtime(0); if(todo <= 0) usleep_time= 0; else if(todo > granularity) usleep_time= granularity * 1.0e6; else usleep_time= todo * 1.0e6; if(usleep_time == 0) break; usleep(usleep_time); } sprintf(xorriso->info_text, "Slept for %f seconds", Sfile_microtime(0) - start_time); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); return(1); } /* Commands -speed , -read_speed */ /* @param flag bit0= -read_speed rather than -speed */ int Xorriso_option_speed(struct XorrisO *xorriso, char *speed_in, int flag) { int is_cd= 1, unit_found= 0, ret, profile_number, intspeed= 1, for_force= 0; double num= -2.0; char *cpt, profile_name[80], *speed; speed= speed_in; if(strncmp(speed, "soft_corr:", 10) == 0 && (flag & 1)) { sscanf(speed + 10, "%lf", &num); if(num > 1.0e9 || num < 0.0) { sprintf(xorriso->info_text, "-read_speed soft_corr: Value too small or too large (0 to 1e9): '%s'", speed + 10); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } xorriso->read_speed_corr= num; return(1); } if(strncmp(speed, "soft_force:", 11) == 0 && (flag & 1)) { for_force= 1; speed+= 11; } if(speed[0] == 0 || strcmp(speed, "any") == 0 || strcmp(speed, "max") == 0) { intspeed= 0; } else if(strcmp(speed, "min") == 0) { intspeed= -1; } else if(strcmp(speed, "none") == 0) { intspeed= -2; } else { sscanf(speed,"%lf",&num); if(num <= 0) intspeed= num; } if(intspeed <= 0) goto set_speed_and_exit; for(cpt= speed+strlen(speed)-1; cpt>=speed; cpt--) if(isdigit(*cpt) || *cpt=='.') break; cpt++; if(*cpt=='k' || *cpt=='K') { /* is merchand kilobyte, stays merchand kilobyte */ unit_found= 1; } else if(*cpt=='m' || *cpt=='M') { num*= 1000; unit_found= 1; } else if(*cpt=='x' || *cpt=='X') cpt++; if (unit_found) { ; } else if(*cpt=='c' || *cpt=='C') { cd_speed:; num*= 176.4; } else if(*cpt=='d' || *cpt=='D') { dvd_speed:; num*= 1385; } else if(*cpt=='b' || *cpt=='B') { bd_speed:; num*= 4495.625; } else { ret= Xorriso_get_profile(xorriso, &profile_number, profile_name, 2 * !(flag & 1)); is_cd= (ret==2); if(is_cd) goto cd_speed; else if (ret == 3) goto bd_speed; else goto dvd_speed; } if(num> 2.0e9) { sprintf(xorriso->info_text, "%s: Value too large or not recognizable: '%s'", flag & 1 ? "-read_speed" : "-speed", speed); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } intspeed= num; if(intspeed < num) intspeed++; set_speed_and_exit:; if(flag & 1) { if(for_force) xorriso->read_speed_force= intspeed; else xorriso->read_speed= intspeed; } else { xorriso->write_speed= intspeed; } return(1); } /* Option -split_size */ int Xorriso_option_split_size(struct XorrisO *xorriso, char *size, int flag) { double num; num= Scanf_io_size(size, 0); if(num > xorriso->file_size_limit && xorriso->file_size_limit > 0) { sprintf(xorriso->info_text, "-split_size: too large %.f (allowed: %.f)", num, (double) xorriso->file_size_limit); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } else if(num < 0) num= 0.0; xorriso->split_size= num; return(1); } /* Option -status */ int Xorriso_option_status(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode,"short")==0) Xorriso_status(xorriso,NULL,NULL,1); else if(strcmp(mode,"long")==0) Xorriso_status(xorriso,NULL,NULL,0); else if(strcmp(mode,"long_history")==0) Xorriso_status(xorriso,NULL,NULL,8); else if(mode[0]=='-') Xorriso_status(xorriso,mode,NULL,8); else Xorriso_status(xorriso,NULL,NULL,1); return(1); } /* Option -status_history_max */ int Xorriso_option_status_history_max(struct XorrisO *xorriso, int num, int flag) { if(num>=0 && num<1000000) xorriso->status_history_max= num; return(1); } /* Option -stdio_sync "on"|"off"|"end"|size */ int Xorriso_option_stdio_sync(struct XorrisO *xorriso, char *rhythm, int flag) { double num; if(strcmp(rhythm, "default") == 0 || strcmp(rhythm, "on") == 0) { num= 0; } else if(strcmp(rhythm, "off") == 0) { num= -1; } else if(strcmp(rhythm, "end") == 0) { num= 1; } else { num = Scanf_io_size(rhythm, 0) / 2048; if(num < 32 || num > 512 * 1024) { sprintf(xorriso->info_text, "-stdio_sync : Bad size. Use: 64k to 1g, \"on\", \"off\", \"end\""); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } } xorriso->stdio_sync= num; xorriso->stdio_sync_is_default= 0; return(1); } /* Option -stream_recording */ int Xorriso_option_stream_recording(struct XorrisO *xorriso, char *mode, int flag) { double num; if(strcmp(mode,"on")==0 || mode[0]==0) xorriso->do_stream_recording= 32; else if(strcmp(mode,"full")==0) xorriso->do_stream_recording= 1; else if(strcmp(mode,"data")==0) xorriso->do_stream_recording= 2; else if(mode[0] >= '0' && mode[0] <= '9') { num= Scanf_io_size(mode, 0); num/= 2048.0; if(num >= 16 && num <= 0x7FFFFFFF) xorriso->do_stream_recording= num; else xorriso->do_stream_recording= 0; } else xorriso->do_stream_recording= 0; return(1); } /* Option -system_id */ int Xorriso_option_system_id(struct XorrisO *xorriso, char *name, int flag) { if(Xorriso_check_name_len(xorriso, name, (int) sizeof(xorriso->system_id), "-system_id", 0) <= 0) return(0); strcpy(xorriso->system_id, name); Xorriso_set_change_pending(xorriso, 1); return(1); } /* Option -tell_media_space */ int Xorriso_option_tell_media_space(struct XorrisO *xorriso, int flag) { int ret, free_space= 0, media_space= 0; ret= Xorriso_tell_media_space(xorriso, &media_space, &free_space, 0); if(ret<=0) { sprintf(xorriso->info_text, "Cannot -tell_media_space"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } if(free_space<0) { sprintf(xorriso->info_text, "Pending image size larger than free space on medium"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } sprintf(xorriso->result_line, "Media space : %ds\n", media_space); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "After commit : %ds\n", free_space); Xorriso_result(xorriso, 0); return(1); } /* Option -temp_mem_limit */ int Xorriso_option_temp_mem_limit(struct XorrisO *xorriso, char *size, int flag) { double num; num= Scanf_io_size(size, 0); if(num < 64.0 * 1024.0 || num > 1024.0 * 1024.0 * 1024.0) { sprintf(xorriso->info_text, "-temp_mem_limit: wrong size %.f (allowed: %.f - %.f)", num, 64.0 * 1024.0, 1024.0 * 1024.0 * 1024.0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } xorriso->temp_mem_limit= num; return(1); } /* Option -toc */ /* @param flag bit0= short report form as with -dev, no table-of-content */ int Xorriso_option_toc(struct XorrisO *xorriso, int flag) { int ret, in_ret= 1000; if(strcmp(xorriso->indev,xorriso->outdev)==0) ret= Xorriso_toc(xorriso, 0); else { if(xorriso->indev[0]!=0) in_ret= Xorriso_toc(xorriso, 0); if(xorriso->indev[0]!=0 && xorriso->outdev[0]!=0) { strcpy(xorriso->result_line, "-------------: ---------------------------------------------------------------\n"); Xorriso_result(xorriso,0); } ret= 1; if(xorriso->outdev[0]!=0) ret= Xorriso_toc(xorriso, 2 | (flag & 1)); if(in_retindev[0] == 0) { Xorriso_msgs_submit(xorriso, 0, "-toc_of 'in' : No input drive acquired", 0, "NOTE", 0); return(2); } ret= Xorriso_toc(xorriso, toc_flag | 0); } else if(strncmp(which, "out", 3) == 0) { if(xorriso->outdev[0] == 0) { Xorriso_msgs_submit(xorriso, 0, "-toc_of 'out' : No output drive acquired", 0, "NOTE", 0); return(2); } ret= Xorriso_toc(xorriso, toc_flag | 2); } else if(strncmp(which, "all", 3) == 0) { if(xorriso->indev[0] == 0 && xorriso->outdev[0] == 0) { Xorriso_msgs_submit(xorriso, 0, "-toc_of 'all' : No drive acquired", 0, "NOTE", 0); return(2); } ret= Xorriso_option_toc(xorriso, toc_flag | 0); } else { sprintf(xorriso->info_text, "-toc_of: Unknown drive code "); Text_shellsafe(which, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= 0; } return(ret); } /* Command -truncate_overwritable */ int Xorriso_option_truncate_overwritable(struct XorrisO *xorriso, char *adr_mode, char *adr_value, char *adjust, int flag) { int ret; ret= Xorriso_truncate_overwritable(xorriso, adr_mode, adr_value, adjust, 0); return(ret); } /* Option -uid */ int Xorriso_option_uid(struct XorrisO *xorriso, char *uid, int flag) { int ret; xorriso->do_global_uid= 0; if(uid[0]==0 || strcmp(uid,"-")==0) return(1); ret= Xorriso_convert_uidstring(xorriso, uid, &(xorriso->global_uid), 0); if(ret>0) xorriso->do_global_uid= 1; return(ret); } /* Option -unregister_filter */ int Xorriso_option_unregister_filter(struct XorrisO *xorriso, char *name, int flag) { int ret; ret= Xorriso_external_filter(xorriso, name, "", "", 0, NULL, 1); return(ret); } /* Options -update and -update_r @param flag bit0= issue start and summary message bit1= do not reset pacifier, no final pacifier message bit2= do not issue pacifier messages at all bit3= recursive: -update_r bit4= do not establish and dispose xorriso->di_array bit5= do not delete files which are not found under disk_path, but rather mark visited files and mark files which were found. */ int Xorriso_option_update(struct XorrisO *xorriso, char *disk_path, char *iso_path, int flag) { int ret, mem_pci, zero= 0, result, uret, follow_links, do_register= 0; int not_in_iso= 0, not_on_disk= 0; double mem_lut= 0.0, start_time; char *ipth, *argv[6]; char *eff_origin= NULL, *eff_dest= NULL; struct stat stbuf; Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); start_time= Sfile_microtime(0); ipth= iso_path; if(ipth[0]==0) ipth= disk_path; if(disk_path[0]==0) { sprintf(xorriso->info_text, "-update: Empty disk_path given"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 1); {ret= 0; goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, disk_path, eff_origin, 2|4|8); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, ipth, eff_dest, 2|8); if(ret<=0) goto ex; if(!(flag&2)) { Xorriso_pacifier_reset(xorriso, 0); mem_lut= xorriso->last_update_time; } mem_pci= xorriso->pacifier_interval; xorriso->pacifier_interval= 5.0; if(flag&1) { sprintf(xorriso->info_text, "Updating "); Text_shellsafe(eff_origin, xorriso->info_text, 1); strcat(xorriso->info_text, " to "); Text_shellsafe(eff_dest, xorriso->info_text, 1 | 2); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso,0); } if(xorriso->disk_excl_mode&8) ret= Xorriso_path_is_excluded(xorriso, eff_origin, 1); else ret= 0; if(ret!=0) goto report_outcome; if(!(xorriso->ino_behavior & 2)) { if(!(xorriso->di_array != NULL || (flag & 16))) { /* Create all-image node array sorted by isofs.di */ ret= Xorriso_make_di_array(xorriso, 0); if(ret <= 0) goto ex; } if(xorriso->di_array != NULL) { do_register= 1; if(!(flag & 8)) { /* If directory with -update : do not register di_*_paths */ ret= lstat(eff_origin, &stbuf); if(ret != -1) if(S_ISDIR(stbuf.st_mode)) do_register= 0; } } } if(flag&8) { xorriso->find_compare_result= 1; ret= Xorriso_iso_lstat(xorriso, eff_dest, &stbuf, 0); if(ret >= 0) { argv[0]= eff_dest; argv[1]= "-exec"; if(flag & 32) argv[2]= "update_merge"; else argv[2]= "update"; argv[3]= eff_origin; zero= 0; ret= Xorriso_option_find(xorriso, 4, argv, &zero, 2 | (8 * !((xorriso->do_aaip & 96) == 96))); /* -findi */ } else if(ret==-2) { /* severe error (e.g. lack of image) */ ret= -1; goto report_outcome; } else { not_in_iso= 1; ret= 1; } if(ret>0) { ret= lstat(eff_origin, &stbuf); if(ret != -1) { argv[0]= eff_origin; argv[1]= "-exec"; argv[2]= "add_missing"; argv[3]= eff_dest; zero= 0; ret= Xorriso_option_find(xorriso, 4, argv, &zero, 1|2); /* -findx */ if(ret>0 && (!xorriso->do_follow_mount) && !(flag & 32)) { /* >>> ??? what about mount points with (flag & 32) ? empty_iso_dir shall delete those which already existed and are freshly excluded. (E.g. by mounting at a non-empty directory, or by new follow rules.) This deletion does not match the idea of merging. For determining the foreign files in a directory which is target of a mount point, one would have to enter that mount point directory. Somewhat contrary to do-not-follow. */ argv[0]= eff_origin; argv[1]= "-type"; argv[2]= "m"; argv[3]= "-exec"; argv[4]= "empty_iso_dir"; argv[5]= eff_dest; zero= 0; ret= Xorriso_option_find(xorriso, 6, argv, &zero, 1|2); /* -findx */ } if(ret>0) ret= xorriso->find_compare_result; else ret= -1; } else { ret= xorriso->find_compare_result; not_on_disk= 1; } } else ret= -1; if(not_on_disk && not_in_iso) { sprintf(xorriso->info_text, "Missing on disk and in ISO: disk_path "); Text_shellsafe(disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 1); ret= -1; } } else { if(flag & 32) xorriso->update_flags|= 1; /* Enter update_merge mode for node adding */ /* compare ctime too, no filename reporting, eventually silent */ follow_links= (xorriso->do_follow_links || xorriso->do_follow_param) <<28; ret= Xorriso_compare_2_files(xorriso, eff_origin, eff_dest, "", &result, 2 | follow_links | ((flag&4)<<27) | (3<<30)); if(ret == 0 || (ret > 0 && (flag & 32))) { if(ret > 0) result= 0; uret= Xorriso_update_interpreter(xorriso, NULL, NULL, result, eff_origin, eff_dest, (!!(flag & 32)) << 1); if(uret<=0) ret= -1; if(uret==3) ret= -1; } } xorriso->pacifier_interval= mem_pci; if(mem_lut!=xorriso->last_update_time && !(flag & (2 | 4))) Xorriso_pacifier_callback(xorriso, "content bytes read", xorriso->pacifier_count, 0, "", 1 | 8 | 32); report_outcome:; if(ret>0) { sprintf(xorriso->info_text, "No file object needed update."); do_register= 0; } else if(ret==0) { sprintf(xorriso->info_text, "Differences detected and updated."); } else { sprintf(xorriso->info_text, "Not ok. Comparison or update failed due to error."); do_register= 0; } if(do_register) { ret= Xorriso_iso_lstat(xorriso, eff_dest, &stbuf, 0); if(ret < 0) do_register= 0; } if(do_register) { ret= Xorriso_lst_new(&(xorriso->di_disk_paths), eff_origin, xorriso->di_disk_paths, 1); if(ret <= 0) goto ex; ret= Xorriso_lst_new(&(xorriso->di_iso_paths), eff_dest, xorriso->di_iso_paths, 1); if(ret <= 0) goto ex; } sprintf(xorriso->info_text+strlen(xorriso->info_text), " (runtime %.1f s)\n", Sfile_microtime(0)-start_time); if(flag&1) Xorriso_info(xorriso,0); ex:; Xorriso_free_meM(eff_origin); Xorriso_free_meM(eff_dest); if(ret < 0) return(ret); return(1); } /* Command -use_immed_bit */ int Xorriso_option_use_immed_bit(struct XorrisO *xorriso, char *mode, int flag) { int ret; if(strncmp(mode, "default", 7) == 0 || mode[0] == 0) { xorriso->use_immed_bit= 0; } else if(strcmp(mode, "on")==0) { xorriso->use_immed_bit= 1; } else if(strcmp(mode, "off")==0) { xorriso->use_immed_bit= -1; } else { sprintf(xorriso->info_text, "-use_immed_bit: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_use_immed_bit(xorriso, 0); return(ret); } /* Option -use_readline */ int Xorriso_option_use_readline(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode,"off")==0) xorriso->use_stdin= 1; else xorriso->use_stdin= 0; return(1); } /* Option -version */ int Xorriso_option_version(struct XorrisO *xorriso, int flag) { const char *license_text; sprintf(xorriso->result_line, "%sxorriso %d.%d.%d%s\n", #ifdef Xorriso_GNU_xorrisO "GNU ", #else "", #endif /* ! Xorriso_GNU_xorrisO */ Xorriso_header_version_majoR, Xorriso_header_version_minoR, Xorriso_header_version_micrO, Xorriso_program_patch_leveL); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "ISO 9660 Rock Ridge filesystem manipulator and CD/DVD/BD burn program\n"); sprintf(xorriso->result_line+strlen(xorriso->result_line), "Copyright (C) 2019, Thomas Schmitt , libburnia project.\n"); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "xorriso version : %d.%d.%d%s\n", Xorriso_header_version_majoR, Xorriso_header_version_minoR, Xorriso_header_version_micrO, Xorriso_program_patch_leveL); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "Version timestamp : %s\n",Xorriso_timestamP); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "Build timestamp : %s\n",Xorriso_build_timestamP); Xorriso_result(xorriso, 0); Xorriso_report_lib_versions(xorriso, 0); #ifdef Xorriso_GNU_xorrisO license_text= "License GPLv3+: GNU GPL version 3 or later ."; sprintf(xorriso->result_line, "%s\n", license_text); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "This is free software: you are free to change and redistribute it.\n"); Xorriso_result(xorriso, 0); #else license_text= "Provided under GNU GPL version 2 or later."; #ifdef Xorriso_with_readlinE { const char *readline_license; readline_license= Xorriso__readline_license(0); if(strcmp(readline_license, "GPLv3+") == 0) license_text= "Provided under GNU GPL version 3 or later, due to libreadline license."; } #endif /* Xorriso_with_readlinE */ sprintf(xorriso->result_line, "%s\n", license_text); Xorriso_result(xorriso, 0); #endif /* ! Xorriso_GNU_xorrisO */ sprintf(xorriso->result_line, "There is NO WARRANTY, to the extent permitted by law.\n"); Xorriso_result(xorriso, 0); return(1); } /* Option -volid */ /* @param flag bit0= do not warn of problematic volid */ int Xorriso_option_volid(struct XorrisO *xorriso, char *volid, int flag) { int warn_shell= 0, warn_ecma= 0, i, ret; static char shell_chars[]= { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-+=:.,~@"}; static char ecma_chars[]= {"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"}; for(i=0; volid[i]!=0; i++) { if(strchr(shell_chars, volid[i])==NULL) warn_shell= 1; if(strchr(ecma_chars, volid[i])==NULL) warn_ecma= 1; } if(i>32) { sprintf(xorriso->info_text, "-volid: Text too long (%d > 32)", i); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(warn_shell && !(flag & 1)) { sprintf(xorriso->info_text, "-volid text problematic as automatic mount point name"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } if(xorriso->do_joliet && strlen(volid)>16 && !(flag & 1)) { sprintf(xorriso->info_text, "-volid text is too long for Joliet (%d > 16)",(int) strlen(volid)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } if(warn_ecma && !(flag & 1)) { sprintf(xorriso->info_text, "-volid text does not comply to ISO 9660 / ECMA 119 rules"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } strcpy(xorriso->volid, volid); ret= Xorriso_set_volid(xorriso, volid, 0); if(ret<=0) return(ret); xorriso->volid_default= (strcmp(xorriso->volid, "ISOIMAGE")==0 || xorriso->volid[0]==0); return(1); } /* Option -volset_id */ int Xorriso_option_volset_id(struct XorrisO *xorriso, char *name, int flag) { if(Xorriso_check_name_len(xorriso, name, (int) sizeof(xorriso->volset_id), "-volset_id", 0) <= 0) return(0); strcpy(xorriso->volset_id, name); Xorriso_set_change_pending(xorriso, 1); return(1); } /* Option -volume_date */ int Xorriso_option_volume_date(struct XorrisO *xorriso, char *time_type, char *timestring, int flag) { int ret, t_type= 0; time_t t; struct tm erg; if(timestring[0] == 0 || strcmp(timestring, "default") == 0 || strcmp(timestring, "overridden") == 0 ){ t= 0; } else if(strcmp(time_type, "uuid") == 0 || (strcmp(time_type, "all_file_dates") == 0 && strcmp(timestring, "set_to_mtime") == 0)) { t= time(NULL); /* Just to have some that is not 0 */ } else { ret= Xorriso_convert_datestring(xorriso, "-volume_date", "m", timestring, &t_type, &t, 0); if(ret<=0) goto ex; } if(strcmp(time_type, "uuid") == 0) { if(t == 0) { xorriso->vol_uuid[0]= 0; ret= 1; goto ex; } ret= Decode_ecma119_format(&erg, timestring, 0); if(ret <= 0 || strlen(timestring) != 16) { sprintf(xorriso->info_text, "-volume_date uuid : Not an ECMA-119 time string. (16 decimal digits, range 1970... to 2999...)"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } strcpy(xorriso->vol_uuid, timestring); if(erg.tm_year < 138) { sprintf(xorriso->info_text, "Understanding ECMA-119 timestring '%s' as: %s", timestring, asctime(&erg)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); } } else if(strcmp(time_type, "all_file_dates") == 0) { if(t == 0) { xorriso->all_file_dates[0]= 0; ret= 1; goto ex; } strncpy(xorriso->all_file_dates, timestring, sizeof(xorriso->all_file_dates) - 1); xorriso->all_file_dates[sizeof(xorriso->all_file_dates) - 1]= 0; } else if(strcmp(time_type, "c") == 0) { xorriso->vol_creation_time= t; } else if(strcmp(time_type, "m") == 0) { xorriso->vol_modification_time= t; } else if(strcmp(time_type, "x") == 0) { xorriso->vol_expiration_time= t; } else if(strcmp(time_type, "f") == 0) { xorriso->vol_effective_time= t; } else { /* >>> unknown time type */; ret= 0; goto ex; } ret= 1; ex:; return(ret); } /* Command -write_type */ int Xorriso_option_write_type(struct XorrisO *xorriso, char *mode, int flag) { if(strcmp(mode, "auto") == 0) xorriso->do_tao = 0; else if(strcmp(mode, "tao") == 0 || strcmp(mode, "TAO") == 0) xorriso->do_tao = 1; else if(strcmp(mode, "sao") == 0 || strcmp(mode, "SAO") == 0 || strcmp(mode, "dao") == 0 || strcmp(mode, "DAO") == 0 || strcmp(mode, "sao/dao") == 0 || strcmp(mode, "SAO/DAO") == 0 ) xorriso->do_tao = -1; else { sprintf(xorriso->info_text, "-write_type: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* Option -xattr "on"|"off" */ int Xorriso_option_xattr(struct XorrisO *xorriso, char *mode, int flag) { int ret; if(strcmp(mode, "off") == 0) { xorriso->do_aaip&= ~(4 | 8 | 1024); } else if(strcmp(mode, "on") == 0 || strcmp(mode, "user") == 0) { xorriso->do_aaip&= ~1024; xorriso->do_aaip|= (4 | 8); } else if(strcmp(mode, "any") == 0) { xorriso->do_aaip|= (4 | 8 | 1024); } else { sprintf(xorriso->info_text, "-xattr: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_set_ignore_aclea(xorriso, 0); if(ret <= 0) return(ret); return(1); } /* Option -zisofs */ int Xorriso_option_zisofs(struct XorrisO *xorriso, char *mode, int flag) { int was_level, was_blocksize, was_v2_enabled, was_blocksize_v2; int was_zisofs_susp_z2; uint64_t was_max_total_blocks, was_max_file_blocks, was_block_number_target; int ret, l, i, sticky, set_isofs_params= 0; double num, was_bpt_discard_free_ratio; char *cpt, *npt; was_level= xorriso->zlib_level; was_blocksize= xorriso->zisofs_block_size; was_v2_enabled= xorriso->zisofs_v2_enabled; was_max_total_blocks= xorriso->zisofs_max_total_blocks; was_max_file_blocks= xorriso->zisofs_max_file_blocks; was_blocksize_v2= xorriso->zisofs_v2_block_size; was_block_number_target= xorriso->zisofs_block_number_target; was_bpt_discard_free_ratio= xorriso->zisofs_bpt_discard_free_ratio; was_zisofs_susp_z2= xorriso->zisofs_susp_z2; npt= cpt= mode; for(cpt= mode; npt!=NULL; cpt= npt+1) { npt= strchr(cpt,':'); if(npt==NULL) l= strlen(cpt); else l= npt-cpt; if(l==0) goto unknown_mode; if(strncmp(cpt, "level=", 6) == 0) { sscanf(cpt + 6, "%lf", &num); if(num < 0 || num > 9) { sprintf(xorriso->info_text, "-zisofs: Wrong zlib compression level '%s' (allowed 0...9)", cpt + 6); goto sorry_ex; } xorriso->zlib_level= num; } else if(strncmp(cpt, "ziso_used=", 10) == 0 || strncmp(cpt, "osiz_used=", 10) == 0 || strncmp(cpt, "gzip_used=", 10) == 0 || strncmp(cpt, "gunzip_used=", 12) == 0 || strncmp(cpt, "bpt_ratio_used=", 15) == 0 || strncmp(cpt, "bpt_used=", 9) == 0) { /* (ignored info from -status) */; } else if(strncmp(cpt, "block_size=", 11)==0) { Xorriso__parse_size_param(cpt, 11, l, &num); if (num != (1 << 15) && num != (1 << 16) && num != (1 << 17)) { sprintf(xorriso->info_text, "-zisofs: Unsupported block size (allowed 32k, 64k, 128k)"); goto sorry_ex; } xorriso->zisofs_block_size= num; } else if(strncmp(cpt, "by_magic=", 9)==0) { if(strncmp(cpt + 9, "on", l - 9) == 0) { xorriso->zisofs_by_magic= 1; } else if(strncmp(cpt + 9, "v2", l - 9) == 0) { xorriso->zisofs_by_magic= 2; } else if(strncmp(cpt + 9, "off", l - 9) == 0) { xorriso->zisofs_by_magic= 0; } else { sprintf(xorriso->info_text, "-zisofs: Unrecognized by_magic mode (allowed: on, off, v2)"); goto sorry_ex; } } else if(strncmp(cpt, "version_2=", 10) == 0) { if(strncmp(cpt + 10, "off", l - 10) == 0) { xorriso->zisofs_v2_enabled= 0; } else if(strncmp(cpt + 10, "as_needed", l - 10) == 0) { xorriso->zisofs_v2_enabled= 1; } else if(strncmp(cpt + 10, "on", l - 10) == 0) { xorriso->zisofs_v2_enabled= 2; } else { sprintf(xorriso->info_text, "-zisofs: Unrecognized version_2 mode (allowed: on, off, as_needed)"); goto sorry_ex; } } else if(strncmp(cpt, "max_bpt=", 8) == 0) { Xorriso__parse_size_param(cpt, 8, l, &num); if(num < 1024.0 || num > 128.0 * 1024.0 * 1024.0 * 1024.0) { sprintf(xorriso->info_text, "-zisofs: Unsupported block pointer pool size (allowed: 1k to 128g)"); goto sorry_ex; } sticky= 0; if(xorriso->zisofs_max_total_blocks == xorriso->zisofs_max_file_blocks) sticky= 1; xorriso->zisofs_max_total_blocks= num / 8.0; if(xorriso->zisofs_max_total_blocks < xorriso->zisofs_max_file_blocks || sticky) xorriso->zisofs_max_file_blocks= xorriso->zisofs_max_total_blocks; } else if(strncmp(cpt, "max_bpt_f=", 10) == 0) { Xorriso__parse_size_param(cpt, 10, l, &num); if(num < 1024.0 || num > 128.0 * 1024.0 * 1024.0 * 1024.0) { sprintf(xorriso->info_text, "-zisofs: Unsupported block pointer list size (allowed: 1k to 128g)"); goto sorry_ex; } xorriso->zisofs_max_file_blocks= num / 8.0; if(xorriso->zisofs_max_file_blocks > xorriso->zisofs_max_total_blocks) xorriso->zisofs_max_total_blocks= xorriso->zisofs_max_file_blocks; } else if(strncmp(cpt, "block_size_v2=", 14) == 0) { Xorriso__parse_size_param(cpt, 14, l, &num); for(i= 15 ; i <= 20; i++) if(num == (1 << i)) break; if(i > 20) { sprintf(xorriso->info_text, "-zisofs: Unsupported block size (allowed 32k, 64k, 128k, ... 1024k)"); goto sorry_ex; } xorriso->zisofs_v2_block_size= num; } else if(strncmp(cpt, "bpt_target=", 11) == 0) { Xorriso__parse_size_param(cpt, 11, l, &num); xorriso->zisofs_block_number_target= num; } else if(strncmp(cpt, "bpt_free_ratio=", 15) == 0) { Xorriso__parse_size_param(cpt, 15, l, &num); /* 0 means to libisofs "do not change" */ if(num == 0.0) num= -1.0; if(num != -1.0 && (num <= 0.0 || num > 1.0)) { sprintf(xorriso->info_text, "-zisofs: Unsupported free blockpointer ratio (allowed -1 or 0.0 to 1.0)"); goto sorry_ex; } xorriso->zisofs_bpt_discard_free_ratio = num; } else if(strncmp(cpt, "susp_z2=", 8) == 0) { if(strncmp(cpt + 8, "off", l - 8) == 0) { xorriso->zisofs_susp_z2= 0; } else if(strncmp(cpt + 8, "on", l - 8) == 0) { xorriso->zisofs_susp_z2= 1; } else { sprintf(xorriso->info_text, "-zisofs: Unrecognized susp_z2 mode (allowed: on, off)"); goto sorry_ex; } Xorriso_set_zisofs_params(xorriso, 2); } else if(strncmp(cpt, "default", l)==0) { xorriso->zlib_level= xorriso->zlib_level_default; xorriso->zisofs_block_size= xorriso->zisofs_block_size_default; xorriso->zisofs_by_magic= 0; xorriso->zisofs_v2_enabled= 0; xorriso->zisofs_max_total_blocks= xorriso->zisofs_max_total_blocks_default; xorriso->zisofs_max_file_blocks= xorriso->zisofs_max_file_blocks_default; xorriso->zisofs_v2_block_size= xorriso->zisofs_v2_block_size_default; xorriso->zisofs_block_number_target= -1; xorriso->zisofs_bpt_discard_free_ratio= xorriso->zisofs_bpt_discard_free_ratio_default; xorriso->zisofs_susp_z2= xorriso->zisofs_susp_z2_default; Xorriso_set_zisofs_params(xorriso, 2); } else { unknown_mode:; if(linfo_text, "-zisofs: unknown mode '%s'", cpt); else sprintf(xorriso->info_text, "-zisofs: oversized mode parameter (%d)",l); sorry_ex: Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); xorriso->zlib_level= was_level; xorriso->zisofs_block_size= was_blocksize; xorriso->zisofs_v2_enabled= was_v2_enabled; xorriso->zisofs_max_total_blocks= was_max_total_blocks; xorriso->zisofs_max_file_blocks= was_max_file_blocks; xorriso->zisofs_v2_block_size= was_blocksize_v2; xorriso->zisofs_block_number_target= was_block_number_target; xorriso->zisofs_bpt_discard_free_ratio= was_bpt_discard_free_ratio; xorriso->zisofs_susp_z2 = was_zisofs_susp_z2; Xorriso_set_zisofs_params(xorriso, 2); return(0); } if(strncmp(cpt, "by_magic=", 9) != 0 && strncmp(cpt, "susp_z2=", 8) != 0) set_isofs_params= 1; } ret= 1; if(set_isofs_params) ret= Xorriso_set_zisofs_params(xorriso, 1); return(ret); } libisoburn-1.5.4/xorriso/sfile.c0000644000175700017510000005516413762645074013626 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of functions around files and strings. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include "sfile.h" /* @param flag bit0= do not clip off carriage return at line end */ char *Sfile_fgets_n(char *line, int maxl, FILE *fp, int flag) { int l; char *ret; ret= fgets(line,maxl,fp); if(ret==NULL) return(NULL); l= strlen(line); if(l > 0 && !(flag & 1)) if(line[l-1] == '\r') line[--l]= 0; if(l > 0) if(line[l-1] == '\n') line[--l]= 0; if(l > 0 && !(flag & 1)) if(line[l-1] == '\r') line[--l]= 0; return(ret); } int Sfile_count_char(char *text, char to_count) { int count= 0; char *cpt; for(cpt= text; *cpt != 0; cpt++) if(*cpt == to_count) count++; return count; } int Sfile_count_components(char *path, int flag) /* bit0= do not ignore trailing slash bit1= do not ignore empty components (other than the empty root name) */ { int l,count= 0; char *cpt; l= strlen(path); if(l==0) return(0); count= 1; for(cpt= path+l-1;cpt>=path;cpt--) { if(*cpt=='/') { if(*(cpt+1)==0 && !(flag&1)) continue; if(*(cpt+1)=='/' && !(flag&2)) continue; count++; } } return(count); } int Sfile_component_pointer(char *path, char **sourcept, int idx, int flag) /* bit0= do not ignore trailing slash bit1= do not ignore empty components (other than the empty root name) bit2= accept 0 as '/' */ { int count= 0; char *spt; for(spt= path;*spt!=0 || (flag&4);spt++) { if(count>=idx) { *sourcept= spt; return(1); } if(*spt=='/' || *spt==0) { if(*(spt+1)=='/' && !(flag&2)) continue; if(*(spt+1)==0 && !(flag&1)) continue; count++; } } if((flag&1) && count>=idx) return(1); return(0); } int Sfile_leafname(char *path, char leafname[SfileadrL], int flag) { int count, ret; char *lpt; leafname[0]= 0; count= Sfile_count_components(path, 0); if(count==0) return(0); ret= Sfile_component_pointer(path, &lpt, count-1, 0); if(ret<=0) return(ret); if(Sfile_str(leafname, lpt, 0)<=0) return(0); lpt= strchr(leafname, '/'); if(lpt!=NULL) *lpt= 0; return(1); } int Sfile_add_to_path(char path[SfileadrL], char *addon, int flag) { int l; l= strlen(path); if(l+1>=SfileadrL) return(0); if(l==0) { strcpy(path,"/"); l= 1; } else if(path[l-1]!='/') { path[l++]= '/'; path[l]= 0; } if(l+strlen(addon)>=SfileadrL) return(0); if(addon[0]=='/') strcpy(path+l,addon+1); else strcpy(path+l,addon); return(1); } int Sfile_prepend_path(char *prefix, char path[SfileadrL], int flag) { int l, i, slashes, prefix_len, path_len; l= strlen(prefix); if(l == 0) return(1); /* Do not copy slashes between both parts */ for(prefix_len= l; prefix_len > 0; prefix_len--) if(prefix[prefix_len - 1] != '/') break; if(prefix_len == 0) prefix_len= strlen(prefix) - 1; path_len= strlen(path); for(slashes= 0; slashes < path_len; slashes++) if(path[slashes] != '/') break; l= (strlen(path) - slashes) + prefix_len + 1; if(l>=SfileadrL) { #ifdef Not_yeT /* >>> ??? how to transport messages to xorriso ? */ sprintf(xorriso->info_text, "Combination of wd and relative address too long (%d > %d)", l,SfileadrL-1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); #endif return(-1); } l-= strlen(path); if(l < 0) { for(i= slashes; i <= path_len + 1; i++) path[i+l]= path[i]; } else if(l > 0) { for(i= path_len + 1; i >= slashes; i--) path[i+l]= path[i]; } if(prefix_len > 0) memcpy(path, prefix, prefix_len); path[l - 1 + slashes]= '/'; return(1); } int Sfile_get_dev_fd_no(char *filename, int flag) { int i, fd= -1; if(strncmp(filename, "/dev/fd/", 8) != 0) return(-1); for(i = 8; filename[i]; i++) if(filename[i] < '0' || filename[i] > '9') break; if(i > 8 && filename[i] == 0) sscanf(filename + 8, "%d", &fd); if(fd < 0) fd = -1; return(fd); } int Sfile_type(char *filename, int flag) /* bit0= return -1 if file is missing bit1= return a hardlink with siblings as type 5 bit2= evaluate eventual link target rather than the link object itself bit3= return a socket or a char device as types 7 or 8 rather than 0 bit4= interpret /dev/fd/#fd# as open file descriptor fd */ /* return: 0=unknown 1=regular 2=directory 3=symbolic link 4=named pipe 5=multiple hardlink (with bit1) 6=block device 7=socket (with bit3) 8=character device (with bit3) | 1024 if interpreted as /dev/fd/#fd# | 2048 if interpreted as /dev/fd/#fd# and not fstatable */ { struct stat stbuf; int fd= -1, was_dev_fd= 0, ret; if(flag & 16) fd= Sfile_get_dev_fd_no(filename, 0); if(fd != -1) { was_dev_fd= 1; if(fstat(fd, &stbuf) == -1) return(1024 | 2048); } else if(flag&4) { if(stat(filename,&stbuf)==-1) { if(flag&1) return(-1); else return(0); } } else { if(lstat(filename,&stbuf)==-1) { if(flag&1) return(-1); else return(0); } } if(S_ISREG(stbuf.st_mode)) { if(flag&2) if(stbuf.st_nlink>1) {ret= 5; goto ex;} {ret= 1; goto ex;} } if(S_ISDIR(stbuf.st_mode)) {ret= 2; goto ex;} if((stbuf.st_mode&S_IFMT)==S_IFLNK) {ret= 3; goto ex;} if(S_ISFIFO(stbuf.st_mode)) {ret= 4; goto ex;} if(S_ISBLK(stbuf.st_mode)) {ret= 6; goto ex;} if(flag&8) if((stbuf.st_mode&S_IFMT)==S_IFSOCK) {ret= 7; goto ex;} if(flag&8) if(S_ISCHR(stbuf.st_mode)) {ret= 8; goto ex;} ret = 0; ex:; return(ret | (was_dev_fd << 10)); } char *Sfile_datestr(time_t tim, short int flag) /* bit0=with hours+minutes bit1=with seconds bit8= local time rather than UTC */ { static char zeitcode[80]={"000000"}; char puff[80]; struct tm *azt; if(flag&256) azt = localtime(&tim); else azt = gmtime(&tim); if(azt->tm_year>99) sprintf(zeitcode,"%c%1.1d%2.2d%2.2d", 'A'+(azt->tm_year-100)/10,azt->tm_year%10, azt->tm_mon+1,azt->tm_mday); else sprintf(zeitcode,"%2.2d%2.2d%2.2d", azt->tm_year,azt->tm_mon+1,azt->tm_mday); if(flag&1){ sprintf(puff,".%2.2d%2.2d",azt->tm_hour,azt->tm_min); strcat(zeitcode,puff); } if(flag&2){ sprintf(puff,"%2.2d",azt->tm_sec); strcat(zeitcode,puff); } return(zeitcode); } int Sfile_scale(double value, char *result, int siz, double thresh, int flag) /* bit0= omit 'b' if it would elsewise be appended bit1= make text as short as possible bit2= no fraction (if it would fit at all) */ { char scale_c,scales[7],form[80], *negpt= NULL, *cpt; int i,dec_siz= 0,avail_siz= 1; if(value<0) { value= -value; siz--; result[0]= '-'; negpt= result; result++; } strcpy(scales,"bkmgtp"); scale_c= scales[0]; for(i=1;scales[i]!=0;i++) { if(value0) sprintf(form,"%%%d.%df%%c",avail_siz,dec_siz); else sprintf(form,"%%%d.f%%c",siz-1); sprintf(result,form,value,scale_c); } if(negpt != NULL) { for(cpt= result; *cpt==' '; cpt++); if(cpt > result) { *negpt= ' '; *(cpt - 1)= '-'; } } return(1); } int Sfile_off_t_text(char text[80], off_t num, int flag) { char *tpt; off_t hnum, scale= 1; int digits= 0, d, i; tpt= text; hnum= num; if(hnum<0) { *(tpt++)= '-'; hnum= -num; } if(hnum<0) { /* it can stay nastily persistent */ strcpy(text, "_overflow_"); return(0); } for(i= 0; i<23; i++) { /* good for up to 70 bit = 10 exp 21.07... */ if(hnum==0) break; hnum/= 10; if(hnum) scale*= 10; } if(i==0) { strcpy(text, "0"); return(1); } if(i==23) { strcpy(text, "_overflow_"); return(0); } digits= i; hnum= num; for(; i>0; i--) { d= hnum/scale; tpt[digits-i]= '0'+d; hnum= hnum%scale; scale/= 10; } tpt[digits]= 0; return(1); } /* @return index number of first not interpreted text byte */ int Sfile_text_to_off_t(char *text, off_t *num, int flag) { int sig= 1, ridx; *num= 0; ridx= 0; if(text[ridx] == '-') { sig= -1; ridx++; } else if(text[ridx] == '+') { ridx++; } for(; text[ridx] != 0; ridx++) { if(text[ridx] < '0' || text[ridx] > '9') break; if(*num > (((off_t) 1) << 59)) return(-1); *num= *num * 10 + text[ridx] - '0'; } *num= *num * sig; return(ridx); } /* 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 */ 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); } /* @param flag bit0= only encode inside quotes bit1= encode < 32 outside quotes except 7, 8, 9, 10, 12, 13 bit2= encode in any case above 126 bit3= encode in any case shellsafe and name-value-safe: <=42 , 59, 60, 61, 62, 63, 92, 94, 96, >=123 */ int Sfile_bsl_encoder(char **result, char *text, size_t text_len, int flag) { signed char *rpt; char *wpt; int count, sq_open= 0, dq_open= 0; count= 0; for(rpt= (signed char *) text; (size_t) (((char *) rpt) - text) < text_len; rpt++) { count++; if(flag & 8) { if(!(*rpt <= 42 || (*rpt >= 59 && *rpt <= 63) || *rpt == 92 || *rpt == 94 || *rpt == 96 || *rpt >= 123)) continue; } else if(*rpt >= 32 && *rpt <= 126 && *rpt != '\\') continue; if(((*rpt >= 7 && *rpt <= 13) || *rpt == 27 || *rpt == '\\') && !(flag & 8)) count++; else count+= 3; } (*result)= wpt= calloc(count + 1, 1); if(wpt == NULL) return(-1); for(rpt= (signed char *) text; (size_t) (((char *) rpt) - text) < text_len; rpt++) { if(*rpt == '\'') sq_open= !(sq_open || dq_open); if(*rpt == '"') dq_open= !(sq_open || dq_open); if(flag & 8) { if(!(*rpt <= 42 || (*rpt >= 59 && *rpt <= 63) || *rpt == 92 || *rpt == 94 || *rpt == 96 || *rpt >= 123)) { *(wpt++)= *rpt; continue; } } else if(*rpt >= 32 && *rpt <= 126 && *rpt != '\\') { *(wpt++)= *rpt; continue; } else if( ((flag & 1) && !(sq_open || dq_open)) && !((flag & 2) && (*rpt >= 1 && * rpt <= 31 && !(*rpt == 7 || *rpt == 8 || *rpt == 9 || *rpt == 10 || *rpt == 12 || *rpt == 13))) && !((flag & 4) && (*rpt > 126 || *rpt < 0)) && !((flag & 6) && *rpt == '\\')) { *(wpt++)= *rpt; continue; } *(wpt++)= '\\'; if(((*rpt >= 7 && *rpt <= 13) || *rpt == 27 || *rpt == '\\') && !(flag&8)) { if(*rpt == 7) *(wpt++)= 'a'; else if(*rpt == 8) *(wpt++)= 'b'; else if(*rpt == 9) *(wpt++)= 't'; else if(*rpt == 10) { *(wpt++)= 'n'; } else if(*rpt == 11) *(wpt++)= 'v'; else if(*rpt == 12) *(wpt++)= 'f'; else if(*rpt == 13) *(wpt++)= 'r'; else if(*rpt == 27) *(wpt++)= 'e'; else if(*rpt == '\\') *(wpt++)= '\\'; } else { sprintf(wpt, "%-3.3o", (unsigned int) *((unsigned char *) rpt)); wpt+= 3; } } *wpt= 0; return(1); } 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) Smem_freE((*argv)[i]); } Smem_freE((char *) *argv); } *argc= 0; *argv= NULL; return(1); } 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 + bufl, 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 + bufl, 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 + bufl, 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 **) Smem_malloC((argzaehl + !!(flag & 128)) * sizeof(char *)); if(*argv==NULL) {ret= -1; goto ex;} } for(i=0;i<*argc;i++) { (*argv)[i]= (char *) Smem_malloC((maxl+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); } int Sfile_make_argv(char *progname, char *line, int *argc, char ***argv, int flag) { return Sfile_sep_make_argv(progname, line, "", 0, argc, argv, flag); } /* @param flag bit0= append */ int Sfile_str(char target[SfileadrL], char *source, int flag) { int l; l= strlen(source); if(flag&1) l+= strlen(target); if(l>=SfileadrL) { fprintf(stderr, "--- Path string overflow (%d > %d). Malicious input ?\n", l,SfileadrL-1); return(0); } if(flag&1) strcat(target, source); else strcpy(target, source); return(1); } /** Combine environment variable HOME with given filename @param filename Address relative to $HOME @param fileadr Resulting combined address @param fa_size Size of array fileadr @param flag Unused yet @return 1=ok , 0=no HOME variable , -1=result address too long */ int Sfile_home_adr_s(char *filename, char *fileadr, int fa_size, int flag) { char *home; strcpy(fileadr,filename); home= getenv("HOME"); if(home==NULL) return(0); if((int) (strlen(home) + strlen(filename) + 1) >= fa_size) return(-1); strcpy(fileadr,home); if(filename[0]!=0){ strcat(fileadr,"/"); strcat(fileadr,filename); } return(1); } /** Return a double representing seconds and microseconds since 1 Jan 1970 */ double Sfile_microtime(int flag) { struct timeval tv; gettimeofday(&tv, NULL); return((double) (tv.tv_sec+1.0e-6*tv.tv_usec)); } int Sfile_decode_datestr(struct tm *reply, char *text, int flag) /* YYMMDD[.hhmm[ss]] */ { int i,l; time_t current_time; struct tm *now; current_time= time(0); now= localtime(¤t_time); for(i=0; i < (int) sizeof(struct tm); i++) ((char *) reply)[i]= ((char *) now)[i]; if(text[0]<'0'|| (text[0]>'9' && text[0]<'A') || text[0]>'Z') return(0); l= strlen(text); for(i=1;i'9') break; if(i!=6) return(0); if(text[i]==0) goto decode; if(text[i]!='.' || (l!=11 && l!=13)) return(0); for(i++;i'9') break; if(i!=l) return(0); decode:; reply->tm_hour= 0; reply->tm_min= 0; reply->tm_sec= 0; i= 0; if(text[0]>='A') reply->tm_year= 100+(text[i]-'A')*10+text[1]-'0'; else reply->tm_year= 10*(text[0]-'0')+text[1]-'0'; reply->tm_mon= 10*(text[2]-'0')+text[3]-'0'-1; reply->tm_mday= 10*(text[4]-'0')+text[5]-'0'; if(l==6) return(1); reply->tm_hour= 10*(text[7]-'0')+text[8]-'0'; reply->tm_min= 10*(text[9]-'0')+text[10]-'0'; if(l==11) return(1); reply->tm_sec= 10*(text[11]-'0')+text[12]-'0'; return(1); } /* From libisofs: Find backward from idx the start byte of a possible UTF-8 character. https://en.wikipedia.org/wiki/UTF-8#Description */ static int find_utf8_start(char *name, int idx, int flag) { unsigned char *uname, uch; int i; uname= (unsigned char *) name; if ((uname[idx] & 0xc0) != 0x80) return idx; /* not an UTF-8 tail byte */ for (i = 0; i < 5 && idx - 1 - i >= 0; i++) { /* up to deprecated 6-byte codes */ uch = uname[idx - 1 - i]; if ((uch & 0xe0) == 0xc0 || (uch & 0xf0) == 0xe0 || (uch & 0xf8) == 0xf0 || (uch & 0xfc) == 0xf8 || (uch & 0xfe) == 0xfc) return (idx - 1 - i); /* UTF-8 start byte found */ if ((uch & 0xc0) != 0x80) return idx; /* not an UTF-8 tail byte, so no UTF-8 */ } return idx; /* no UTF-8 start found */ } int Sfile_flatten_utf8_heads(char *name, int idx, int flag) { int neck; neck = find_utf8_start(name, idx, 0); if(neck >= idx) return(2); for(; neck < idx; neck++) name[neck] = '_'; return(1); } libisoburn-1.5.4/xorriso/xorrisofs.10000644000175700017510000025145314005266025014461 00000000000000.\" Hey, EMACS: -*- nroff -*- .\" .\" IMPORTANT NOTE: .\" .\" The original of this file is kept in xorriso/xorrisofs.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 XORRISOFS 1 "Version 1.5.4, Jan 30, 2021" .\" 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 insert n+1 empty lines .\" for manpage-specific macros, see man(7) .nh .SH NAME xorrisofs \- Emulation of ISO 9660 program mkisofs by program xorriso .SH SYNOPSIS .B xorrisofs [ options ] [-o filename ] pathspec [pathspecs ...] .br .SH DESCRIPTION .PP \fBxorrisofs\fR produces Rock Ridge enhanced ISO 9660 filesystems and add\-on sessions to such filesystems. Optionally it can produce Joliet directory trees too. .br .PP \fBxorrisofs\fR understands options of program mkisofs from cdrtools by Joerg Schilling. Its implementation is part of program xorriso which shares no source code with cdrtools. .SS \fBISO 9660, Rock Ridge, Joliet, HFS+:\fR .br \fBISO 9660\fR (aka \fBECMA\-119\fR) is a read\-only filesystem that is mainly used for optical media CD, DVD, BD, but may also reside on other storage devices like disk files, USB sticks or disk partitions. It is widely readable by many operating systems and by boot facilities of personal computers. .br ISO 9660 describes directories and data files by very restricted filenames with no distinction of upper case and lower case. Its metadata do not comply to fundamental POSIX specifications. .br \fBRock Ridge\fR is the name of a set of additional information which enhance an ISO 9660 filesystem so that it can represent a POSIX compliant filesystem with ownership, access permissions, symbolic links, and other attributes. Rock Ridge allows filenames of up to 255 bytes and paths of up to 1024 bytes. .br xorrisofs produces Rock Ridge information by default. It is strongly discouraged to disable this feature. .br \fBJoliet\fR is the name of an additional directory tree which provides filenames up to 64 characters encoded as UTF\-16. A Joliet tree is mainly interesting for reading the ISO image by operating systems of Microsoft Corporation. Production of this directory tree may be enabled by option \-J. .br \fBISO 9660:1999\fR is the name of an additional directory tree which provides longer filenames. It allows single file names to have up to 207 characters. It might be of use with some older computer system boot facilities which read neither Rock Ridge nor Joliet but need longer filenames nevertheless. Production of this directory tree may be enabled by option \-iso\-level 4. .br \fBHFS+\fR is the name of a filesystem which is normally used for writing and reading on hard disks and similar devices. It is possible to embed a HFS+ partition into the emerging ISO 9660 image and to mark it by Apple Partition Map entries. This interferes with options which copy data into the first 32 KiB of the ISO image, like \-G or \-isohybrid\-mbr. See option \-hfsplus. .br The main purpose for having an embedded HFS+ partition is booting of certain models of Apple computers. .SS .B Inserting files into the ISO image: .PP \fBxorrisofs\fR deals with two kinds of file addresses: .br \fBdisk_path\fR is a path to an object in the local filesystem tree. .br \fBiso_rr_path\fR is the Rock Ridge address of a file object in the ISO image. If no Rock Ridge information shall be stored in an emerging ISO, then the names will get mapped to ISO 9660 names of limited length and character set. .br .PP A program argument is handled as a \fBpathspec\fR, if it is not recognized as original mkisofs option or additional \fBxorrisofs\fR option. A pathspec depicts an input file object by a disk_path. If option \-graft\-points is not present, then the behavior depends on the file type of disk_path. Directories get merged with the /\-directory of the ISO image. Files of other types get copied into the /\-directory. .br If \-graft\-points is present then each pathspec gets split at the first occurrence of the =\-character. The part before the = is taken as \fBtarget\fR, i.e. the iso_rr_path for the file object in the ISO image. The part after the first = is taken as \fBsource\fR, i.e. the disk_path of the input object. .br It is possible to make =\-characters part of the iso_rr_path by preceding them with a \\\-character. The same must be done for \\\-characters which shall be part of the iso_rr_path. .br .PP If the source part of the pathspec leads to a directory, then all files underneath this directory get inserted into the image, too. It is possible to exclude particular files from being inserted by help of option \-m. .br In case that target already exists, the following rules apply: Directories and other files may overwrite existing non\-directories. Directories get merged with existing directories. Non\-directories may not overwrite existing directories. .SS \fBRelation to program xorriso:\fR .br \fBxorrisofs\fR is actually a command mode of program \fBxorriso\fR, which gets entered either by xorriso command "\-as mkisofs" or by starting the program by one of the names "xorrisofs", "mkisofs", "genisoimage", or "genisofs". .br This command mode can be left by argument "\-\-" which leads to generic xorriso command mode. See \fBman xorriso\fR for its description. .br .PP xorriso performs image reading and writing by help of libburn, which is mainly intended for optical drives, but also operates on all POSIX file types except directories. .br The program messages call any image file a "drive". File types which are not supported for reading are reported as "blank". The reported free media space may be quite fictional. .br Nevertheless \fBxorrisofs\fR does not operate directly on optical drives, but rather forces libburn to regard them as general device files. So for writing of sequential optical media (CD, DVD\-R, DVD+R, BD\-R) one will have to use a burn program. E.g the cdrecord emulation of xorriso. See EXAMPLES. .SS .br .SH OPTIONS .br .PP .TP .B Image loading: .PP The following options control loading of an existing ISO image for the purpose of preparing a suitable add\-on session. If they are missing then a new image is composed from scratch. .TP \fB\-M\fR disk_path Set the path from which to load the existing ISO image directory tree on which to base the upcoming directory tree as add\-on session. The path must lead to a random\-access readable file object. On GNU/Linux: regular data files or block device files. .br A special kind of pseudo disk_path has the form "/dev/fd/"number. It depicts the open file descriptor with the given number, regardless whether the operating system supports this feature by file nodes in /dev/fd or not. E.g. /dev/fd/3 is file descriptor 3 which was opened by the program that later started xorriso. .TP \fB\-prev-session\fR disk_path Alias of \-M. .TP \fB\-dev\fR disk_path Alias of \-M. .TP \fB\-C\fR last_session_start,next_writeable_address Set the 2 KiB block address last_session_start from where to read the ISO image out of the file given by option \-M. .br Separated by a comma, set the next_writeable_address to which the add\-on session will finally be written. Decisive is actually the block address which the intended readers will have to use as superblock address on the intended medium. .br Both values can be inquired from optical media by help of burn programs and cdrecord option \-msinfo. xorriso itself can obtain it in its cdrecord emulation. .br values=$(xorriso \-as cdrecord dev=/dev/... \-msinfo) .br echo $values .br Option \-C may be used without option \-M to create an ISO image from scratch and prepare it for being finally written to a block address other than 0. Parameter last_session_start must then be set to 0. .TP \fB\-cdrecord-params\fR last_session_start,next_writeable_address Alias of \-C. .TP .B Settings for file insertion: .TP \fB\-path-list\fR disk_path Read pathspecs line\-by\-line from disk_file and insert the depicted file objects into the ISO image. If disk_path is "\-" then read the pathspecs from standard input. .TP \fB--quoted_path_list\fR disk_path Like option \-path\-list but reading quoted words rather than plain lines. Whitespace outside of quotes will be discarded. On the other hand it is possible to represent pathspecs which contain newline characters. .br The double quotation mark " and the single quotation mark ' can be used to enclose whitespace and make it part of pathspecs. Each mark type can enclose the marks of the other type. A trailing backslash \\ outside quotations or an open quotation cause the next input line to be appended. .TP \fB\-f\fR .br Resolve symbolic links on disk rather than storing them as symbolic links in the ISO image. .TP \fB\-follow-links\fR Alias of \-f. .TP \fB\-graft-points\fR Enable interpretation of input file pathspecs as combination of iso_rr_path and disk_path, separated by a =\-character. .TP \fB\-m\fR disk_pattern Exclude files from being inserted into the image. Silently ignored are those files of which the disk_path matches the given shell parser pattern. If no /\-character is part of the pattern, then it gets matched against the leaf name of the disk file. .br It is possible to give more than one \-m option. .TP \fB\-exclude\fR Alias of \-m. .TP \fB\-x\fR .br Alias of \-m. .TP \fB\-old-exclude\fR Alias of \-m. .TP \fB\-exclude-list\fR disk_path Perform \-m using each line out of file disk_path as argument disk_pattern. .TP \fB\-z\fR .br Enable recognition and proper processing of zisofs compressed files as produced by program mkzftree. These files will get equipped with the necessary meta data so that a Linux kernel will recognize them and deliver their content in uncompressed form. .TP \fB\-transparent-compression\fR Alias of \-z. .TP \fB\--zisofs-version-2\fR .br Enable the recognition and proper processing of experimental zisofs version 2 compressed files. The Linux kernel (as of 5.9) does not yet know this format and will complain like .br isofs: Unknown ZF compression algorithm: PZ .br This complaint can be prevented by option \-\-zisofs2\-susp\-z2 . .br The files will be shown by unaware kernels as they were submitted to xorriso, i.e. with zisofs2 header, block pointer list, and compressed data. .br \-\-zisofs\-version\-2 also enables \-z. .TP \fB\--zisofs2-susp-z2\fR Enable the production of SUSP entries "Z2" instead of "ZF" with zisofs2 compressed files. Unaware Linux kernels silently ignore "Z2" entries. .TP \fB\--zisofs2-susp-zf\fR Enable the production of SUSP entries "ZF" instead of "Z2" with zisofs2 compressed files. Unaware Linux kernels complain about zisofs2 "ZF" by "Unknown ZF compression algorithm" and thus leave a mark in the system log. .TP \fB\-root\fR iso_rr_path Insert all files under the given iso_rr_path. If option \-graft\-points is given, then iso_rr_path is prepended to each target part of a pathspec. .br The default for \-root is "/". .TP \fB\-old-root\fR iso_rr_path Enable incremental insertion of files into the loaded image. The effective target and source addresses of given pathspecs get compared whether the target already exists in the ISO image and is still identical to the source on disk. Metadata in the ISO image will get adjusted, if they differ from those on disk. New files and files with changed content will get newly added. Target files which do not exist in any of the according pathspec sources will get removed from the ISO directory tree. .br If the effective setting of \-root differs from the iso_rr_path given with \-old\-root, then the files underneath the \-old\-root directory get cloned underneath the \-root directory. Cloning happens before file comparison. .TP \fB--old-root-no-ino\fR Disable recording and use of disk inode numbers. If no disk inode numbers are recorded, then option \-old\-root will have to read disk file content and compare it with the MD5 checksum that is recorded in the ISO image. .br With recorded disk inode numbers and with credible ctime and mtime, it is possible to detect potential changes in the content without actually reading it. A loophole remains if multiple different filesystems may get mounted at the same directory, like it is habit with /mnt. In this case one has to use option \-\-old\-root\-devno or disable the inode number shortcut by \-\-old\-root\-no\-ino. .TP \fB--old-root-devno\fR Enable comparison of recorded device numbers together with recorded inode numbers. This works only with good old stable device numbers which get out of fashion, regrettably. If the hard disk has a different device number after each reboot, then this comparison will see all files as changed and thus prevent any incremental size saving. .TP \fB--old-root-no-md5\fR Disable recording and use of MD5 checksums for data file content. If neither checksums and nor disk inode numbers are recorded, then option \-old\-root will have to read ISO image file content when comparing it with disk file content. .TP .B Settings for image production: .TP \fB\-o\fR disk_path Set the output file address for the emerging ISO image. If the address exists as regular file, it will be truncated to length 0 when image production begins. It may not already exist as directory. If it does not exist yet then its parent directory must exist and a regular file will get created. .br A special kind of pseudo disk_path has the form "/dev/fd/"number. It depicts the open file descriptor with the given number, regardless whether the operating system supports this feature by file nodes in /dev/fd or not. E.g. /dev/fd/4 is file descriptor 4 which was opened by the program that later started xorriso. .br Default is standard output (/dev/fd/1) which may also be set by disk_path "\-". .TP \fB\-output\fR disk_path Alias of \-o. .TP \fB--stdio_sync\fR "on"|"off"|"end"|number Set the number of bytes after which to force output to disk in order to keep the memory from being clogged with lots of pending data for slow devices. "on" is the same as "16m". Forced output can be disabled by "off", or be delayed by "end" until all data are produced. If a number is chosen, then it must be at least 64k. .br The default with xorriso mkisofs emulation is \-\-stdio_sync "off". .br xorriso uses an inner fifo buffer with default size 4 MiB. So forcing the operating system i/o cache to disk does not necessarily block the simultaneous production of more image content. .TP \fB--emul-toc\fR Write a second superblock with the first session into random\-access files. If further sessions get appended and the first superblock gets updated, then the second superblock will not be overwritten. So it is still possible to mount the first session and to find the start blocks of the further sessions. .br The price is 64 KiB extra space consumption. If \-partition_offset is non\-zero, then it is 128 KiB plus twice the partition setup. .TP \fB--no-emul-toc\fR Do not write a second superblock with the first session into random\-access files. .br This is the default. .TP \fB--sort-weight\fR weight_number iso_rr_path Attribute a LBA weight number to regular files. If iso_rr_path leads to a directory then all regular files underneath will get the weight_number. .br The weight_number may range from \-2147483648 to 2147483647. The higher it is, the lower will be the block address of the file data in the emerging ISO image. Currently the El Torito boot catalog has a hardcoded weight of 1 billion. Normally it should occupy the block with the lowest possible address. Data files get added or loaded with initial weight 0. Boot image files have a default weight of 2. .TP \fB--sort-weight-list\fR disk_path Read pairs of weight number and iso_rr_path from a file of the local filesystem. Apply each pair like with \-\-sort\-weight. .br Only the last \-\-sort\-weight\-list or \-\-sort\-weight\-patterns of a xorrisofs run gets into effect. .br The weight number is read from the start of the line. The iso_rr_path part of an input line begins immediately after the first blank or tab character of the line. .br Notes for the case that this feature is used within a sequence of generic xorriso commands (not an issue with a pure mkisofs emulation run): .br The addressed files must already be in the ISO image model when you execute .br \-as mkisofs \-\-sort\-weight\-list disk_path \-\- .br Several such commands may be used to apply more than one weight file. .br Data files which are loaded by \-indev or \-dev get a weight between 1 and 2 exp 28 = 268,435,456, depending on their block address. This shall keep them roughly in the same order if the write method of modifying is applied. .TP \fB--sort-weight-patterns\fR disk_path Like \-\-sort\-weight\-list , but expanding the iso_rr_paths as shell parser patterns and applying \-\-sort\-weight to each matching file. .TP \fB\-uid\fR number|name Use the given number or locally existing user name as owner id of all files and directories in the emerging filesystem. Empty name or name "\-" revoke this feature. .TP \fB\-gid\fR number|name Use the given number or locally existing group name as group id of all files and directories in the emerging filesystem. Empty name or name "\-" revoke this feature. .TP \fB\-dir-mode\fR mode Set the access permissions for all directories in the image to the given mode which is either an octal number beginning with "0" or a comma separated list of statements of the form [ugoa]*[+\-=][rwxst]* . E.g. ug=rx,a\-rwx .TP \fB\-file-mode\fR mode Like \-dir\-mode but for all regular data files in the image. .TP \fB\-pad\fR .br Add 300 KiB to the end of the produced ISO image. This circumvents possible read errors from ISO images which have been written to CD media in TAO mode. The additional bytes are claimed as part of the ISO image if not \-\-emul\-toc is given. .br Option \-pad is the default. .TP \fB\-no-pad\fR Disable padding of 300 KiB to the end of the produced ISO image. This is safe if the image is not meant to be written on CD or if it gets written to CD as only track in write mode SAO. .TP \fB--old-empty\fR Use the old way of of giving block addresses in the range of [0,31] to files with no own data content. The new way is to have a dedicated block to which all such files will point. .TP .B Settings for standards compliance: .TP \fB\-iso-level\fR number Specify the ISO 9660 version which defines the limitations of file naming and data file size. The naming restrictions do not apply to the Rock Ridge names but only to the low\-level ISO 9660 names. There are three conformance levels: .br Level 1 allows ISO names of the form 8.3 and file size up to 4 GiB \- 1. .br Level 2 allows ISO names with up to 32 characters and file size up to 4 GiB \- 1. .br Level 3 allows ISO names with up to 32 characters and file size of up to 400 GiB \- 200 KiB. (This size limitation is set by the xorriso implementation and not by ISO 9660 which would allow nearly 8 TiB.) .br Pseudo\-level 4 enables production of an additional ISO 9660:1999 directory tree. .TP \fB\-disallow_dir_id_ext\fR Do not follow a bad habit of mkisofs which allows dots in the ISO names of directories. On the other hand, some bootable GNU/Linux images depend on this bad habit. .TP \fB\-U\fR .br This option allows ISO file names without dot and up to 37 characters, ISO file paths longer than 255 characters, and all ASCII characters in file names. Further it omits the semicolon and the version numbers at the end of ISO names. .br This all violates ISO 9660 specs. .TP \fB\-untranslated-filenames\fR Alias of \-U. .TP \fB\-untranslated_name_len\fR number Allow ISO file names up to the given number of characters without any character conversion. The maximum number is 96. If a file name has more characters, then image production will fail deliberately. .br This violates ISO 9660 specs. .TP \fB\-allow-lowercase\fR Allow lowercase character in ISO file names. .br This violates ISO 9660 specs. .TP \fB\-relaxed-filenames\fR Allow nearly all 7\-bit characters in ISO file names. Not allowed are 0x0 and '/'. If not option \-allow\-lowercase is given, then lowercase letters get converted to uppercase. .br This violates ISO 9660 specs. .TP \fB\-d\fR .br Do not add trailing dot to ISO file names without dot. .br This violates ISO 9660 specs. .TP \fB\-omit-period\fR Alias of \-d. .TP \fB\-l\fR .br Allow up to 31 characters in ISO file names. .TP \fB\-full-iso9660-filenames\fR Alias of \-l. .TP \fB\-max-iso9660-filenames\fR Allow up to 37 characters in ISO file names. .br This violates ISO 9660 specs. .TP \fB\-N\fR .br Omit the semicolon and the version numbers at the end of ISO names. .br This violates ISO 9660 specs. .TP \fB\-omit-version-number\fR Alias of \-N. .TP .B Settings for standards extensions: .TP \fB\-R\fR .br With mkisofs this option enables Rock Ridge extensions. \fBxorrisofs\fR produces them by default. It is strongly discouraged to disable them by option \-\-norock. .TP \fB\-rock\fR .br Alias of \-R. .TP \fB\-r\fR .br Enable Rock Ridge and set user and group id of all files in the ISO image to 0. Grant r\-permissions to all. Deny all w\-permissions. If any x\-permission is set, grant x\-permission to all. Remove s\-bit and t\-bit. .br These attribute changes stay delayed until mkisofs emulation ends. Within the same \-as mkisofs emulation command they can be revoked by a subsequent option \-\-norock. For compatibility reasons, option \-R does not revoke the changes ordered by \-r. .TP \fB\-rational-rock\fR Alias of \-r. .TP \fB--norock\fR .br This option disables the production of Rock Ridge extensions for the ISO 9660 file objects. The multi\-session capabilities of \fBxorrisofs\fR depend much on the naming fidelity of Rock Ridge. So it is strongly discouraged to disable it by this option, except for the special use case to revoke the effect of \-r by: \-\-norock \-R .TP \fB--set_all_file_dates\fR timestring Set mtime, atime, and ctime of all files and directories to the given time. .br Valid timestring formats are: 'Nov 8 14:51:13 CET 2007', 110814512007.13, 2007110814511300. See also \-\-modification\-date= and man xorriso, Examples of input timestrings. .br If the timestring is "set_to_mtime", then the atime and ctime of each file and directory get set to the value found in their mtime. .br These actions stay delayed until actual ISO production begins. Up to then they can be revoked by \-\-set_all_file_dates with empty timestring or timestring "default". .br The timestamps of the El Torito boot catalog file get refreshed when the ISO is produced. They can be influenced by \-\-modification\-date=. .TP \fB\-file_name_limit\fR number Set the maximum permissible length for file names in the range of 64 to 255. Path components which are longer than the given number will get truncated and have their last 33 bytes overwritten by a colon ':' and the hex representation of the MD5 of the first 4095 bytes of the whole oversized name. Potential incomplete UTF\-8 characters will get their leading bytes replaced by '_'. .br Linux kernels up to at least 4.1 misrepresent names of length 254 and 255. If you expect such names in or under disk_paths and plan to mount the ISO by such Linux kernels, consider to set \-file_name_limit 253. .TP \fB\-D\fR The standard ECMA\-119 demands that no path in the image shall have more than 8 name components or 255 characters. Therefore it would be necessary to move deeper directory trees to a higher directory. Rock Ridge offers an opportunity to let these relocated directories appear at their original deep position, but this feature might not be implemented properly by operating systems which mount the image. .br Option \-D disables this deep directory relocation, and thus violates ISO 9660 specs. .br xorrisofs has \-D set by default. If given explicitly then it overrides the options \-rr_reloc_dir and \-hide\-rr\-moved. .TP \fB\-disable-deep-relocation\fR Alias of \-D. .TP \fB\-rr_reloc_dir\fR name Enable the relocation of deep directories and thus avoid ECMA\-119 file paths of more than 8 name components or 255 characters. Directories which lead to such file paths will get moved to a directory in the root directory of the image. Its name gets set by this option. It is permissible to use the root directory itself. .br The overall directory tree will appear originally deep when interpreted as Rock Ridge tree. It will appear as re\-arranged if only ECMA\-119 information is considered. .br If the given relocation target directory does not already exist when image production begins, then it will get created and marked for Rock Ridge as relocation artefact. At least on GNU/Linux it will not be displayed in mounted Rock Ridge images. .br The name must not contain a '/' character after its first character and it must not be longer than 255 bytes. .br This option has no effect if option \-D is present. .TP \fB\-hide-rr-moved\fR Alias of \-rr_reloc_dir "/.rr_moved" .TP \fB--for_backup\fR Enable all options which improve backup fidelity: .br \-\-acl, \-\-xattr\-any, \-\-md5, \-\-hardlinks. .br If you later restore a backup with xattr from non\-user namespaces, then make sure that the target operating system and filesystem know what these attributes mean. Possibly you will need administrator privileges to record or restore such attributes. At recording time, xorriso will try to tolerate missing privileges and just record what is readable. .br Option \-xattr after option \-for_backup excludes non\-user attributes from being recorded. .TP \fB--acl\fR .br Enable recording and loading of ACLs from GNU/Linux or FreeBSD (see man getfacl, man acl). They will not be in effect with mounted ISO images. But xorriso can restore them on the same systems when extracting files from the ISO image. .TP \fB--xattr\fR .br Enable recording and loading of GNU/Linux or FreeBSD extended attributes in user namespace (see man getfattr and man attr, man getextattr and man 9 extattr, respectively). They will not be in effect with mounted ISO images. But xorriso can restore them on the same systems when extracting files from the ISO image. .TP \fB--xattr-any\fR .br Enable recording and loading of GNU/Linux or FreeBSD extended attributes in all namespaces. This might need administrator privileges, even if the owner of the disk file tries to read the attributes. .TP \fB--md5\fR .br Enable recording of MD5 checksums for the overall ISO image and for each single data file in the image. xorriso can check the content of an ISO image with these sums and raise alert on mismatch. See man xorriso, options \-check_media, check_md5_r. xorriso can print recorded MD5 checksums. E.g. by: .br \-find / \-exec get_md5 .TP \fB--hardlinks\fR Enable loading and recording of hardlink relations. Search for families of iso_rr files which stem from the same disk file, have identical content filtering and have identical properties. The members of each family get the same inode number in the ISO image. .br Whether these numbers are respected at mount time depends on the operating system. xorriso can create hardlink families when extracting files from the ISO image. .TP \fB--scdbackup_tag\fR disk_path record_name Append a scdbackup checksum record to the image. This works only if the parameter next_writeable_address of option \-C is 0 and \-\-md5 is enabled. If disk_path is not an empty string, then append a scdbackup checksum record to the end of this file. record_name is a word that gets part of tag and record. .br Program scdbackup_verify will recognize and verify tag and file record. .br An empty record_name disables this feature. .TP \fB\-J\fR .br Enable the production of an additional Joliet directory tree along with the ISO 9660 Rock Ridge tree. .TP \fB\-joliet\fR Alias of \-J. .TP \fB\-joliet-long\fR Allow 103 characters in Joliet file names rather than 64 as is prescribed by the specification. Allow Joliet paths longer than the prescribed limit of 240 characters. .br Oversized names get truncated. Without this option, oversized paths get excluded from the Joliet tree. .TP \fB\-joliet-utf16\fR Encode Joliet file names in UTF\-16BE rather than UCS\-2. The difference is with characters which are not present in UCS\-2 and get encoded in UTF\-16 by 2 words of 16 bit each. Both words then stem from a reserved subset of UCS\-2. .TP \fB\-hfsplus\fR Enable the production of an additional HFS+ filesystem inside the ISO 9660 image and mark it by Apple Partition Map (APM) entries in the System Area, the first 32 KiB of the image. .br This may collide with options like \-G or \-isohybrid\-mbr which submit user data for inclusion in the same address range. The first 8 bytes of the System Area get overwritten by { 0x45, 0x52, 0x08 0x00, 0xeb, 0x02, 0xff, 0xff } which can be executed as x86 machine code without negative effects. So if an MBR gets combined with this feature, then its first 8 bytes should contain no essential commands. .br The next blocks of 2 KiB in the System Area will be occupied by APM entries. The first one covers the part of the ISO image before the HFS+ filesystem metadata. The second one marks the range from HFS+ metadata to the end of file content data. If more ISO image data follow, then a third partition entry gets produced. Other features of xorriso might cause the need for more APM entries. .br Be aware that HFS+ is case\-insensitive although it can record file names with upper\-case and lower\-case letters. Therefore, file names from the iso_rr name tree may collide in the HFS+ name tree. In this case they get changed by adding underscore characters and counting numbers. In case of very long names, it might be necessary to map them to "MANGLED_...". .br WARNING: .br The HFS+ implementation in libisofs has a limit of 125,829,120 bytes for the size of the overall directory tree. This suffices for about 300,000 files of normal name length. If the limit gets exceeded, a FAILURE event will be issued and the ISO production will not happen. .TP \fB\-hfsplus-serial-no\fR Set a string of 16 digits "0" to "9" and letters "a" to "f", which will be used as unique serial number of an emerging HFS+ filesystem. .TP \fB\-hfsplus-block-size\fR number Set the allocation block size to be used when producing HFS+ filesystems. Permissible are 512, 2048, or 0. The latter lets the program decide. .TP \fB\-apm-block-size\fR number Set the block size to be used when describing partitions by an Apple Partition Map. Permissible are 512, 2048, or 0. The latter lets the program decide. .br Note that size 512 is not compatible with production of GPT, and that size 2048 will not be mountable \-t hfsplus at least by older Linux kernels. .TP \fB\-hfsplus-file-creator-type\fR creator type iso_rr_path Set the HFS+ creator and type attributes of a file in the emerging image. These are two codes of 4 characters each. .TP \fB\-hfs-bless-by\fR blessing iso_rr_path Issue a HFS+ blessing. They are roles which can be attributed to up to four directories and a data file: .br "ppc_bootdir", "intel_bootfile", "show_folder", "os9_folder", "osx_folder". .br They may be abbreviated as "p", "i", "s", "9", and "x". .br Each such role can be attributed to at most one file object. "intel_bootfile" is the one that would apply to a data file. All others apply to directories. No file object can bear more than one blessing. .TP \fB\-hfs-bless\fR disk_path Issue HFS+ blessing "ppc_bootdir" to the directory which stems from the directory disk_path in the local filesystem tree. .br This works only if there is at least one data file underneath the directory. disk_path can become ambiguous if files from different local filesystem sub\-trees are put into the same sub\-tree of the ISO image. Consider to use \-hfs\-bless\-by "p" for unambiguous addressing via iso_rr_path. .TP .B Settings for file hiding: .TP \fB\-hide\fR disk_path_pattern Make files invisible in the directory tree of ISO 9660 and Rock Ridge, if their disk_path matches the given shell parser pattern. The data content of such hidden files will be included in the resulting image, even if they do not show up in any directory. But you will need own means to find nameless data in the image. .br This command does not apply to the boot catalog. .TP \fB\-hide-list\fR disk_path Perform \-hide using each line out of file disk_path as argument disk_path_pattern. .TP \fB\-hide-joliet\fR disk_path_pattern Like option \-hide but making files invisible in the directory tree of Joliet, if their disk_path matches the given shell parser pattern. .TP \fB\-hide-joliet-list\fR disk_path Perform \-hide\-joliet using each line out of file disk_path as argument disk_path_pattern. .TP \fB\-hide-hfsplus\fR disk_path_pattern Like option \-hide but making files invisible in the directory tree of HFS+, if their disk_path matches the given shell parser pattern. .TP \fB\-hide-hfsplus-list\fR disk_path Perform \-hide\-hfsplus using each line out of file disk_path as argument disk_path_pattern. .TP .B ISO image ID strings: .PP The following strings and file addresses get stored in the Primary Volume Descriptor of the ISO9660 image. The file addresses are ISO 9660 paths. These files should have iso_rr_paths which consist only of the characters [A\-Z0\-9_] and exactly one dot which separates at most 8 characters from at most 3 characters. .TP \fB\-V\fR text Set the Volume Id of the ISO image. xorriso accepts any text up to 32 characters, but according to rarely obeyed specs stricter rules apply: .br Conformant are ASCII characters out of [A\-Z0\-9_]. Like: "IMAGE_23" .br Joliet allows 16 UCS\-2 characters. Like: "Windows name" .br Be aware that the volume id might get used automatically as name of the mount point when the medium is inserted into a playful computer system. .TP \fB\-volid\fR text Alias of \-V. .TP \fB\-volset\fR text Set the Volume Set Id of the ISO image. Permissible are up to 128 characters. .TP \fB\-P\fR text Set the Publisher Id of the ISO image. This may identify the person or organisation who specified what shall be recorded. Permissible are up to 128 characters. .TP \fB\-publisher\fR text Alias of \-P. .TP \fB\-A\fR text Set the Application Id of the ISO image. This may identify the specification of how the data are recorded. Permissible are up to 128 characters. .br The special text "@xorriso@" gets converted to the id string of xorriso which is normally written as Preparer Id. It is a wrong tradition to write the program id as Application Id. .TP \fB\-appid\fR text Alias of \-A. .TP \fB\-sysid\fR text Set the System Id of the ISO image. This may identify the system which can recognize and act upon the content of the System Area in image blocks 0 to 15. Permissible are up to 32 characters. .TP \fB\-p\fR text Set the Preparer Id of the ISO image. This may identify the person or other entity which controls the preparation of the data which shall be recorded. Normally this should be the id of xorriso and not of the person or program which operates xorriso. Please avoid to change it. Permissible are up to 128 characters. .br The special text "@xorriso@" gets converted to the id string of xorriso which is default at program startup. .TP \fB\-preparer\fR text Alias of \-p. .TP \fB\-abstract\fR iso_path Set the address of the Abstract File of the ISO image. This should be the ISO 9660 path of a file in the image which contains an abstract statement about the image content. Permissible are up to 37 characters. .TP \fB\-biblio\fR iso_path Set the address of the Biblio File of the ISO image. This should be the ISO 9660 path of a file in the image which contains bibliographic records. Permissible are up to 37 characters. .TP \fB\-copyright\fR iso_path Set the address of the Copyright File of the ISO image. This should be the ISO 9660 path of a file in the image which contains a copyright statement. Permissible are up to 37 characters. .TP \fB--modification-date=YYYYMMDDhhmmsscc\fR Set a timestring that overrides ISO image creation and modification timestamps literally. It must consist of 16 decimal digits which form YYYYMMDDhhmmsscc, with YYYY between 1970 and 2999. Time zone is GMT. It is supposed to match this GRUB line: .br search \-\-fs\-uuid \-\-set YYYY\-MM\-DD\-hh\-mm\-ss\-cc .br E.g. 2010040711405800 is 7 Apr 2010 11:40:58 (+0 centiseconds). .br Among the influenced timestamps are: isohybrid MBR id, El Torito boot catalog file, HFS+ superblock. .TP \fB--application_use\fR character|0xXY|disk_path Specify the content of the Application Use field which can take at most 512 bytes. .br If the parameter of this command is empty, then the field is filled with 512 0\-bytes. If it is a single character, then it gets repeated 512 times. If it begins by "0x" followed by two hex digits [0\-9a\-fA\-F], then the digits are read as byte value which gets repeated 512 times. .br Any other parameter text is used as disk_path to open a data file and to read up to 512 bytes from it. If the file is smaller than 512 bytes, then the remaining bytes in the field get set to binary 0. .TP .B El Torito Bootable ISO images: .PP The precondition for a bootable ISO image is to have in the ISO image the files of a boot loader. The boot facilities of computers get directed to such files, which usually execute further program files from the ISO image. \fBxorrisofs\fR can produce several kinds of boot block or boot record, which become part of the ISO image, and get interpreted by the according boot facility. .br .PP An \fBEl Torito\fR boot record points the bootstrapping facility to a boot catalog with one or more boot images, which are binary program files stored in the ISO image. The content of the boot image files is not in the scope of El Torito. .br xorriso composes the boot catalog according to the boot image files given and structured by options \-b, \-e, \-eltorito\-alt\-boot, and \-\-efi\-boot. Often it contains only one entry. .br Normally the boot images are data files inside the ISO filesystem. By special path "\-\-interval:appended_partition_NNN:all::" it is possible to refer to an appended partition. The number NNN gives the partition number as used with the corresponding option \-append_partition. E.g.: .br \-append_partition 2 0xef /tmp/efi.img .br \-e \-\-interval:appended_partition_2:all:: .br El Torito gets interpreted by boot facilities PC\-BIOS and EFI. Most bootable GNU/Linux CDs are equipped with ISOLINUX or GRUB boot images for PC\-BIOS. .br \fBxorrisofs\fR supports the example options out of the ISOLINUX wiki, the options used in GRUB script grub\-mkrescue, and the example in the FreeBSD AvgLiveCD wiki. .br .PP For CD booting via boot facilities other than PC\-BIOS and EFI, and for booting from USB sticks or hard disks, see the next section about the System Area. .br .TP \fB\-b\fR iso_rr_path Specify the boot image file which shall be mentioned in the current entry of the El Torito boot catalog. It will be marked as suitable for PC\-BIOS. .br With boot images from ISOLINUX and GRUB this option should be accompanied by options \-c , \-no\-emul\-boot , \-boot\-load\-size 4 , \-boot\-info\-table. .TP \fB\-eltorito-boot\fR iso_rr_path Alias of \-b. .TP \fB\-eltorito-alt-boot\fR Finalize the current El Torito boot catalog entry and begin a new one. A boot image file and all its necessary options shall be specified before option \-eltorito\-alt\-boot. All further El Torito boot options apply to the new catalog entry. Up to 32 catalog entries are possible. .TP \fB\-e\fR iso_rr_path Specify the boot image file which shall be mentioned in the current entry of the El Torito boot catalog. It will be marked as suitable for EFI. .br Option \-e should be followed by option \-no\-emul\-boot and no other El Torito options before an eventual \-eltorito\-alt\-boot. .TP \fB--efi-boot\fR iso_rr_path Perform \-eltorito\-alt\-boot, option \-e with the given iso_rr_path, \-no\-emul\-boot, and again \-eltorito\-alt\-boot. This gesture is used for achieving EFI\-bootability of the GRUB2 rescue CD. .TP \fB\-eltorito-platform\fR "x86"|"PPC"|"Mac"|"efi"|0xnn|nnn Set the Platform Id number for the next option \-b or \-eltorito\-boot. The number may be chosen by a platform name or by a number between 0 and 255 (0x00 and 0xFF). "x86" = 0 is for PC\-BIOS, "PPC" = 1 for some PowerPC systems, "Mac" = 2 for some MacIntosh systems, "efi" = 0xEF for EFI on modern PCs with x86 compatible CPUs or others. .br If the new platform id differs from the previous one, \-eltorito\-alt\-boot gets performed. .TP \fB\-boot-load-size\fR number|"full" Set the number of 512\-byte blocks to be loaded at boot time from the boot image in the current catalog entry. .br Non\-emulating BIOS bootimages usually need a load size of 4. Nevertheless the default setting of mkisofs is to use the full size of the boot image rounded up to a multiple of 4 512\-byte blocks. This default may be explicitly enforced by the word "full" instead of a number. .br EFI boot images usually get set the number of blocks occupied by the boot image file. .br El Torito cannot represent load sizes higher than 65535. .TP \fB\-hard-disk-boot\fR Mark the boot image in the current catalog entry as emulated hard disk. (Not suitable for any known boot loader.) .TP \fB\-no-emul-boot\fR Mark the boot image in the current catalog entry as not emulating floppy or hard disk. (This is to be used with all known boot loaders.) .br If neither \-hard\-disk\-boot nor \-no\-emul\-boot is given, then the boot image will be marked as emulating a floppy. (Not suitable for any known boot loader.) .TP \fB\-eltorito-id\fR text|56_hexdigits Define the ID string of the boot catalog section where the boot image will be listed. If the value consists of 56 characters [0\-9A\-Fa\-f] then it is converted into 28 bytes, else the first 28 characters become the ID string. The ID string of the first boot image becomes the overall catalog ID. It is limited to 24 characters. Other id_strings become section IDs. .TP \fB\-eltorito-selcrit\fR hexdigits Define the Selection Criteria of the boot image. Up to 20 bytes get read from the given characters [0\-9A\-Fa\-f]. They get attributed to the boot image entry in the catalog. .TP \fB\-boot-info-table\fR Overwrite bytes 8 to 63 in the current boot image. The information will be supplied by xorriso in the course of image production: Block address of the Primary Volume Descriptor, block address of the boot image file, size of the boot image file. .TP \fB--grub2-boot-info\fR Overwrite bytes 2548 to 2555 in the current boot image by the address of that boot image. The address is written as 64 bit little\-endian number. It is the 2KB block address of the boot image content, multiplied by 4, and then incremented by 5. .TP \fB\-c\fR iso_rr_path Set the address of the El Torito boot catalog file within the image. This file address is not significant for the booting PC\-BIOS or EFI, but it may later be read by other programs in order to learn about the available boot images. .TP \fB\-eltorito-catalog\fR iso_rr_path Alias of \-c. .TP \fB--boot-catalog-hide\fR Prevent the El Torito boot catalog from appearing as file in the directory trees of the image. .TP .B System Area, MBR, GPT, APM, other boot blocks: .PP The first 16 blocks of an ISO image are the System Area. It is reserved for system dependent boot software. This may be the boot facilities and partition tables of various hardware architectures. .br A \fBMBR\fR (Master Boot Record) contains boot code and a partition table. It is read by PC\-BIOS when booting from USB stick or hard disk, and by PowerPC CHRP or PReP when booting. An MBR partition with type 0xee indicates the presence of GPT. .br A \fBGPT\fR (GUID Partition Table) marks partitions in a more modern way. It is read by EFI when booting from USB stick or hard disk, and may be used for finding and mounting a HFS+ partition inside the ISO image. .br An \fBAPM\fR (Apple Partition Map) marks the HFS+ partition. It is read by Macs for booting and for mounting. .br MBR, GPT and APM are combinable. APM occupies the first 8 bytes of MBR boot code. All three do not hamper El Torito booting from CDROM. .br \fBxorrisofs\fR supports further boot facilities: MIPS Big Endian (SGI), MIPS Little Endian (DEC), SUN SPARC, HP\-PA, DEC Alpha. Those are mutually not combinable and also not combinable with MBR, GPT, or APM. .PP Several of the following options expect disk paths as input but also accept description strings for the libisofs interval reader, which is able to cut out data from disk files or \-indev and to zeroize parts of the content: \-G, \-generic\-boot, \-\-embedded\-boot, \-\-grub2\-mbr, \-isohybrid\-mbr, \-efi\-boot\-part, \-prep\-boot\-part, \-B, \-sparc\-boot, \-append_partition. .br The description string consists of the following components, separated by colon ':' .br "\-\-interval:"Flags":"Interval":"Zeroizers":"Source .br The component "\-\-interval" states that this is not a plain disk path but rather a interval reader description string. .br The component Flags modifies the further interpretation: .br "local_fs" demands to read from a file depicted by the path in Source. .br "imported_iso" demands to read from the \-indev. This works only if \-outdev is not the same as \-indev. The Source component is ignored. .br "appended_partition_NNN" with a decimal number NNN works only for options which announce El Torito boot image paths: \-b, \-e, \-\-efi\-boot. The number gives the partition number as used with the corresponding option \-append_partition. .br The component Interval consists of two byte address numbers separated by a "\-" character. E.g. "0\-429" means to read bytes 0 to 429. .br The component Zeroizers consists of zero or more comma separated strings. They define which part of the read data to zeroize. Byte number 0 means the byte read from the Interval start address. Each string may be one of: .br "zero_mbrpt" demands to zeroize the MBR partition table if bytes 510 and 511 bear the MBR signature 0x55 0xaa. .br "zero_gpt" demands to check for a GPT header in bytes 512 to 1023, to zeroize it and its partition table blocks. .br "zero_apm" demands to check for an APM block 0 and to zeroize its partition table blocks. .br Start_byte"\-"End_byte demands to zeroize the read\-in bytes beginning with number Start_byte and ending after End_byte. .br The component Source is the file path with flag "local_fs", and ignored with flag "imported_iso". .br Byte numbers may be scaled by a suffix out of {k,m,g,t,s,d} meaning multiplication by {1024, 1024k, 1024m, 1024g, 2048, 512}. A scaled value end number depicts the last byte of the scaled range. .br E.g. "0d\-0d" is "0\-511". .br Examples: .br "local_fs:0\-32767:zero_mbrpt,zero_gpt,440\-443:/tmp/template.iso" .br "imported_iso:45056d\-47103d::" .br .TP \fB\-G\fR disk_path Copy at most 32768 bytes from the given disk file to the very start of the ISO image. .br Other than a El Torito boot image, the file disk_path needs not to be added to the ISO image. It will not show up as file in the directory trees. .br In multi\-session situations, the special disk_path "." prevents reading of a disk file but nevertheless causes the adjustments in the existing MBR, which were ordered by other options. .TP \fB\-generic-boot\fR disk_path Alias of \-G. .TP \fB--embedded-boot\fR disk_path Alias of \-G. .TP \fB--grub2-mbr\fR disk_path Install disk_path in the System Area and treat it as modern GRUB2 MBR. The content start address of the first boot image is converted to a count of 512 byte blocks, and an offset of 4 is added. The result is written as 64 bit little\-endian number to byte address 0x1b0. .TP \fB\-isohybrid-mbr\fR disk_path Install disk_path as ISOLINUX isohybrid MBR which makes the boot image given by option \-b bootable from USB sticks and hard disks via PC\-BIOS. This preparation is normally done by ISOLINUX program isohybrid on the already produced ISO image. .br The disk path should lead to one of the Syslinux files isohdp[fp]x*.bin . The MBR gets patched according to isohybrid needs. The first partition describes the range of the ISO image. Its start is at block 0 by default, but may be set to 64 disk blocks by option \-partition_offset 16. .br For the meaning of special disk_path "." see option \-G. .TP \fB\-isohybrid-gpt-basdat\fR Mark the current El Torito boot image (see options \-b and \-e) in an actually invalid GPT as partition of type Basic Data. This works only with \-isohybrid\-mbr and has the same impact on the system area as \-efi\-boot\-part. It cannot be combined with \-efi\-boot\-part or \-hfsplus. .br The first three boot images which are marked by GPT will also show up as partition entries in MBR. The MBR partition of type 0xEF is what actually is used by EFI firmware for booting from USB stick. The MBR partition for PC\-BIOS gets type 0x00 rather than 0x17 in this case. Often the further MBR entries are the ones which actually get used by EFI. .TP \fB\-isohybrid-gpt-hfsplus\fR Mark the current El Torito boot image (see options \-b and \-e) in GPT as partition of type HFS+. Impact and restrictions are like with \-isohybrid\-gpt\-basdat. .TP \fB\-isohybrid-apm-hfsplus\fR Mark the current El Torito boot image (see options \-b and \-e) in Apple Partition Map as partition of type HFS+. This works only with \-isohybrid\-mbr and has a similar impact on the system area as \-hfsplus. It cannot be combined with \-efi\-boot\-part or \-hfsplus. .br The ISOLINUX isohybrid MBR file must begin by a known pattern of 32 bytes of x86 machine code which essentially does nothing. It will get overwritten by 32 bytes of APM header mock\-up. .TP \fB\-part_like_isohybrid\fR Control whether \-isohybrid\-gpt\-basdat, \-isohybrid\-gpt\-hfsplus, and \-isohybrid\-apm\-hfsplus apply even if not \-isohybrid\-mbr is present. No MBR partition of type 0xee emerges, even if GPT gets produced. Gaps between GPT and APM partitions will not be filled by more partitions. Appended partitions get mentioned in APM if other APM partitions emerge. .TP \fB\-iso_mbr_part_type\fR "default"|number|type_guid Set the partition type of the MBR or GPT partition which represents the ISO or at least protects it. .br Number may be 0x00 to 0xff. The text "default" re\-enables the default types of the various occasions to create an ISO MBR partition. This is without effect if no such partition emerges by other settings or if the partition type is prescribed mandatorily like 0xee for GPT protective MBR or 0x96 for CHRP. .br If instead a type_guid is given by a 32\-digit hex string like a2a0d0ebe5b9334487c068b6b72699c7 or by a structured text like EBD0A0A2\-B9E5\-4433\-87C0\-68B6B72699C7, then it will be used as partition type if the ISO filesystem appears as partition in GPT. In MBR, C12A7328\-F81F\-11D2\-BA4B\-00A0C93EC93B will be mapped to 0xef. Any other GUID will be mapped to 0x83. .TP \fB--protective-msdos-label\fR Patch the System Area by a simple PC\-DOS partition table where partition 1 claims the range of the ISO image but leaves the first block unclaimed. This is mutally exclusive to option \-isohybrid\-mbr. .TP \fB--mbr-force-bootable\fR Enforce an MBR partition with "bootable/active" flag if options like \-\-protective\-msdos\-label or \-\-grub2\-mbr are given. These options normally cause the flag to be set if there is an MBR partition of type other than 0xee or 0xef. If no such partition exists, then no bootflag is set, unless \-\-mbr\-force\-bootable forces creation of a dummy partition of type 0x00 which covers only the first block of the ISO image. .br If no bootable MBR is indicated by other options and a partition gets created by \-append_partition, then \-\-mbr\-force\-bootable causes a bootflag like it would do with e.g. \-\-protective\-msdos\-label. .TP \fB\-partition_offset\fR 2kb_block_adr Cause a partition table with a single partition that begins at the given block address. This is counted in 2048 byte blocks, not in 512 byte blocks. If the block address is non\-zero then it must be at least 16. Values larger than 16 are hardly of use. A non\-zero partition offset causes two superblocks to be generated and two sets of directory trees. The image is then mountable from its absolute start as well as from the partition start. .br The offset value of an ISO image gets preserved when a new session is added to a loaded image. So the value defined here is only in effect if a new ISO image gets written. .TP \fB\-partition_hd_cyl\fR number Set the number of heads per cylinder for the MBR partition table. 0 chooses a default value. Maximum is 255. .TP \fB\-partition_sec_hd\fR number Set the number of sectors per head for the MBR partition table. 0 chooses a default value. Maximum is 63. .br The product partition_sec_hd * partition_hd_cyl * 512 is the cylinder size. It should be divisible by 2048 in order to make exact alignment possible. With appended partitions and \-appended_part_as_gpt there is no limit for the number of cylinders. Else there may be at most 1024 of them. If the cylinder size is too small to stay below the limit, then appropriate values of partition_hd_cyl are chosen with partition_sec_hd 32 or 63. If the image is larger than 8,422,686,720 bytes, then the cylinder size constraints cannot be fulfilled for MBR. They seem not overly important anyway. Flat block addresses in partition tables are good for 1 TiB. .TP \fB\-partition_cyl_align\fR mode Control image size alignment to an integer number of cylinders. It is prescribed by isohybrid specs and it seems to please program fdisk. Cylinder size must be divisible by 2048. Images larger than 8,323,596,288 bytes cannot be aligned in MBR partition table. .br Mode "auto" is default. Alignment by padding happens only if option \-isohybrid\-mbr is given. .br Mode "on" causes alignment by padding with option \-\-protective\-msdos\-label too. Mode "all" is like "on" but also pads up partitions from \-append_partition to an aligned size. .br Mode "off" disables alignment unconditionally. .TP \fB\-append_partition\fR partition_number type_code disk_path Cause a prepared filesystem image to be appended to the ISO image and to be described by a partition table entry in a boot block at the start of the emerging ISO image. The partition entry will bear the size of the submitted file rounded up to the next multiple of 2048 bytes or to the next multiple of the cylinder size. .br Beware of subsequent multi\-session runs. The appended partition will get overwritten. .br partition_number may be 1 to 4. Number 1 will put the whole ISO image into the unclaimed space before partition 1. So together with most xorriso MBR or GPT features, number 2 would be the most natural choice. .br The type_code may be "FAT12", "FAT16", "Linux", or a hexadecimal number between 0x00 and 0xff. Not all those numbers will yield usable results. For a list of codes search the Internet for "Partition Types" or run fdisk command "L". If the partition appears in GPT then type_code 0xef is mapped to the EFI System Partition Type GUID. All others get mapped to Basic Data Type GUID. .br type_code may also be a type GUID as plain hex string like a2a0d0ebe5b9334487c068b6b72699c7 or as structured text like EBD0A0A2\-B9E5\-4433\-87C0\-68B6B72699C7. It will be used if the partition is mentioned in GPT. In MBR, C12A7328\-F81F\-11D2\-BA4B\-00A0C93EC93B will be mapped to 0xef. Any other GUID will be mapped to 0x83. In APM, 48465300\-0000\-11AA\-AA11\-00306543ECAC will be mapped to partition type "Apple_HFS", any other to "Data". .br If some other command causes the production of GPT, then the appended partitions will be mentioned there too, even if not \-appended_part_as_gpt is given. .TP \fB\-appended_part_as_gpt\fR Marks partitions from \-append_partition in GPT rather than in MBR. In this case the MBR shows a single partition of type 0xee which covers the whole output data. .br By default, appended partitions get marked in GPT only if GPT is produced because of other options. .TP \fB\-appended_part_as_apm\fR Marks partitions from \-append_partition in Apple Partition Map, too. .br By default, appended partitions get marked in APM only if APM is produced because of other options and \-part_like_isohybrid is enabled. .TP \fB\-efi-boot-part\fR disk_path Copy a file from disk into the emerging ISO image and mark it by a GPT entry as EFI System Partition. EFI boot firmware is supposed to use a FAT filesystem image in such a partition for booting from USB stick or hard disk. .br Instead of a disk_path, the word \-\-efi\-boot\-image may be given. It exposes in GPT the content of the first El Torito EFI boot image as EFI system partition. EFI boot images are introduced by options \-e or \-\-efi\-boot. The affected EFI boot image cannot show up in HFS+ because it is stored outside the HFS+ partition. .TP \fB--gpt_disk_guid\fR value Control whether an emerging GPT shall get a randomly generated disk GUID or whether the GUID is supplied by the user. Value "random" is default. Value "modification\-date" produces a low quality GUID from the value set by option \-\-modification\-date=. .br A string of 32 hex digits, or a RFC 4122 compliant GUID string may be used to set the disk GUID directly. UEFI prescribes the first three components of a RFC 4122 GUID string to be byte\-swapped in the binary representation: .br E.g. \-\-gpt_disk_guid 2303cd2a\-73c7\-424a\-a298\-25632da7f446 equals \-\-gpt_disk_guid 2acd0323c7734a42a29825632da7f446 .br The partition GUIDs get generated by minimally varying the disk GUID. .TP \fB\-chrp-boot-part\fR Mark the block range of the whole emerging ISO image as MBR partition of type 0x96. This is not compatible with any other feature that produces MBR partition entries. It makes GPT unrecognizable. .br CHRP is often used in conjunction with HFS. It is not yet tested whether HFS+ filesystems produced with option \-hfsplus would boot on any CHRP capable machine which does not boot pure ISO 9660 as well. .TP \fB\-chrp-boot\fR Alias of \-chrp\-boot\-part. .TP \fB\-prep-boot-part\fR disk_path Copy a file from disk into the emerging ISO image and mark it by a MBR partition entry of type 0x41. PReP boot firmware is supposed to read the content of the partition as single ELF executable file. This option is compatible with other MBR partitions and with GPT. .TP \fB\-mips-boot\fR iso_rr_path Declare a data file in the image to be a MIPS Big Endian boot file and cause production of a MIPS Big Endian Volume Header. This is mutually exclusive with production of other boot blocks like MBR. It will overwrite the first 512 bytes of any data provided by \-G. Up to 15 boot files can be declared by multiple \-mips\-boot options. .TP \fB\-mipsel-boot\fR iso_rr_path Declare a data file in the image to be the MIPS Little Endian boot file. This is mutually exclusive with other boot blocks. It will overwrite the first 512 bytes of any data provided by \-G. Only a single boot file can be declared by \-mipsel\-boot. .TP \fB\-B\fR disk_path[,disk_path ...] Cause one or more data files on disk to be written after the end of the ISO image. A SUN Disk Label will be written into the first 512 bytes of the ISO image which lists this image as partition 1 and the given disk_paths as partition 2 up to 8. .br The disk files should contain suitable boot images for SUN SPARC systems. .br The pseudo disk_path "..." causes that all empty partition entries become copies of the last non\-empty entry. If no other disk_path is given before "..." then all partitions describe the ISO image. In this case, the boot loader code has to be imported by option \-G. .TP \fB\-sparc-boot\fR disk_path[,disk_path ...] Alias of \-B. .TP \fB\-sparc-label\fR text Set the ASCII label text of a SUN Disk Label. .TP \fB--grub2-sparc-core\fR iso_rr_path Cause the content address and size of the given data file in the image to be written after the SUN Disk Label. Both numbers are counted in bytes. The address is written as 64 bit big\-endian number to byte 0x228. The size is written as 32 bit big\-endian number to byte 0x230. .TP \fB\-hppa-cmdline\fR text Set the PALO command line for HP\-PA. Up to 1023 characters are permitted by default. With \-hppa\-hdrversion 4 the limit is 127. .br Note that the first five \-hppa options are mandatory, if any of the \-hppa options is given. Only option \-hppa\-hdrversion is allowed to be missing. .TP \fB\-hppa-bootloader\fR iso_rr_path Designate the given path as HP\-PA bootloader file. .TP \fB\-hppa-kernel-32\fR iso_rr_path Designate the given path as HP\-PA 32 bit kernel file. .TP \fB\-hppa-kernel-64\fR iso_rr_path Designate the given path as HP\-PA 64 bit kernel file. .TP \fB\-hppa-ramdisk\fR iso_rr_path Designate the given path as HP\-PA RAM disk file. .TP \fB\-hppa-hdrversion\fR number Choose between PALO header version 5 (default) and version 4. For the appropriate value see in PALO source code: PALOHDRVERSION. .TP \fB\-alpha-boot\fR iso_rr_path Declare a data file in the image to be the DEC Alpha SRM Secondary Bootstrap Loader and cause production of a boot sector which points to it. This is mutually exclusive with production of other boot blocks like MBR. .TP .B Character sets: .PP Character sets should not matter as long as only english alphanumeric characters are used for file names or as long as all writers and readers of the medium use the same character set. Outside these constraints it may be necessary to let xorriso convert byte codes. .br A conversion from input character set to the output character set is performed when an ISO image gets written. Vice versa there is a conversion from output character set to the input character set when an ISO image gets loaded. The sets can be defined by options \-input\-charset and \-output\-charset, if needed. .br .TP \fB\-input-charset\fR character_set_name Set the character set from which to convert disk file names when inserting them into the ISO image. .TP \fB\-output-charset\fR character_set_name Set the character set from which to convert names of loaded ISO images and to which to convert names when writing ISO images. .TP .B Jigdo Template Extraction: .PP From man genisoimage: "Jigdo is a tool to help in the distribution of large files like CD and DVD images; see http://atterer.net/jigdo/ for more details. Debian CDs and DVD ISO images are published on the web in jigdo format to allow end users to download them more efficiently." .br If the use of libjte was enabled at compile time of xorriso, then \fBxorrisofs\fR can produce a .jigdo and a .template file together with a single\-session ISO image. If not, then Jigdo options will cause a FAILURE event, which normally leads to program abort. .br One may determine the ability for Jigdo by: .br $ xorrisofs \-version 2>&1 | grep '^libjte' && echo YES .br .PP The .jigdo file contains checksums and symbolic file addresses. The .template file contains the compressed ISO image with reference tags instead of the content bytes of the listed files. .br Input for this process are the normal arguments for a \fBxorrisofs\fR session with no image loaded, and a checksum file which lists those data files which may be listed in the .jigdo file and externally referenced in the .template file. Each designated file is represented in the checksum file by a single text line: .br Checksum as hex digits, 2 blanks, size as 12 decimal digits or blanks, 2 blanks, symbolic file address .br The kind of checksum is chosen by \-jigdo "checksum_algorithm" with values "md5" (32 hex digits) or "sha256" (64 hex digits). It will also be used for the file address lines in the .jigdo file. The default is "md5". .br The file address in a checksum file line has to bear the same basename as the disk_path of the file which it shall match. The directory path of the file address is decisive for To=From mapping, not for file recognition. After To=From mapping, the file address gets written into the .jigdo file. Jigdo restore tools will convert these addresses into really reachable data source addresses from which they can read. .br If the list of jigdo parameters is not empty, then padding will be counted as part of the ISO image. .br .TP \fB\-jigdo-checksum-algorithm\fR "md5"|"sha256" Set the checksum algorithm which shall be used for the data file entries in the .jigdo file and is expected in the checksum file. Default is "md5". .TP \fB\-jigdo-jigdo\fR disk_path Set the disk_path for the .jigdo file with the checksums and download addresses for filling the holes in .template. .TP \fB\-jigdo-template\fR disk_path Set the disk_path for the .template file with the holed and compressed ISO image copy. .TP \fB\-jigdo-min-file-size\fR size Set the minimum size for a data file to be listed in the .jigdo file and being a hole in the .template file. size may be a plain number counting bytes, or a number with appended letter "k", "m", "g" to count KiB (1024 bytes), MiB (1024 KiB), or GiB (1024 MiB). .TP \fB\-jigdo-force-checksum\fR disk_path_pattern adds a regular expression pattern which will get compared with the absolute disk_path of any data file that was not found in the checksum file. A match causes a MISHAP event, which normally does not abort the program run but finally causes a non\-zero exit value of the program. .TP \fB\-jigdo-force-md5\fR disk_path_pattern Outdated alias of \-jigdo\-force\-checksum. .TP \fB\-jigdo-exclude\fR disk_path_pattern Add a regular expression pattern which will get compared with the absolute disk_path of any data file. A match causes the file to stay in .template in any case. .TP \fB\-jigdo-map\fR To=From Add a string pair of the form To=From to the parameter list. If a data file gets listed in the .jigdo file, then it is referred by the file address from its line in the checksum file. This file address gets checked whether it begins with the From string. If so, then this string will be replaced by the To string and a ':' character, before it goes into the .jigdo file. The From string should end by a '/' character. .TP \fB\-checksum-list\fR disk_path Set the disk_path where to find the checksum file file with symbolic file addresses and checksums according to \-jigdo\-checksum\-algorithm. .TP \fB\-md5-list\fR disk_path Outdated alias of \-checksum\-list. .TP \fB\-jigdo-template-compress\fR "gzip"|"bzip2" Choose one of "bzip2" or "gzip" for the compression of the template file. The jigdo file is put out uncompressed. .TP \fB\-checksum_algorithm_iso\fR list_of_names Choose one or more of "md5", "sha1", "sha256", "sha512" for the auxiliary "# Image Hex" checksums in the .jigdo file. The list_of_names may e.g. look like "md5,sha1,sha512". Value "all" chooses all available algorithms. Note that MD5 stays always enabled. .TP \fB\-checksum_algorithm_template\fR list_of_names Choose the algorithms for the "# Template Hex" checksums in the .jigdo file. The rules for list_of_names are the same as with \-checksum_algorithm_iso. .TP .B Miscellaneous options: .TP \fB\-print-size\fR Print to stdandard output the foreseeable number of 2048 byte blocks in the emerging ISO image. Do not produce this image. .br The result depends on several settings. .br If option \-\-emul\-toc is given, then padding (see \-pad) is not counted as part of the image size. In this case either use \-no\-pad or add 150 (= 300 KiB) to the resulting number. .br If mkisofs emulation ends after option \-print\-size, then the properties of the most recently specified boot image file cannot be edited by subsequent xorriso commands. .TP \fB--no_rc\fR Only if used as first argument this option prevents reading and interpretation of startup files. See section FILES below. .TP \fB\-help\fR .br List supported options to stderr. Original mkisofs options bear their original mkisofs description texts. .TP \fB\-quiet\fR .br Suppress most messages of the program run, except those which indicate problems or errors. .TP \fB\-gui\fR .br Increase the frequency of pacifier messages while writing an ISO image. .TP \fB\-log-file\fR disk_path .br Truncate file disk_path to 0 size and redirect to it all messages which would normally appear on stderr. \-log\-file with empty text as disk_path re\-enables output to stderr. .TP \fB\-v\fR .br Enable the output of informational program messages. .TP \fB\-verbose\fR Alias of \-v. .TP \fB\-version\fR Print to standard output a text that begins with .br "mkisofs 2.01\-Emulation Copyright (C)" .br and to standard error the version information of xorriso. .br .SH EXAMPLES .SS .B Overview of examples: A simple image production run .br Set ISO image paths by -graft-points .br Perform multi-session runs .br Let xorrisofs work underneath growisofs .br Incremental backup of a few directory trees .br Incremental backup with accumulated trees .br Create bootable images for PC-BIOS and EFI .br .SS .B A simple image production run A prepared file tree in directory ./for_iso gets copied into the root directory of the ISO image. File permissions get set to read\-only for everybody. Joliet attributes for Microsoft systems get added. The resulting image gets written as data file ./image.iso on disk. .br $ xorrisofs \-r \-J \-o ./image.iso ./for_iso .SS .B Set ISO image paths by -graft-points Without option \-graft\-points each given disk file is copied into the root directory of the ISO image, maintaining its name. If a directory is given, then its files and sub\-directories are copied into the root directory, maintaining their names. .br $ xorrisofs ... /home/me/datafile /tmp/directory .br yields in the ISO image root directory: .br /datafile .br /file_1_from_directory .br ... .br /file_N_from_directory .br .sp 1 With option \-graft\-points it is possible to put files and directories to arbitrary paths in the ISO image. .br $ xorrisofs ... \-graft\-points /home/me/datafile /dir=/tmp/directory .br yields in the ISO image root directory: .br /datafile .br /dir .br Eventually needed parent directories in the image will be created automatically: .br /datafiles/file1=/home/me/datafile .br yields in the ISO image: .br /datafiles/file1 .br The attributes of directory /datafiles get copied from /home/me on disk. .br .sp 1 Normally one should avoid = and \\ characters in the ISO part of a pathspec. But if it must be, one may escape them: .br /with_\\=_and_\\\\/file=/tmp/directory/file .br yields in the ISO image: .br /with_=_and_\\/file .SS .B Perform multi-session runs This example works for multi\-session media only: CD\-R[W], DVD\-R[W], DVD+R, BD\-R. Add cdrskin option \-\-grow_overwriteable_iso to all \-as cdrecord runs in order to enable multi\-session emulation on overwritable media. .br The first session is written like this: .br $ xorrisofs \-graft\-points \\ .br /tree1=prepared_for_iso/tree1 \\ .br | xorriso \-as cdrecord \-v dev=/dev/sr0 blank=fast \-multi \-eject \- .br Follow\-up sessions are written like this (the run of dd is only to give demons a chance to spoil it): .br $ m=$(xorriso \-as cdrecord dev=/dev/sr0 \-msinfo) .br $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 .br $ xorrisofs \-M /dev/sr0 \-C $m \-graft\-points \\ .br /tree2=prepared_for_iso/tree2 \\ .br | xorriso \-as cdrecord \-v dev=/dev/sr0 \-waiti \-multi \-eject \- .br Always eject the drive tray between sessions. .br The run of xorriso \-as mkisofs will read old sessions via the CD\-ROM driver of /dev/sr0. This driver might not be aware of the changed content as long as the medium is not loaded again. In this case the previous session would not be properly assessed by xorriso and the new session would contain only the newly added files. .br Some systems have not enough patience with automatic tray loading and some demons may interfere with a first CD\-ROM driver read attempt from a freshly loaded medium. .br When loading the tray manually, wait 10 seconds after the drive has stopped blinking. .br A safe automatic way seems to be a separate run of xorriso for loading the tray with proper waiting, and a subsequent run of dd which shall offer itself to any problems caused by demons assessing the changed drive status. If this does not help, insert a run of "sleep 10" between xorriso and dd. .SS .B Let xorrisofs work underneath growisofs growisofs expects an ISO formatter program which understands options \-C and \-M. A variable is defined to override the hardcoded default name. .br $ export MKISOFS="xorrisofs" .br $ growisofs \-Z /dev/dvd /some/files .br $ growisofs \-M /dev/dvd /more/files .br If no "xorrisofs" is available on your system, then you will have to create a link pointing to the xorriso binary and tell growisofs to use it. E.g. by: .br $ ln \-s $(which xorriso) "$HOME/xorrisofs" .br $ export MKISOFS="$HOME/xorrisofs" .br One may quit mkisofs emulation by argument "\-\-" and make use of all xorriso commands. growisofs dislikes options which start with "\-o" but \-outdev must be set to "\-". So use "outdev" instead: .br $ growisofs \-Z /dev/dvd \-\-for_backup \-\- \\ .br outdev \- \-update_r /my/files /files .br $ growisofs \-M /dev/dvd \-\-for_backup \-\- \\ .br outdev \- \-update_r /my/files /files .br Note that \-\-for_backup is given in the mkisofs emulation. To preserve the recorded extra data it must already be in effect, when the emulation loads the image. .SS .B Incremental backup of a few directory trees This changes the directory trees /open_source_project and /personal_mail in the ISO image so that they become exact copies of their disk counterparts. ISO file objects get created, deleted or get their attributes adjusted accordingly. .br ACL, xattr, hard links and MD5 checksums will be recorded. It is expected that inode numbers in the disk filesystem are persistent over cycles of mounting and booting. Files with names matching *.o or *.swp get excluded explicitly. .br .sp 1 To be used several times on the same medium, whenever an update of the two disk trees to the medium is desired. Begin with a blank medium and update it until he run fails gracefully due to lack of remaining space on the old one. .br Always eject the drive tray between sessions. A run of dd shall give demons a chance to spoil the first read on freshly loaded media. .br $ msinfo=$(xorriso \-as cdrecord dev=/dev/sr0 \-msinfo) .br $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 .br $ load_opts= .br $ test \-n "$msinfo" && load_opts="\-M /dev/sr0 \-C $msinfo" .br $ xorrisofs $load_opts \-o \- \-\-for_backup \-m '*.o' \-m '*.swp' \\ .br \-V PROJ_MAIL_"$(date '+%Y_%m_%d_%H%M%S')" \-graft\-points \\ .br \-old\-root / \\ .br /projects=/home/thomas/projects \\ .br /personal_mail=/home/thomas/personal_mail \\ .br | xorriso \-as cdrecord dev=/dev/sr0 \-v \-multi \-waiti \-eject \- .br .sp 1 This makes sense if the full backup leaves substantial remaining capacity on media and if the expected changes are much smaller than the full backup. .br .sp 1 \fBBetter do not use your youngest backup for \-old\-root\fR. Have at least two media which you use alternatingly. So only older backups get endangered by the new write operation, while the newest backup is stored safely on a different medium. .br Always have a blank medium ready to perform a full backup in case the update attempt fails due to insufficient remaining capacity. This failure will not spoil the old medium, of course. .br .sp 1 If inode numbers on disk are not persistent, then use option \-\-old\-root\-no\-ino . In this case an update run will compare recorded MD5 sums against the current file content on hard disk. .br .sp 1 With \fBmount\fR option \fB\-o "sbsector="\fR on GNU/Linux or \fB\-s\fR on FreeBSD or NetBSD it is possible to access the session trees which represent the older backup versions. With CD media, GNU/Linux mount accepts session numbers directly by its option "session=". .br Multi\-session media and most overwritable media written by xorriso can tell the sbsectors of their sessions by xorriso option \-toc: .br $ xorriso \-dev /dev/sr0 \-toc .br xorriso can print the matching mount command for a session number: .br $ xorriso \-mount_cmd /dev/sr0 session 12 /mnt .br or for a volume id that matches a search expression: .br $ xorriso \-mount_cmd /dev/sr0 volid '*2008_12_05*' /mnt .br Both yield on standard output something like: .br mount \-t iso9660 \-o nodev,noexec,nosuid,ro,sbsector=1460256 '/dev/sr0' '/mnt' .br The superuser may let xorriso execute the mount command directly: .br # osirrox \-mount /dev/sr0 "volid" '*2008_12_05*' /mnt .SS .B Incremental backup with accumulated trees Solaris does not offer the option to mount older sessions. In order to keep them accessible, one may map all files to a file tree under a session directory and accumulate those directories from session to session. The \-root tree is cloned from the \-old\-root tree before it gets compared with the appropriate trees on disk. .br This demands to know the previously used session directory name. .br With the first session: .br $ xorrisofs \-root /session1 \\ .br \-o \- \-\-for_backup \-m '*.o' \-m '*.swp' \\ .br \-V PROJ_MAIL_"$(date '+%Y_%m_%d_%H%M%S')" \-graft\-points \\ .br /projects=/home/thomas/projects \\ .br /personal_mail=/home/thomas/personal_mail \\ .br | xorriso \-as cdrecord dev=/dev/sr0 \-v blank=as_needed \\ .br \-multi \-waiti \-eject \- .br .sp 1 With the second session, option \-old\-root refers to /session1 and the new \-root is /session2. .br Always eject the drive tray between sessions. A run of dd shall give demons a chance to spoil the first read on freshly loaded media. .br $ msinfo=$(xorriso \-as cdrecord dev=/dev/sr0 \-msinfo) .br $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 .br $ load_opts= .br $ test \-n "$msinfo" && load_opts="\-M /dev/sr0 \-C $msinfo" .br $ xorrisofs $load_opts \-root /session2 \-old\-root /session1 \\ .br \-o \- \-\-for_backup \-m '*.o' \-m '*.swp' \\ .br \-V PROJ_MAIL_"$(date '+%Y_%m_%d_%H%M%S')" \-graft\-points \\ .br /projects=/home/thomas/projects \\ .br /personal_mail=/home/thomas/personal_mail \\ .br | xorriso \-as cdrecord dev=/dev/sr0 \-v \-multi \-waiti \-eject \- .br With the third session, option \-old\-root refers to /session2. The new \-root is /session3. And so on. .SS .B Create bootable images for PC-BIOS and EFI The SYSLINUX/ISOLINUX boot loader suite is popular for booting PC\-BIOS. The ISOLINUX wiki prescribes to create on disk a directory ./CD_root and to copy all desired files underneath that directory. Especially file isolinux.bin shall be copied to ./CD_root/isolinux/isolinux.bin . This is the boot image file. .br The prescribed mkisofs options can be used unchanged with \fBxorrisofs\fR: .br $ xorrisofs \-o output.iso \\ .br \-b isolinux/isolinux.bin \-c isolinux/boot.cat \\ .br \-no\-emul\-boot \-boot\-load\-size 4 \-boot\-info\-table \\ .br ./CD_root .br Put it on CD by a burn program. E.g.: .br $ xorriso \-as cdrecord \-v dev=/dev/sr0 blank=as_needed output.iso .br .sp 1 The image from above example will boot from CD, DVD or BD, but not from USB stick or other hard\-disk\-like devices. This can be done by help of an isohybrid MBR. Syslinux provides matching template files as isohdp[fp]x*.bin . E.g. /usr/lib/syslinux/isohdpfx.bin . .br If a few hundred KB of size do not matter, then option \-partition_offset can be used to create a partition table where partition 1 starts not at block 0. This facilitates later manipulations of the USB stick by tools for partitioning and formatting. .br The image from the following example will be prepared for booting via MBR and its first partition will start at hard disk block 64. .br It will also boot from optical media. .br $ xorrisofs \-o output.iso \\ .br \-b isolinux/isolinux.bin \-c isolinux/boot.cat \\ .br \-no\-emul\-boot \-boot\-load\-size 4 \-boot\-info\-table \\ .br \-isohybrid\-mbr /usr/lib/syslinux/isohdpfx.bin \\ .br \-partition_offset 16 \\ .br ./CD_root .br Become superuser and copy the image to the unpartitioned base device file of the USB stick. On GNU/Linux this is e.g. /dev/sdb, not /dev/sdb1. .br CAUTION: This will overwrite any partitioning on the USB stick and make remaining data unaccessible. .br So first make sure you got the correct address of the intended device. E.g. by reading 100 MiB data from it and watching it blinking: .br # dd bs=2K if=/dev/sdb count=50K >/dev/null .br Now copy the image onto it .br # dd bs=2K if=output.iso of=/dev/sdb .br .sp 1 Now for EFI: .br The boot image file has to be the image of an EFI System Partition, i.e. a FAT filesystem with directory /EFI/BOOT and boot files with EFI prescribed names: BOOTIA32.EFI for 32 bit x86, BOOTx64.EFI for 64 bit AMD/x86 (in UEFI\-2.4 there is indeed a lower case "x"), BOOTAA64.EFI for 64 bit ARM. The software in the FAT filesystem should be able to find and inspect the ISO filesystem for boot loader configuration and start of operating system. GRUB2 program grub\-mkimage can produce such a FAT filesystem with suitable content, which then uses further GRUB2 software from the ISO filesystem. .br EFI boot equipment may be combined with above ISOLINUX isohybrid for PC\-BIOS in a not really UEFI\-2.4 compliant way, which obviously works well. It yields MBR and GPT partition tables, both with nested partitions. Assumed the EFI System Partition image is ready as ./CD_root/boot/grub/efi.img, add the following options before the directory address ./CD_root: .br \-eltorito\-alt\-boot \-e 'boot/grub/efi.img' \-no\-emul\-boot \\ .br \-isohybrid\-gpt\-basdat \\ .br More compliant with UEFI\-2.4 is to decide for either MBR or GPT and to append a copy of the EFI System Partition in order to avoid overlap of ISO partition and EFI partition. Here for MBR: .br \-eltorito\-alt\-boot \-e 'boot/grub/efi.img' \-no\-emul\-boot \\ \-append_partition 2 0xef ./CD_root/boot/grub/efi.img \\ .br The resulting ISOs are supposed to boot from optical media and USB stick. One may omit option \-eltorito\-alt\-boot if no option \-b is used to make the ISO bootable via PC\-BIOS. .br .sp 1 For ISOs with pure GRUB2 boot equipment consider to use GRUB2 tool grub\-mkrescue as frontend to xorrisofs. .br .sp 1 If you have a bootable ISO filesystem and want to know its equipment plus a proposal how to reproduce it, try: .br $ xorriso \-hfsplus on \-indev IMAGE.iso \\ \-report_el_torito plain \-report_system_area plain \\ \-print "" \-print "======= Proposal for xorrisofs options:" \\ \-report_el_torito as_mkisofs .br .br .SH FILES .SS .B Startup files: .br If not \-\-no_rc is given as the first argument then \fBxorrisofs\fR attempts on startup to read and execute lines from the following files: .br /etc/default/xorriso .br /etc/opt/xorriso/rc .br /etc/xorriso/xorriso.conf .br $HOME/.xorrisorc .br The files are read in the sequence given here, but none of them is required to exist. The lines are not interpreted as \fBxorrisofs\fR options but as generic xorriso commands. See man xorriso. .PP After the xorriso startup files, the program tries one by one to open for reading: .br ./.mkisofsrc .br $MKISOFSRC .br $HOME/.mkisofsrc .br $(dirname $0)/.mkisofsrc .br On success it interprets the file content and does not try further files. The last address is used only if start argument 0 has a non\-trivial dirname. .br The reader currently interprets the following NAME=VALUE pairs: .br APPI default for \-A .br PUBL default for \-publisher .br SYSI default for \-sysid .br VOLI default for \-V .br VOLS default for \-volset .br Any other lines will be silently ignored. .br .SH ENVIRONMENT The following environment variables influence the program behavior: .br HOME is used to find xorriso and mkisofs startup files. .br MKISOFSRC may be used to point the program to a mkisofs startup file. .br SOURCE_DATE_EPOCH belongs to the specs of reproducible\-builds.org. It is supposed to be either undefined or to contain a decimal number which tells the seconds since january 1st 1970. If it contains a number, then it is used as time value to set the default of \-\-modification\-date=. \-\-gpt_disk_guid defaults to "modification\-date". The default of \-\-set_all_file_dates is then "set_to_mtime". Further the "now" time for ISO nodes without disk source is then set to the SOURCE_DATE_EPOCH value. .br Startup files and program options can override the effect of SOURCE_DATE_EPOCH. .SS .SH SEE ALSO .TP For generic xorriso command mode .BR xorriso(1) .TP For the cdrecord emulation of xorriso .BR xorrecord(1) .TP For mounting xorriso generated ISO 9660 images (-t iso9660) .BR mount(8) .TP Other programs which produce ISO 9660 images .BR mkisofs(8), .BR genisoimage(8) .TP Programs which burn sessions to optical media .BR growisofs(1), .BR cdrecord(1), .BR wodim(1), .BR cdrskin(1), .BR xorriso(1) .TP ACL and xattr .BR getfacl(1), .BR setfacl(1), .BR getfattr(1), .BR setfattr(1) .TP MD5 checksums .BR md5sum(1) .TP On FreeBSD the commands for xattr and MD5 differ .BR getextattr(8), .BR setextattr(8), .BR md5(1) .SH BUGS To report bugs, request help, or suggest enhancements for \fBxorriso\fR, please send electronic mail to the public list . If more privacy is desired, mail to . .br Please describe what you expect \fBxorriso\fR to do, the program arguments or dialog commands by which you tried to achieve it, the messages of \fBxorriso\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 .br for libburnia\-project.org .SH COPYRIGHT Copyright (c) 2011 \- 2021 Thomas Schmitt .br Permission is granted to distribute this text freely. It shall only be modified in sync with the technical properties of xorriso. If you make use of the license to derive modified versions of xorriso then you are entitled to modify this text under that same license. .SH CREDITS \fBxorrisofs\fR is in part based on work by Vreixo Formoso who provides libisofs together with Mario Danic who also leads the libburnia team. Vladimir Serbinenko contributed the HFS+ filesystem code and related knowledge. .br Compliments towards Joerg Schilling whose cdrtools served me for ten years. libisoburn-1.5.4/xorriso/sfile.h0000644000175700017510000001073213762645057013624 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of functions around files and strings. */ #ifndef Xorriso_pvt_sfile_includeD #define Xorriso_pvt_sfile_includeD yes #define TSOB_FELD(typ, count) (typ *) calloc(1, (count)*sizeof(typ)); #define Smem_malloC malloc #define Smem_freE free #define Xorriso_alloc_meM(pt, typ, count) { \ pt= (typ *) calloc(1, (count) * sizeof(typ)); \ if(pt == NULL) { \ Xorriso_no_malloc_memory(xorriso, NULL, 0); \ ret= -1; \ goto ex; \ } } #define Xorriso_free_meM(pt) { \ if(pt != NULL) \ free((char *) pt); \ } #define SfileadrL 4096 int Sfile_str(char target[SfileadrL], char *source, int flag); double Sfile_microtime(int flag); int Sfile_add_to_path(char path[SfileadrL], char *addon, int flag); int Sfile_scale(double value, char *result, int siz, double thresh, int flag); int Sfile_destroy_argv(int *argc, char ***argv, int flag); int Sfile_count_char(char *text, char to_count); /* bit0= do not ignore trailing slash bit1= do not ignore empty components (other than the empty root name) */ int Sfile_count_components(char *path, int flag); /* @param flag bit0= return -1 if file is missing bit1= return a hardlink with siblings as type 5 bit2= evaluate eventual link target rather than the link object itself bit3= return a socket or a char device as types 7 or 8 rather than 0 @return 0=unknown 1=regular 2=directory 3=symbolic link 4=named pipe 5=multiple hardlink (with bit1) 6=block device 7=socket (with bit3) 8=character device (with bit3) | 1024 if interpreted as /dev/fd/#fd# | 2048 if interpreted as /dev/fd/#fd# and not fstatable */ int Sfile_type(char *filename, int flag); /* @param flag bit0= only encode inside quotes bit1= encode < 32 outside quotes except 7, 8, 9, 10, 12, 13 bit2= encode in any case above 126 bit3= encode in any case shellsafe: <=42 , 59, 60, 62, 63, 92, 94, 96, >=123 */ int Sfile_bsl_encoder(char **result, char *text, size_t text_len, int flag); int Sfile_argv_bsl(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 Sfile_make_argv(char *progname, char *line, int *argc, char ***argv, int flag); int Sfile_sep_make_argv(char *progname, char *line, char *separators, int max_argc, int *argc, char ***argv, int flag); /* YYMMDD[.hhmm[ss]] */ int Sfile_decode_datestr(struct tm *reply, char *text, int flag); int Sfile_off_t_text(char text[80], off_t num, int flag); int Sfile_text_to_off_t(char *text, off_t *num, int flag); int Sfile_leafname(char *path, char leafname[SfileadrL], int flag); /* @param flag bit0= do not clip of carriage return at line end */ char *Sfile_fgets_n(char *line, int maxl, FILE *fp, int flag); /* bit0=with hours+minutes bit1=with seconds bit8= local time rather than UTC */ char *Sfile_datestr(time_t tim, short int flag); /* 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 */ int Sfile_bsl_interpreter(char *text, int upto, int *eaten, int flag); int Sfile_prepend_path(char *prefix, char path[SfileadrL], int flag); int Sfile_home_adr_s(char *filename, char *fileadr, int fa_size, int flag); int Sfile_get_dev_fd_no(char *filename, int flag); int Sfile_flatten_utf8_heads(char *name, int idx, int flag); #endif /* ! Xorriso_pvt_sfile_includeD */ libisoburn-1.5.4/xorriso/xorrecord.10000644000175700017510000010541314005266113014422 00000000000000.\" Hey, EMACS: -*- nroff -*- .\" .\" IMPORTANT NOTE: .\" .\" The original of this file is kept in xorriso/xorrecord.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 XORRECORD 1 "Version 1.5.4, Jan 30, 2021" .\" 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 insert n+1 empty lines .\" for manpage-specific macros, see man(7) .nh .SH NAME xorrecord \- Emulation of CD/DVD/BD program cdrecord by program xorriso .SH SYNOPSIS .B xorrecord [ options ] dev=device [track_source] .br .SH DESCRIPTION .PP \fBxorrecord\fR writes preformatted data to CD, DVD, and BD media. .br .PP It understands some options of program cdrecord from cdrtools by Joerg Schilling. Its implementation is part of program xorriso which shares no source code with cdrtools, but rather makes use of libburn for communicating with the drive. .br Another, more complete cdrecord emulator is program \fBcdrskin\fR which uses the same burn functions as \fBxorrecord\fR, but is able to burn audio CDs and to handle CD\-TEXT. .SS \fBMMC, Session, Track, Media types:\fR .br \fBMMC\fR is a standard out of the SCSI family which defines the interaction between computers and optical drives. Since more than a decade all CD, DVD, or BD recorders obey this standard regardless by what bus cabling they are attached to the computer. libburn relies on this standard compliance and on the capability of the operating system to perform SCSI transactions over the particular bus cabling. .br A \fBSession\fR is a data region on an optical disc which usually gets written in a single sweep. It contains at least one \fBTrack\fR which is a contiguous string of readable blocks. \fBxorrecord\fR produces a single session with a single data track which consists of blocks with 2048 bytes each. It chooses the write mode automatically according to media type, medium state, and option \-multi. .br On CD media there are other track types, like audio, and particular write modes like TAO and SAO. CD and DVD\- media can put more than one track into a session. Some of these features can be addressed by program \fBcdrskin\fR. .br MMC describes several recordable \fBmedia types\fR which roughly form two families. .br \fBSequentially recordable media\fR are CD\-R, CD\-RW, DVD\-R, DVD\-R DL, DVD\-RW, DVD+R, DVD+R DL, BD\-R. Except DVD\-R DL they can store more than one session if there is still unwritten space and if the previous session was written with option \fB\-multi\fR. CD\-RW and DVD\-RW can be blanked in order to be re\-usable from scratch. .br \fBOverwritable media\fR are DVD\-RAM, DVD+RW, formatted DVD\-RW, BD\-RE. They offer a single session with a single track for random access writing. There is no need to blank overwritable media before re\-use. .br DVD\-RW media are sold in sequentially recordable state but can be formatted once to become overwritable. See options \fBblank=format_overwrite\fR and \fBblank=deformat\fR. .br If ISO 9660 filesystems are to be stored on overwritable media, then it is possible to emulate multiple sessions, by using option \fB\-\-grow_overwriteable_iso\fR. In this case, the need for blanking before re\-use is emulated too. .SS .B Drive preparation and addressing: .PP The drives, CD, DVD, or BD burners, are accessed via file addresses which are specific to libburn and the operating system. Those addresses get listed by a run of \fBxorrecord \-\-devices\fR or \fBxorriso \-device_links\fR. .br On GNU/Linux, FreeBSD, and NetBSD, the user needs rw\-permission for the device file. On Solaris, the user needs r\-permission and privilege "sys_devices", which is usually gained by running \fBxorrecord\fR via command pfexec. .br These permissions or privileges are needed already for listing a drive. So it might be necessary to get the overview as superuser or via pfexec. .br \fBxorrecord\fR does not perform cdrecord option \-scanbus and does not accept the addresses of form Bus,Target,Lun which are told by \-scanbus. If support for these addresses is necessary, consider to use program cdrskin. .br It is possible to let \fBxorrecord\fR work on emulated drives. Their addresses begin by prefix "stdio:" followed by a file address. The emulated media behavior depends on the file type. See man xorriso for details. .br If standard output is chosen as emulated drive, then all program result texts, which usually appear on standard output, will get redirected to standard error. .SS \fBRelation to program xorriso:\fR .br \fBxorrecord\fR is actually a command mode of program \fBxorriso\fR, which gets entered either by xorriso command "\-as cdrecord" or by starting the program by one of the names "xorrecord", "cdrecord", "wodim", or "cdrskin". .br This command mode can be left by argument "\-\-" which leads to generic xorriso command mode. See \fBman xorriso\fR for its description. Other than in xorriso command mode, the sequence of the cdrecord emulation options does not matter. All pending actions get performed in a fixed sequence before the program run ends or before cdrecord emulation ends. .SS .br .SH OPTIONS .br .PP .TP .B Addressing the drive: .TP \fB--devices\fR Print the list of accessible CD, DVD, or BD drives to standard output. Drives might be inaccessible if the user lacks of permissions to use them or if the drive is in use by another program. .br Each accessible drive is shown by a line like: .br 0 \-dev '/dev/sr0' rwrw\-\- : 'TSSTcorp' 'CDDVDW SH\-S203B' .br The libburn address of this drive is '/dev/sr0'. 'TSSTcorp' is the name of the vendor (in this case: Toshiba Samsung Storage Technologies Corporation), 'CDDVDW SH\-S203B' is the model name (in this case: a DVD burner). .br Afterwards end emulation without performing any further drive operation. .TP \fBdev=drive_address\fR Set the libburn address of the drive to be used. .br E.g. on GNU/Linux: dev=/dev/sr0 .br E.g. on FreeBSD: dev=/dev/cd0 .br E.g. on NetBSD: dev=/dev/rcd0d .br E.g. on Solaris: dev=/dev/rdsk/c2t2d0s2 .br See also above "Drive preparation and addressing". .br The medium in the drive should not be mounted or be otherwise in use. .br This option will only get into effect if a track source, a blank= option, or a drive inquiry option is given. Else it will lead to a SORRY event and normally cause a non\-zero exit value. .TP .B Inquiring drive and media: .TP \fB\-inq\fR Print to standard output: vendor, model name, and firmware revision of the drive. .TP \fB\-checkdrive\fR Print unconditionally that the drive supports burnfree, SAO, and TAO. Also print the output of option \-inq. .TP \fB\-atip\fR Print the output of \-checkdrive, the most capable profile of the medium in the drive, the list of profiles which are supported by the drive, whether it is erasable (i.e. can be blanked), the media manufacturer, and the medium product name. .br Profiles are usage models, which are often tied to a particular media type (e.g. CD\-RW), but may also apply to a family of media. E.g. profile CD\-ROM applies to all CD media which contain data. .TP \fB\-toc\fR Print a table of content of the medium in the drive. The output is not compatible to cdrecord option \-toc, but rather the one of \fBxorriso\fR command \-toc. It lists the address, vendor, model name, and firmware revision of the drive. .br About the medium it tells product name and manufacturer, whether there is already content written, and if so, whether the medium is closed or appendable. Appendable media can take another session. The amount of readable and writable data is told. If there are sessions, then their start block address and size is reported. If a session contains an ISO 9660 filesystem, then its Volume Id is reported. If the medium is writable, then the next writable block address is reported. .br If not option \fB\-\-grow_overwriteable_iso\fR is given or no ISO 9660 file system is present on the medium, then overwritable media are reported as being blank. This is due to the fact that they can be written from scratch without further preparation, and that MMC does not distinguish between data written by the most previous burn run and older data which have not been overwritten by that burn run. Consequently, these media are reported with 0 readable blocks, although all their writable blocks normally are readable, too. .TP \fB\-msinfo\fR Print the argument text for option \-C of programs mkisofs, genisoimage, or xorrisofs. It consists of two numbers separated by a comma. .br The first number tells the first block of the first track of the last recorded session. This is also the address used by default when operating systems mount a medium with e.g. ISO 9660 filesystem. .br The second number tells the next writable address, where \fBxorrecord\fR will begin to write the next session. .br This option is only valid for written, appendable media. In all other cases it will yield no output text but will abort the program with non\-zero exit value. .TP .B Settings for the burn run: .PP A burn run requires exactly one track source address argument, which tells from where to read the data which shall be put into the upcoming session. The medium state must be either blank or appendable. .br Track source may be "\-" for standard input or the address of a readable file of any type except directories. Nearly all media types accept a track source with unpredictable byte count, like standard input or named pipes. Nevertheless, DVD\-R DL and DVD\-RW blanked by mode deformat_quickest demand exact in\-advance reservation of the track size, so that they either need to be read from a source of predictable length, or need to be accompanied by option \fBtsize=\fR or by option \fB\-isosize\fR. .br Several options expect a size value as argument. A number with a trailing letter "b" or without a trailing letter is a plain byte count. Other trailing letters cause multiplication of the given number by a scaling factor: .br "k" or "K" = 1024 , "m" or "M" = 1024k , "g" or "G" = 1024m , "s" or "S" = 2048 .br E.g. tsize=234567s means a size of 234567 * 2048 = 480393216 bytes. .TP \fBblank=mode\fR Blank a CD\-RW or DVD\-RW to make it re\-usable from scratch. Format a DVD\-RW, DVD+RW, DVD\-RAM, BD\-R, or BD\-RE if not yet formatted. .br This operation normally makes any recorded data on the medium unreadable. It is combinable with burning in the same run of \fBxorrecord\fR, or it may be performed without a track source, leaving the medium empty. .br The mode given with blank= selects the particular behavior: .RS .TP .br as_needed .br Try to make the media ready for writing from scratch. If it needs formatting, then format it. If it is not blank, then try to apply blank=fast. It is a reason to abort if the medium cannot assume thoroughly writeable state, e.g. if it is a non\-blank write\-once. .br This leaves unformatted DVD\-RW in unformatted blank state. To format DVD\-RW use blank=format_overwrite. Blank unformatted BD\-R stay unformatted. .br (Note: blank=as_needed is not an original cdrecord option.) .TP .br all .br Blank an entire CD\-RW or an unformatted DVD\-RW. .TP .br fast .br Minimally blank an entire CD\-RW or blank an unformatted DVD\-RW. .TP .br deformat .br Like blank=all but with the additional ability to blank overwritable DVD\-RW. This will destroy their formatting and make them sequentially recordable. .br (Note: blank=deformat is not an original cdrecord options) .TP .br deformat_quickest .br Like blank=deformat but blanking DVD\-RW only minimally. This is faster than full blanking but yields media incapable of writing tracks of unpredictable size. Multi\-session will not be possible either. .br (Note: blank=deformat_quickest is not an original cdrecord option.) .TP .br format_overwrite .br Format a DVD\-RW to "Restricted Overwrite". The user should bring some patience. .br Format unformatted DVD+RW, BD\-RE or blank BD\-R to their default size. It is not mandatory to do this with DVD+RW and BD\-RE media, because they will get formatted automatically on the first write attempt. .br BD\-R media may be written in unformatted state. This keeps disabled the replacement of bad blocks and enables full nominal write speed. Once BD\-R media are written, they cannot be formatted any more. .br For re\-formatting already formatted media or for formatting with non\-default size, use program \fBxorriso\fR with command \fB\-format\fR. .br (Note: blank=format_overwrite is not an original cdrecord options) .TP .br help .br Print a short overview of blank modes to standard error output. .br Afterwards end emulation without performing any drive operation. .RE .TP \fB\-multi\fR This option keeps CD, unformatted DVD\-R[W], DVD+R, or BD\-R appendable after the current session has been written. Without it the disc gets closed and may not be written any more \- unless it is a \-RW and gets blanked, which causes loss of its content. .br This option cannot be applied to DVD\-R DL or to DVD\-RW which were blanked by mode "deformat_quickest". Option \-\-multi_if_possible may automatically recognize and handle this situation. .br In order to have all filesystem content accessible, the eventual ISO\-9660 filesystem of a follow\-up session needs to be prepared in a special way by the filesystem formatter program. mkisofs, genisoimage, and xorrisofs expect particular info about the situation which can be retrieved by \fBxorrecord\fR option \-msinfo. .br With overwritable DVD or BD media, \-multi cannot mark the end of the session. So when adding a new session, this end has to be determined from the payload. Currently only ISO\-9660 filesystems can be used that way. See option \fB\-\-grow_overwriteable_iso\fR. .TP \fB\-dummy\fR Try to perform the drive operations without actually affecting the inserted media. There is no warranty that this will work with a particular combination of drive and media. Blanking is prevented reliably, though. To avoid inadverted real burning, \-dummy refuses burn runs on anything but CD\-R[W], DVD\-R[W], or emulated stdio\-drives. .TP \fB\-waiti\fR Wait until input data is available at stdin or EOF occurs at stdin. Only then begin to access any drives. .br One should use this if xorrisofs is working at the end of a pipe where the feeder process reads from the drive before it starts writing its output into xorrisofs. Example: .br xorrisofs ... \-C 0,12800 \-M /dev/sr0 ... | \\ .br xorrecord dev=/dev/sr0 ... \-waiti \- .br This option works even if standard input is not the track source. If no process is piping in, then the Enter key of your terminal will act as trigger for \fBxorrecord\fR. Note that this input line will not be consumed by cdrskin if standard input is not the track source. It will end up as shell command, usually. .TP \fBtsize=size\fR Announce the exact size of the track source. This is necessary with DVD\-R DL media and with quickest blanked DVD\-RW, if the size cannot be determined in advance from the track source. E.g. if it is standard input or a named pipe. .br If the track source does not deliver the predicted amount of bytes, the remainder of the track is padded with zeros. This is not considered an error. If on the other hand the track source delivers more than the announced bytes then the track on media gets truncated to the predicted size and xorrecord exits with non\-zero value. .TP \fB\-isosize\fR Try to obtain the track size from the content of the track source. This works only if the track source bears an ISO 9660 filesystem. Any other track source content will cause the burn run to abort. .br If the track source is not a regular file or block device, then this option will work only if the program's fifo size is at least 64k. See option fs=. .TP \fBpadsize=size\fR Add the given amount of trailing zeros to the upcoming track. This feature can be disabled by size 0. Default is 300 kB in order to work around a problem with GNU/Linux which often fails to read the last few blocks of a CD track which was written in write mode TAO. TAO is used by \fBxorrecord\fR if the track size cannot be predicted or if the CD medium is not blank but appendable. .TP \fB\-nopad\fR The same as padsize=0. .TP \fB\-pad\fR The same as padsize=15s. This was once sufficient with older GNU/Linux kernels. Meanwhile one should at least use padsize=128k, if not padsize=300k. .TP \fB\-data\fR Explicitly announce that the track source shall be recorded as data track, and not as audio track. This option has no effect with \fBxorrecord\fR, because there is no support for other track formats anyway. .TP \fB\-tao\fR Explicitly demand that write type TAO shall be used for CD, or Incremental for DVD\-R. Normally the program will choose the write type according to the given medium state, option \-multi, and track source. Demanding it explicitly prevents the start of a write run, if it is not appropriate to the situation. .TP \fB\-sao\fR Explicitly demand that write type SAO shall be used for CD, or DAO for DVD\-R. This might prevent the write run, if it is not appropriate to the situation. .TP \fB\-dao\fR Alias of \-sao. .TP \fBfs=size\fR Set the size of the program fifo buffer to the given value rather than the default of 4m. .br The fifo buffers a temporary surplus of track source data in order to provide the drive with a steady stream during times of temporary lack of track source supply. .br Other than cdrecord, xorrecord enables drive buffer underrun protection by default and does not wait with writing until the fifo is full for a first time. On very old CD drives and slow computers, this might cause aborted burn runs. In this case, consider to use program \fBcdrskin\fR for CD burning. DVD and BD drives tolerate buffer underrun without problems. .br The larger the fifo, the longer periods of poor source supply can be compensated. But a large fifo can deprive the operating system of read cache for better filesystem performance. .TP \fBspeed=value\fR Set the write speed. Default is 0 = maximum speed. Speed can be given in media type dependent x\-speed numbers or as a desired throughput per second in MMC compliant kB (= 1000) or MB (= 1000 kB). Media x\-speed factor can be set explicitly by appending "c" for CD, "d" for DVD, "b" for BD. "x" is optional. .br Example speeds: .br 706k = 706kB/s = 4c = 4xCD .br 5540k = 5540kB/s = 4d = 4xDVD .br If there is no hint about the speed unit attached, then the medium in the drive will decide. Default unit is CD, 1x = 176,400 raw bytes/second. With DVD, 1x = 1,385,000 bytes/second. With BD, 1x = 4,495,625 bytes/second. .br MMC drives usually activate their own idea of speed and take the speed value given by the burn program only as a hint for their own decision. .TP \fBminbuf=percentage\fR Equivalent to: .br modesty_on_drive= .TP \fB\-immed\fR Equivalent to: .br modesty_on_drive=75 .br In cdrecord, this also controls use of the Immed bit. But xorriso uses Immed where possible and appropriate, unless it is disabled by option use_immed_bit=off . .TP \fB\-eject\fR Eject the drive tray after alll other work is done. .TP .B Program version and verbosity: .TP \fB\-version\fR Print to standard output a line beginning by .br "Cdrecord 2.01\-Emulation Copyright" .br and further lines which report the version of xorriso and its supporting libraries. They also state the license under which the program is provided, and disclaim any warranty, to the extent permitted by law. .br Afterwards end emulation without performing any drive operation. .TP \fB\-v\fR Increase program verbosity by one level. There are four verbosity levels from nearly silent to debugging verbosity. The both highest levels can be enabled by repeated \-v or by \-vv or by \-vvv. .TP \fB\-V\fR Log SCSI commands and drive replies to standard error. This might be of interest if \fBxorrecord\fR and a particular drive or medium do not cooperate as expected, or if you just want to know how libburn interacts with the drive. To understand this extremely verbose log, one needs to read SCSI specs SPC, SBC, and MMC. .br Please do not add such a log to a bug report on the first hand, unless you want to point out a particular deviation from said specs, or if you get asked for this log by a maintainer of \fBxorrecord\fR who feels in charge for your bug report. .TP \fB\-help\fR Print a sparse list of program options to standard error and declare not to be cdrecord. .br Afterwards end emulation without performing any drive operation. .TP .B Options not compatible to cdrecord: .TP \fB--no_rc\fR Only if used as first command line argument this option prevents reading and interpretation of startup files. See section FILES below. .TP \fB--drive_not_exclusive\fR This option disables the use of device file locking mechanisms when acquiring the drive. On GNU/Linux the locking is done by open(O_EXCL), on FreeBSD by flock(LOCK_EX). .br Be aware that it can cause problems if you use a drive which is mounted, or opened by some other process, or guarded by /dev/pktcdvd*. Make sure that other users of the drive do not cause drive activities while a xorrecord burn run is going on. .TP \fBdrive_scsi_dev_family=sr|scd|sg|default\fR GNU/Linux specific: .br By default, cdrskin tries to map Linux drive addresses to /dev/sr* before they get opened for operating the drive. This coordinates well with other use cases of optical drives, like mount(8). But since year 2010 all /dev/sr* share a global lock which allows only one drive to process an SCSI command while all others have to wait for its completion. This yields awful throughput if more than one drive is writing or reading simultaneously. .br The global lock is not applied to device files /dev/sg* and also not with the system calls read(2), write(2). But ioctl(SG_IO) is affected, which is needed to perform the SCSI commands for optical burning. .br So for simultaneous burn runs on modern GNU/Linux it is advisable to use drive_scsi_dev_family="sg". The drive addresses may then well be given as /dev/sr* but will nevertheless get used as /dev/sg*. .TP \fB--grow_overwriteable_iso\fR Enable emulation of multi\-session writing on overwritable media which contain an ISO 9660 filesystem. This emulation is learned from growisofs \-M but adapted to the usage model of .br xorrecord \-msinfo .br xorrisofs \-C \-M | xorrecord \-waiti \-multi \- .br for sequential media. .br \-\-grow_overwriteable_iso does not hamper the use of true multi\-session media. I.e. it is possible to use the same \fBxorrecord\fR options with both kinds of media and to achieve similar results if ISO 9660 filesystem images are to be written. This option implies option \-isosize and therefore demands that the track source is a ISO 9660 filesystem image. .br With overwritable media and no option blank=fast|all present it expands an eventual ISO 9660 filesystem on media. It is assumed that this image's inner size description points to the end of the valuable data. Overwritable media with a recognizable ISO 9660 size will be regarded as appendable rather than as blank. I.e. options \-msinfo and \-toc will work. \-toc will always show a single session with its size increasing with every added ISO 9660 image. .TP \fB--multi_if_possible\fR Apply option \-multi if the medium is suitable. Not suitable are DVD\-R DL and DVD\-RW, which were blanked with mode "deformat_quickest". .br Not all drives correctly recognize such fast\-blanked DVD\-RW which need "on". If there is well founded suspicion that a burn run failed due to \-multi, then this causes a re\-try without \-multi. .TP \fBstream_recording="on"|"off"|number\fR Mode "on" requests that compliance to the desired speed setting is preferred over management of write errors. With DVD\-RAM and BD this can bring effective write speed near to the nominal write speed of the media. But it will also disable the automatic use of replacement blocks if write errors occur. It might as well be disliked or ignored by the drive. .br If a number is given, then error management stays enabled for all byte addresses below that number. Any number below 16s is the same as "off". .TP \fBdvd_obs="default"|"32k"|"64k"\fR Linux specific: Set the number of bytes to be transmitted with each write operation to DVD or BD media. Tracks get padded up to the next multiple of this write size. A number of 64 KB may improve throughput with bus systems which show latency problems. The default depends on media type, option stream_recording=, and on compile time options. .TP \fBmodesty_on_drive=parameter[:parameters]\fR Control whether the drive buffer shall be kept from getting completely filled. Parameter "on" (or "1") keeps the program from trying to write to the burner drive while its buffer is in danger to be filled over a given limit. If this filling is exceeded then the program will wait until the filling reaches a given low percentage value. .br This can ease the load on operating system and drive controller and thus help with achieving better input bandwidth if disk and burner are not on independent controllers (like hda and hdb). It may also help with simultaneous burns on different burners with Linux kernels like 3.16, if one has reason not to fix the problem by drive_scsi_dev_family="sg". On the other hand it increases the risk of buffer underflow and thus reduced write speed. .br Some burners are not suitable because they report buffer fill with granularity too coarse in size or time, or expect their buffer to be filled to the top before they go to full speed. .br Parameters "off" or "0" disable this feature. .br The threshold for beginning to wait is given by parameter "max_percent=". Parameter "min_percent=" defines the threshold for resuming transmission. Percentages are permissible in the range of 25 to 100. Numbers in this range without a prepended name are interpreted as "on:min_percent=". .br E.g.: modesty_on_drive=75 .br The optimal values depend on the buffer behavior of the drive. .br Parameter "timeout_sec=" defines after which time of unsuccessful waiting the modesty shall be disabled because it does not work. .br Parameter "min_usec=" defines the initial sleeping period in microseconds. If the drive buffer appears to be too full for sending more data, the program will wait the given time and inquire the buffer fill state again. If repeated inquiry shows not enough free space, the sleep time will slowly be increased to what parameter "max_usec=" defines. .br Parameters, which are not mentioned with a modesty_on_drive= option, stay unchanged. Default is: .br modesty_on_drive=off:min_percent=90:max_percent=95: timeout_sec=120:min_usec=5000:max_usec=25000 .TP \fBuse_immed_bit="on"|"off"|"default"\fR Control whether several long lasting SCSI commands shall be executed with the Immed bit, which makes the commands end early while the drive operation is still going on. xorriso then inquires progress indication until the drive reports to be ready again. If this feature is turned off, then blanking and formatting will show no progress indication. .br It may depend on the operating system whether \-use_immed_bit is set to "off" by default. .TP \fBwrite_start_address=value\fR Set the block address on overwritable media where to start writing the track. With DVD+RW, DVD\-RAM or BD\-RE, byte_offset must be aligned to 2 kiB blocks, but better is 32 kiB on DVD and 64 kiB on BD. With formatted DVD\-RW 32 kiB alignment is mandatory. .br Other media are not suitable for this option. .TP \fBstdio_sync="on"|"off"|number\fR Set the number of bytes after which to force output to emulated stdio: drives. This forcing keeps the memory from being clogged with lots of pending data for slow devices. Default "on" is the same as "16m". Forced output can be disabled by "off". .SH EXAMPLES .SS .B Overview of examples: Get an overview of drives and their addresses .br Get info about a particular drive or loaded media .br Prepare CD-RW or DVD-RW for re-use, BD-R for bad block handling .br Format DVD-RW to avoid need for blanking before re-use .br De-format DVD-RW to make it capable of multi-session again .br Write a single ISO 9660 filesystem image .br Write multiple ISO 9660 sessions .br Write ISO 9660 session on-the-fly .br Write compressed afio archive on-the-fly .br .SS .B Get an overview of drives and their addresses: $ xorrecord \-\-devices .SS .B Get info about a particular drive and loaded media: $ xorrecord dev=/dev/sr0 \-atip \-toc \-\-grow_overwriteable_iso .SS .B Prepare CD-RW or DVD-RW for re-use: $ xorrecord \-v dev=/dev/sr0 blank=as_needed \-eject .SS .B Format DVD-RW to avoid need for blanking before re-use: $ xorrecord \-v dev=/dev/sr0 blank=format_overwrite \-eject .br This command may also be used to format BD\-R media before first use, in order to enable handling of write errors. Several hundred MB of spare blocks will be reserved and write runs on such media will perform with less than half nominal speed. .SS .B De-format DVD-RW to make it capable of multi-session again: $ xorrecord \-v dev=/dev/sr0 blank=deformat .SS .B Write a single ISO 9660 filesystem image: $ xorrecord \-v dev=/dev/sr0 speed=12 fs=8m \\ blank=as_needed \-eject padsize=300k my_image.iso .SS .B Write multiple ISO 9660 sessions: This is possible with all media except minimally blanked DVD\-RW and DVD\-R DL, which cannot do multi\-session. .br The first session is written like in the previous example, except that option \-multi is used. It will contain the files of hard disk directory ./tree1 under the ISO 9660 directory /dir1: .br $ xorrisofs \-o image_1.iso \-J \-graft\-points /dir1=./tree1 .br $ xorrecord \-v dev=/dev/sr0 speed=12 fs=8m \\ .br \-multi \-\-grow_overwriteable_iso \\ .br blank=as_needed \-eject padsize=300k image_1.iso .br For the second session xorrisofs needs to know the \-msinfo numbers of the medium. Further it will read data from the medium by using the system's read\-only CD\-ROM driver. .br Many systems do not take notice of xorrecord's write activities. It is necessary to force their attention by ejecting and reloading the drive tray. Therefore above run uses option \-eject. .br Get the \-msinfo numbers (and properly reload the tray if it has a motor) by: .br $ m=$(xorrecord dev=/dev/sr0 \-msinfo) .br Offer a victim to any problem caused by obtrusive demons after tray loading: .br $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 .br Use the numbers with xorrisofs to add ./tree2 to the image as /dir2: .br $ xorrisofs \-M /dev/sr0 \-C $m \-o image_2.iso \\ .br \-J \-graft\-points /dir2=./tree2 .br Now burn the new session onto the same medium. This time without blanking: .br $ xorrecord \-v dev=/dev/sr0 speed=12 fs=8m \\ .br \-multi \-\-grow_overwriteable_iso \\ .br \-eject padsize=300k image_2.iso .br Operating systems which mount this medium will read the superblock of the second session and show both directories /dir1 and /dir2. .SS .B Write ISO 9660 session on-the-fly: It is possible to combine the run of \fBxorrisofs\fR and \fBxorrecord\fR in a pipeline without storing the ISO 9660 image as file on hard disk. .br The piped run is more vulnerable to the problem that some systems have not enough patience with automatic tray loading and that demons may interfere with a first CD\-ROM driver read attempt from a freshly loaded medium. It is advised to load the tray manually or via a separate run of xorriso with a subsequent run of dd. .br Again, xorriso has the patience and dd is a dispensable victim for demons. .br $ m=$(xorrecord dev=/dev/sr0 \-msinfo) .br $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 .br $ xorrisofs \-M /dev/sr0 \-C $m \\ .br \-J \-graft\-points /dir2=./tree2 \\ .br | xorrecord \-v dev=/dev/sr0 speed=12 fs=8m \\ .br \-waiti \-multi \-\-grow_overwriteable_iso \\ .br \-eject padsize=300k \- .br This is also the main use case of program \fBxorriso\fR itself, where the run would need no system workarounds and simply look like: .br $ xorriso \-dev /dev/sr0 \-joliet on \-speed 12 \-fs 8m \\ .br \-map ./tree2 /dir2 \-commit_eject all .SS .B Write compressed afio archive on-the-fly: This is possible with all media except minimally blanked DVD\-RW and DVD\-R DL. Since the compressed output stream is of very variable speed, a larger fifo is advised. Nevertheless, this example is not suitable for very old CD drives which have no underrun protection and thus would abort the burn run on temporary data shortage. .br $ find . | afio \-oZ \- | \\ .br xorrecord \-v dev=/dev/sr0 speed=12 fs=64m \\ .br \-multi padsize=300k \- .br afio archives do not contain references to absolute data block addresses. So they need no special precautions for multi\-session. One may get the session start addresses by option \-toc, and then use dd option skip= to begin reading at one of those addresses. E.g. for listing its content: .br $ dd if=/dev/sr0 bs=2048 skip=64046 | afio \-tvZ \- .br afio will know when the end of the archive is reached. .SH FILES .SS .B Startup files: .br If not \-\-no_rc is given as the first argument then \fBxorrecord\fR attempts on startup to read and execute lines from the following files: .br /etc/default/xorriso .br /etc/opt/xorriso/rc .br /etc/xorriso/xorriso.conf .br $HOME/.xorrisorc .br The files are read in the sequence given here, but none of them is required to exist. The lines are not interpreted as \fBxorrecord\fR options but as generic \fBxorriso\fR commands. See man xorriso. .SH SEE ALSO .TP For generic xorriso command mode .BR xorriso(1) .TP Formatting track sources for xorrecord: .BR xorrisofs(1), .BR mkisofs(8), .BR genisoimage(8), .BR afio(1), .BR star(1) .TP Other programs which burn sessions to optical media .BR growisofs(1), .BR cdrecord(1), .BR wodim(1), .BR cdrskin(1) .SH BUGS To report bugs, request help, or suggest enhancements for \fBxorriso\fR, please send electronic mail to the public list . If more privacy is desired, mail to . .br Please describe what you expect \fBxorriso\fR to do, the program arguments or dialog commands by which you tried to achieve it, the messages of \fBxorriso\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 .br for libburnia\-project.org .SH COPYRIGHT Copyright (c) 2011 \- 2021 Thomas Schmitt .br Permission is granted to distribute this text freely. It shall only be modified in sync with the technical properties of xorriso. If you make use of the license to derive modified versions of xorriso then you are entitled to modify this text under that same license. .SH CREDITS \fBxorriso\fR is in part based on work by Vreixo Formoso who provides libisofs together with Mario Danic who also leads the libburnia team. Thanks to Andy Polyakov who invented emulated growing, to Derek Foreman and Ben Jansens who once founded libburn. .br Compliments towards Joerg Schilling whose cdrtools served me for ten years. libisoburn-1.5.4/xorriso/check_media.c0000644000175700017510000010030513762645047014724 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of classes SpotlistiteM, SectorbitmaP, CheckmediajoB which perform verifying runs on media resp. images. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include /* O_BINARY is needed for Cygwin but undefined elsewhere */ #ifndef O_BINARY #define O_BINARY 0 #endif #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" /* ------------------------------ SpotlisT -------------------------------- */ struct SpotlistiteM { int start_lba; int blocks; int quality; struct SpotlistiteM *next; }; int Spotlistitem_new(struct SpotlistiteM **o, int start_lba, int blocks, int quality, int flag) { struct SpotlistiteM *m; m= TSOB_FELD(struct SpotlistiteM,1); if(m==NULL) return(-1); *o= m; m->start_lba= start_lba; m->blocks= blocks; m->quality= quality; m->next= NULL; return(1); } int Spotlistitem_destroy(struct SpotlistiteM **o, int flag) { if((*o) == NULL) return(0); free((char *) *o); *o= NULL; return(1); } struct SpotlisT { struct SpotlistiteM *list_start; struct SpotlistiteM *list_end; int list_count; struct SpotlistiteM *current_item; int current_idx; }; int Spotlist_new(struct SpotlisT **o, int flag) { struct SpotlisT *m; m= TSOB_FELD(struct SpotlisT,1); if(m==NULL) return(-1); *o= m; m->list_start= NULL; m->list_end= NULL; m->list_count= 0; m->current_item= NULL; m->current_idx= -1; return(1); } int Spotlist_destroy(struct SpotlisT **o, int flag) { struct SpotlisT *m; struct SpotlistiteM *li, *next_li; if((*o) == NULL) return(0); m= *o; for(li= m->list_start; li != NULL; li= next_li) { next_li= li->next; Spotlistitem_destroy(&li, 0); } free((char *) *o); *o= NULL; return(1); } int Spotlist_add_item(struct SpotlisT *o, int start_lba, int blocks, int quality, int flag) { int ret; struct SpotlistiteM *li; static int debug_verbous= 0; ret= Spotlistitem_new(&li, start_lba, blocks, quality, 0); if(ret <= 0) return(ret); if(o->list_end != NULL) o->list_end->next= li; o->list_end= li; if(o->list_start == NULL) o->list_start= li; (o->list_count)++; if(debug_verbous) {char quality_name[80]; fprintf(stderr, "debug: lba %10d , size %10d , quality '%s'\n", start_lba, blocks, Spotlist__quality_name(quality, quality_name, Xorriso_read_quality_invaliD, 0) + 2); } return(1); } int Spotlist_count(struct SpotlisT *o, int flag) { return o->list_count; } int Spotlist_block_count(struct SpotlisT *o, int flag) { int list_blocks= 0; struct SpotlistiteM *li; for(li= o->list_start; li != NULL; li= li->next) { if(li->start_lba + li->blocks > list_blocks) list_blocks= li->start_lba + li->blocks; } return(list_blocks); } int Spotlist_sector_size(struct SpotlisT *o, int read_chunk, int flag) { int sector_size; struct SpotlistiteM *li; sector_size= read_chunk * 2048; for(li= o->list_start; li != NULL; li= li->next) { if((li->start_lba % read_chunk) || (li->blocks % read_chunk)) { sector_size= 2048; break; } } return(sector_size); } int Spotlist_get_item(struct SpotlisT *o, int idx, int *start_lba, int *blocks, int *quality, int flag) { int i; struct SpotlistiteM *li; if(idx < 0 || idx > o->list_count) return(0); if(idx == o->current_idx && o->current_item != NULL) li= o->current_item; else if(idx == o->current_idx + 1 && o->current_item != NULL) { li= o->current_item->next; } else { li= o->list_start; for(i= 0; i < idx; i++) li= li->next; } o->current_item= li; o->current_idx= idx; *start_lba= li->start_lba; *blocks= li->blocks; *quality= li->quality; return(1); } char *Spotlist__quality_name(int quality, char name[80], int bad_limit, int flag) { if(quality == Xorriso_read_quality_untesteD || quality == Xorriso_read_quality_tao_enD || (quality == Xorriso_read_quality_md5_mismatcH && quality > bad_limit) || quality == Xorriso_read_quality_off_tracK) strcpy(name, "0 "); else if(quality <= bad_limit) strcpy(name, "- "); else strcpy(name, "+ "); if(quality == Xorriso_read_quality_gooD) strcat(name, "good"); else if(quality == Xorriso_read_quality_md5_matcH) strcat(name, "md5_match"); else if(quality == Xorriso_read_quality_sloW) strcat(name, "slow"); else if(quality == Xorriso_read_quality_partiaL) strcat(name, "partial"); else if(quality == Xorriso_read_quality_valiD) strcat(name, "valid"); else if(quality == Xorriso_read_quality_untesteD) strcat(name, "untested"); else if(quality == Xorriso_read_quality_md5_mismatcH) strcat(name, "md5_mismatch"); else if(quality == Xorriso_read_quality_invaliD) strcat(name, "invalid"); else if(quality == Xorriso_read_quality_tao_enD) strcat(name, "tao_end"); else if(quality == Xorriso_read_quality_off_tracK) strcat(name, "off_track"); else if(quality == Xorriso_read_quality_unreadablE) strcat(name, "unreadable"); else sprintf(name, "0 0x%8.8X", (unsigned int) quality); return(name); } /* ---------------------------- End SpotlisT ------------------------------ */ /* ---------------------------- SectorbitmaP ------------------------------ */ int Sectorbitmap_new(struct SectorbitmaP **o, int sectors, int sector_size, int flag) { struct SectorbitmaP *m; m= TSOB_FELD(struct SectorbitmaP,1); if(m==NULL) return(-1); *o= m; m->sectors= sectors; m->sector_size= sector_size; m->map= NULL; m->map_size= sectors / 8 + 1; m->map= calloc(m->map_size, 1); if(m->map == NULL) goto failure; return(1); failure:; Sectorbitmap_destroy(o, 0); return(-1); } int Sectorbitmap_destroy(struct SectorbitmaP **o, int flag) { if((*o) == NULL) return(0); if((*o)->map != NULL) free((char *) (*o)->map); free((char *) *o); *o= NULL; return(1); } int Sectorbitmap_from_file(struct SectorbitmaP **o, char *path, char *msg, int *os_errno, int flag) { int ret, fd= -1, sectors, sector_size, i, todo, map_size, skip, bufsize= 1024; unsigned char *map; unsigned char *buf; buf= TSOB_FELD(unsigned char, bufsize); if(buf == NULL) return(-1); *os_errno= 0; if(msg != NULL) msg[0]= 0; fd= open(path, O_RDONLY | O_BINARY); if(fd == -1) { *os_errno= errno; if(msg != NULL) { strcpy(msg, "Cannot open path "); Text_shellsafe(path, msg+strlen(msg), 0); } {ret= 0; goto ex;} } ret= read(fd, buf, 32); if(ret < 32) { wrong_filetype:; if(ret == -1) *os_errno= errno; if(msg != NULL) { strcpy(msg, "Not a sector bitmap file: "); Text_shellsafe(path, msg+strlen(msg), 0); } ret= 0; goto ex; } if(strncmp((char *) buf, "xorriso sector bitmap v1 ", 32) == 0) /* ok */; else if(strncmp((char *) buf, "xorriso sector bitmap v2 ", 25) == 0) { skip= -1; sscanf(((char *) buf) + 25, "%d", &skip); if(skip < 0) {ret= 0; goto wrong_filetype;} for(i= 0; i < skip; i+= bufsize) { todo= bufsize; if(i + todo > skip) todo= skip - i; ret= read(fd, buf, todo); if(ret < todo) goto wrong_filetype; } } else {ret= 0; goto wrong_filetype;} ret= read(fd, buf, 8); if(ret < 4) goto wrong_filetype; sectors= (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; sector_size= (buf[4] << 24) | (buf[5] << 16) | (buf[6] << 8) | buf[7]; if(sectors <= 0 || sector_size <= 0) goto wrong_filetype; ret= Sectorbitmap_new(o, sectors, sector_size, 0); if(ret <= 0) { if(msg != NULL) sprintf(msg, "Cannot allocate bitmap memory for %d sectors", sectors); ret= -1; goto ex; } map= (*o)->map; map_size= (*o)->map_size; for(i= 0; i < map_size; i+= bufsize) { todo= bufsize; if(i + todo > map_size) todo= map_size - i; ret= read(fd, buf, todo); if(ret != todo) goto wrong_filetype; memcpy(map + i, buf, todo); } ret= 1; ex:; if(fd != -1) close(fd); if(buf != NULL) free(buf); if(ret <= 0) Sectorbitmap_destroy(o, 0); return(ret); } int Sectorbitmap_to_file(struct SectorbitmaP *o, char *path, char *info, char *msg, int *os_errno, int flag) { int ret, fd= -1, j, l; unsigned char buf[40]; *os_errno= 0; fd= open(path, O_WRONLY | O_CREAT | O_BINARY, S_IRUSR | S_IWUSR); if(fd == -1) { *os_errno= errno; if(msg != NULL) { strcpy(msg, "Cannot open path "); Text_shellsafe(path, msg+strlen(msg), 0); } ret= 0; goto ex; } l= 0; if(info != NULL) l= strlen(info); if(l > 999999) { strcpy(msg, "Info string is longer than 999999 bytes"); ret= 0; goto ex; } sprintf((char *) buf, "xorriso sector bitmap v2 %-6d\n", l); ret= write(fd, buf, 32); if(ret != 32) { cannot_write:; *os_errno= errno; if(msg != NULL) { strcpy(msg, "Cannot write to "); Text_shellsafe(path, msg+strlen(msg), 0); } ret= 0; goto ex; } if(l > 0) { ret= write(fd, info, l); if(ret != l) goto cannot_write; } for(j= 0; j < 4; j++) { buf[j]= o->sectors >> (24 - j * 8); buf[j+4]= o->sector_size >> (24 - j * 8); } ret= write(fd, buf, 8); if(ret != 8) goto cannot_write; ret= write(fd, o->map, o->map_size); if(ret != o->map_size) goto cannot_write; ret= 1; ex:; if(fd != -1) close(fd); return(ret); } /* @param flag bit0= sector bit value */ int Sectorbitmap_set(struct SectorbitmaP *o, int sector, int flag) { if(sector < 0 || sector >= o->sectors) return(0); if(flag & 1) o->map[sector / 8]|= 1 << (sector % 8); else o->map[sector / 8]&= ~(1 << (sector % 8)); return(1); } /* @param flag bit0= sector bit value */ int Sectorbitmap_set_range(struct SectorbitmaP *o, int start_sector, int sectors, int flag) { int start_i, end_i, i; unsigned char value; if(start_sector < 0 || start_sector + sectors > o->sectors || sectors < 1) return(0); if(flag & 1) value= ~0; else value= 0; start_i= start_sector / 8; end_i= (start_sector + sectors - 1) / 8; for(i= start_sector; i / 8 == start_i && i < start_sector + sectors; i++) Sectorbitmap_set(o, i, flag & 1); for(i= start_i + 1; i < end_i; i++) o->map[i]= value; if(end_i > start_i) for(i= end_i * 8; i < start_sector + sectors; i++) Sectorbitmap_set(o, i, flag & 1); return(1); } int Sectorbitmap_is_set(struct SectorbitmaP *o, int sector, int flag) { if(sector < 0 || sector >= o->sectors) return(0); return(!! (o->map[sector / 8] & (1 << (sector % 8)))); } int Sectorbitmap_bytes_are_set(struct SectorbitmaP *o, off_t start_byte, off_t end_byte, int flag) { int end_sector, i; end_sector= end_byte / o->sector_size; for(i= start_byte / o->sector_size; i <= end_sector; i++) if(!Sectorbitmap_is_set(o, i, 0)) return(0); return(1); } int Sectorbitmap_get_layout(struct SectorbitmaP *o, int *sectors, int *sector_size, int flag) { *sectors= o->sectors; *sector_size= o->sector_size; return(1); } int Sectorbitmap_copy(struct SectorbitmaP *from, struct SectorbitmaP *to, int flag) { int i, run_start, run_value, start_sec, limit_sec, start_aligned; int end_complete; if(((off_t) from->sectors) * ((off_t) from->sector_size) > ((off_t) to->sectors) * ((off_t) to->sector_size)) return(-1); if(from->sector_size == to->sector_size) { for(i= 0; i < from->map_size; i++) to->map[i]= from->map[i]; return(1); } run_start= 0; run_value= Sectorbitmap_is_set(from, 0, 0); for(i= 1; i <= from->sectors; i++) { if(i < from->sectors) if(Sectorbitmap_is_set(from, i, 0) == run_value) continue; start_sec= run_start * from->sector_size / to->sector_size; start_aligned= (start_sec * to->sector_size == run_start * from->sector_size); limit_sec= i * from->sector_size / to->sector_size; end_complete= (limit_sec * to->sector_size == i * from->sector_size); if(run_value) { if(!start_aligned) start_sec++; } else { if(!end_complete) limit_sec++; } if(start_sec < limit_sec) Sectorbitmap_set_range(to, start_sec, limit_sec - 1 - start_sec, !!run_value); run_value= !run_value; run_start= i; } return(1); } int Sectorbitmap_clone(struct SectorbitmaP *from, struct SectorbitmaP **clone, int flag) { int ret; ret= Sectorbitmap_new(clone, from->sectors, from->sector_size, 0); if(ret <= 0) return(ret); ret= Sectorbitmap_copy(from, *clone, 0); if(ret <= 0) Sectorbitmap_destroy(clone, 0); return(ret); } /* -------------------------- End SectorbitmaP ---------------------------- */ /* ---------------------------- CheckmediajoB ----------------------------- */ int Checkmediajob_new(struct CheckmediajoB **o, int flag) { struct CheckmediajoB *m; m= TSOB_FELD(struct CheckmediajoB,1); if(m==NULL) return(-1); *o= m; m->use_dev= 0; m->min_lba= -1; m->max_lba= -1; m->min_block_size= 0; m->async_chunks= 0; m->mode= 0; m->start_time= time(NULL); m->time_limit= 28800; m->item_limit= 100000; strcpy(m->abort_file_path, "/var/opt/xorriso/do_abort_check_media"); m->data_to_path[0]= 0; m->data_to_fd= -1; m->data_to_offset= 0; m->data_to_limit= -1; m->data_to_skip= 0; m->patch_lba0= 0; m->patch_lba0_msc1= -1; m->sector_map_path[0]= 0; m->sector_map= NULL; m->map_with_volid= 0; m->retry= 0; m->report_mode= 0; strcpy(m->event_severity, "ALL"); m->slow_threshold_seq= 1.0; return(1); } int Checkmediajob_destroy(struct CheckmediajoB **o, int flag) { if((*o) == NULL) return(0); if((*o)->data_to_fd != -1 && strcmp((*o)->data_to_path, "-") != 0) close((*o)->data_to_fd); Sectorbitmap_destroy(&((*o)->sector_map), 0); free((char *) *o); *o= NULL; return(1); } int Checkmediajob_copy(struct CheckmediajoB *from, struct CheckmediajoB *to, int flag) { to->use_dev= from->use_dev; to->min_lba= from->min_lba; to->max_lba= from->max_lba; to->min_block_size= from->min_block_size; to->mode= from->mode; to->time_limit= from->time_limit; to->item_limit= from->item_limit; strcpy(to->abort_file_path, from->abort_file_path); strcpy(to->data_to_path, from->data_to_path); /* not copied: data_to_fd */ to->data_to_offset= from->data_to_offset; to->data_to_limit= from->data_to_limit; to->data_to_skip= from->data_to_skip; to->patch_lba0= from->patch_lba0; to->patch_lba0_msc1= from->patch_lba0_msc1; strcpy(to->sector_map_path, from->sector_map_path); /* not copied: sector_map */ to->map_with_volid= from->map_with_volid; to->retry= from->retry; to->report_mode= from->report_mode; strcpy(to->event_severity, from->event_severity); to->slow_threshold_seq= from->slow_threshold_seq; return(1); } /* -------------------------- End CheckmediajoB --------------------------- */ int Xorriso_check_media_setup_job(struct XorrisO *xorriso, struct CheckmediajoB *job, char **argv, int old_idx, int end_idx, int flag) { int ret, i, sev; double num; struct CheckmediajoB *default_job; char sev_text[20]; if(xorriso->check_media_default != NULL) Checkmediajob_copy(xorriso->check_media_default, job, 0); for(i= old_idx; i < end_idx; i++) { if(strncmp(argv[i], "abort_file=", 11) == 0) { ret= Sfile_str(job->abort_file_path, argv[i] + 11, 0); if(ret <= 0) goto ex; } else if(strncmp(argv[i], "async_chunks=", 13) == 0) { num= Scanf_io_size(argv[i] + 13, 1); if(num >= 0 && num <= 1024) job->async_chunks= num; else goto bad_value; } else if(strncmp(argv[i], "bad_limit=", 10) == 0) { if(strcmp(argv[i] + 10, "good") == 0) xorriso->check_media_bad_limit= Xorriso_read_quality_gooD; else if(strcmp(argv[i] + 10, "md5_match") == 0) xorriso->check_media_bad_limit= Xorriso_read_quality_md5_matcH; else if(strcmp(argv[i] + 10, "slow") == 0) xorriso->check_media_bad_limit= Xorriso_read_quality_sloW; else if(strcmp(argv[i] + 10, "partial") == 0) xorriso->check_media_bad_limit= Xorriso_read_quality_partiaL; else if(strcmp(argv[i] + 10, "valid") == 0) xorriso->check_media_bad_limit= Xorriso_read_quality_valiD; else if(strcmp(argv[i] + 10, "untested") == 0) xorriso->check_media_bad_limit= Xorriso_read_quality_untesteD; else if(strcmp(argv[i] + 10, "md5_mismatch") == 0) xorriso->check_media_bad_limit= Xorriso_read_quality_md5_mismatcH; else if(strcmp(argv[i] + 10, "invalid") == 0) xorriso->check_media_bad_limit= Xorriso_read_quality_invaliD; else if(strcmp(argv[i] + 10, "tao_end") == 0) xorriso->check_media_bad_limit= Xorriso_read_quality_tao_enD; else if(strcmp(argv[i] + 10, "off_track") == 0) xorriso->check_media_bad_limit= Xorriso_read_quality_off_tracK; else if(strcmp(argv[i] + 10, "unreadable") == 0) xorriso->check_media_bad_limit= Xorriso_read_quality_unreadablE; else goto unknown_value; } else if(strncmp(argv[i], "data_to=", 8) == 0) { ret= Sfile_str(job->data_to_path, argv[i] + 8, 0); if(ret <= 0) goto ex; } else if(strncmp(argv[i], "chunk_size=", 11) == 0) { num= Scanf_io_size(argv[i] + 11, 1); if(num >= 2048 || num == 0) job->min_block_size= num / 2048; else goto bad_value; } else if(strncmp(argv[i], "event=", 6) == 0) { strncpy(sev_text, argv[i] + 6, 19); sev_text[19]= 0; ret= Xorriso__text_to_sev(sev_text, &sev, 0); if(ret <= 0) { strcpy(xorriso->info_text, "-check_media event="); Text_shellsafe(sev_text, xorriso->info_text, 1); strcat(xorriso->info_text, " : Not a known severity name"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto ex; } strcpy(job->event_severity, sev_text); } else if(strncmp(argv[i], "map_with_volid=", 15) == 0) { if(strcmp(argv[i] + 15, "on") == 0) job->map_with_volid= 1; else if(strcmp(argv[i] + 15, "off") == 0) job->map_with_volid= 0; else goto unknown_value; } else if(strncmp(argv[i], "max_lba=", 8) == 0 || strncmp(argv[i], "min_lba=", 8) == 0) { num= -1; sscanf(argv[i] + 8, "%lf", &num); if(num > 0x7fffffff || num < 0) num= -1; if(strncmp(argv[i], "max_lba=", 8) == 0) job->max_lba= num; else job->min_lba= num; } else if(strncmp(argv[i], "patch_lba0=", 11) == 0) { job->patch_lba0_msc1= -1; if(strcmp(argv[i] + 11, "on") == 0) job->patch_lba0= 1; else if(strcmp(argv[i] + 11, "off") == 0) job->patch_lba0= 0; else if(strcmp(argv[i] + 11, "force") == 0) job->patch_lba0= 2; else if(argv[i][11] >= '1' && argv[i][11] <= '9') { num= -1; sscanf(argv[i] + 11, "%lf", &num); if(num > 0x7fffffff || num < 0) goto bad_value; job->patch_lba0_msc1= num; job->patch_lba0= (num >= 32) + (strstr(argv[i] + 11, ":force") != NULL); } else goto unknown_value; } else if(strncmp(argv[i], "report=", 7) == 0) { if(strcmp(argv[i] + 7, "blocks") == 0) job->report_mode= 0; else if(strcmp(argv[i] + 7, "files") == 0) job->report_mode= 1; else if(strcmp(argv[i] + 7, "blocks_files") == 0) job->report_mode= 2; else goto unknown_value; } else if(strcmp(argv[i], "reset=now") == 0) { ret= Checkmediajob_new(&default_job, 0); if(ret <= 0) { sprintf(xorriso->info_text, "-check_media: Cannot reset options due to lack of resources"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); ret= -1; goto ex; } Checkmediajob_copy(default_job, job, 0); Checkmediajob_destroy(&default_job, 0); xorriso->check_media_bad_limit= Xorriso_read_quality_invaliD; } else if(strncmp(argv[i], "retry=", 6) == 0) { if(strcmp(argv[i] + 6, "on") == 0) job->retry= 1; else if(strcmp(argv[i] + 6, "off") == 0) job->retry= -1; else if(strcmp(argv[i] + 6, "default") == 0) job->retry= 0; else goto unknown_value; } else if(strncmp(argv[i], "sector_map=", 11) == 0) { ret= Sfile_str(job->sector_map_path, argv[i] + 11, 0); if(ret <= 0) goto ex; } else if(strncmp(argv[i], "slow_limit=", 11) == 0) { sscanf(argv[i] + 11, "%lf", &(job->slow_threshold_seq)); } else if(strncmp(argv[i], "time_limit=", 11) == 0 || strncmp(argv[i], "item_limit=", 11) == 0 ) { num= -1; sscanf(argv[i] + 11, "%lf", &num); if(num > 0x7fffffff || num < 0) num= -1; if(strncmp(argv[i], "time_limit=", 11) == 0) job->time_limit= num; else job->item_limit= num; } else if(strncmp(argv[i], "use=", 4) == 0) { if(strcmp(argv[i] + 4, "outdev") == 0) job->use_dev= 1; else if(strcmp(argv[i] + 4, "indev") == 0) job->use_dev= 0; else if(strcmp(argv[i] + 4, "sector_map") == 0) job->use_dev= 2; else goto unknown_value; } else if(strncmp(argv[i], "what=", 5) == 0) { if(strcmp(argv[i]+5, "tracks") == 0) job->mode= 0; else if(strcmp(argv[i]+5, "image")== 0) job->mode= 1; else if(strcmp(argv[i]+5, "disc")== 0) job->mode= 2; else { unknown_value:; sprintf(xorriso->info_text, "-check_media: Unknown value with option %s", argv[i]); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; bad_value:; sprintf(xorriso->info_text, "-check_media: Unsuitable value with option %s", argv[i]); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } else { sprintf(xorriso->info_text, "-check_media: Unknown option '%s'", argv[i]); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } ret= 1; ex:; return(ret); } /* @param report Buffer of at least 10*SfileadrL @param flag bit0= only report non-default settings @return <=0 error , 1 ok , 2 with bit0: every option is on default setting */ int Xorriso_check_media_list_job(struct XorrisO *xorriso, struct CheckmediajoB *job, char *report, int flag) { int all, ret; char *default_report= NULL, quality_name[80]; struct CheckmediajoB *dflt= NULL; Xorriso_alloc_meM(default_report, char, 161); all= !(flag&1); report[0]= 0; ret= Checkmediajob_new(&dflt, 0); if(ret <= 0) {ret= -1; goto ex;} sprintf(report, "-check_media_defaults"); if(!all) strcat(report, " reset=now"); if(all || job->use_dev != dflt->use_dev) sprintf(report + strlen(report), " use=%s", job->use_dev == 1 ? "outdev" : job->use_dev == 2 ? "sector_map" : "indev"); if(all || job->mode != dflt->mode) sprintf(report + strlen(report), " what=%s", job->mode == 1 ? "disc" : "tracks"); if(all || job->min_lba != dflt->min_lba) sprintf(report + strlen(report), " min_lba=%d", job->min_lba); if(all || job->max_lba != dflt->max_lba) sprintf(report + strlen(report), " max_lba=%d", job->max_lba); if(all || job->retry != dflt->retry) sprintf(report + strlen(report), " retry=%s", job->retry == 1 ? "on" : job->retry == -1 ? "off" : "default"); if(all || job->time_limit != dflt->time_limit) sprintf(report + strlen(report), " time_limit=%d", job->time_limit); if(all || job->item_limit != dflt->item_limit) sprintf(report + strlen(report), " item_limit=%d", job->item_limit); if(all || strcmp(job->abort_file_path, dflt->abort_file_path)) { strcat(report, " abort_file="); Text_shellsafe(job->abort_file_path, report + strlen(report), 0); } if(strlen(report) > 4 * SfileadrL) {ret= 0; goto ex;} if(all || strcmp(job->data_to_path, dflt->data_to_path)) { strcat(report, " data_to="); Text_shellsafe(job->data_to_path, report + strlen(report), 0); } if(strlen(report) > 4 * SfileadrL) {ret= 0; goto ex;} if(all || strcmp(job->sector_map_path, dflt->sector_map_path)) { strcat(report, " sector_map="); Text_shellsafe(job->sector_map_path, report + strlen(report), 0); } if(all || job->map_with_volid != dflt->map_with_volid) sprintf(report + strlen(report), " map_with_volid=%s", job->map_with_volid == 1 ? "on" : "off"); if(all || job->patch_lba0 != dflt->patch_lba0) { sprintf(report + strlen(report), " patch_lba0="); if(job->patch_lba0 == 0) sprintf(report + strlen(report), "off"); else if(job->patch_lba0_msc1 >= 0) sprintf(report + strlen(report), "%d%s", job->patch_lba0_msc1, job->patch_lba0 == 2 ? ":force" : ""); else sprintf(report + strlen(report), "%s", job->patch_lba0 == 2 ? "force" : "on"); } if(all || job->report_mode != dflt->report_mode) sprintf(report + strlen(report), " report=%s", job->report_mode == 0 ? "blocks" : job->report_mode == 1 ? "files" : "blocks_files"); if(all || job->slow_threshold_seq != dflt->slow_threshold_seq) sprintf(report + strlen(report), " slow_limit=%f", job->slow_threshold_seq); if(all || xorriso->check_media_bad_limit != Xorriso_read_quality_invaliD) sprintf(report + strlen(report), " bad_limit=%s", Spotlist__quality_name(xorriso->check_media_bad_limit, quality_name, Xorriso_read_quality_invaliD, 0) + 2); if(all || job->min_block_size != dflt->min_block_size) sprintf(report + strlen(report), " chunk_size=%ds", job->min_block_size); if(all || strcmp(job->event_severity, "ALL") != 0) sprintf(report + strlen(report), " event=%s", job->event_severity); if(strlen(report) > 4 * SfileadrL) {ret= 0; goto ex;} ret= 1; ex:; strcat(report, " "); strcat(report, xorriso->list_delimiter); Checkmediajob_destroy(&dflt, 0); if(default_report != NULL) { sprintf(default_report, "-check_media_defaults reset=now %s", xorriso->list_delimiter); if(ret > 0 && strcmp(report, default_report) == 0) ret= 2; } Xorriso_free_meM(default_report); return(ret); } int Xorriso_sectormap_to_spotlist(struct XorrisO *xorriso, struct CheckmediajoB *job, struct SpotlisT **spotlist, int flag) { struct SectorbitmaP *map; int ret, i, sectors, sector_size, value, old_value= -1, old_start= -1; map= job->sector_map; if(map == NULL) return(-1); ret= Spotlist_new(spotlist, 0); if(ret <= 0) {ret= -1; goto ex;} Sectorbitmap_get_layout(map, §ors, §or_size, 0); sector_size/= 2048; if(job->max_lba >= 0) sectors= (job->max_lba + 1) / sector_size; i= 0; if(job->min_lba >= 0) i= job->min_lba / sector_size; for(; i < sectors; i++) { value= Sectorbitmap_is_set(map, i, 0); if(value == old_value) continue; if(old_value >= 0) { ret= Spotlist_add_item(*spotlist, old_start, i * sector_size - old_start, (old_value ? Xorriso_read_quality_valiD : Xorriso_read_quality_invaliD), 0); if(ret <= 0) goto ex; if(job->item_limit > 0 && Spotlist_count(*spotlist, 0) + 1 >= job->item_limit) { sprintf(xorriso->info_text, "-check_media: Reached item_limit=%d", job->item_limit); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); if(sectors - i > 1) { ret= Spotlist_add_item(*spotlist, i * sector_size, (sectors - i - 1) * sector_size, Xorriso_read_quality_untesteD, 0); if(ret <= 0) goto ex; } ret= 2; goto ex; } } old_value= value; old_start= i * sector_size; } if(old_value >= 0) { ret= Spotlist_add_item(*spotlist, old_start, i * sector_size - old_start, (old_value ? Xorriso_read_quality_valiD : Xorriso_read_quality_invaliD), 0); if(ret <= 0) goto ex; } ret= 1; ex:; if(ret <= 0) Spotlist_destroy(spotlist, 0); return(ret); } /* @param flag bit0= mark untested areas as valid bit1= leave untested areas as they are */ int Xorriso_spotlist_to_sectormap(struct XorrisO *xorriso, struct SpotlisT *spotlist, int read_chunk, struct SectorbitmaP **map, int flag) { struct SectorbitmaP *m; int map_sectors= -1, map_sector_size= -1, valid; int list_sectors, list_blocks, sector_size, sector_blocks; int replace_map= 0, count, i, lba, blocks, quality, ret, pass; sector_size= Spotlist_sector_size(spotlist, read_chunk, 0); sector_blocks= sector_size / 2048; if(*map != NULL) Sectorbitmap_get_layout(*map, &map_sectors, &map_sector_size, 0); count= Spotlist_count(spotlist, 0); list_blocks= Spotlist_block_count(spotlist, 0); /* >>> ??? insist in list_blocks % sector_blocks == 0 */ list_sectors= list_blocks / sector_blocks; if(list_sectors * sector_blocks < list_blocks) list_sectors++; if(*map != NULL && map_sectors * (map_sector_size / 2048) >= list_blocks && map_sector_size == sector_size) m= *map; else { if(*map != NULL) { if(((off_t) (*map)->sectors) * ((off_t) (*map)->sector_size) > ((off_t) list_sectors) * ((off_t) sector_size)) list_sectors= (((off_t) (*map)->sectors) * ((off_t) (*map)->sector_size)) / ((off_t) sector_size) + 1; } ret= Sectorbitmap_new(&m, list_sectors, sector_size, 0); if(ret <= 0) return(-1); replace_map= 1; if(*map != NULL) { ret= Sectorbitmap_copy(*map, m, 0); if(ret <= 0) { Sectorbitmap_destroy(&m, 0); return(0); } } } count= Spotlist_count(spotlist, 0); /* first set good bits, then eventually override by bad bits */ for(pass= 0; pass < 2; pass++) { for(i= 0; i < count; i++) { ret= Spotlist_get_item(spotlist, i, &lba, &blocks, &quality, 0); if(ret <= 0) continue; valid= quality > xorriso->check_media_bad_limit; if(quality == Xorriso_read_quality_untesteD && (flag & 1)) valid= 1; if(quality == Xorriso_read_quality_untesteD && (flag & 2)) continue; if(pass == 0 && !valid) continue; else if(pass == 1 && valid) continue; Sectorbitmap_set_range(m, lba / sector_blocks, blocks / sector_blocks, valid); } } if(replace_map) { Sectorbitmap_destroy(map, 0); *map= m; } return(1); } int Xorriso_open_job_data_to(struct XorrisO *xorriso, struct CheckmediajoB *job, int flag) { if(job->data_to_path[0] == 0) return(2); if(strcmp(job->data_to_path, "-") == 0) { job->data_to_fd= 1; } else { job->data_to_fd= open(job->data_to_path, O_RDWR | O_CREAT | O_BINARY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); } if(job->data_to_fd == -1) { sprintf(xorriso->info_text, "Cannot open path "); Text_shellsafe(job->data_to_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); return(0); } return(1); } int Xorriso_update_in_sector_map(struct XorrisO *xorriso, struct SpotlisT *spotlist, int read_chunk, struct CheckmediajoB *job, int flag) { int sectors, sector_size, sector_blocks, ret; struct SectorbitmaP *map; Sectorbitmap_destroy(&(xorriso->in_sector_map), 0); if(job->use_dev == 1) return(1); map= job->sector_map; sectors= Spotlist_block_count(spotlist, 0); if(sectors <= 0) return(0); sector_size= Spotlist_sector_size(spotlist, read_chunk, 0); sector_blocks= sector_size / 2048; if(sector_blocks > 1) sectors= sectors / sector_blocks + !!(sectors % sector_blocks); ret= Sectorbitmap_new(&(xorriso->in_sector_map), sectors, sector_size, 0); if(ret <= 0) return(ret); if(map != NULL) Sectorbitmap_copy(map, xorriso->in_sector_map, 0); ret= Xorriso_spotlist_to_sectormap(xorriso, spotlist, read_chunk, &(xorriso->in_sector_map), 1); return(ret); } libisoburn-1.5.4/xorriso/lib_mgt.c0000644000175700017510000007272513746476156014150 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2020 Thomas Schmitt, Provided under GPL version 2 or later. This file contains functions which manage the relation between xorriso and the libraries: libburn, libisofs, libisoburn. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_STDINT_H #include #else #ifdef HAVE_INTTYPES_H #include #endif #endif /* for -charset */ #include #include #ifdef Xorriso_standalonE #ifdef Xorriso_with_libjtE #include "../libjte/libjte.h" #endif #else #ifdef Xorriso_with_libjtE #include #endif #endif /* ! Xorriso_standalonE */ #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" #include "lib_mgt.h" #include "iso_manip.h" int Xorriso_abort(struct XorrisO *xorriso, int flag) { int ret; ret= burn_abort(4440, burn_abort_pacifier, "xorriso : "); if(ret<=0) { fprintf(stderr, "\nxorriso : ABORT : Cannot cancel burn session and release drive.\n"); return(0); } fprintf(stderr, "xorriso : ABORT : Drive is released and library is shut down now.\n"); fprintf(stderr, "xorriso : ABORT : Program done. Even if you do not see a shell prompt.\n"); fprintf(stderr, "\n"); exit(1); } /* @param flag bit0= asynchronous handling (else catch thread, wait, and exit) bit1= dealing with MMC drive in critical state behavior 2 -> behavior 1 */ int Xorriso_set_signal_handling(struct XorrisO *xorriso, int flag) { char *handler_prefix= NULL; int behavior, mode; behavior= Xorriso__get_signal_behavior(0); if(behavior == 0) return(2); if(behavior == 2 && !(flag & 2)) mode= 1; else if(behavior == 3) mode= 2; else mode= (flag & 1) * 0x30; handler_prefix= calloc(strlen(xorriso->progname)+3+1, 1); if(handler_prefix==NULL) { sprintf(xorriso->info_text, "Cannot allocate memory for setting signal handler"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); return(-1); } mode|= 256; /* Ignore SIGPIPE */ /* <<< */ sprintf(xorriso->info_text, "burn_set_signal_handling(%d)", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); sprintf(handler_prefix, "%s : ", xorriso->progname); burn_set_signal_handling(handler_prefix, NULL, mode); free(handler_prefix); return(1); } int Xorriso_startup_libraries(struct XorrisO *xorriso, int flag) { int ret, major, minor, micro; char *queue_sev, *print_sev, reason[1024]; struct iso_zisofs_ctrl zisofs_ctrl; /* First an ugly compile time check for header version compatibility. If everything matches, then no C code is produced. In case of mismatch, intentionally faulty C code will be inserted. */ /* The minimum requirement of xorriso towards the libisoburn header at compile time is defined in xorriso/xorrisoburn.h xorriso_libisoburn_req_major xorriso_libisoburn_req_minor xorriso_libisoburn_req_micro It gets compared against the version macros in libburn/libburn.h : isoburn_header_version_major isoburn_header_version_minor isoburn_header_version_micro If the header is too old then the following code shall cause failure of cdrskin compilation rather than to allow production of a program with unpredictable bugs or memory corruption. The compiler messages supposed to appear in this case are: error: 'LIBISOBURN_MISCONFIGURATION' undeclared (first use in this function) error: 'INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libisoburn_dot_h_TOO_OLD__SEE_xorrisoburn_dot_c' undeclared (first use in this function) error: 'LIBISOBURN_MISCONFIGURATION_' undeclared (first use in this function) */ /* The indentation is an advise of man gcc to help old compilers ignoring */ #if xorriso_libisoburn_req_major > isoburn_header_version_major #define Isoburn_libisoburn_dot_h_too_olD 1 #endif #if xorriso_libisoburn_req_major == isoburn_header_version_major && xorriso_libisoburn_req_minor > isoburn_header_version_minor #define Isoburn_libisoburn_dot_h_too_olD 1 #endif #if xorriso_libisoburn_req_minor == isoburn_header_version_minor && xorriso_libisoburn_req_micro > isoburn_header_version_micro #define Isoburn_libisoburn_dot_h_too_olD 1 #endif #ifdef Isoburn_libisoburn_dot_h_too_olD LIBISOBURN_MISCONFIGURATION = 0; INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libisoburn_dot_h_TOO_OLD__SEE_xorrisoburn_dot_c = 0; LIBISOBURN_MISCONFIGURATION_ = 0; #endif /* End of ugly compile time test (scroll up for explanation) */ reason[0]= 0; ret= isoburn_initialize(reason, 0); if(ret==0) { sprintf(xorriso->info_text, "Cannot initialize libraries"); if(reason[0]) sprintf(xorriso->info_text+strlen(xorriso->info_text), ". Reason given:\n%s", reason); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); return(0); } ret= isoburn_is_compatible(isoburn_header_version_major, isoburn_header_version_minor, isoburn_header_version_micro, 0); if(ret<=0) { isoburn_version(&major, &minor, µ); sprintf(xorriso->info_text, "libisoburn version too old: %d.%d.%d . Need at least: %d.%d.%d .\n", major, minor, micro, isoburn_header_version_major, isoburn_header_version_minor, isoburn_header_version_micro); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); return(-1); } xorriso->libs_are_started= 1; queue_sev= "ALL"; if(xorriso->library_msg_direct_print) { /* >>> need option for controlling this in XorrisO. See also Xorriso_msgs_submit */; print_sev= xorriso->report_about_text; } else print_sev= "NEVER"; iso_set_msgs_severities(queue_sev, print_sev, "libsofs : "); burn_msgs_set_severities(queue_sev, print_sev, "libburn : "); /* ??? >>> do we want united queues ? */ /* burn_set_messenger(iso_get_messenger()); */ isoburn_set_msgs_submit(Xorriso_msgs_submit_void, (void *) xorriso, (3<<2) | 128 , 0); ret= Xorriso_set_signal_handling(xorriso, 0); if(ret <= 0) return(ret); memset(&zisofs_ctrl, 0, sizeof(zisofs_ctrl)); zisofs_ctrl.version = 1; ret = iso_zisofs_get_params(&zisofs_ctrl, 0); if (ret == 1) { xorriso->zisofs_block_size= xorriso->zisofs_block_size_default= (1 << zisofs_ctrl.block_size_log2); xorriso->zlib_level= xorriso->zlib_level_default= zisofs_ctrl.compression_level; xorriso->zisofs_v2_enabled= zisofs_ctrl.v2_enabled; xorriso->zisofs_max_total_blocks= xorriso->zisofs_max_total_blocks_default= zisofs_ctrl.max_total_blocks; xorriso->zisofs_max_file_blocks= xorriso->zisofs_max_file_blocks_default= zisofs_ctrl.max_file_blocks; xorriso->zisofs_v2_block_size= xorriso->zisofs_v2_block_size_default= 1 << zisofs_ctrl.v2_block_size_log2; xorriso->zisofs_block_number_target= zisofs_ctrl.block_number_target; xorriso->zisofs_bpt_discard_free_ratio= xorriso->zisofs_bpt_discard_free_ratio_default= zisofs_ctrl.bpt_discard_free_ratio; } xorriso->zisofs_susp_z2= xorriso->zisofs_susp_z2_default= iso_zisofs_ctrl_susp_z2(-1); iso_node_xinfo_make_clonable(Xorriso__mark_update_xinfo, Xorriso__mark_update_cloner, 0); /* Second initialization. This time with libs. */ Xorriso_preparer_string(xorriso, xorriso->preparer_id, 0); Xorriso_process_msg_queues(xorriso,0); if(reason[0]) { sprintf(xorriso->info_text, "%s", reason); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); } strcpy(xorriso->info_text, "Using "); strncat(xorriso->info_text, burn_scsi_transport_id(0), 1024); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); return(1); } /* @param flag bit0= global shutdown of libraries */ int Xorriso_detach_libraries(struct XorrisO *xorriso, int flag) { Xorriso_give_up_drive(xorriso, 3); if(xorriso->in_volset_handle!=NULL) { /* standalone image */ iso_image_unref((IsoImage *) xorriso->in_volset_handle); xorriso->in_volset_handle= NULL; Sectorbitmap_destroy(&(xorriso->in_sector_map), 0); Xorriso_destroy_di_array(xorriso, 0); Xorriso_destroy_hln_array(xorriso, 0); xorriso->boot_count= 0; } if(flag&1) { if(xorriso->libs_are_started==0) return(0); isoburn_finish(); #ifdef Xorriso_with_editlinE Xorriso__shutdown_editline(0); #endif } return(1); } /* @param flag bit0= suppress messages below UPDATE bit1= suppress messages below FAILURE */ int Xorriso_set_image_severities(struct XorrisO *xorriso, int flag) { char *queue_sev, *print_sev; if(flag&2) queue_sev= "FAILURE"; else if(flag&1) queue_sev= "UPDATE"; else queue_sev= "ALL"; if(xorriso->library_msg_direct_print) print_sev= xorriso->report_about_text; else print_sev= "NEVER"; iso_set_msgs_severities(queue_sev, print_sev, "libisofs : "); return(1); } /* @param flag bit0=prepare for a burn run */ int Xorriso_set_abort_severity(struct XorrisO *xorriso, int flag) { int ret, abort_on_number; char *sev_text; static int note_number= -1, failure_number= -1; if(note_number==-1) Xorriso__text_to_sev("NOTE", ¬e_number, 0); if(failure_number==-1) Xorriso__text_to_sev("FAILURE", &failure_number, 0); sev_text= xorriso->abort_on_text; ret= Xorriso__text_to_sev(xorriso->abort_on_text, &abort_on_number, 0); if(ret<=0) return(ret); if(abort_on_numberfailure_number) sev_text= "FAILURE"; ret= iso_set_abort_severity(sev_text); return(ret>=0); } int Xorriso_report_lib_versions(struct XorrisO *xorriso, int flag) { int major, minor, micro; int req_major, req_minor, req_micro; iso_lib_version(&major, &minor, µ); isoburn_libisofs_req(&req_major, &req_minor, &req_micro); sprintf(xorriso->result_line, "libisofs in use : %d.%d.%d (min. %d.%d.%d)\n", major, minor, micro, req_major, req_minor, req_micro); Xorriso_result(xorriso, 0); #ifdef Xorriso_with_libjtE libjte__version(&major, &minor, µ); isoburn_libjte_req(&req_major, &req_minor, &req_micro); sprintf(xorriso->result_line, "libjte in use : %d.%d.%d (min. %d.%d.%d)\n", major, minor, micro, req_major, req_minor, req_micro); Xorriso_result(xorriso, 0); #endif burn_version(&major, &minor, µ); isoburn_libburn_req(&req_major, &req_minor, &req_micro); sprintf(xorriso->result_line, "libburn in use : %d.%d.%d (min. %d.%d.%d)\n", major, minor, micro, req_major, req_minor, req_micro); Xorriso_result(xorriso, 0); strcpy(xorriso->result_line, "libburn OS adapter: "); strncat(xorriso->result_line, burn_scsi_transport_id(0), 1024); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); isoburn_version(&major, &minor, µ); sprintf(xorriso->result_line, "libisoburn in use : %d.%d.%d (min. %d.%d.%d)\n", major, minor, micro, isoburn_header_version_major, isoburn_header_version_minor, isoburn_header_version_micro); Xorriso_result(xorriso, 0); return(1); } int Xorriso__sev_to_text(int severity, char **severity_name, int flag) { int ret; ret= iso_sev_to_text(severity, severity_name); if(ret>0) return(ret); ret= burn_sev_to_text(severity, severity_name, 0); if(ret>0) return(ret); *severity_name= ""; return(0); } int Xorriso__text_to_sev(char *severity_name, int *severity_number, int flag) { int ret= 1; char severity[20]; Xorriso__to_upper(severity_name, severity, (int) sizeof(severity), 0); ret= iso_text_to_sev(severity, severity_number); if(ret>0) return(ret); ret= burn_text_to_sev(severity, severity_number, 0); return(ret); } int Xorriso__severity_cmp(char *sev1, char *sev2) { int s1= 0x7fffffff, s2= 0x7fffffff, ret; char *default_sev= "FATAL"; ret= Xorriso__text_to_sev(sev1, &s1, 0); if(ret <= 0) Xorriso__text_to_sev(default_sev, &s1, 0); ret= Xorriso__text_to_sev(sev2, &s2, 0); if(ret <= 0) Xorriso__text_to_sev(default_sev, &s2, 0); if(s1 < s2) return -1; if(s1 > s2) return(1); return(0); } char *Xorriso__severity_list(int flag) { return(burn_list_sev_texts(0)); } /* @param flag bit0= report libisofs error text bit1= victim is disk_path bit2= do not inquire libisofs, report msg_text and min_severity */ int Xorriso_report_iso_error(struct XorrisO *xorriso, char *victim, int iso_error_code, char msg_text[], int os_errno, char min_severity[], int flag) { int error_code, iso_sev, min_sev, ret; char *sev_text_pt, *msg_text_pt= NULL; char *sfe= NULL; static int sorry_sev= -1; Xorriso_alloc_meM(sfe, char, 6 * SfileadrL); if(sorry_sev<0) Xorriso__text_to_sev("SORRY", &sorry_sev, 0); if(flag&4) { error_code= 0x00050000; Xorriso__text_to_sev(min_severity, &iso_sev, 0); } else { error_code= iso_error_get_code(iso_error_code); if(error_code < 0x00030000 || error_code >= 0x00040000) error_code= (error_code & 0xffff) | 0x00050000; if(flag&1) msg_text_pt= (char *) iso_error_to_msg(iso_error_code); iso_sev= iso_error_get_severity(iso_error_code); } if(msg_text_pt==NULL) msg_text_pt= msg_text; if(iso_sev >= sorry_sev && (flag & 2) && victim[0]) Xorriso_msgs_submit(xorriso, 0, victim, 0, "ERRFILE", 0); sev_text_pt= min_severity; Xorriso__text_to_sev(min_severity, &min_sev, 0); if(min_sev < iso_sev && !(flag&4)) Xorriso__sev_to_text(iso_sev, &sev_text_pt, 0); strcpy(sfe, msg_text_pt); if(victim[0]) { strcat(sfe, ": "); Text_shellsafe(victim, sfe+strlen(sfe), 0); } ret= Xorriso_msgs_submit(xorriso, error_code, sfe, os_errno, sev_text_pt, 4); ex:; Xorriso_free_meM(sfe); return(ret); } int Xorriso_get_local_charset(struct XorrisO *xorriso, char **name, int flag) { (*name)= iso_get_local_charset(0); return(1); } int Xorriso_set_local_charset(struct XorrisO *xorriso, char *name, int flag) { int ret; char *nl_charset; iconv_t iconv_ret= (iconv_t) -1; nl_charset= nl_langinfo(CODESET); if(name == NULL) name= nl_charset; if(name == NULL) goto cannot; iconv_ret= iconv_open(nl_charset, name); if(iconv_ret == (iconv_t) -1) goto cannot; else iconv_close(iconv_ret); ret= iso_set_local_charset(name, 0); if(ret <= 0) { cannot:; sprintf(xorriso->info_text, "-local_charset: Cannot assume as local character set: "); if(name != NULL) Text_shellsafe(name, xorriso->info_text, 1); else Text_shellsafe("(NULL-pointer)", xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(0); } sprintf(xorriso->info_text, "Local character set is now assumed as: "); Text_shellsafe(name, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(1); } int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag) { int ret, error_code= 0, os_errno= 0, count= 0, pass, imgid, tunneled; int name_prefix_code; char severity[80], *text= NULL; #ifdef Xorriso_fetch_with_msg_queueS int locked= 0, uret; #endif #ifdef Xorriso_with_libjtE char *msg; #endif if(!xorriso->libs_are_started) { ret= 1; goto ex; } #ifdef Xorriso_fetch_with_msg_queueS Xorriso_alloc_meM(text, char, sizeof(xorriso->info_text)); ret= pthread_mutex_lock(&(xorriso->lib_msg_queue_lock)); if(ret != 0) { Xorriso_msgs_submit(xorriso, 0, "Cannot acquire mutex lock for processing library message queues", ret, "FATAL", 0); } else locked= 1; #else /* Xorriso_fetch_with_msg_queueS */ text= xorriso->info_text; #endif /* ! Xorriso_fetch_with_msg_queueS */ for(pass= 0; pass< 3; pass++) { while(1) { tunneled= 0; if(pass==0) { #ifdef Xorriso_with_libjtE ret= 0; if(xorriso->libjte_handle != NULL) { msg= libjte_get_next_message(xorriso->libjte_handle); if(msg != NULL) { sprintf(text, "%1.4095s", msg); free(msg); strcpy(severity, "NOTE"); error_code= 0; os_errno= 0; ret= 1; } } #else break; #endif /* ! Xorriso_with_libjtE */ } else if(pass==1) ret= iso_obtain_msgs("ALL", &error_code, &imgid, text, severity); else { ret= burn_msgs_obtain("ALL", &error_code, text, &os_errno, severity); if((error_code>=0x00030000 && error_code<0x00040000) || (error_code>=0x00050000 && error_code<0x00060000)) tunneled= -1; /* "libisofs:" */ else if(error_code>=0x00060000 && error_code<0x00070000) tunneled= 1; /* "libisoburn:" */ } if(ret<=0) break; /* <<< tunneled MISHAP from libisoburn through libburn or well known error codes of MISHAP events With libburn-0.4.4 this is not necessary */ if(error_code==0x5ff73 || error_code==0x3ff73 || error_code==0x3feb9 || error_code==0x3feb2) strcpy(severity, "MISHAP"); else if(error_code==0x51001) strcpy(severity, "ERRFILE"); #ifdef Xorriso_with_libjtE if(pass == 0) name_prefix_code= 0; else name_prefix_code= pass + tunneled; #else name_prefix_code= pass + tunneled; #endif /* Xorriso_with_libjtE */ Xorriso_msgs_submit(xorriso, error_code, text, os_errno, severity, name_prefix_code << 2); count++; } } if(xorriso->library_msg_direct_print && count>0) { sprintf(text," (%d library messages repeated by xorriso)\n", count); #ifdef Xorriso_fetch_with_msg_queueS Xorriso_msgs_submit(xorriso, 0, text, 0, "NOTE", 256); #else /* Xorriso_fetch_with_msg_queueS */ Xorriso_info(xorriso, 0); #endif /* Xorriso_fetch_with_msg_queueS */ } ret= 1; ex:; #ifdef Xorriso_fetch_with_msg_queueS if(locked) { uret= pthread_mutex_unlock(&(xorriso->lib_msg_queue_lock)); if(uret != 0) { Xorriso_msgs_submit(xorriso, 0, "Cannot release mutex lock for processing library message queues", uret, "FATAL", 0); ret= -1; } } Xorriso_free_meM(text); #endif /* Xorriso_fetch_with_msg_queueS */ return(ret); } int Xorriso_md5_start(struct XorrisO *xorriso, void **ctx, int flag) { int ret; ret= iso_md5_start(ctx); if(ret == 1) return(1); Xorriso_no_malloc_memory(xorriso, NULL, 0); return(-1); } int Xorriso_md5_compute(struct XorrisO *xorriso, void *ctx, char *data, int datalen, int flag) { iso_md5_compute(ctx, data, datalen); return(1); } int Xorriso_md5_end(struct XorrisO *xorriso, void **ctx, char md5[16], int flag) { int ret; ret= iso_md5_end(ctx, md5); Xorriso_process_msg_queues(xorriso,0); if(ret <= 0) return(0); return(1); } /* @param flag bit0= avoid library calls */ int Xorriso_preparer_string(struct XorrisO *xorriso, char xorriso_id[129], int flag) { int major, minor, micro; xorriso_id[0]= 0; sprintf(xorriso_id, "XORRISO-%d.%d.%d ", Xorriso_header_version_majoR, Xorriso_header_version_minoR, Xorriso_header_version_micrO); if(strlen(xorriso_id) + strlen(Xorriso_timestamP) < 128) strcat(xorriso_id, Xorriso_timestamP); if(flag & 1) return(1); isoburn_version(&major, &minor, µ); if(strlen(xorriso_id) < 100) sprintf(xorriso_id + strlen(xorriso_id), ", LIBISOBURN-%d.%d.%d", major, minor, micro); iso_lib_version(&major, &minor, µ); if(strlen(xorriso_id) < 100) sprintf(xorriso_id + strlen(xorriso_id), ", LIBISOFS-%d.%d.%d", major, minor, micro); burn_version(&major, &minor, µ); if(strlen(xorriso_id) < 100) sprintf(xorriso_id + strlen(xorriso_id), ", LIBBURN-%d.%d.%d", major, minor, micro); return(1); } #ifdef Xorriso_with_libjtE int Xorriso_assert_jte_handle(struct XorrisO *xorriso, int flag) { int ret; if(xorriso->libjte_handle == NULL) { ret= libjte_new(&(xorriso->libjte_handle), 0); if(ret <= 0 || xorriso->libjte_handle == NULL) { sprintf(xorriso->info_text, "-jigdo: Failed to create libjte environment object"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); return(-1); } /* no stderr, no exit() */ libjte_set_error_behavior(xorriso->libjte_handle, 0, 0); } return(1); } #endif /* Xorriso_with_libjtE */ int Xorriso_jigdo_interpreter(struct XorrisO *xorriso, char *aspect, char *arg, int flag) { #ifdef Xorriso_with_libjtE int ret, num; struct libjte_env *jte; char *msg = NULL; if(strcmp(aspect, "clear") == 0) { if(xorriso->libjte_handle != NULL) libjte_destroy(&(xorriso->libjte_handle)); Xorriso_lst_destroy_all(&(xorriso->jigdo_params), 0); Xorriso_lst_destroy_all(&(xorriso->jigdo_values), 0); xorriso->libjte_params_given= 0; return(1); } ret= Xorriso_assert_jte_handle(xorriso, 0); if(ret <= 0) return(ret); jte= xorriso->libjte_handle; if(strcmp(aspect, "verbose") == 0) { if(strcmp(arg, "on") == 0) { libjte_set_verbose(jte, 1); /* Direct libjte messages to stderr, rather than message list */ libjte_set_error_behavior(xorriso->libjte_handle, 1, 0); xorriso->libjte_params_given|= 2; } else if(strcmp(arg, "off") == 0) { libjte_set_verbose(jte, 0); libjte_set_error_behavior(xorriso->libjte_handle, 0, 0); xorriso->libjte_params_given&= ~2; } else goto bad_arg; } else if(strcmp(aspect, "template_path") == 0 || strcmp(aspect, "-jigdo-template") == 0) { ret= libjte_set_template_path(jte, arg); if(ret <= 0) goto jte_failed; xorriso->libjte_params_given|= 4; } else if(strcmp(aspect, "jigdo_path") == 0 || strcmp(aspect, "-jigdo-jigdo") == 0) { ret= libjte_set_jigdo_path(jte, arg); if(ret <= 0) goto jte_failed; xorriso->libjte_params_given|= 8; } else if(strcmp(aspect, "md5_path") == 0 || strcmp(aspect, "-md5-list") == 0 || strcmp(aspect, "checksum_path") == 0 || strcmp(aspect, "-checksum-list") == 0) { ret= libjte_set_checksum_path(jte, arg); if(ret <= 0) goto jte_failed; xorriso->libjte_params_given|= 16; } else if(strcmp(aspect, "min_size") == 0 || strcmp(aspect, "-jigdo-min-file-size") == 0) { num= Scanf_io_size(arg, 0); ret= libjte_set_min_size(jte, num); if(ret <= 0) goto jte_failed; xorriso->libjte_params_given|= 32; } else if(strcmp(aspect, "checksum_iso") == 0 || strcmp(aspect, "-checksum_algorithm_iso") == 0) { ret= libjte_set_checksum_iso(jte, arg); if(ret <= 0) goto jte_failed; xorriso->libjte_params_given|= 64; } else if(strcmp(aspect, "checksum_template") == 0 || strcmp(aspect, "-checksum_algorithm_template") == 0) { ret= libjte_set_checksum_template(jte, arg); if(ret <= 0) goto jte_failed; xorriso->libjte_params_given|= 128; } else if(strcmp(aspect, "compression") == 0 || strcmp(aspect, "-jigdo-template-compress") == 0) { ret= libjte_set_compression(jte, arg); if(ret <= 0) goto jte_failed; xorriso->libjte_params_given|= 256; } else if(strcmp(aspect, "exclude") == 0 || strcmp(aspect, "-jigdo-exclude") == 0) { ret= libjte_add_exclude(jte, arg); if(ret <= 0) goto jte_failed; xorriso->libjte_params_given|= 512; } else if(strcmp(aspect, "demand_md5") == 0 || strcmp(aspect, "-jigdo-force-md5") == 0 || strcmp(aspect, "demand_checksum") == 0 || strcmp(aspect, "-jigdo-force-checksum") == 0) { ret= libjte_add_checksum_demand(jte, arg); if(ret <= 0) goto jte_failed; xorriso->libjte_params_given|= 1024; } else if(strcmp(aspect, "mapping") == 0 || strcmp(aspect, "-jigdo-map") == 0) { ret= libjte_add_mapping(jte, arg); if(ret <= 0) goto jte_failed; xorriso->libjte_params_given|= 2048; } else if(strcmp(aspect, "checksum_algorithm") == 0 || strcmp(aspect, "-jigdo-checksum-algorithm") == 0) { int ck_size; ret= libjte_set_checksum_algorithm(jte, arg, &ck_size); if(ret <= 0) goto jte_failed; xorriso->libjte_params_given|= 4096; } else { sprintf(xorriso->info_text, "-jigdo: unknown aspect '%s'", aspect); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= Xorriso_lst_new(&(xorriso->jigdo_params), aspect, xorriso->jigdo_params, 1); if(ret > 0) ret= Xorriso_lst_new(&(xorriso->jigdo_values), arg, xorriso->jigdo_values, 1); if(ret <= 0) { Xorriso_no_malloc_memory(xorriso, NULL, 0); return(-1); } Xorriso_process_msg_queues(xorriso, 0); return(1); bad_arg: sprintf(xorriso->info_text, "-jigdo %s : unknown argument '%s'", aspect, arg); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); jte_failed: while(1) { msg= libjte_get_next_message(xorriso->libjte_handle); if(msg == NULL) break; sprintf(xorriso->info_text, "%1.4095s", msg); free(msg); msg= NULL; Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } sprintf(xorriso->info_text, "Experienced libjte failure with: -jigdo %s %s", aspect, arg); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); #else /* Xorriso_with_libjtE */ sprintf(xorriso->info_text, "Jigdo Template Extraction was not enabled at compile time"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); #endif /* ! Xorriso_with_libjtE */ } int Xorriso_list_extras_result(struct XorrisO *xorriso, char *mode, char *what, int flag) { if(mode[0] != 0 && strcmp(mode, "all") != 0) { if(strcmp(mode, what) != 0 && (mode[0] != '-' || strcmp(mode + 1, what) != 0)) return(2); } Xorriso_result(xorriso, 0); return(1); } int Xorriso_list_extras(struct XorrisO *xorriso, char *mode, int flag) { int ret; if(strcmp(mode, "codes") == 0) { sprintf(xorriso->result_line, "List of xorriso extra feature codes. Usable with or without dash.\n"); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "Local ACL : -acl\n"); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "Local xattr : -xattr\n"); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "Jigdo files : -jigdo\n"); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "zisofs : -zisofs\n"); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "Ext. filters : -external_filter\n"); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "DVD obs 64 kB: -dvd_obs\n"); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "Readline : -use_readline\n"); Xorriso_result(xorriso, 0); return(1); } sprintf(xorriso->result_line, "List of xorriso extra features. yes = enabled , no = disabled\n"); Xorriso_list_extras_result(xorriso, mode, "list_extras", 0); ret= iso_local_attr_support(3); sprintf(xorriso->result_line, "Local ACL : %s\n", ret & 1 ? "yes" : "no"); Xorriso_list_extras_result(xorriso, mode, "acl", 0); sprintf(xorriso->result_line, "Local xattr : %s\n", ret & 2 ? "yes" : "no"); Xorriso_list_extras_result(xorriso, mode, "xattr", 0); sprintf(xorriso->result_line, "Jigdo files : %s\n", #ifdef Xorriso_with_libjtE "yes"); #else "no"); #endif Xorriso_list_extras_result(xorriso, mode, "jigdo", 0); ret= iso_file_add_zisofs_filter(NULL, 4); sprintf(xorriso->result_line, "zisofs : %s\n", ret == 2 ? "yes" : "no"); Xorriso_list_extras_result(xorriso, mode, "zisofs", 0); sprintf(xorriso->result_line, "Ext. filters : %s\n", #ifdef Xorriso_allow_external_filterS #ifdef Xorriso_allow_extf_suiD "yes , setuid allowed"); #else "yes , setuid banned"); #endif #else "no"); #endif Xorriso_list_extras_result(xorriso, mode, "external_filter", 0); sprintf(xorriso->result_line, "DVD obs 64 kB: %s\n", #ifdef Xorriso_dvd_obs_default_64K "yes"); #else "no"); #endif Xorriso_list_extras_result(xorriso, mode, "dvd_obs", 0); sprintf(xorriso->result_line, "Readline : %s\n", #ifdef Xorriso_with_editlinE "yes , libedit"); #else #ifdef Xorriso_with_readlinE "yes"); #else "no"); #endif #endif Xorriso_list_extras_result(xorriso, mode, "use_readline", 0); return(1); } /* @param flag bit0= set num_tiles to default value bit1= set tile_blocks to default value */ int Xorriso_set_data_cache(struct XorrisO *xorriso, void *o, int num_tiles, int tile_blocks, int flag) { int ret, tiles, blocks, set_flag; struct isoburn_read_opts *ropts; ropts= (struct isoburn_read_opts *) o; if(flag & (1 | 2)) { isoburn_ropt_get_data_cache(ropts, &tiles, &blocks, &set_flag, 1); if(flag & 1) num_tiles= tiles; if(flag & 2) tile_blocks= blocks; } ret= isoburn_ropt_set_data_cache(ropts, num_tiles, tile_blocks, 0); return(ret); } int Xorriso_format_guid(struct XorrisO *xorriso, uint8_t guid[16], char *line, int flag) { /* >>> Maybe let the user switch between hex string and structured text */; Xorriso__format_guid(guid, line, 1); return(1); } int Xorriso_make_guid(struct XorrisO *xorriso, char *line, int flag) { uint8_t guid[16]; int ret; iso_generate_gpt_guid(guid); ret= Xorriso_format_guid(xorriso, guid, line, 0); return(ret); } int Xorriso_set_libisofs_now(struct XorrisO *xorriso, int flag) { int ret; time_t now; if(xorriso->do_override_now_time) { now= xorriso->now_time_override; ret= iso_nowtime(&now, 1); } else { ret= iso_nowtime(&now, 0); } return(ret); } libisoburn-1.5.4/xorriso/iso_manip.c0000644000175700017510000043140413751503534014465 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2019 Thomas Schmitt, Provided under GPL version 2 or later. This file contains functions which manipulate the libisofs tree model. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "xorriso.h" #include "xorriso_private.h" #include "xorrisoburn.h" #include "lib_mgt.h" #include "iso_img.h" #include "iso_tree.h" #include "iso_img.h" #include "iso_manip.h" #include "sort_cmp.h" #include "parse_exec.h" #include "write_run.h" /* @param flag bit0= give directory x-permission where is r-permission bit1= do not transfer ACL or xattr bit2= record dev,inode (only if enabled by xorriso) bit3= with bit0: pretend to have indeed a directory bit5= transfer ACL or xattr from eventual link target */ int Xorriso_transfer_properties(struct XorrisO *xorriso, struct stat *stbuf, char *disk_path, IsoNode *node, int flag) { mode_t mode; int ret= 1; size_t num_attrs= 0, *value_lengths= NULL; char **names= NULL, **values= NULL; mode= stbuf->st_mode; if((!(flag & 2)) && !(xorriso->do_aaip & 1)) /* Will drop ACL. Update mode S_IRWXG by eventual group:: ACL entry */ iso_local_get_perms_wo_acl(disk_path, &mode, flag & 32); if((flag & 1) && ((flag & 8) || S_ISDIR(mode))) { if(mode&S_IRUSR) mode|= S_IXUSR; if(mode&S_IRGRP) mode|= S_IXGRP; if(mode&S_IROTH) mode|= S_IXOTH; } iso_node_set_permissions(node, mode & 07777); iso_node_set_uid(node, stbuf->st_uid); iso_node_set_gid(node, stbuf->st_gid); iso_node_set_atime(node, stbuf->st_atime); iso_node_set_mtime(node, stbuf->st_mtime); iso_node_set_ctime(node, stbuf->st_ctime); if((xorriso->do_aaip & 5) && !(flag & 2)) { ret= iso_local_get_attrs(disk_path, &num_attrs, &names, &value_lengths, &values, ((xorriso->do_aaip & 1) && !(flag & 2)) | ((!(xorriso->do_aaip & 4)) << 2) | (flag & 32)); if(ret < 0) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, disk_path, ret, "Error when obtaining local ACL and xattr", 0, "FAILURE", 1 | 2); ret= 0; goto ex; } /* Preserve namespace isofs, but not ACL or system xattr */ ret= iso_node_set_attrs(node, num_attrs, names, value_lengths, values, 1 | 8 | 16); if(ret < 0) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, "", ret, "Error when setting ACL and xattr to image node", 0, "FAILURE", 1); ret= 0; goto ex; } } if((flag & 4) && ((xorriso->do_aaip & 16) || !(xorriso->ino_behavior & 2))) { ret= Xorriso_record_dev_inode(xorriso, disk_path, (dev_t) 0, (ino_t) 0, (void *) node, "", flag & 32); if(ret <= 0) goto ex; } ret= 1; ex:; Xorriso_process_msg_queues(xorriso,0); iso_local_get_attrs(disk_path, &num_attrs, &names, &value_lengths, &values, 1 << 15); /* free memory */ return(ret); } int Xorriso_graft_split(struct XorrisO *xorriso, IsoImage *volume, IsoDir *dir, char *disk_path, char *img_name, char *nominal_source, char *nominal_target, off_t size, IsoNode **node, int flag) { int ret; IsoDir *new_dir= NULL; IsoNode *part_node; int partno, total_parts; off_t offset; char *part_name= NULL; Xorriso_alloc_meM(part_name, char, SfileadrL); ret= iso_image_add_new_dir(volume, dir, img_name, &new_dir); if(ret < 0) goto ex; *node= (IsoNode *) new_dir; if(xorriso->update_flags & 1) { ret= Xorriso_mark_update_merge(xorriso, img_name, node, 1); if(ret <= 0) {ret= 0; goto ex;} } total_parts= size / xorriso->split_size; if(size % xorriso->split_size) total_parts++; for(partno= 1; partno<=total_parts; partno++) { offset = xorriso->split_size * (off_t) (partno-1); Splitpart__compose(part_name, partno, total_parts, offset, xorriso->split_size, size, 0); ret= Xorriso_tree_graft_node(xorriso, volume, new_dir, disk_path, part_name, nominal_source, nominal_target, offset, xorriso->split_size, &part_node, 8); if(ret<=0) goto ex; } sprintf(xorriso->info_text, "Split into %d parts: ", total_parts); Text_shellsafe(nominal_target, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= 1; ex:; Xorriso_free_meM(part_name); return(ret); } /* @param flag bit0= ISO_NODE_NAME_NOT_UNIQUE exception mode: Do not issue message. Return existing node into *node. bit1= if name truncation happens: copy truncated into img_name bit3= cut_out_node: offset and size are valid bit8= hide in iso_rr bit9= hide in joliet bit10= hide in hfsplus */ int Xorriso_tree_graft_node(struct XorrisO *xorriso, IsoImage *volume, IsoDir *dir, char *disk_path, char *img_name, char *nominal_source, char *nominal_target, off_t offset, off_t cut_size, IsoNode **node, int flag) { int ret, stbuf_valid= 0; struct stat stbuf; char *namept, *eff_name, *trunc_name= NULL; off_t size= 0; eff_name= img_name; if(lstat(disk_path, &stbuf) != -1) { stbuf_valid= 1; if(S_ISREG(stbuf.st_mode)) size= stbuf.st_size; } if((int) strlen(eff_name) > xorriso->file_name_limit) { Xorriso_alloc_meM(trunc_name, char, SfileadrL); strncpy(trunc_name, eff_name, SfileadrL - 1); trunc_name[SfileadrL - 1]= 0; ret= iso_truncate_leaf_name(1, xorriso->file_name_limit, trunc_name, 0); if(ret < 0) goto ex; strcpy(xorriso->info_text, "File name had to be truncated and MD5 marked: "); Text_shellsafe(eff_name, xorriso->info_text, 1); strcat(xorriso->info_text, " -> "); Text_shellsafe(trunc_name, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); eff_name= trunc_name; if(flag & 2) strcpy(img_name, trunc_name); } if(flag&8) { if(cut_size > xorriso->file_size_limit && xorriso->file_size_limit > 0) { sprintf(xorriso->info_text, "File piece exceeds size limit of %.f bytes: %.f from ", (double) xorriso->file_size_limit, (double) cut_size); Text_shellsafe(disk_path, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } ret= iso_tree_add_new_cut_out_node(volume, dir, eff_name, disk_path, offset, cut_size, node); if(ret<0) goto ex; } else { if(xorriso->split_size > 0 && size > xorriso->split_size) { ret= Xorriso_graft_split(xorriso, volume, dir, disk_path, eff_name, nominal_source, nominal_target, size, node, 0); if(ret<=0) goto ex; } else if(size > xorriso->file_size_limit && xorriso->file_size_limit > 0) { sprintf(xorriso->info_text, "File exceeds size limit of %.f bytes: ", (double) xorriso->file_size_limit); Text_shellsafe(disk_path, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } else { ret= iso_tree_add_new_node(volume, dir, eff_name, disk_path, node); if(ret<0) goto ex; } } if(flag & (256 | 512 | 1024)) { ret= Xorriso_set_hidden(xorriso, (void *) *node, "", (flag >> 8) & 7, 0); if(ret <= 0) goto ex; } if(stbuf_valid && ((xorriso->do_aaip & 16) || !(xorriso->ino_behavior & 2))) { ret= Xorriso_record_dev_inode(xorriso, disk_path, stbuf.st_dev, stbuf.st_ino, (void *) *node, "", 1); if(ret <= 0) goto ex; } if(xorriso->update_flags & 1) { ret= Xorriso_mark_update_merge(xorriso, eff_name, *node, 1); if(ret <= 0) goto ex; } ex:; if(ret<0) { if(ret == (int) ISO_NODE_NAME_NOT_UNIQUE && (flag & 1)) { iso_image_dir_get_node(volume, dir, eff_name, node, 0); } else { Xorriso_process_msg_queues(xorriso,0); if(ret == (int) ISO_RR_NAME_TOO_LONG || ret == (int) ISO_RR_NAME_RESERVED || ret == (int) ISO_RR_PATH_TOO_LONG) namept= nominal_target; else namept= nominal_source; Xorriso_report_iso_error(xorriso, namept, ret, "Cannot add node to tree", 0, "FAILURE", 1|2); } } else { if(LIBISO_ISREG(*node)) xorriso->pacifier_byte_count+= iso_file_get_size((IsoFile *) *node); ret= 1; } Xorriso_free_meM(trunc_name); return(ret); } /* @param boss_iter Opaque handle to be forwarded to actions in ISO image Set to NULL if calling this function without having a boss iterator object. @param node Pointer to pointer to existing node, *node is set to NULL, if the node gets removed. @param flag bit0= source is directory bit4= return 3 on rejection by exclusion or user bit6= do not delete eventually existing node from di_array bit7= no special handling of split file directories @return 1= no action was needed, 2= target removed, 3= rejected with bit4, <=0 means error */ int Xoriso_handle_collision(struct XorrisO *xorriso, void *boss_iter, IsoNode **node, char *img_path, char *full_img_path, char *disk_path, char *show_path, int flag) { int ret, target_is_dir, target_is_split, source_is_dir; source_is_dir= flag & 1; target_is_dir= LIBISO_ISDIR(*node); target_is_split= 0; if(target_is_dir && !(flag & 128)) target_is_split= Xorriso_is_split(xorriso, "", (void *) *node, 1 | 2); if(!((target_is_dir && !target_is_split) && source_is_dir)) { Xorriso_process_msg_queues(xorriso, 0); /* handle overwrite situation */; if(xorriso->do_overwrite == 1 || (xorriso->do_overwrite == 2 && !(target_is_dir && !target_is_split))) { ret= Xorriso_rmi(xorriso, boss_iter, (off_t) 0, img_path, 1 | 8 | (flag & 64)); if(ret <= 0) return(ret); if(ret == 3) { sprintf(xorriso->info_text, "User revoked adding of: "); Text_shellsafe(show_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(3 * !!(flag & 16)); } *node= NULL; return(2); } if (disk_path[0]) Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0); if(strcmp(full_img_path, img_path) == 0) sprintf(xorriso->info_text, "While grafting '%s' : file object exists and may not be overwritten", img_path); else sprintf(xorriso->info_text, "While grafting '%s' : '%s' exists and may not be overwritten", full_img_path, img_path); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } return(1); } /* @param flag bit0= recursion is active bit1= do not report added files bit6= do not delete eventually existing node from di_array bit7= no special handling of split file directories bit8= hide in iso_rr bit9= hide in joliet */ int Xorriso_add_tree(struct XorrisO *xorriso, IsoDir *dir, char *img_dir_path, char *disk_dir_path, struct LinkiteM *link_stack, int flag) { IsoImage *volume; IsoNode *node; int ret, source_is_dir, source_is_link, fret, was_failure= 0; int do_not_dive, hide_attrs; struct DirseQ *dirseq= NULL; char *name, *img_name, *srcpt, *stbuf_src= ""; struct stat stbuf, hstbuf; dev_t dir_dev; struct LinkiteM *own_link_stack = NULL; char *sfe= NULL, *sfe2= NULL; char *disk_path= NULL, *img_path= NULL, *link_target= NULL; #define Xorriso_add_handle_collisioN 1 #define Xorriso_optimistic_add_treE 1 #ifndef Xorriso_optimistic_add_treE #ifndef Xorriso_add_handle_collisioN int target_is_split= 0, target_is_dir; #endif #endif /* Avoiding large local memory objects in order to save stack space */ sfe= malloc(5*SfileadrL); sfe2= malloc(5*SfileadrL); disk_path= malloc(2*SfileadrL); img_path= malloc(2*SfileadrL); link_target= calloc(SfileadrL, 1); if(sfe==NULL || sfe2==NULL || disk_path==NULL || img_path==NULL || link_target==NULL) { Xorriso_no_malloc_memory(xorriso, &sfe, 0); {ret= -1; goto ex;} } own_link_stack= link_stack; ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) goto ex; stbuf_src= disk_dir_path; if(lstat(disk_dir_path, &stbuf)==-1) goto cannot_open_dir; dir_dev= stbuf.st_dev; if(S_ISLNK(stbuf.st_mode)) { if(!(xorriso->do_follow_links || (xorriso->do_follow_param && !(flag&1)))) {ret= 2; goto ex;} stbuf_src= disk_dir_path; if(stat(disk_dir_path, &stbuf)==-1) goto cannot_open_dir; if(dir_dev != stbuf.st_dev && !(xorriso->do_follow_mount || (xorriso->do_follow_param && !(flag&1)))) {ret= 2; goto ex;} } ret= Dirseq_new(&dirseq, disk_dir_path, 1); if(ret<0) { sprintf(xorriso->info_text,"Failed to create source filesystem iterator"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } if(ret==0) { cannot_open_dir:; Xorriso_msgs_submit(xorriso, 0, disk_dir_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text,"Cannot open as source directory: %s", Text_shellsafe(disk_dir_path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } if(Sfile_str(disk_path, disk_dir_path,0)<=0) {ret= -1; goto ex;} if(disk_path[0]==0 || disk_path[strlen(disk_path)-1]!='/') strcat(disk_path,"/"); name= disk_path+strlen(disk_path); if(Sfile_str(img_path, img_dir_path, 0)<=0) {ret= -1; goto ex;} if(img_path[0] == 0) strcat(img_path, "/"); else if(img_path[strlen(img_path) - 1] != '/') strcat(img_path, "/"); img_name= img_path+strlen(img_path); while(1) { /* loop over directory content */ stbuf_src= ""; Linkitem_reset_stack(&own_link_stack, link_stack, 0); srcpt= disk_path; Xorriso_process_msg_queues(xorriso,0); ret= Dirseq_next_adr(dirseq,name,0); /* name is a pointer into disk_path */ if(ret==0) break; if(ret<0) { sprintf(xorriso->info_text,"Failed to obtain next directory entry"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } /* Compare exclusions against disk_path resp. name */ ret= Xorriso_path_is_excluded(xorriso, disk_path, 0); /* (is never param) */ if(ret<0) {ret= -1; goto ex;} if(ret>0) continue; /* Check for mkisofs-style hidings */ hide_attrs= (flag >> 8) & 3; if(hide_attrs != 3) { ret= Xorriso_path_is_hidden(xorriso, disk_path, 0); if(ret<0) goto ex; if(ret>=0) hide_attrs|= ret; } strcpy(img_name, name); if(Xorriso_much_too_long(xorriso, strlen(img_path), 0)<=0) {ret= 0; goto was_problem;} if(Xorriso_much_too_long(xorriso, strlen(srcpt), 0)<=0) {ret= 0; goto was_problem;} stbuf_src= srcpt; if(lstat(srcpt, &stbuf)==-1) { cannot_lstat:; Xorriso_msgs_submit(xorriso, 0, srcpt, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "Cannot determine attributes of source file %s", Text_shellsafe(srcpt, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); ret= 0; goto was_problem; } source_is_dir= 0; source_is_link= S_ISLNK(stbuf.st_mode); if(xorriso->do_follow_links && source_is_link) { /* Xorriso_hop_link checks for wide link loops */ ret= Xorriso_hop_link(xorriso, srcpt, &own_link_stack, &hstbuf, 0); if(ret<0) goto was_problem; if(ret==1) { ret= Xorriso_resolve_link(xorriso, srcpt, link_target, 0); if(ret<=0) goto was_problem; srcpt= link_target; stbuf_src= srcpt; if(lstat(srcpt, &stbuf)==-1) goto cannot_lstat; } else { if(Xorriso_eval_problem_status(xorriso, 0, 1|2)<0) {ret= 0; goto was_problem;} ret= Xorriso_resolve_link(xorriso, srcpt, link_target, 1); if(ret<=0) goto was_problem; } } else if (S_ISLNK(stbuf.st_mode)) { ret= Xorriso_resolve_link(xorriso, srcpt, link_target, 1); if(ret<=0) goto was_problem; } do_not_dive= 0; if(S_ISDIR(stbuf.st_mode)) { source_is_dir= 1; if(dir_dev != stbuf.st_dev && !xorriso->do_follow_mount) do_not_dive= 1; } #ifdef Xorriso_optimistic_add_treE ret= Xorriso_tree_graft_node(xorriso, volume, dir, srcpt, img_name, "", img_path, (off_t) 0, (off_t) 0, &node, 1 | (hide_attrs << 8)); if(ret == (int) ISO_NODE_NAME_NOT_UNIQUE) { ret= Xoriso_handle_collision(xorriso, NULL, &node, img_path, img_path, srcpt, img_path, (!!source_is_dir) | (flag & (64 | 128))); if(ret <= 0) goto was_problem; if(node == NULL) { ret= Xorriso_tree_graft_node(xorriso, volume, dir, srcpt, img_name, "", img_path, (off_t) 0, (off_t) 0, &node, (hide_attrs << 8)); if(ret <= 0) node= NULL; } } #else /* Xorriso_optimistic_add_treE */ /* does a node exist with this name ? */ node= NULL; if(dir != NULL) { ret= iso_image_get_dir_node(volume, dir, img_name, &node); } else { ret= Xorriso_node_from_path(xorriso, volume, img_path, &node, 1); } if(ret>0) { target_is_dir= LIBISO_ISDIR(node); target_is_split= 0; if(target_is_dir && !(flag & 128)) target_is_split= Xorriso_is_split(xorriso, "", (void *) node, 1 | 2); if(!((target_is_dir && !target_is_split) && source_is_dir)) { Xorriso_process_msg_queues(xorriso,0); /* handle overwrite situation */; if(xorriso->do_overwrite==1 || (xorriso->do_overwrite==2 && !(target_is_dir && !target_is_split))) { ret= Xorriso_rmi(xorriso, NULL, (off_t) 0, img_path, 1 | 8 | (flag & 64)); if(ret<=0) goto was_problem; if(ret==3) { sprintf(xorriso->info_text, "User revoked adding of: %s", Text_shellsafe(img_path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= 0; goto was_problem; } node= NULL; } else { Xorriso_msgs_submit(xorriso, 0, srcpt, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "While grafting %s : file object exists and may not be overwritten by %s", Text_shellsafe(img_path,sfe,0), Text_shellsafe(stbuf_src,sfe2,0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto was_problem; } } } if(node==NULL) { ret= Xorriso_tree_graft_node(xorriso, volume, dir, srcpt, img_name, "", img_path, (off_t) 0, (off_t) 0, &node, (hide_attrs << 8)); } #endif /* Xorriso_optimistic_add_treE */ if(node==NULL) { Xorriso_process_msg_queues(xorriso,0); Xorriso_msgs_submit(xorriso, 0, stbuf_src, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "Grafting failed: %s = %s", Text_shellsafe(img_path,sfe,0), Text_shellsafe(stbuf_src,sfe2,0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto was_problem; } xorriso->pacifier_count++; if((xorriso->pacifier_count%100)==0) Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 0); Xorriso_set_change_pending(xorriso, 0); if(source_is_dir) { if(do_not_dive) { sprintf(xorriso->info_text, "Did not follow mount point : %s", Text_shellsafe(disk_path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } else { ret= Xorriso_add_tree(xorriso, (IsoDir *) node, img_path, disk_path, own_link_stack, 1 | (flag & (2 | 64 | 128))); } if(ret<=0) goto was_problem; } continue; /* regular bottom of loop */ was_problem:; was_failure= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret<0) goto ex; } ret= 1; ex: if(sfe!=NULL) free(sfe); if(sfe2!=NULL) free(sfe2); if(disk_path!=NULL) free(disk_path); if(img_path!=NULL) free(img_path); if(link_target!=NULL) free(link_target); Xorriso_process_msg_queues(xorriso,0); Linkitem_reset_stack(&own_link_stack, link_stack, 0); Dirseq_destroy(&dirseq, 0); if(ret<=0) return(ret); return(!was_failure); } /* @param flag bit0= cut_out mode : base on leaf parent directory bit1= do not check and perform hidings */ int Xorriso_copy_implicit_properties(struct XorrisO *xorriso, IsoDir *dir, char *full_img_path, char *img_path, char *full_disk_path, int flag) { int ret, nfic, nic, nfdc, d, i; char *nfi= NULL, *ni= NULL, *nfd= NULL, *cpt; struct stat stbuf; Xorriso_alloc_meM(nfi, char, SfileadrL); Xorriso_alloc_meM(ni, char, SfileadrL); Xorriso_alloc_meM(nfd, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, full_img_path, nfi, 1|2); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, img_path, ni, 1|2); if(ret<=0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, full_disk_path, nfd, 1|2|4); if(ret<=0) goto ex; nfic= Sfile_count_components(nfi, 0); nic= Sfile_count_components(ni, 0); nfdc= Sfile_count_components(nfd, 0); d= nfic-(flag&1)-nic; if(d<0) {ret= -1; goto ex;} if(d>nfdc) {ret= 0; goto ex;} for(i= 0; iinfo_text, "Copied properties for "); Text_shellsafe(ni, xorriso->info_text, 1); sprintf(xorriso->info_text+strlen(xorriso->info_text), " from "); Text_shellsafe(nfd, xorriso->info_text, 1); if(!((flag&1) && d==0)) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); if(!(flag & 2)) { /* Check for mkisofs-style hidings */ ret= Xorriso_path_is_hidden(xorriso, nfd, 0); if(ret<0) goto ex; if(ret>=0) { /* Hide dir */ ret= Xorriso_set_hidden(xorriso, (void *) dir, "", ret, 0); if(ret <= 0) goto ex; } } ret= 1; ex: Xorriso_free_meM(nfi); Xorriso_free_meM(ni); Xorriso_free_meM(nfd); return(ret); } /* @param bit0= copy link target properties rather than link properties bit1= give directory x-permission where is r-permission bit2= record dev,inode (only if enabled by xorriso) */ int Xorriso_copy_properties(struct XorrisO *xorriso, char *disk_path, char *img_path, int flag) { int ret; IsoNode *node; struct stat stbuf; ret= Xorriso_get_node_by_path(xorriso, img_path, NULL, &node, 0); if(ret<=0) return(ret); if(flag & 1) { if(stat(disk_path, &stbuf)==-1) return(0); } else { if(lstat(disk_path, &stbuf)==-1) return(0); } Xorriso_transfer_properties(xorriso, &stbuf, disk_path, node, ((flag & 2) >> 1) | ((flag & 1) << 5) | (flag & 4)); Xorriso_set_change_pending(xorriso, 0); return(1); } int Xorriso_add_symlink(struct XorrisO *xorriso, IsoDir *parent, char *link_target, char *leaf_name, char *nominal_path, int flag) { int ret= 0; IsoSymlink *link= NULL; IsoImage *volume; ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret <= 0) return(ret); ret= iso_image_add_new_symlink(volume, parent, leaf_name, link_target, &link); Xorriso_process_msg_queues(xorriso,0); if(ret < 0) { Xorriso_report_iso_error(xorriso, nominal_path, ret, "Cannot create symbolic link", 0, "FATAL", 1); ret= 0; } return(ret); } /* @param boss_iter Opaque handle to be forwarded to actions in ISO image Set to NULL if calling this function from outside ISO world @param flag bit0= mkdir: graft in as empty directory, not as copy from disk bit1= do not report added files bit2= -follow, -not_*: this is not a command parameter bit3= use offset and cut_size for cut_out_node bit4= return 3 on rejection by exclusion or user bit5= if directory then do not add sub tree bit6= do not delete eventually existing node from di_array bit7= no special handling of split file directories bit8= hide in iso_rr bit9= hide in joliet bit10= ln -s: graft in as symbolic link. Link target is handed over in parameter disk_path. @return <=0 = error , 1 = added simple node , 2 = added directory , 3 = rejected */ int Xorriso_graft_in(struct XorrisO *xorriso, void *boss_iter, char *disk_path, char *img_path, off_t offset, off_t cut_size, int flag) { IsoImage *volume; char *path= NULL, *apt, *npt, *cpt; char *disk_path_pt, *resolved_disk_path= NULL; IsoDir *dir= NULL, *hdir; IsoNode *node; int done= 0, is_dir= 0, l, ret, source_is_dir, resolve_link= 0; int hide_attrs; struct stat stbuf; #define Xorriso_graft_handle_collisioN 1 #define Xorriso_optimistic_graft_iN 1 #ifndef Xorriso_optimistic_graft_iN #ifndef Xorriso_graft_handle_collisioN int target_is_split, target_is_dir; #endif #endif Xorriso_alloc_meM(path, char, SfileadrL); Xorriso_alloc_meM(resolved_disk_path, char, SfileadrL); hide_attrs= (flag >> 8) & 3; if (disk_path == NULL && !(flag & 1)) { Xorriso_msgs_submit(xorriso, 0, "Program error: Xorriso_graft_in(): disk_path == NULL && !(flag & 1)", 0, "ABORT", 0); {ret= -1; goto ex;} } if (disk_path == NULL) { disk_path= ""; } else { ret= Xorriso_path_is_excluded(xorriso, disk_path, !(flag&4)); if(ret<0) goto ex; if(ret>0) {ret= 3*!!(flag&16); goto ex;} /* Check for mkisofs-style hidings */ if(hide_attrs != 3) { ret= Xorriso_path_is_hidden(xorriso, disk_path, 0); if(ret<0) goto ex; if(ret>=0) hide_attrs|= ret; } } for(cpt= img_path; 1; cpt++) { cpt= strstr(cpt,"/."); if(cpt==NULL) break; if(cpt[2]=='.') { if(cpt[3]=='/' || cpt[3]==0) break; } else if(cpt[2]=='/' || cpt[2]==0) break; } if(cpt!=NULL) { if(disk_path[0]) Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "Unsupported relative addressing in iso_rr_path "); Text_shellsafe(img_path, xorriso->info_text, 1); if(disk_path[0]) { strcat(xorriso->info_text, " (disk: "); Text_shellsafe(disk_path, xorriso->info_text, 1); strcat(xorriso->info_text, ")"); } Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); {ret= 0; goto ex;} } ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) goto ex; strncpy(path, img_path, SfileadrL - 1); path[SfileadrL - 1]= 0; apt= npt= path; if(!(flag & (1 | 1024))) { if(disk_path[0] == 0) { Xorriso_msgs_submit(xorriso, 0, "/", 0, "ERRFILE", 0); sprintf(xorriso->info_text, "Will not graft-in the whole local filesystem by path '/'"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } ret= lstat(disk_path, &stbuf); if(ret!=-1) { if(S_ISDIR(stbuf.st_mode)) is_dir= 1; else if((stbuf.st_mode&S_IFMT)==S_IFLNK && (xorriso->do_follow_links || (xorriso->do_follow_param && !(flag&4)))) { resolve_link= 1; ret= stat(disk_path, &stbuf); if(ret!=-1) { if(S_ISDIR(stbuf.st_mode)) is_dir= 1; } } } if(ret == -1) { Xorriso_process_msg_queues(xorriso,0); Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "Cannot determine attributes of source file "); Text_shellsafe(disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); {ret= 0; goto ex;} } if(S_ISDIR(stbuf.st_mode)) { is_dir= 1; } else { l= strlen(img_path); if(l>0) if(img_path[l-1]=='/') l= 0; if(l==0) { Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "Source "); Text_shellsafe(disk_path, xorriso->info_text, 1); strcat(xorriso->info_text, " is not a directory. Target "); Text_shellsafe(img_path, xorriso->info_text, 1); strcat(xorriso->info_text, " would be."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } } } dir= iso_image_get_root(volume); if(dir==NULL) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "While grafting '%s' : no root node available", img_path); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= 0; goto ex;} } for(npt= apt; !done; apt= npt+1) { npt= strchr(apt, '/'); if(npt==NULL) { npt= apt+strlen(apt); done= 1; } else *npt= 0; if(*apt==0) { *apt= '/'; apt++; if(done) goto attach_source; continue; } source_is_dir= (is_dir || (flag&1) || !done); #ifdef Xorriso_optimistic_graft_iN /* Directories of the source path are likely to exist already as directory in the image. That will cause two lookups with optimistic, and only one with pessimistic. So optimism will pay off only with the leaf. I.e. if(done). */ if(source_is_dir) { /* eventually create directory */ ret= iso_image_dir_get_node(volume, dir, apt, &node, 0); if(ret == 1) { ret= Xoriso_handle_collision(xorriso, boss_iter, &node, path, img_path, disk_path, disk_path[0] ? disk_path : img_path, (!!source_is_dir) | (flag & (16 | 64 | 128))); if(ret <= 0 || ret == 3) goto ex; if(ret == 1 && node != NULL) dir= (IsoDir *) node; } else node= NULL; if(node == NULL) { ret= iso_image_add_new_dir(volume, dir, apt, &hdir); if(ret < 0) { Xorriso_process_msg_queues(xorriso,0); if(disk_path[0]) Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0); Xorriso_report_iso_error(xorriso, img_path, ret, "Cannot create directory", 0, "FAILURE", 1); sprintf(xorriso->info_text, "While grafting '%s' : could not insert '%s'", img_path, path); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } if(xorriso->update_flags & 1) { ret= Xorriso_mark_update_merge(xorriso, path, (IsoNode *) hdir, 1); if(ret <= 0) {ret= 0; goto ex;} } dir= hdir; Xorriso_set_change_pending(xorriso, 0); iso_node_set_ctime((IsoNode *) dir, time(NULL)); iso_node_set_uid((IsoNode *) dir, geteuid()); iso_node_set_gid((IsoNode *) dir, getegid()); if(disk_path[0] && !done) { /* This not only copies disk directory properties but also sets eventual hide_attrs */ Xorriso_copy_implicit_properties(xorriso, dir, img_path, path, disk_path, !!(flag&8)); } } } if(done) { attach_source:; if(flag&1) { /* directory node was created above */; } else if(flag & 1024) { ret= Xorriso_add_symlink(xorriso, dir, disk_path, apt, img_path, 0); if(ret <= 0) goto ex; Xorriso_set_change_pending(xorriso, 0); } else if(is_dir) { Xorriso_transfer_properties(xorriso, &stbuf, disk_path, (IsoNode *) dir, 4 | 32); if(!(flag&32)) { ret= Xorriso_add_tree(xorriso, dir, img_path, disk_path, NULL, flag & (2 | 64 | 128)); if(ret<=0) goto ex; } } else { if(resolve_link) { ret= Xorriso_resolve_link(xorriso, disk_path, resolved_disk_path, 0); if(ret<=0) goto ex; disk_path_pt= resolved_disk_path; } else disk_path_pt= disk_path; ret= Xorriso_tree_graft_node(xorriso, volume, dir, disk_path_pt, apt, disk_path, img_path, offset, cut_size, &node, 1 | (flag & 8) | (hide_attrs << 8)); if(ret == (int) ISO_NODE_NAME_NOT_UNIQUE) { ret= Xoriso_handle_collision(xorriso, boss_iter, &node, img_path, img_path, disk_path, disk_path[0] ? disk_path : img_path, (flag & (16 | 64 | 128))); if(ret <= 0 || ret == 3) goto ex; ret= Xorriso_tree_graft_node(xorriso, volume, dir, disk_path_pt, apt, disk_path, img_path, offset, cut_size, &node, (flag & 8) | (hide_attrs << 8)); } if(ret<=0) { sprintf(xorriso->info_text, "Grafting failed: "); Text_shellsafe(img_path, xorriso->info_text, 1); strcat(xorriso->info_text, " = "); Text_shellsafe(disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } Xorriso_set_change_pending(xorriso, 0); /* <<< Why set the name once again ? iso_image_set_node_name(volume, node, apt, 1); */ xorriso->pacifier_count++; if(xorriso->pacifier_count%100 && !(flag&2)) Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 0); } } else *npt= '/'; #else /* Xorriso_optimistic_graft_iN */ node= NULL; ret= iso_image_dir_get_node(volume, dir, apt, &node, 0); if(ret == 1) { #ifdef Xorriso_graft_handle_collisioN ret= Xoriso_handle_collision(xorriso, boss_iter, &node, path, img_path, disk_path, disk_path[0] ? disk_path : img_path, (!!source_is_dir) | (flag & (16 | 64 | 128))); if(ret <= 0 || ret == 3) goto ex; if(ret == 2) goto handle_path_node; #else /* Xorriso_graft_handle_collisioN */ target_is_dir= LIBISO_ISDIR(node); target_is_split= 0; if(target_is_dir && !(flag & 128)) target_is_split= Xorriso_is_split(xorriso, "", (void *) node, 1 | 2); if(!((target_is_dir && !target_is_split) && source_is_dir)) { Xorriso_process_msg_queues(xorriso,0); /* handle overwrite situation */; if(xorriso->do_overwrite==1 || (xorriso->do_overwrite==2 && !(target_is_dir && !target_is_split))) { ret= Xorriso_rmi(xorriso, boss_iter, (off_t) 0, path, 1 | 8 | (flag & 64)); if(ret<=0) goto ex; if(ret==3) { sprintf(xorriso->info_text, "User revoked adding of: "); if(disk_path[0]) Text_shellsafe(disk_path, xorriso->info_text, 1); else Text_shellsafe(img_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); {ret= 3*!!(flag&16); goto ex;} } node= NULL; goto handle_path_node; } if (disk_path[0]) Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "While grafting '%s' : '%s' exists and may not be overwritten", img_path, path); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } #endif /* ! Xorriso_graft_handle_collisioN */ dir= (IsoDir *) node; } handle_path_node:; if(node==NULL && source_is_dir) { /* make a directory */ ret= iso_image_add_new_dir(volume, dir, apt, &hdir); if(ret<0) { Xorriso_process_msg_queues(xorriso,0); if(disk_path[0]) Xorriso_msgs_submit(xorriso, 0, disk_path, 0, "ERRFILE", 0); Xorriso_report_iso_error(xorriso, img_path, ret, "Cannot create directory", 0, "FAILURE", 1); sprintf(xorriso->info_text, "While grafting '%s' : could not insert '%s'", img_path, path); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } if(xorriso->update_flags & 1) { ret= Xorriso_mark_update_merge(xorriso, path, (IsoNode *) hdir, 1); if(ret <= 0) {ret= 0; goto ex;} } dir= hdir; Xorriso_set_change_pending(xorriso, 0); iso_node_set_ctime((IsoNode *) dir, time(NULL)); iso_node_set_uid((IsoNode *) dir, geteuid()); iso_node_set_gid((IsoNode *) dir, getegid()); if(disk_path[0] && !done) /* This not only copies disk directory properties but also sets eventual hide_attrs */ Xorriso_copy_implicit_properties(xorriso, dir, img_path, path, disk_path, !!(flag&8)); } if(done) { attach_source:; if(flag&1) { /* directory node was created above */; } else if(flag & 1024) { ret= Xorriso_add_symlink(xorriso, dir, disk_path, apt, img_path, 0); if(ret <= 0) goto ex; } else if(is_dir) { Xorriso_transfer_properties(xorriso, &stbuf, disk_path, (IsoNode *) dir, 4 | 32); if(!(flag&32)) { ret= Xorriso_add_tree(xorriso, dir, img_path, disk_path, NULL, flag & (2 | 64 | 128)); if(ret<=0) goto ex; } } else { if(resolve_link) { ret= Xorriso_resolve_link(xorriso, disk_path, resolved_disk_path, 0); if(ret<=0) goto ex; disk_path_pt= resolved_disk_path; } else disk_path_pt= disk_path; ret= Xorriso_tree_graft_node(xorriso, volume, dir, disk_path_pt, apt, disk_path, img_path, offset, cut_size, &node, (flag&8) | (hide_attrs << 8)); if(ret<=0) { sprintf(xorriso->info_text, "Grafting failed: "); Text_shellsafe(img_path, xorriso->info_text, 1); strcat(xorriso->info_text, " = "); Text_shellsafe(disk_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } Xorriso_set_change_pending(xorriso, 0); iso_image_set_node_name(volume, node, apt, 1); xorriso->pacifier_count++; if(xorriso->pacifier_count%100 && !(flag&2)) Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 0); } } else *npt= '/'; #endif /* ! Xorriso_optimistic_graft_iN */ } Xorriso_process_msg_queues(xorriso,0); ret= 1+!!is_dir; ex:; Xorriso_free_meM(path); Xorriso_free_meM(resolved_disk_path); return(ret); } /* @param flag bit0= -follow: disk_path is not a command parameter */ int Xorriso_cut_out(struct XorrisO *xorriso, char *disk_path, off_t startbyte, off_t bytecount, char *iso_rr_path, int flag) { int ret; char *eff_source= NULL, *eff_dest= NULL; struct stat stbuf; Xorriso_alloc_meM(eff_source, char, SfileadrL); Xorriso_alloc_meM(eff_dest, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, disk_path, eff_source, 2|4); if(ret<=0) goto ex; ret= Xorriso_path_is_excluded(xorriso, disk_path, !(flag&1)); if(ret!=0) {ret= 0; goto ex;} if(lstat(eff_source, &stbuf)==-1) { Xorriso_msgs_submit(xorriso, 0, eff_source, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "-cut_out: Cannot determine type of "); Text_shellsafe(eff_source, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); {ret= 0; goto ex;} } if((stbuf.st_mode&S_IFMT) == S_IFLNK) { if(!(xorriso->do_follow_links || (xorriso->do_follow_param && !(flag&1)))) goto unsupported_type; if(stat(eff_source, &stbuf)==-1) { Xorriso_msgs_submit(xorriso, 0, eff_source, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "-cut_out: Cannot determine link target type of "); Text_shellsafe(eff_source, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE",0); {ret= 0; goto ex;} } } if(S_ISREG(stbuf.st_mode)) { if(stbuf.st_sizeinfo_text, "-cut_out: Byte offset %.f larger than file size %.f", (double) startbyte, (double) stbuf.st_size); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "SORRY", 0); {ret= 0; goto ex;} } } else { unsupported_type:; Xorriso_msgs_submit(xorriso, 0, eff_source, 0, "ERRFILE", 0); sprintf(xorriso->info_text, "-cut_out: Unsupported file type (%s) with ", Ftypetxt(stbuf.st_mode, 0)); Text_shellsafe(eff_source, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); {ret= 0; goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, iso_rr_path, eff_dest, 2); if(ret<=0) goto ex; ret= Xorriso_graft_in(xorriso, NULL, eff_source, eff_dest, startbyte, bytecount, 8); ex:; Xorriso_free_meM(eff_source); Xorriso_free_meM(eff_dest); return(ret); } /* @param flag bit0= do not produce info message on success bit1= do not raise protest if directory already exists @return 1=success, 0=was already directory, -1=was other type, -2=other error */ int Xorriso_mkdir(struct XorrisO *xorriso, char *path, int flag) { int ret; char *eff_path= NULL; Xorriso_alloc_meM(eff_path, char, SfileadrL); ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 1); if(ret<0) {ret= -2; goto ex;} if(ret>0) { if(ret == 2 && (flag & 2)) {ret= 0; goto ex;} sprintf(xorriso->info_text,"-mkdir: Address already existing "); Text_shellsafe(eff_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, (ret==2 ? "WARNING" : "FAILURE"), 0); {ret= -1 + (ret == 2); goto ex;} } ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 2); if(ret<0) {ret= -2; goto ex;} ret= Xorriso_graft_in(xorriso, NULL, NULL, eff_path, (off_t) 0, (off_t) 0, 1); if(ret<=0) {ret= -2; goto ex;} if(!(flag&1)) { sprintf(xorriso->info_text, "Created directory in ISO image: "); Text_shellsafe(eff_path, xorriso->info_text, 1); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso, 0); } ret= 1; ex:; Xorriso_free_meM(eff_path); return(ret); } /* @param boss_iter If not NULL then this is an iterator suitable for iso_dir_iter_remove() which is then to be used instead of iso_node_remove(). @param flag bit0= remove whole sub tree: rm -r bit1= remove empty directory: rmdir bit2= recursion: do not reassure in mode 2 "tree" bit3= this is for overwriting and not for plain removal bit4= count deleted files in xorriso->pacifier_count bit5= with bit0 only remove directory content, not the directory bit6= do not delete eventually existing node from di_array @return <=0 = error 1 = removed simple node 2 = removed directory or tree 3 = did not remove on user revocation */ int Xorriso_rmi(struct XorrisO *xorriso, void *boss_iter, off_t boss_mem, char *path, int flag) { int ret, is_dir= 0, pl, not_removed= 0, fret; IsoNode *victim_node= NULL, *node; IsoDir *boss_node, *root_dir; IsoDirIter *iter= NULL; IsoImage *volume; char *sub_name, *name; char *sfe= NULL, *sub_path= NULL; off_t mem; IsoNode **node_array= NULL; int node_count= 0, node_idx; /* Avoiding large local memory objects in order to save stack space */ sfe= malloc(5*SfileadrL); sub_path= malloc(2*SfileadrL); if(sfe==NULL || sub_path==NULL) { Xorriso_no_malloc_memory(xorriso, &sfe, 0); {ret= -1; goto ex;} } #ifndef Libisofs_iso_dir_iter_sufficienT /* Ticket 127: A80301 - A80302 I do not not deem IsoDirIter safe for node list manipulations. The parameter boss_iter once was intended to allow such but has now been downgraded to a mere check for eventual programming bugs. */ if(boss_iter!=NULL) { sprintf(xorriso->info_text, "Program error: Xorriso_rmi() was requested to delete iterated node %s", Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); ret= -1; goto ex; } #endif /* Libisofs_iso_dir_iter_sufficienT */ ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) goto ex; if(Xorriso_much_too_long(xorriso, strlen(path), 0)<=0) {ret= 0; goto ex;} ret= Xorriso_node_from_path(xorriso, volume, path, &victim_node, 0); if(ret<=0) goto ex; root_dir= iso_image_get_root(volume); if(((void *) root_dir) == ((void *) victim_node) && !(flag & 1)) { sprintf(xorriso->info_text, "May not delete root directory"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } if(LIBISO_ISDIR(victim_node)) is_dir= 1; if(!is_dir) { if(flag&2) { /* rmdir */ sprintf(xorriso->info_text, "%s in loaded ISO image is not a directory", Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } else { if(flag&1) { /* rm -r */ if((xorriso->do_reassure==1 && !xorriso->request_not_to_ask) || (flag&32) || ((void *) root_dir) == ((void *) victim_node)) { /* Iterate over subordinates and delete them */ mem= boss_mem; ret= Xorriso_findi_iter(xorriso, (IsoDir *) victim_node, &mem, &iter, &node_array, &node_count, &node_idx, &node, 1|2); if(ret<=0) { cannot_create_iter:; Xorriso_cannot_create_iter(xorriso, ret, 0); ret= -1; goto ex; } pl= strlen(path); strcpy(sub_path, path); if(pl==0 || sub_path[pl-1]!='/') { sub_path[pl++]= '/'; sub_path[pl]= 0; } sub_name= sub_path+pl; while(1) { ret= Xorriso_findi_iter(xorriso, (IsoDir *) victim_node, &mem, &iter, &node_array, &node_count, &node_idx, &node, 0); if(ret<0) goto ex; if(ret==0 || xorriso->request_to_abort) break; name= (char *) iso_node_get_name(node); if(Xorriso_much_too_long(xorriso, pl+1+strlen(name), 0)<=0) {ret= 0; goto rm_r_problem_handler;} strcpy(sub_name, name); ret= Xorriso_rmi(xorriso, iter, mem, sub_path, (flag & ( 1 | 2 | 8 | 16 | 64)) | 4); if(ret==3 || ret<=0 || xorriso->request_to_abort) { rm_r_problem_handler:; not_removed= 1; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret<0) goto dir_not_removed; } } if(flag&32) {ret= 2; goto ex;} if(not_removed) { dir_not_removed:; sprintf(xorriso->info_text, "Directory not removed: %s", Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); if(ret>0) ret= 3; goto ex; } } } else { if(!(flag&2)) { /* not rmdir */ sprintf(xorriso->info_text, "%s in loaded ISO image is a directory", Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } ret= iso_dir_get_children((IsoDir *) victim_node, &iter); Xorriso_process_msg_queues(xorriso,0); if(ret<0) goto cannot_create_iter; if(ret>0) { if(iso_dir_iter_next(iter, &node) == 1) { sprintf(xorriso->info_text, "Directory not empty on attempt to delete: %s", Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } } } if(((void *) root_dir) == ((void *) victim_node)) {ret= 2; goto ex;} if(xorriso->request_to_abort) {ret= 3; goto ex;} boss_node= iso_node_get_parent(victim_node); Xorriso_process_msg_queues(xorriso,0); if(boss_node==NULL) { sprintf(xorriso->info_text, "Cannot find parent node of %s in loaded ISO image", Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } while((xorriso->do_reassure==1 || (xorriso->do_reassure==2 && !(flag&4))) && !xorriso->request_not_to_ask) { /* ls -ld */ Xorriso_ls_filev(xorriso, xorriso->wdi, 1, &path, (off_t) 0, 1|2|8); if(is_dir) /* du -s */ Xorriso_ls_filev(xorriso, xorriso->wdi, 1, &path, (off_t) 0, 2|4); if(flag&8) sprintf(xorriso->info_text, "File exists. Remove ? n= keep old, y= remove, x= abort, @= stop asking\n"); else sprintf(xorriso->info_text, "Remove above file ? n= keep it, y= remove it, x= abort, @= stop asking\n"); Xorriso_info(xorriso, 4); ret= Xorriso_request_confirmation(xorriso, 1|2|4|16); if(ret<=0) goto ex; if(xorriso->request_to_abort) { sprintf(xorriso->info_text, "Removal operation aborted by user before file: %s", Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= 3; goto ex; } if(ret==3) continue; if(ret==6) /* yes */ break; if(ret==4) { /* yes, do not ask again */ xorriso->request_not_to_ask= 1; break; } if(ret==1) { /* no */ sprintf(xorriso->info_text, "Kept in existing state: %s", Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= 3; goto ex; } } if(!(flag & 64)) Xorriso_invalidate_di_item(xorriso, victim_node, 0); #ifdef Libisofs_iso_dir_iter_sufficienT if(boss_iter!=NULL) { ret= iso_dir_iter_remove((IsoDirIter *) boss_iter); if(ret<0) ret= -1; } else ret= iso_node_remove(victim_node); #else /* ! Libisofs_iso_dir_iter_sufficienT */ ret= iso_node_remove(victim_node); #endif /* Libisofs_iso_dir_iter_sufficienT */ Xorriso_process_msg_queues(xorriso,0); if(ret<0) { Xorriso_report_iso_error(xorriso, path, ret, "Cannot remove node", 0, "FATAL", 1); sprintf(xorriso->info_text, "Internal failure to remove %s from loaded ISO image", Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); ret= -1; goto ex; } if(flag&16) xorriso->pacifier_count++; Xorriso_set_change_pending(xorriso, 0); ret= 1+!!is_dir; ex:; if(sfe!=NULL) free(sfe); if(sub_path!=NULL) free(sub_path); Xorriso_findi_iter(xorriso, (IsoDir *) victim_node, &mem, &iter, &node_array, &node_count, &node_idx, &node, (1u<<31)); return(ret); } int Xorriso_overwrite_dest(struct XorrisO *xorriso, void *boss_iter, char *eff_dest, int dest_ret, char *activity, int flag) { int ret; if(dest_ret==2 && xorriso->do_overwrite!=1) { sprintf(xorriso->info_text, "%s: May not overwrite directory: ", activity); Text_shellsafe(eff_dest, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } else if (dest_ret==1 && !xorriso->do_overwrite) { sprintf(xorriso->info_text, "%s: May not overwrite: ", activity); Text_shellsafe(eff_dest, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } else if(dest_ret>0) { ret= Xorriso_rmi(xorriso, boss_iter, (off_t) 0, eff_dest, 1|8); if(ret<=0) return(0); if(ret==3) { sprintf(xorriso->info_text, "%s: User revoked removal of: ", activity); Text_shellsafe(eff_dest, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(0); } } return(1); } /* @param boss_iter Opaque handle to be forwarded to actions in ISO image Set to NULL if calling this function from outside ISO world @param flag bit0= silently ignore attempt of renaming to same path and return 2 */ int Xorriso_rename(struct XorrisO *xorriso, void *boss_iter, char *origin, char *dest, int flag) { int ret, ol, dest_ret; char *eff_dest= NULL, *dir_adr= NULL, *cpt; char *leafname, *eff_origin= NULL, *old_leafname; IsoImage *volume; IsoDir *origin_dir, *dest_dir; IsoNode *node, *iso_node; Xorriso_alloc_meM(eff_dest, char, SfileadrL); Xorriso_alloc_meM(dir_adr, char, SfileadrL); Xorriso_alloc_meM(eff_origin, char, SfileadrL); #ifndef Libisofs_iso_dir_iter_sufficienT /* Ticket 127: A80301 - A80302 I do not not deem IsoDirIter safe for node list manipulations. The parameter boss_iter once was intended to allow such but has now been downgraded to a mere check for eventual programming bugs. */ if(boss_iter!=NULL) { sprintf(xorriso->info_text, "Program error: Xorriso_rename() was requested to delete iterated node "); Text_shellsafe(origin, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } #endif /* Libisofs_iso_dir_iter_sufficienT */ ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, origin, eff_origin, 0); if(ret<=0) goto ex; dest_ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, dest, eff_dest,1); if(dest_ret<0) {ret= dest_ret; goto ex;} if(dest_ret==0) { /* obtain eff_dest address despite it does not exist */ ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, dest, eff_dest, 2); if(ret<=0) goto ex; } /* Prevent that destination is a subordinate of origin (that would be a black hole plopping out of the universe) */ ol= strlen(eff_origin); if(ol==0) { sprintf(xorriso->info_text, "May not rename root directory"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } else if(strcmp(eff_origin, eff_dest)==0) { if(flag & 1) {ret= 2; goto ex;} sprintf(xorriso->info_text, "Ignored attempt to rename "); Text_shellsafe(eff_origin, xorriso->info_text, 1); strcat(xorriso->info_text, " to itself"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); {ret= 0; goto ex;} } else if(strncmp(eff_origin, eff_dest, ol)==0 && (eff_dest[ol]==0 || eff_dest[ol]=='/')) { sprintf(xorriso->info_text, "May not rename "); Text_shellsafe(eff_origin, xorriso->info_text, 1); strcat(xorriso->info_text, " to its own sub address "); Text_shellsafe(eff_dest, xorriso->info_text, 1 | 2); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } /* Check whether destination exists and may be not overwritable */ ret= Xorriso_overwrite_dest(xorriso, boss_iter, eff_dest, dest_ret, "Renaming", 0); if(ret <= 0) goto ex; /* Ensure existence of destination directory */ strcpy(dir_adr, eff_dest); cpt= strrchr(dir_adr, '/'); if(cpt==NULL) cpt= dir_adr+strlen(dir_adr); *cpt= 0; if(dir_adr[0]!=0) { ret= Xorriso_graft_in(xorriso, boss_iter, NULL, dir_adr, (off_t) 0, (off_t) 0, 1); if(ret<=0) goto ex; } /* Move node */ ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) goto ex; Xorriso_node_from_path(xorriso, volume, dir_adr, &iso_node, 0); dest_dir= (IsoDir *) iso_node; strcpy(dir_adr, eff_origin); cpt= strrchr(dir_adr, '/'); if(cpt==NULL) cpt= dir_adr+strlen(dir_adr); *cpt= 0; Xorriso_node_from_path(xorriso, volume, dir_adr, &iso_node, 0); origin_dir= (IsoDir *) iso_node; Xorriso_node_from_path(xorriso, volume, eff_origin, &node, 0); if(dest_dir==NULL || origin_dir==NULL || node==NULL) { Xorriso_process_msg_queues(xorriso,0); sprintf(xorriso->info_text, "Internal error on rename: confirmed node turns out as NULL"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } ret= iso_node_take(node); if(ret<0) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, eff_dest, 0, "Cannot take", 0, "FATAL",1); sprintf(xorriso->info_text, "Internal error on rename: failed to take node"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } leafname= strrchr(eff_dest, '/'); if(leafname==NULL) leafname= eff_dest; else leafname++; old_leafname= (char *) iso_node_get_name(node); if(strcmp(leafname, old_leafname)!=0) ret= iso_image_set_node_name(volume, node, leafname, 1); else ret= 1; if(ret<0) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, eff_dest, ret, "Cannot set name", 0, "FAILURE", 1); ret= iso_dir_add_node(origin_dir, node, 0); Xorriso_process_msg_queues(xorriso,0); if(ret < 0) Xorriso_report_iso_error(xorriso, eff_origin, ret, "Cannot re-instate node at old path", 0, "FAILURE", 1); {ret= -1; goto ex;} } Xorriso_process_msg_queues(xorriso,0); ret= iso_dir_add_node(dest_dir, node, 0); if(ret<0) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, eff_dest, 0, "Cannot add", 0, "FATAL", 1); sprintf(xorriso->info_text, "Internal error on rename: failed to insert node"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } Xorriso_set_change_pending(xorriso, 0); ret= 1; ex:; Xorriso_free_meM(eff_dest); Xorriso_free_meM(dir_adr); Xorriso_free_meM(eff_origin); return(ret); } int Xorriso_cannot_clone(struct XorrisO *xorriso, char *eff_origin, char *eff_dest, int iso_error, int flag) { Xorriso_report_iso_error(xorriso, eff_dest, iso_error, "Cannot clone", 0, "FAILURE", 1); sprintf(xorriso->info_text, "Failed to clone "); Text_shellsafe(eff_origin, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } /* @param flag bit0= for iso_tree_clone() : merge directories bit1= do not issue NOTE message */ int Xorriso_clone_tree(struct XorrisO *xorriso, void *boss_iter, char *origin, char *dest, int flag) { int ret, dest_ret, l; char *eff_dest= NULL, *eff_origin= NULL, *dir_adr= NULL; char *leafname; IsoImage *volume; IsoDir *new_parent; IsoNode *origin_node, *dir_node, *new_node; Xorriso_alloc_meM(eff_dest, char, SfileadrL); Xorriso_alloc_meM(eff_origin, char, SfileadrL); Xorriso_alloc_meM(dir_adr, char, SfileadrL); ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret <= 0) goto ex; ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, origin, eff_origin, 0); if(ret<=0) goto ex; ret= Xorriso_node_from_path(xorriso, volume, eff_origin, &origin_node, 0); if(ret <= 0) goto ex; dest_ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, dest, eff_dest,1); if(dest_ret<0) {ret= dest_ret; goto ex;} if(dest_ret > 0) { if(eff_dest[0] == 0) strcpy(eff_dest, "/"); sprintf(xorriso->info_text, "Cloning: Copy address already exists: "); Text_shellsafe(eff_dest, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); {ret= 0; goto ex;} } else { /* obtain eff_dest address despite it does not exist */ ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, dest, eff_dest, 2); if(ret<=0) goto ex; } /* Obtain parent path and leaf name */ strcpy(dir_adr, eff_dest); for(l= strlen(dir_adr); l > 0; ) { if(dir_adr[l - 1] == '/') dir_adr[--l]= 0; else break; } leafname= strrchr(dir_adr, '/'); if(leafname == NULL) { leafname= dir_adr; if (leafname[0] == 0) { Xorriso_msgs_submit(xorriso, 0, "Empty file name as clone destination", 0, "FAILURE", 0); {ret= 0; goto ex;} } } else { *leafname= 0; leafname++; if(dir_adr[0] != 0) { /* Ensure existence of destination directory */ ret= Xorriso_graft_in(xorriso, boss_iter, NULL, dir_adr, (off_t) 0, (off_t) 0, 1); if(ret <= 0) goto ex; } } ret= Xorriso_node_from_path(xorriso, volume, dir_adr, &dir_node, 0); if(ret <= 0) goto ex; new_parent= (IsoDir *) dir_node; ret = iso_image_tree_clone(volume, origin_node, new_parent, leafname, &new_node, (flag & 1) | 2); Xorriso_process_msg_queues(xorriso,0); if(ret < 0) { Xorriso_cannot_clone(xorriso, eff_origin, eff_dest, ret, 0); {ret= 0; goto ex;} } Xorriso_set_change_pending(xorriso, 0); if(!(flag & 2)) { strcpy(xorriso->info_text, "Cloned in ISO image: "); Text_shellsafe(eff_origin, xorriso->info_text, 1); strcat(xorriso->info_text, " to "); Text_shellsafe(eff_dest, xorriso->info_text, 1 | 2); strcat(xorriso->info_text, "\n"); Xorriso_info(xorriso, 0); } ret= 1; ex:; Xorriso_free_meM(eff_dest); Xorriso_free_meM(eff_origin); Xorriso_free_meM(dir_adr); return(ret); } int Xorriso_clone_under(struct XorrisO *xorriso, char *origin, char *dest, int flag) { int ret, pass; char *eff_dest= NULL, *eff_origin= NULL, *namept; IsoDir *origin_dir, *dest_dir; IsoDirIter *iter= NULL; IsoNode *origin_node, *new_node; IsoImage *volume; Xorriso_alloc_meM(eff_dest, char, SfileadrL); Xorriso_alloc_meM(eff_origin, char, SfileadrL); ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret <= 0) goto ex; ret= Xorriso_dir_from_path(xorriso, "Copy source", origin, &origin_dir, 0); if(ret <= 0) goto ex; ret= Xorriso_dir_from_path(xorriso, "Copy destination", dest, &dest_dir, 0); if(ret <= 0) goto ex; for(pass= 0; pass < 2; pass++) { ret= iso_dir_get_children(origin_dir, &iter); if(ret < 0) { Xorriso_cannot_create_iter(xorriso, ret, 0); {ret= -1; goto ex;} } Xorriso_process_msg_queues(xorriso,0); while(iso_dir_iter_next(iter, &origin_node) == 1) { namept= (char *) iso_node_get_name(origin_node); sprintf(eff_origin, "%s/%s", origin, namept); sprintf(eff_dest, "%s/%s", dest, namept); if(pass == 0) { ret= Xorriso_node_from_path(xorriso, volume, eff_dest, &new_node, 1); if(ret < 0) goto ex; if(ret > 0) { sprintf(xorriso->info_text, "Cloning: Copy address already exists: "); Text_shellsafe(eff_dest, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } } else { ret = iso_image_tree_clone(volume, origin_node, dest_dir, namept, &new_node, 1 | 2); Xorriso_process_msg_queues(xorriso,0); if(ret < 0) { Xorriso_cannot_clone(xorriso, eff_origin, eff_dest, ret, 0); ret= 0; goto ex; } } } iso_dir_iter_free(iter); iter= NULL; } Xorriso_set_change_pending(xorriso, 0); ret= 1; ex:; if(iter != NULL) iso_dir_iter_free(iter); Xorriso_free_meM(eff_dest); Xorriso_free_meM(eff_origin); Xorriso_process_msg_queues(xorriso,0); return(ret); } int Xorriso_set_st_mode(struct XorrisO *xorriso, char *in_path, mode_t mode_and, mode_t mode_or, int flag) { mode_t mode= 0; int ret; IsoNode *node; char *path= NULL; Xorriso_alloc_meM(path, char, SfileadrL); ret= Xorriso_get_node_by_path(xorriso, in_path, path, &node, 0); if(ret<=0) goto ex; mode= iso_node_get_permissions(node); mode= (mode & mode_and) | mode_or; iso_node_set_permissions(node, mode); iso_node_set_ctime(node, time(NULL)); sprintf(xorriso->info_text,"Permissions now: %-5.5o ", (unsigned int) (mode & 0xffff)); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); Xorriso_set_change_pending(xorriso, 0); Xorriso_process_msg_queues(xorriso,0); ret= 1; ex:; Xorriso_free_meM(path); return(ret); } int Xorriso_set_uid(struct XorrisO *xorriso, char *in_path, uid_t uid, int flag) { int ret; IsoNode *node; ret= Xorriso_get_node_by_path(xorriso, in_path, NULL, &node, 0); if(ret<=0) return(ret); iso_node_set_uid(node, uid); iso_node_set_ctime(node, time(NULL)); Xorriso_set_change_pending(xorriso, 0); Xorriso_process_msg_queues(xorriso,0); return(1); } int Xorriso_set_gid(struct XorrisO *xorriso, char *in_path, gid_t gid, int flag) { int ret; IsoNode *node; ret= Xorriso_get_node_by_path(xorriso, in_path, NULL, &node, 0); if(ret<=0) return(ret); iso_node_set_gid(node, gid); iso_node_set_ctime(node, time(NULL)); Xorriso_set_change_pending(xorriso, 0); Xorriso_process_msg_queues(xorriso,0); return(1); } /* @parm flag bit0= atime, bit1= ctime, bit2= mtime, bit8=no auto ctime */ int Xorriso_set_time(struct XorrisO *xorriso, char *in_path, time_t t, int flag) { int ret; IsoNode *node; ret= Xorriso_get_node_by_path(xorriso, in_path, NULL, &node, 0); if(ret<=0) return(ret); if(flag&1) iso_node_set_atime(node, t); if(flag&2) iso_node_set_ctime(node, t); if(flag&4) iso_node_set_mtime(node, t); if(!(flag&(2|256))) iso_node_set_ctime(node, time(NULL)); Xorriso_set_change_pending(xorriso, 0); Xorriso_process_msg_queues(xorriso,0); return(1); } /* Apply the effect of mkisofs -r to a single node */ int Xorriso_mkisofs_lower_r(struct XorrisO *xorriso, IsoNode *node, int flag) { mode_t perms; perms= iso_node_get_permissions(node); iso_node_set_uid(node, (uid_t) 0); iso_node_set_gid(node, (gid_t) 0); perms|= S_IRUSR | S_IRGRP | S_IROTH; perms&= ~(S_IWUSR | S_IWGRP | S_IWOTH); if(perms & (S_IXUSR | S_IXGRP | S_IXOTH)) perms|= (S_IXUSR | S_IXGRP | S_IXOTH); perms&= ~(S_ISUID | S_ISGID | S_ISVTX); iso_node_set_permissions(node, perms); return(1); } /* @param node Opaque handle to IsoNode which is to be manipulated instead of path if it is not NULL. @param path is used as address if node is NULL. @param access_text "access" ACL in long text form @param default_text "default" ACL in long text form @param flag bit0= do not warn of root directory if not capable of AAIP @return >0 success , <=0 failure */ int Xorriso_setfacl(struct XorrisO *xorriso, void *in_node, char *path, char *access_text, char *default_text, int flag) { int ret; IsoNode *node; node= (IsoNode *) in_node; if(node == NULL) { ret= Xorriso_get_node_by_path(xorriso, path, NULL, &node, 0); if(ret<=0) goto ex; } ret= iso_node_set_acl_text(node, access_text, default_text, 4); Xorriso_process_msg_queues(xorriso,0); if(ret <= 0) { Xorriso_report_iso_error(xorriso, "", ret, "Error when setting ACL to image node", 0, "FAILURE", 1); if(path != NULL && path[0] != 0) { strcpy(xorriso->info_text, "Error with setting ACL of "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } ret= 0; goto ex; } Xorriso_set_change_pending(xorriso, 0); ret= 1; ex:; return(ret); } /* @param in_node Opaque handle to IsoNode which is to be manipulated instead of path if it is not NULL. @param path is used as address if node is NULL. @param num_attrs Number of attributes @param names Array of pointers to 0 terminated name strings @param value_lengths Array of byte lengths for each attribute payload @param values Array of pointers to the attribute payload bytes @param flag bit0= Do not maintain eventual existing ACL of the node bit1= Do not clear the existing attribute list bit2= Delete the attributes with the given names bit3= Allow non-user attributes. bit4= do not warn of root if incapable of AAIP @return >0 success , <=0 failure */ int Xorriso_setfattr(struct XorrisO *xorriso, void *in_node, char *path, size_t in_num_attrs, char **in_names, size_t *in_value_lengths, char **in_values, int flag) { int ret, block_isofs= 0, in_original= 1; size_t i, j, num_attrs; IsoNode *node; char **names, **values; size_t *value_lengths; num_attrs= in_num_attrs; names= in_names; value_lengths= in_value_lengths; values= in_values; node= (IsoNode *) in_node; if(node == NULL) { ret= Xorriso_get_node_by_path(xorriso, path, NULL, &node, 0); if(ret<=0) goto ex; } if((xorriso->do_aaip & 1024) && !(flag & 8)) { flag|= 8; block_isofs= 1; for(i= 0; i < in_num_attrs; i++) { if(strncmp(in_names[i], "isofs.", 6) == 0) { if(in_original) { strcpy(xorriso->info_text, "Attempt to set xattr from namespace \"isofs\" to "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); ret= Xorriso_eval_problem_status(xorriso, 0, 0); if(ret < 0) { ret= 0; goto ex; } /* Switch to copy mode and omit isofs names */ Xorriso_alloc_meM(names, char *, num_attrs); Xorriso_alloc_meM(value_lengths, size_t, num_attrs); Xorriso_alloc_meM(values, char *, num_attrs); in_original= 0; for(j= 0; j < i; j++) { names[j]= in_names[j]; value_lengths[j]= in_value_lengths[j]; values[j]= in_values[j]; } num_attrs= i; } } else if(!in_original) { names[num_attrs]= in_names[i]; value_lengths[num_attrs]= in_value_lengths[i]; values[num_attrs]= in_values[i]; num_attrs++; } } } if(num_attrs <= 0) { ret= 1; goto ex; } ret= iso_node_set_attrs(node, num_attrs, names, value_lengths, values, (flag & (1 | 2 | 4 | 8)) | (block_isofs << 4)); Xorriso_process_msg_queues(xorriso,0); if(ret <= 0) { Xorriso_report_iso_error(xorriso, "", ret, "Error when setting ACL and xattr to image node", 0, "FAILURE", 1); if(path != NULL && path[0] != 0) { strcpy(xorriso->info_text, "Error with setting xattr of "); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); } ret= 0; goto ex; } Xorriso_set_change_pending(xorriso, 0); ret= 1; ex:; Xorriso_process_msg_queues(xorriso, 0); if(!in_original) { Xorriso_free_meM(names); Xorriso_free_meM(value_lengths); Xorriso_free_meM(values); } return(ret); } /* @param flag bit0= use parameters dev,ino rather than disk_path bit1= compare attribute rather than setting it return: 0=dev,ino match, 1=mismatch, 2=no node attribute -1=error bit5= if not bit0: transfer dev,inode from eventual link target bit7= omit dev check mit bit1 */ int Xorriso_record_dev_inode(struct XorrisO *xorriso, char *disk_path, dev_t dev, ino_t ino, void *in_node, char *iso_path, int flag) { size_t l, di_l= 0; int i, ret; dev_t hdev; ino_t hino; char buf[66], *bufpt, *wpt, *di= NULL; static char *name= "isofs.di"; struct stat stbuf; if(!(flag & 1)) { if(flag & 32) { if(stat(disk_path, &stbuf) == -1) return(-1); } else { if(lstat(disk_path, &stbuf) == -1) return(-1); } dev= stbuf.st_dev; ino= stbuf.st_ino; } wpt= buf; hdev= dev; for(i= 0; hdev != 0; i++) hdev= hdev >> 8; l= i; *(wpt++)= l; for(i= 0; i < (int) l; i++) *(wpt++)= dev >> (8 * (l - i - 1)); hino= ino; for(i= 0; hino != 0; i++) hino= hino >> 8; l= i; *(wpt++)= l; for(i= 0; i < (int) l; i++) *(wpt++)= ino >> (8 * (l - i - 1)); l= wpt - buf; bufpt= buf; if(flag & 2) { /* Compare node attribute with bufpt,l */ ret= Xorriso_get_attr_value(xorriso, in_node, iso_path, "isofs.di", &di_l, &di, 0); if(ret < 0) goto ex; if(ret == 0) {ret= 2; goto ex;} if(flag & 128) { if(di_l <= 0) {ret= 1; goto ex;} hino= 0; for(i= di[0] + 2; i < (int) di_l && i - di[0] - 2 < di[(int) di[0] + 1]; i++) hino= (hino << 8) | ((unsigned char *) di)[i]; if(hino != ino) {ret= 1; goto ex;} } else { if(l != di_l) {ret= 1; goto ex;} for(i= 0; i < (int) l; i++) if(di[i] != buf[i]) {ret= 1; goto ex;} } ret= 0; } else { ret= Xorriso_setfattr(xorriso, in_node, iso_path, (size_t) 1, &name, &l, &bufpt, 2 | 8); } ex:; if(di != NULL) free(di); return(ret); } /* @return see Xorriso_update_interpreter() */ int Xorriso_widen_hardlink(struct XorrisO *xorriso, void * boss_iter, IsoNode *node, char *abs_path, char *iso_prefix, char *disk_prefix, int flag) { int ret= 0, idx, low, high, i, do_widen= 0, compare_result= 0; char *disk_path; Xorriso_alloc_meM(disk_path, char, SfileadrL); /* Lookup all di_array instances of node */ if(LIBISO_ISDIR(node)) {ret= 3; goto ex;} ret= Xorriso_search_di_range(xorriso, node, &idx, &low, &high, 2); if(ret <= 0) {ret= 3; goto ex;} /* Check and reset di_do_widen bits */ for(i= low; i <= high; i++) { if(node != xorriso->di_array[i]) /* might be NULL */ continue; if(xorriso->di_do_widen[i / 8] & (1 << (i % 8))) do_widen= 1; xorriso->di_do_widen[i / 8]&= ~(1 << (i % 8)); } if(idx < 0 || !do_widen) {ret= 3; goto ex;} ret= Xorriso_pfx_disk_path(xorriso, abs_path, iso_prefix, disk_prefix, disk_path, 0); if(ret <= 0) goto ex; ret= Sfile_type(disk_path, 1); if(ret < 0) {ret= 3; goto ex;} /* does not exist on disk */ /* >>> compare_result bit17 = is_split */; ret= Xorriso_update_interpreter(xorriso, boss_iter, NULL, compare_result, disk_path, abs_path, 1); if(ret <= 0) goto ex; ex:; Xorriso_free_meM(disk_path); return(ret); } int Xorriso_set_hidden(struct XorrisO *xorriso, void *in_node, char *path, int hide_state, int flag) { int ret, hide_attrs= 0; IsoNode *node; node= (IsoNode *) in_node; if(node == NULL) { ret= Xorriso_get_node_by_path(xorriso, path, NULL, &node, 0); if(ret<=0) return(ret); } if(hide_state) { hide_attrs|= LIBISO_HIDE_BUT_WRITE; if(hide_state & 1) hide_attrs|= LIBISO_HIDE_ON_RR; if(hide_state & 2) hide_attrs|= LIBISO_HIDE_ON_JOLIET; if(hide_state & 4) hide_attrs|= LIBISO_HIDE_ON_HFSPLUS; } iso_node_set_hidden(node, hide_attrs); return(1); } /* @param flag bit0= increase only upper estimation */ int Xorriso_estimate_file_size(struct XorrisO *xorriso, struct FindjoB *job, char *basename, mode_t st_mode, off_t st_size, int flag) { off_t upper, lower, size; lower = 3 * strlen(basename) + 34; /* >>> + minimum RR ? */ upper = 3 * strlen(basename) + 2048; if(S_ISREG(st_mode)) { size= ((st_size + (off_t) 2047) / (off_t) 2048) * (off_t) 2048; lower+= size; upper+= size; } else if(S_ISDIR(st_mode)) { upper+= 4096; } job->estim_upper_size+= upper; if(!(flag & 1)) job->estim_lower_size+= lower; return(1); } /* @param flag bit0= do not compare but print input and back converted name */ int Xorriso_test_outchar(struct XorrisO *xorriso, void *node_pt, int name_space, int flag) { IsoNode *node; char *result= NULL, *name, *back= NULL; int ret, relax_mem; size_t result_len, back_len, i; struct isoburn_imgen_opts *sopts= NULL; relax_mem= xorriso->relax_compliance; node= (IsoNode *) node_pt; ret= isoburn_igopt_new(&sopts, 0); if(ret<=0) { Xorriso_process_msg_queues(xorriso, 0); ret= -1; goto ex; } if(!(flag & 1)) xorriso->relax_compliance|= isoburn_igopt_omit_version_numbers; ret= Xorriso_make_iso_write_opts(xorriso, NULL, sopts, 0); if(ret <= 0) { ret= -1; goto ex; } if(iso_node_get_type(node) == LIBISO_DIR) name_space |= 256; name_space|= 512; /* no error messages */ name= (char *) iso_node_get_name(node); if(name == NULL) { ret= 1; goto ex; } ret= isoburn_conv_name_chars(sopts, name, strlen(name), &result, &result_len, name_space); if(ret <= 0) { Xorriso_process_msg_queues(xorriso, 0); if(flag & 1) goto print_outname; ret= 0; goto ex; } /* Convert back and compare with original */ ret= isoburn_conv_name_chars(sopts, result, result_len, &back, &back_len, name_space | (1 << 15)); if(ret <= 0) { Xorriso_process_msg_queues(xorriso, 0); if(flag & 1) goto print_outname; ret= 0; goto ex; } if(flag & 1) { print_outname:; Text_shellsafe(name, xorriso->result_line, 0); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); if(back == NULL) strcpy(xorriso->result_line, "(file name conversion error)"); else Text_shellsafe(back, xorriso->result_line, 0); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); strcpy(xorriso->result_line, "--\n"); Xorriso_result(xorriso, 0); } else { for(i= 0; i < back_len; i++) if(name[i] != back[i]) {ret= 0; goto ex;} if(name[i] != 0) {ret= 0; goto ex;} } ret= 1; ex:; isoburn_igopt_destroy(&sopts, 0); if(result != NULL) free(result); if(back != NULL) free(back); xorriso->relax_compliance= relax_mem; return(ret); } int Xorriso_set_to_mtime(struct XorrisO *xorriso, char *show_path, IsoNode *node, int flag) { time_t t; t= iso_node_get_mtime(node); iso_node_set_atime(node, t); iso_node_set_ctime(node, t); Xorriso_set_change_pending(xorriso, 0); return(1); } int Xorriso_cannot_create_iter(struct XorrisO *xorriso, int iso_error,int flag) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, "", iso_error, "Cannot create iter", 0, "FATAL", 1); sprintf(xorriso->info_text, "Cannot create IsoDirIter object"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); return(1); } /* The caller shall make no assumptions about the meaning of iter, node_array, node_count, node_idx ! They are just opaque handles for which the caller provides the memory of proper type. @param flag bit0= initialize iteration bit1= action needs full freedom of object manipulation bit2= action needs LBA sorted iteration bit31= end iteration (mandatory !) */ int Xorriso_findi_iter(struct XorrisO *xorriso, IsoDir *dir_node, off_t *mem, IsoDirIter **iter, IsoNode ***node_array, int *node_count, int *node_idx, IsoNode **iterated_node, int flag) { int ret, i; IsoNode *node; off_t new_mem= 0; char mem_text[80], limit_text[80]; if(flag&1) { *node_array= NULL; *node_count= -1; *node_idx= 0; *iter= NULL; ret= iso_dir_get_children(dir_node, iter); if(ret<0) { cannot_iter:; Xorriso_cannot_create_iter(xorriso, ret, 0); return(-1); } if((flag&2)|(flag&4)) { /* copy list of nodes and prepare soft iterator */ *node_count= 0; while(iso_dir_iter_next(*iter, &node) == 1) (*node_count)++; iso_dir_iter_free(*iter); *iter= NULL; new_mem= ((*node_count)+1) * sizeof(IsoNode *); if(new_mem > xorriso->temp_mem_limit) { Sfile_scale((double) new_mem, mem_text, 5,1e4, 0); Sfile_scale((double) xorriso->temp_mem_limit, limit_text, 5,1e4, 0); sprintf(xorriso->info_text, "Stacked directory snapshots exceed -temp_mem_limit (%s > %s)", mem_text, limit_text); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); *node_count= -1; return(-1); } (*node_array)= (IsoNode **) calloc((*node_count)+1, sizeof(IsoNode *)); if(*node_array == NULL) { sprintf(xorriso->info_text, "Could not allocate inode list of %.f bytes", ((double) (*node_count)+1) * (double) sizeof(IsoNode *)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); *node_count= -1; return(-1); } *mem= new_mem; ret= iso_dir_get_children(dir_node, iter); if(ret<0) goto cannot_iter; while(iso_dir_iter_next(*iter, &node) == 1 && *node_idx < *node_count) { (*node_array)[*node_idx]= node; iso_node_ref(node); (*node_idx)++; } iso_dir_iter_free(*iter); *iter= NULL; *node_count= *node_idx; *node_idx= 0; if((flag&4) && *node_count>1) qsort(*node_array, *node_count, sizeof(IsoNode *), Xorriso__node_lba_cmp); } } if(flag&(1u<<31)) { if(*node_count>=0 && *node_array!=NULL) { for(i= 0; i<*node_count; i++) iso_node_unref((*node_array)[i]); free(*node_array); *node_array= NULL; *node_count= -1; *node_idx= 0; } else { if(*iter!=NULL) iso_dir_iter_free(*iter); *iter= NULL; } } if(flag&(1|(1u<<31))) return(1); if(*node_count>=0) { /* return next node_array element */ if(*node_idx>=*node_count) return(0); *iterated_node= (*node_array)[*node_idx]; (*node_idx)++; } else { ret= iso_dir_iter_next(*iter, iterated_node); return(ret == 1); } return(1); } /* @param flag bit0= not a command parameter (directory iteration or recursion) bit1= do not count deleted files with rm and rm_r @return <=0 error, 1=ok 2=ok, node has been deleted, 3=ok, do not dive into directory (e.g. because it is a split file) 4=ok, end findjob gracefully */ int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job, IsoDirIter *boss_iter, off_t boss_mem, char *abs_path, char *show_path, IsoNode *node, int depth, int flag) { int ret= 0, type, action= 0, hflag, deleted= 0, no_dive= 0, i, bless_idx; int unbless= 0; uid_t user= 0; gid_t group= 0; time_t date= 0; mode_t mode_or= 0, mode_and= ~1; char *target, *text_2, *iso_prefix, md5[16], *basename, bless_code[17]; char crtp[10]; struct FindjoB *subjob; struct stat dir_stbuf, stbuf; void *xinfo; struct iso_hfsplus_xinfo_data *hfsplus_xinfo; size_t value_length; char *value; action= Findjob_get_action_parms(job, &target, &text_2, &user, &group, &mode_and, &mode_or, &type, &date, &subjob, 0); if(action<0) action= 0; job->match_count++; hflag= 16*!(flag&2); ret= 1; if(action==1) { /* rm (including rmdir) */ ret= Xorriso_fake_stbuf(xorriso, abs_path, &dir_stbuf, &node, 1); if(ret>0) { if(S_ISDIR(dir_stbuf.st_mode)) hflag= 2; ret= Xorriso_rmi(xorriso, boss_iter, boss_mem, abs_path, hflag); deleted= 1; } } else if(action==2) { /* rm_r */ ret= Xorriso_rmi(xorriso, boss_iter, boss_mem, abs_path, 1|hflag); deleted= 1; } else if(action==3) { /* >>> mv target */; } else if(action==4) { /* chown */ ret= Xorriso_set_uid(xorriso, abs_path, user, 0); } else if(action==5) { /* chgrp */ ret= Xorriso_set_gid(xorriso, abs_path, group, 0); } else if(action==6) { /* chmod */ ret= Xorriso_set_st_mode(xorriso, abs_path, mode_and, mode_or, 0); } else if(action==7) { /* alter_date */ ret= Xorriso_set_time(xorriso, abs_path, date, type&7); } else if(action==8) { /* lsdl */ ret= Xorriso_ls_filev(xorriso, "", 1, &abs_path, (off_t) 0, 1|2|8); } else if(action>=9 && action<=13) { /* actions which have own findjobs */ Findjob_set_start_path(subjob, abs_path, 0); ret= Xorriso_findi(xorriso, subjob, boss_iter, boss_mem, NULL, abs_path, &dir_stbuf, depth, 1); } else if(action==14 || action==17 || action == 41) { /* compare , update , update_merge */ Findjob_get_start_path(job, &iso_prefix, 0); ret= Xorriso_find_compare(xorriso, (void *) boss_iter, (void *) node, abs_path, iso_prefix, target, (action == 17 || action == 41) | ((flag&1)<<1) | ((action == 41) << 2)); if(ret==2) deleted= 1; if(ret==3) no_dive= 1; if(ret>=0) ret= 1; } else if(action==16 || action==18) { /* not_in_iso , add_missing */ ; } else if(action == 21) { /* report_damage */ ret= Xorriso_report_damage(xorriso, show_path, node, 0); } else if(action == 22) { ret= Xorriso_report_lba(xorriso, show_path, node, &job->last_data_file_block, 0); } else if(action == 23) { /* internal: memorize path of last matching node */ ret= Findjob_set_found_path(job, show_path, 0); } else if(action == 24) { ret= Xorriso_getfacl(xorriso, (void *) node, show_path, NULL, 0); } else if(action == 25) { if(target == NULL || target[0] || text_2 == NULL || text_2[0]) ret= Xorriso_setfacl(xorriso, (void *) node, show_path, target, text_2,0); } else if(action == 26) { ret= Xorriso_getfattr(xorriso, (void *) node, show_path, NULL, 0); } else if(action == 27) { ret= Xorriso_path_setfattr(xorriso, (void *) node, show_path, target, strlen(text_2), text_2, 0); } else if(action == 28) { /* set_filter */ ret= Xorriso_set_filter(xorriso, (void *) node, show_path, target, 1 | 2); } else if(action == 29 || action == 52) { /* show_stream , show_stream_id */ ret= Xorriso_show_stream(xorriso, (void *) node, show_path, (action == 52)); } else if(action == 30) { /* internal: count */ xorriso->node_counter++; } else if(action == 31) { /* internal: register */ if(xorriso->node_counter < xorriso->node_array_size) { xorriso->node_array[xorriso->node_counter++]= (void *) node; iso_node_ref(node); /* In case node gets deleted from tree during the lifetime of xorriso->node_array */ } } else if(action == 32) { /* internal: widen_hardlinks disk_equiv */ Findjob_get_start_path(job, &iso_prefix, 0); ret= Xorriso_widen_hardlink(xorriso, (void *) boss_iter, node, abs_path, iso_prefix, target, 0); if(ret==2) deleted= 1; } else if(action == 33) { /* get_any_xattr */ ret= Xorriso_getfattr(xorriso, (void *) node, show_path, NULL, 8); } else if(action == 34) { /* get_md5 */ ret= Xorriso_get_md5(xorriso, (void *) node, show_path, md5, 0); if(ret >= 0) ret= 1; } else if(action == 35) { /* check_md5 */ ret= Xorriso_check_md5(xorriso, (void *) node, show_path, 2); if(ret == 0) xorriso->find_check_md5_result|= 1; else if(ret < 0) xorriso->find_check_md5_result|= 2; else if(ret == 1) xorriso->find_check_md5_result|= 8; else if(ret == 2) xorriso->find_check_md5_result|= 4; if(ret >= 0) ret= 1; } else if(action == 36) { /* make_md5 */ ret= Xorriso_make_md5(xorriso, (void *) node, show_path, 0); if(ret >= 0) ret= 1; } else if(action == 37) { /* mkisofs_r */ ret= Xorriso_mkisofs_lower_r(xorriso, node, 0); } else if(action == 38) { /* sort_weight */ iso_node_set_sort_weight(node, type); Xorriso_set_change_pending(xorriso, 0); } else if(action == 39) { /* hide */ Xorriso_set_hidden(xorriso, node, NULL, type, 0); } else if(action == 40) { /* estimate_size */ basename= strrchr(abs_path, '/'); if(basename != NULL) basename++; else basename= abs_path; ret= Xorriso_fake_stbuf(xorriso, "", &stbuf, &node, 1); if(ret > 0) ret= Xorriso_estimate_file_size(xorriso, job, basename, stbuf.st_mode, stbuf.st_size, 0); } else if(action == 42) { /* rm_merge */ ret= Xorriso_mark_update_merge(xorriso, show_path, node, 2 | 4); if(ret == 2) { ret= Xorriso_rmi(xorriso, boss_iter, boss_mem, abs_path, 1|hflag); sprintf(xorriso->info_text, "Deleted "); Text_shellsafe(show_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0); deleted= 1; } } else if(action == 43) { /* clear_merge */ ret= Xorriso_mark_update_merge(xorriso, show_path, node, 2 | 4); } else if(action == 44) { /* list_extattr */ ret= Xorriso_list_extattr(xorriso, (void *) node, show_path, show_path, target, 0); } else if(action == 45) { /* set_hfs_crtp */ ret= Xorriso_hfsplus_file_creator_type(xorriso, show_path, (void *) node, target, text_2, 0); } else if(action == 46) { /* get_hfs_crtp */ ret= iso_node_get_xinfo(node, iso_hfsplus_xinfo_func, &xinfo); if(ret < 0) { Xorriso_process_msg_queues(xorriso, 0); ret= 0; } else if(ret == 1) { hfsplus_xinfo= (struct iso_hfsplus_xinfo_data *) xinfo; for(i= 0; i < 4; i++) xorriso->result_line[i]= hfsplus_xinfo->creator_code[i]; xorriso->result_line[4]= ' '; for(i= 0; i < 4; i++) xorriso->result_line[5 + i]= hfsplus_xinfo->type_code[i]; xorriso->result_line[9]= ' '; xorriso->result_line[10]= 0; Text_shellsafe(show_path, xorriso->result_line, 1); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); } ret= 1; } else if(action == 47) { /* set_hfs_bless */ if(strcmp(target, "none") == 0 || strcmp(target, "n") == 0 || strcmp(target, "N") == 0) { ret= Xorriso_get_blessing(xorriso, node, &bless_idx, bless_code, 0); if(ret < 0) return(ret); if(ret == 0) return(1); unbless= 1; } ret= Xorriso_hfsplus_bless(xorriso, show_path, (void *) node, target, 0); /* If successful, end -find run gracefully */ if(ret > 0) { if(unbless) { sprintf(xorriso->info_text, "HFS blessing '%s' revoked from ", bless_code); } else { sprintf(xorriso->info_text, "HFS blessing '%s' issued to ", target); } Text_shellsafe(show_path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } if(!unbless) return(4); } else if(action == 48) { /* get_hfs_bless */ ret= Xorriso_get_blessing(xorriso, node, &bless_idx, bless_code, 0); if (ret > 0) { sprintf(xorriso->result_line, "%-16.16s ", bless_code); Text_shellsafe(show_path, xorriso->result_line, 1); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); } else if(ret == 0) ret= 1; } else if(action == 49) { /* internal: update creator, type, and blessings from persistent isofs.* */ ret= Xorriso_get_attr_value(xorriso, node, show_path, "isofs.hx", &value_length, &value, 0); if(ret < 0) return(ret); if(ret > 0) { if(value_length >= 10) { ret= Xorriso_hfsplus_file_creator_type(xorriso, show_path, (void *) node, value + 2, value + 6, 4); } else ret= 1; free(value); if(ret <= 0) return(ret); } ret= Xorriso_get_attr_value(xorriso, node, show_path, "isofs.hb", &value_length, &value, 0); if(ret < 0) return(ret); if(ret > 0) { if(value_length >= 1) { bless_code[0]= value[0]; bless_code[1]= 0; ret= Xorriso_hfsplus_bless(xorriso, show_path, (void *) node, bless_code, 0); } else ret= 1; free(value); if(ret <= 0) return(ret); } ret= 1; } else if(action == 50) { /* print_outname */ ret= Xorriso_test_outchar(xorriso, (void *) node, type, 1); if(ret <= 0) return(ret); } else if(action == 51) { /* report_sections */ ret= Xorriso_report_lba(xorriso, show_path, node, &job->last_data_file_block, 1); } else if(action == 53) { /* internal: show_hfs_cmd */ ret= Xorriso_get_blessing(xorriso, node, &bless_idx, bless_code, 0); if (ret > 0) { if(xorriso->show_hfs_cmd_flag & 2) { sprintf(xorriso->result_line, "-hfs-bless-by %s ", bless_code); Text_shellsafe(show_path, xorriso->result_line, 1); } else { sprintf(xorriso->result_line, "-find "); Text_shellsafe(show_path, xorriso->result_line, 1); sprintf(xorriso->result_line + strlen(xorriso->result_line), " -exec set_hfs_bless %s --", bless_code); } ret= Xorriso_record_cmd_line(xorriso, xorriso->result_line, xorriso->show_hfs_cmds, &xorriso->show_hfs_cmd_count, (xorriso->show_hfs_cmd_flag & 1)); if(ret <= 0) return(ret); } ret= iso_node_get_xinfo(node, iso_hfsplus_xinfo_func, &xinfo); if(ret < 0) { Xorriso_process_msg_queues(xorriso, 0); ret= 0; } else if(ret == 1) { hfsplus_xinfo= (struct iso_hfsplus_xinfo_data *) xinfo; for(i= 0; i < 4; i++) crtp[i]= hfsplus_xinfo->creator_code[i]; crtp[4]= ' '; for(i= 0; i < 4; i++) crtp[5 + i]= hfsplus_xinfo->type_code[i]; crtp[9]= 0; if(xorriso->show_hfs_cmd_flag & 2) { sprintf(xorriso->result_line, "-hfsplus-file-creator-type %s ", crtp); Text_shellsafe(show_path, xorriso->result_line, 1); } else { sprintf(xorriso->result_line, "-find "); Text_shellsafe(show_path, xorriso->result_line, 1); sprintf(xorriso->result_line + strlen(xorriso->result_line), " -exec set_hfs_crtp %s --", crtp); } ret= Xorriso_record_cmd_line(xorriso, xorriso->result_line, xorriso->show_hfs_cmds, &xorriso->show_hfs_cmd_count, (xorriso->show_hfs_cmd_flag & 1)); if(ret <= 0) return(ret); } ret= 1; } else if(action == 54 || action == 56) { /* internal: truncate_name */ ret= Xorriso_truncate_uniquely(xorriso, xorriso->file_name_limit, node, abs_path, show_path, 2 * (action == 56)); } else if(action == 55 || action == 57) { /* internal: unique_trunc_test length (in type) */ ret= Xorriso_truncate_uniquely(xorriso, type, node, abs_path, show_path, 1 | (2 * (action == 57))); } else if(action == 58) { /* internal: last_data_file_block */ ret= Xorriso_report_lba(xorriso, show_path, node, &job->last_data_file_block, 2); } else if(action == 59) { /* set_to_mtime */ ret= Xorriso_set_to_mtime(xorriso, show_path, node, 0); } else { /* includes : 15 in_iso */ Xorriso_esc_filepath(xorriso, show_path, xorriso->result_line, 0); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0); ret= 1; } if(ret<=0) return(ret); if(deleted) return(2); if(no_dive) return(3); return(1); } /* flag bit0= perform -disk_path rather than -disk_name bit0= use_pattern */ int Exprtest_match_disk_name(struct XorrisO *xorriso, struct ExprtesT *ftest, IsoNode *node, int flag) { int ret; char *disk_path= NULL, *npt; regmatch_t name_match; char *arg1; void *arg2; Xorriso_alloc_meM(disk_path, char, SfileadrL); ret= Xorriso_retrieve_disk_path(xorriso, node, disk_path, 0); if(ret <= 0) {ret= 0; goto ex;} if(flag & 1) { if(strcmp(disk_path, ftest->arg1) == 0) {ret= 1; goto ex;} {ret= 0; goto ex;} } arg1= (char *) ftest->arg1; arg2= ftest->arg2; npt= strrchr(disk_path, '/'); if(npt != NULL) npt++; else npt= disk_path; if(flag & 2) { ret= ! regexec(arg2, npt, 1, &name_match, 0); } else { ret= (strcmp(arg1, npt) == 0); } ex:; Xorriso_free_meM(disk_path); return(ret); } int Exprtest_match(struct XorrisO *xorriso, struct ExprtesT *ftest, void *node_pt, char *name, char *path, struct stat *boss_stbuf, struct stat *stbuf, int flag) /* return: <0 = error 0 = does not match 1 = does match 2 = immediate decision : does not match 3 = immediate decision : does match */ { int value=0, ret, start_lba, end_lba, bless_idx; int lba_count, *file_end_lbas= NULL, *file_start_lbas= NULL, i, mask; void *arg1, *arg2; char ft, *decision, md5[16], bless_code[17]; regmatch_t name_match; off_t damage_start, damage_end, size, *section_sizes= NULL; void *xinfo_dummy; IsoNode *node; IsoStream *stream; struct iso_hfsplus_xinfo_data *hfsplus_xinfo; if(ftest == NULL) return(1); node= (IsoNode *) node_pt; arg1= ftest->arg1; arg2= ftest->arg2; if(node == NULL) { switch(ftest->test_type) { case 0: case 1: case 2: case 4: case 11: case 12: case 13: case 22: case 23: case 25: case 26: /* Tests which need no node parameter */ break; default: value= 0; goto ex; } } switch(ftest->test_type) { case 0: /* -false */ value= 0; break; case 1: /* -name *arg1 (regex in *arg2) */ if (ftest->boss->use_pattern) { ret= regexec(arg2, name, 1, &name_match, 0); value= !ret; } else { value= (strcmp((char *) arg1, name) == 0); } break; case 2: /* -type *arg1 */ value= 1; ft= *((char *) arg1); if(ft!=0) { if(S_ISBLK(stbuf->st_mode)) { if(ft!='b') value= 0; } else if(S_ISCHR(stbuf->st_mode)) { if(ft!='c') value= 0; } else if(S_ISDIR(stbuf->st_mode)) { if(ft=='m') { if(node != NULL) value= 0; else if(boss_stbuf==NULL) value= 0; else if(boss_stbuf->st_dev == stbuf->st_dev) value= 0; } else if(ft!='d') value= 0; } else if(S_ISFIFO(stbuf->st_mode)) { if(ft!='p') value= 0; } else if(S_ISREG(stbuf->st_mode)) { if(ft!='f' && ft!='-') value= 0; } else if(((stbuf->st_mode)&S_IFMT)==S_IFLNK) { if(ft!='l') value= 0; } else if(((stbuf->st_mode)&S_IFMT)==S_IFSOCK) { if(ft!='s') value= 0; } else if((flag & 1) && ((stbuf->st_mode) & S_IFMT) == Xorriso_IFBOOT) { if(ft!='e' || node == NULL) value= 0; } else { if(ft!='X') value= 0; } } break; case 3: /* -damaged */; value= Xorriso_file_eval_damage(xorriso, node, &damage_start, &damage_end, 0); if(value > 0) value= 1; break; case 4: /* -lba_range *arg1 *arg2 */ value= 1; start_lba= *((int *) ftest->arg1); end_lba= *((int *) ftest->arg2); if(node == NULL) { value= !(start_lba >= 0); goto ex; } ret= Xorriso__start_end_lbas(node, &lba_count, &file_start_lbas, &file_end_lbas, §ion_sizes, &size, 0); if(ret <= 0) { if(ret < 0) Xorriso_process_msg_queues(xorriso, 0); if(start_lba >= 0) value= 0; } else { for(i= 0; i < lba_count; i++) { if(start_lba >= 0) { if(file_end_lbas[i] < start_lba || file_start_lbas[i] > end_lba) value= 0; } else { if(file_end_lbas[i] >= -start_lba && file_start_lbas[i] <= -end_lba) value= 0; } } } break; case 5: /* -has_acl */ ret = Xorriso_getfacl(xorriso, (void *) node, "", NULL, 2); if(ret <= 0) { value= -1; Xorriso_process_msg_queues(xorriso, 0); goto ex; } value= (ret == 1); break; case 6: /* -has_xattr */ case 14: /* -has_any_xattr */ ret = Xorriso_getfattr(xorriso, (void *) node, "", NULL, 64 | (8 * (ftest->test_type == 14))); if(ret < 0) { value= -1; Xorriso_process_msg_queues(xorriso, 0); goto ex; } value= (ret > 0); break; case 7: /* -has_aaip */ ret= iso_node_get_xinfo(node, aaip_xinfo_func, &xinfo_dummy); if(ret < 0) { value= -1; Xorriso_process_msg_queues(xorriso, 0); goto ex; } value= (ret > 0); break; case 8: /* -has_filter */ value= 0; if(LIBISO_ISREG(node)) { stream= iso_file_get_stream((IsoFile *) node); if(iso_stream_get_input_stream(stream, 0) != NULL) value= 1; } break; case 9: /* -wanted_node arg1 (for internal use) */ value= (((IsoNode *) arg1) == node); break; case 10: /* -pending_data */ value= 1; if(!LIBISO_ISREG(node)) { value= 0; } else { ret= Xorriso__file_start_lba(node, &start_lba, 0); if(ret > 0 && start_lba >= 0) value= 0; } break; case 11: /* -decision */ value= 2; decision= (char *) arg1; if(strcmp(decision, "yes") == 0 || strcmp(decision, "true") == 0) value= 3; break; case 12: /* -prune */ value= 1; ftest->boss->prune= 1; break; case 13: /* -wholename *arg1 (regex in *arg2) */ if (ftest->boss->use_pattern) { ret= regexec(arg2, path, 1, &name_match, 0); value= !ret; } else { value= (strcmp(arg1, path) == 0); } break; case 15: /* -has_md5 */ ret= Xorriso_get_md5(xorriso, node, path, md5, 1); value= (ret > 0); break; case 16: /* -disk_name *arg1 (regex in *arg2) */ value= !! Exprtest_match_disk_name(xorriso, ftest, node, 2 * (ftest->boss->use_pattern)); break; case 17: /* -hidden int *arg1 */ value= 1; ret= iso_node_get_hidden(node); mask= *((int *) arg1) & 3; if((!!(mask & 1)) ^ (!!(ret & LIBISO_HIDE_ON_RR))) value= 0; if((!!(mask & 2)) ^ (!!(ret & LIBISO_HIDE_ON_JOLIET))) value= 0; if((!!(mask & 3)) ^ (!!(ret & LIBISO_HIDE_ON_HFSPLUS))) value= 0; break; case 18: /* -has_hfs_crtp char *creator char *type */ ret= iso_node_get_xinfo(node, iso_hfsplus_xinfo_func, &xinfo_dummy); value= 0; if(ret < 0) { Xorriso_process_msg_queues(xorriso, 0); ret= 0; } else if(ret == 1) { hfsplus_xinfo= (struct iso_hfsplus_xinfo_data *) xinfo_dummy; if((strlen(arg1) == 1 || (strncmp(arg1, (char *) hfsplus_xinfo->creator_code, 4) == 0 && strlen(arg1) == 4)) && (strlen(arg2) == 1 || (strncmp(arg2, (char *) hfsplus_xinfo->type_code, 4) == 0 && strlen(arg2) == 4))) value= 1; } break; case 19: /* -has_hfs_bless int bless_index */ value= 0; ret= Xorriso_get_blessing(xorriso, node, &bless_idx, bless_code, 0); if (ret > 0) { if(*((int *) arg1) == (int) ISO_HFSPLUS_BLESS_MAX || *((int *) arg1) == bless_idx) value= 1; } break; case 20: /* -disk_path */ value= !! Exprtest_match_disk_name(xorriso, ftest, node, 1 | 2 * (ftest->boss->use_pattern)); break; case 21: /* -bad_outname */ ret= Xorriso_test_outchar(xorriso, node, *((int *) arg1), 0); if(ret < 0) { value= -1; goto ex; } value= !ret; /* Xorriso_test_outchar() returns 1 for good and 0 for bad */ break; case 22: /* -use_pattern */ ftest->boss->use_pattern= (strcmp(arg1, "off") != 0); value= 1; break; case 23: /* -or_use_pattern */ ftest->boss->use_pattern= (strcmp(arg1, "off") != 0); value= 0; break; case 24: /* -name_limit_blocker */ ret= Xorriso_truncate_uniquely(xorriso, *((int *) arg1), node, path, path, 1 | 4); value= (ret == 0); break; case 25: /* -maxdepth */ value= (ftest->boss->depth <= *((int *) arg1)); break; case 26: /* -mindepth */ value= (ftest->boss->depth >= *((int *) arg1)); break; default: /* >>> complain about unknown test type */; value= -1; } ex:; if(ftest->invert && value<=1 && value>=0) value= !value; if(file_start_lbas != NULL) free((char *) file_start_lbas); if(file_end_lbas != NULL) free((char *) file_end_lbas); if(section_sizes != NULL) free((char *) section_sizes); return(value); } /* @return <0 = error , 0 = no match , 1 = match */ int Xorriso_findi_test(struct XorrisO *xorriso, struct FindjoB *job, IsoNode *node, char *name, char *path, struct stat *boss_stbuf, struct stat *stbuf, int depth, int flag) { int ret; job->prune= 0; ret= Findjob_test_2(xorriso, job, node, name, path, boss_stbuf, stbuf, 1); if(ret <= 0) return(ret); return(1); } int Xorriso_findi_headline(struct XorrisO *xorriso, struct FindjoB *job, int flag) { int action; action= Findjob_get_action(job, 0); if(action == 21) { /* report_damage */ sprintf(xorriso->result_line, "Report layout: %8s , %8s , %8s , %s\n", "at byte", "Range", "Filesize", "ISO image path"); Xorriso_result(xorriso, 0); } else if(action == 22 || action == 51) { /* report_lba, report_sections */ sprintf(xorriso->result_line, "Report layout: %2s , %8s , %8s , %8s , %s\n", "xt", "Startlba", "Blocks", action == 22 ? "Filesize" : "Sectsize", "ISO image path"); Xorriso_result(xorriso, 0); } return(1); } /* @param flag bit0= recursion bit1= do not count deleted files with rm and rm_r bit2= do not dive into split file directories (implicitly given with actions 14=compare and 17=update) @return <=0 error, 1= ok , 2= dir node and path has been deleted 4= end gracefully */ int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job, void *boss_iter, off_t boss_mem, void *dir_node_generic, char *dir_path, struct stat *dir_stbuf, int depth, int flag) { int ret, action= 0, hflag, deleted= 0, no_dive= 0; IsoDirIter *iter= NULL; IsoDir *dir_node= NULL; IsoNode *node, *iso_node; IsoImage *volume= NULL; struct stat stbuf; char *name; off_t mem; IsoNode **node_array= NULL; int node_count= 0, node_idx; char *path= NULL, *abs_path= NULL; job->depth= depth; if(xorriso->request_to_abort) {ret= 0; goto ex;} path= malloc(SfileadrL); abs_path= malloc(SfileadrL); if(path==NULL || abs_path==NULL) { Xorriso_no_malloc_memory(xorriso, &path, 0); {ret= -1; goto ex;} } action= Findjob_get_action(job, 0); if(action<0) action= 0; if(!(flag & 1)) { Xorriso_findi_headline(xorriso, job, 0); job->last_data_file_block= 0; } dir_node= (IsoDir *) dir_node_generic; if(dir_node==NULL) { ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) {ret= -1; goto ex;} ret= Xorriso_make_abs_adr(xorriso, xorriso->wdi, dir_path, path, 1|2|4); if(ret<=0) goto ex; ret= Xorriso_node_from_path(xorriso, volume, path, &iso_node, 0); dir_node= (IsoDir *) iso_node; if(ret<=0) {ret= 0; goto ex;} ret= Xorriso_fake_stbuf(xorriso, "", dir_stbuf, &iso_node, 1); if(ret<=0) goto ex; name= strrchr(dir_path, '/'); if(name==NULL) name= dir_path; else name++; ret= Xorriso_findi_test(xorriso, job, iso_node, name, path, NULL, dir_stbuf, depth, 0); if(ret<0) goto ex; if(job->prune) no_dive= 1; if(ret>0) { iso_node_ref(iso_node); /* protect from real disposal */ ret= Xorriso_findi_action(xorriso, job, (IsoDirIter *) boss_iter, boss_mem, path, dir_path, iso_node, depth, flag&(1|2)); deleted= (iso_node_get_parent(iso_node) == NULL); /* still in tree ? */ iso_node_unref(iso_node); /* eventually do real disposal */ if(xorriso->request_to_abort) {ret= 0; goto ex;} if(ret == 4) goto ex; if(ret<=0) goto ex; if(ret==2 || deleted) { /* re-determine dir_node in case it has a new persona */ ret= Xorriso_node_from_path(xorriso, volume, path, &iso_node, 1); if(ret==0) { deleted= 1; {ret= 2; goto ex;} } if(ret<0) {ret= 0; goto ex;} dir_node= (IsoDir *) iso_node; ret= Xorriso_fake_stbuf(xorriso, "", dir_stbuf, &iso_node, 1); if(ret<=0) goto ex; } if(ret==3) no_dive= 1; } } if(no_dive || !LIBISO_ISDIR((IsoNode *) dir_node)) {ret= 1; goto ex;} if(action == 14 || action == 17 || (flag & 4)) if(Xorriso_is_split(xorriso, dir_path, (IsoNode *) dir_node, 1)>0) {ret= 1; goto ex;} mem= boss_mem; hflag= 1; if(action==1 || action==2 || action==3 || action==17 || action == 28 || action == 32 || action == 41 || action == 42) hflag|= 2; /* need freedom to manipulate image */ if(action==14 || action==17 || action == 28 || action == 35 || action == 36 || action == 41) hflag|= 4; /* need LBA sorted iteration for good data reading performance */ ret= Xorriso_findi_iter(xorriso, dir_node, &mem, &iter, &node_array, &node_count, &node_idx, &node, hflag); if(ret<=0) goto ex; job->depth++; while(1) { ret= Xorriso_findi_iter(xorriso, dir_node, &mem, &iter, &node_array, &node_count, &node_idx, &node, 0); if(ret<0) goto ex; if(ret==0) break; name= (char *) iso_node_get_name(node); ret= Xorriso_make_abs_adr(xorriso, dir_path, name, path, 4); if(ret<=0) goto ex; ret= Xorriso_fake_stbuf(xorriso, "", &stbuf, &node, 1); if(ret<0) goto ex; if(ret==0) continue; /* ??? This seems to be redundant with the single test above ??? Should i dive in unconditionally and leave out test and action here ? ??? Then do above test unconditionally ? --- Seems that the current configuration represents the special handling of the find start path with mount points. Dangerous to change. */ ret= Xorriso_findi_test(xorriso, job, node, name, path, dir_stbuf, &stbuf, depth, 0); if(ret<0) goto ex; if(job->prune) no_dive= 1; if(ret>0) { ret= Xorriso_make_abs_adr(xorriso, xorriso->wdi, path, abs_path, 1|2|4); if(ret<=0) goto ex; ret= Xorriso_findi_action(xorriso, job, iter, mem, abs_path, path, node, depth, 1|(flag&2)); if(xorriso->request_to_abort) {ret= 0; goto ex;} if(ret == 4) goto ex; if(ret==2) { /* node has been deleted */ /* re-determine node in case it has a new persona */ if(volume==NULL) { ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) {ret= -1; goto ex;} } ret= Xorriso_node_from_path(xorriso, volume, abs_path, &node, 1); if(ret==0) continue; if(ret<0) {ret= 0; goto ex;} ret= Xorriso_fake_stbuf(xorriso, "", &stbuf, &node, 1); if(ret<0) goto ex; if(ret==0) continue; } no_dive= (ret==3); if(ret<=0) { if(Xorriso_eval_problem_status(xorriso, ret, 1|2)<0) goto ex; } } if(S_ISDIR(stbuf.st_mode) && !no_dive) { ret= Xorriso_findi(xorriso, job, (void *) iter, mem, (void *) node, path, &stbuf, depth+1, flag|1); if(ret<0) goto ex; if(xorriso->request_to_abort) {ret= 0; goto ex;} if(ret == 4) goto ex; } } ret= 1; ex:; job->depth= depth; if(path!=NULL) free(path); if(abs_path!=NULL) free(abs_path); Xorriso_process_msg_queues(xorriso,0); Xorriso_findi_iter(xorriso, dir_node, &mem, &iter, &node_array, &node_count, &node_idx, &node, (1u<<31)); if(ret<=0) return(ret); if(deleted) return(2); return(1); } /* @param flag bit0= do not dive into trees bit1= do not perform job->action on resulting node array bit2= do not free node_array after all actions are done */ int Xorriso_findi_sorted(struct XorrisO *xorriso, struct FindjoB *job, off_t boss_mem, int filec, char **filev, int flag) { int i, ret, find_flag= 0; struct FindjoB array_job, *proxy_job= NULL, *hindmost= NULL, *hmboss= NULL; struct stat dir_stbuf; IsoNode *node; char *abs_path= NULL; off_t mem_needed= 0; array_job.start_path= NULL; Xorriso_alloc_meM(abs_path, char, SfileadrL); if(job->action == 14 || job->action == 17) find_flag|= 4; if(job->action>=9 && job->action<=13) { /* actions which have own findjobs */ /* array_job replaces the hindmost job in the chain */ for(hindmost= job; hindmost->subjob != NULL; hindmost= hindmost->subjob) hmboss= hindmost; if(hmboss == NULL) {ret= -1; goto ex;} memcpy(&array_job, hindmost, sizeof(struct FindjoB)); hmboss->subjob= &array_job; proxy_job= job; } else { memcpy(&array_job, job, sizeof(struct FindjoB)); proxy_job= &array_job; hindmost= job; } array_job.start_path= NULL; /* is owned by the original, not by array_job */ /* Count matching nodes */ Xorriso_destroy_node_array(xorriso, 0); array_job.action= 30; /* internal: count */ for(i= 0; i < filec; i++) { if(flag & 1) { xorriso->node_counter++; continue; } ret= Findjob_set_start_path(proxy_job, filev[i], 0); if(ret <= 0) goto ex; ret= Xorriso_findi(xorriso, proxy_job, NULL, boss_mem, NULL, filev[i], &dir_stbuf, 0, find_flag); if(ret <= 0) goto ex; } if(xorriso->node_counter <= 0) {ret= 1; goto ex;} mem_needed= boss_mem + xorriso->node_counter * sizeof(IsoNode *); if(!(flag &1)) { ret= Xorriso_check_temp_mem_limit(xorriso, mem_needed, 0); if(ret <= 0) { /* Memory curbed : Perform unsorted find jobs */ if(hmboss != NULL) hmboss->subjob= hindmost; for(i= 0; i < filec; i++) { ret= Findjob_set_start_path(job, filev[i], 0); if(ret <= 0) goto ex; ret= Xorriso_findi(xorriso, job, NULL, boss_mem, NULL, filev[i], &dir_stbuf, 0, find_flag); if(ret <= 0) if(Xorriso_eval_problem_status(xorriso, ret, 1|2)<0) goto ex; } {ret= 1; goto ex;} } } /* Copy matching nodes into allocated array */ ret= Xorriso_new_node_array(xorriso, xorriso->temp_mem_limit, 0, 0); if(ret <= 0) goto ex; array_job.action= 31; /* internal: register */ xorriso->node_counter= 0; for(i= 0; i < filec; i++) { if(flag & 1) { ret= Xorriso_get_node_by_path(xorriso, filev[i], NULL, &node, 0); if(ret <= 0) goto ex; if(xorriso->node_counter < xorriso->node_array_size) { xorriso->node_array[xorriso->node_counter++]= (void *) node; iso_node_ref(node); } continue; } ret= Findjob_set_start_path(proxy_job, filev[i], 0); if(ret <= 0) goto ex; ret= Xorriso_findi(xorriso, proxy_job, NULL, mem_needed, NULL, filev[i], &dir_stbuf, 0, find_flag); if(ret <= 0) goto ex; } Xorriso_sort_node_array(xorriso, 0); if(flag & 2) {ret= 1; goto ex;} /* Perform job->action on xorriso->node_array */ /* Headlines of actions report_damage , report_lba */; Xorriso_findi_headline(xorriso, job, 0); for(i= 0; i < xorriso->node_counter; i++) { node= xorriso->node_array[i]; ret= Xorriso_path_from_node(xorriso, node, abs_path, 0); if(ret < 0) goto ex; if(ret == 0) continue; /* node is deleted from tree meanwhile */ ret= Xorriso_findi_action(xorriso, hindmost, NULL, (off_t) 0, abs_path, abs_path, node, 0, 1); if(ret <= 0 || xorriso->request_to_abort) if(Xorriso_eval_problem_status(xorriso, ret, 1|2)<0) goto ex; if(ret == 4) /* end gracefully */ break; } ret= 1; ex:; if(!(flag & (2 | 4))) Xorriso_destroy_node_array(xorriso, 0); if(hmboss != NULL) hmboss->subjob= hindmost; if(array_job.start_path != NULL) free(array_job.start_path); Xorriso_free_meM(abs_path); return(ret); } int Xorriso_all_node_array(struct XorrisO *xorriso, int addon_nodes, int flag) { int ret; struct FindjoB *job= NULL; struct stat dir_stbuf; ret= Findjob_new(&job, "/", 0); if(ret<=0) { Xorriso_no_findjob(xorriso, "xorriso", 0); {ret= -1; goto ex;} } Findjob_set_action_target(job, 30, NULL, 0); Xorriso_destroy_node_array(xorriso, 0); ret= Xorriso_findi(xorriso, job, NULL, (off_t) 0, NULL, "/", &dir_stbuf, 0, 0); if(ret <= 0) goto ex; ret= Xorriso_new_node_array(xorriso, xorriso->temp_mem_limit, addon_nodes, 0); if(ret <= 0) goto ex; Findjob_set_action_target(job, 31, NULL, 0); ret= Xorriso_findi(xorriso, job, NULL, (off_t) 0, NULL, "/", &dir_stbuf, 0, 0); if(ret <= 0) goto ex; ret= 1; ex:; Findjob_destroy(&job, 0); return(ret); } int Xorriso_perform_acl_from_list(struct XorrisO *xorriso, char *file_path, char *uid, char *gid, char *acl, int flag) { int ret, zero= 0; uid_t uid_number; gid_t gid_number; /* Set group and owner */ if(gid[0]) { ret= Xorriso_convert_gidstring(xorriso, gid, &gid_number, 0); if(ret<=0) return(ret); ret= Xorriso_set_gid(xorriso, file_path, gid_number, 0); if(ret<=0) return(ret); } if(uid[0]) { ret= Xorriso_convert_uidstring(xorriso, uid, &uid_number, 0); if(ret<=0) return(ret); ret= Xorriso_set_uid(xorriso, file_path, uid_number, 0); if(ret<=0) return(ret); } ret= Xorriso_option_setfacli(xorriso, acl, 1, &file_path, &zero, 0); if(ret <= 0) return(ret); return(1); } /* @param flag bit0= do not perform setfattr but only check input */ int Xorriso_path_setfattr(struct XorrisO *xorriso, void *in_node, char *path, char *name, size_t value_length, char *value, int flag) { int ret, hflag; size_t num_attrs= 1; char *name_pt; hflag= 2; name_pt= name; if(name[0] == 0) { sprintf(xorriso->info_text, "-setfattr: Empty attribute name is not allowed"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } else if(strcmp(name, "--remove-all") == 0) { if(value[0]) { sprintf(xorriso->info_text, "-setfattr: Value is not empty with pseudo name --remove-all"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); return(0); } num_attrs= 0; hflag= 0; } else if(name[0] == '-') { name_pt++; hflag|= 4; } else if(name[0] == '=' || name[0] == '+') { name_pt++; } if(flag & 1) return(1); ret= Xorriso_setfattr(xorriso, in_node, path, num_attrs, &name_pt, &value_length, &value, hflag); return(ret); } /* Warning: The text content of lst gets mangled by 0s and unescaping. */ int Xorriso_perform_attr_from_list(struct XorrisO *xorriso, char *path, struct Xorriso_lsT *lst_start, int flag) { int ret, eaten; char *valuept, *ept, *line, **names= NULL, **values= NULL; size_t num_attr= 0, *value_lengths= NULL, v_len; struct Xorriso_lsT *lst; for(lst= lst_start; lst != NULL; lst= Xorriso_lst_get_next(lst, 0)) num_attr++; if(num_attr == 0) { ret= Xorriso_setfattr(xorriso, NULL, path, num_attr, NULL, NULL, NULL, 0); goto ex; } names= calloc(num_attr, sizeof(char *)); if(names == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } value_lengths= calloc(num_attr, sizeof(size_t)); if(value_lengths== NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } values= calloc(num_attr, sizeof(char *)); if(values== NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } num_attr= 0; for(lst= lst_start; lst != NULL; lst= Xorriso_lst_get_next(lst, 0)) { line= Xorriso_lst_get_text(lst, 0); ept= strchr(line, '='); if(ept == NULL) continue; /* Split into name and content */; *ept= 0; valuept= ept + 1; /* Strip quotes from value */ v_len= strlen(valuept); if(v_len < 2 || *valuept != '"' || *(valuept + v_len - 1) != '"') continue; *valuept= 0; *(valuept + v_len - 1)= 0; valuept++; v_len-= 2; /* Unescape backslashes , values eventually with 0-bytes */ ret= Sfile_bsl_interpreter(line, strlen(line), &eaten, 0); if(ret <= 0) continue; ret= Sfile_bsl_interpreter(valuept, (int) v_len, &eaten, 2); if(ret <= 0) continue; names[num_attr]= line; values[num_attr]= valuept; value_lengths[num_attr]= v_len - eaten; num_attr++; } ret= Xorriso_setfattr(xorriso, NULL, path, num_attr, names, value_lengths, values, 0); ex:; if(names != NULL) free(names); if(value_lengths != NULL) free(value_lengths); if(values != NULL) free(values); return(ret); } int Xorriso__mark_update_xinfo(void *data, int flag) { /* data is an int disguised as pointer. It does not point to memory. */ return(1); } int Xorriso__mark_update_cloner(void *old_data, void **new_data, int flag) { *new_data= NULL; if(flag) return(ISO_XINFO_NO_CLONE); if(old_data == NULL) return(0); /* data is an int disguised as pointer. It does not point to memory. */ *new_data= old_data; return(0); } /* @param flag bit0= found on disk bit1= inquire visit-found status: 1=not visited, 2=not found, 3=found bit2= with bit1: delete xinfo before returning status */ int Xorriso_mark_update_merge(struct XorrisO *xorriso, char *path, void *in_node, int flag) { int ret; void *xipt= NULL; IsoNode *node; if(in_node == NULL) { ret= Xorriso_node_from_path(xorriso, NULL, path, &node, 0); if(ret <= 0) return(ret); } else node= (IsoNode *) in_node; ret= iso_node_get_xinfo(node, Xorriso__mark_update_xinfo, &xipt); if(ret < 0) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, "", ret, "Error when looking for update_merge xinfo", 0, "FAILURE", 1); return(0); } if(flag & 2) { /* Inquire status and optionally delete xinfo */ if(ret == 0) return(1); if(flag & 4) { ret= iso_node_remove_xinfo(node, Xorriso__mark_update_xinfo); if(ret < 0) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, "", ret, "Error when removing update_merge xinfo", 0, "FAILURE", 1); return(0); } } if(((char *) &xipt)[0]) return(3); return(2); } /* xipt is a byte value disguised as void pointer */ if(ret == 1) { if(((char *) &xipt)[0]) return(1); if(!(flag & 1)) return(1); } else ((char *) &xipt)[0]= 0; if(flag & 1) ((char *) &xipt)[0]= 1; ret= iso_node_remove_xinfo(node, Xorriso__mark_update_xinfo); if(ret < 0) goto set_error; ret= iso_node_add_xinfo(node, Xorriso__mark_update_xinfo, xipt); if(ret <= 0) { set_error:; Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, "", ret, "Error when trying to set update_merge xinfo", 0, "FAILURE", 1); return(0); } return(1); } /* flag bit0= in case of error talk of "overwrite" rather than "remove" */ static int Xorriso_remove_hfsplus_crtp(struct XorrisO *xorriso, IsoNode *node, char *path, int flag) { int ret; char *msg, buf[10], *bufpt; size_t l; static char *name= "isofs.hx"; ret= iso_node_remove_xinfo(node, iso_hfsplus_xinfo_func); Xorriso_process_msg_queues(xorriso, 0); if(ret < 0) { if(flag & 1) msg= "Cannot overwrite HFS+ creator and type of ISO node"; else msg= "Cannot remove HFS+ creator and type of ISO node"; Xorriso_report_iso_error(xorriso, path, ret, msg, 0, "FAILURE", 1); return(0); } /* Delete isofs.hx attribute */ bufpt= buf; /* >>> ??? check whether there is isofs.hx attached ? */; ret= Xorriso_setfattr(xorriso, node, path, (size_t) 1, &name, &l, &bufpt, 4 | 8); return(ret); } static int Xorriso_set_hfsplus_crtp(struct XorrisO *xorriso, IsoNode *node, char *path, char *creator, char *hfs_type, int flag) { struct iso_hfsplus_xinfo_data *hfs_data= NULL; char buf[10], *bufpt; size_t l; int ret; static char *name= "isofs.hx"; /* Register as non-persistent xinfo */ hfs_data= iso_hfsplus_xinfo_new(0); if(hfs_data == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); return(-1); } memcpy(hfs_data->creator_code, creator, 4); memcpy(hfs_data->type_code, hfs_type, 4); ret= iso_node_add_xinfo(node, iso_hfsplus_xinfo_func, (void *) hfs_data); Xorriso_process_msg_queues(xorriso, 0); if(ret < 0) { Xorriso_report_iso_error(xorriso, path, ret, "Cannot attach HFS+ creator and type to ISO node", 0, "FAILURE", 1); goto failure; } else if(ret == 0) { strcat(xorriso->info_text, "Program error: iso_node_add_xinfo refuses to attach HFS+ creator and type"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); goto failure; } /* Register as persistent attribute isofs.hx */ bufpt= buf; l= 10; buf[0]= 1; buf[1]= 0; memcpy(buf + 2, creator, 4); memcpy(buf + 6, hfs_type, 4); ret= Xorriso_setfattr(xorriso, node, path, (size_t) 1, &name, &l, &bufpt, 2 | 8); if(ret <= 0) goto failure; Xorriso_set_change_pending(xorriso, 0); return(1); failure: if(hfs_data != NULL) iso_hfsplus_xinfo_func(hfs_data, 1); return(0); } /* @param flag bit0= only check creator and hfs_type for compliance. bit1= with bit0: check for search rather than for setting bit2= copy 2 times 4 bytes without any check */ int Xorriso_hfsplus_file_creator_type(struct XorrisO *xorriso, char *path, void *in_node, char *creator, char *hfs_type, int flag) { int ret; IsoNode *node; if(in_node == NULL && !(flag & 1)) { ret= Xorriso_node_from_path(xorriso, NULL, path, &node, 0); if(ret <= 0) return(ret); } else node= (IsoNode *) in_node; if(flag & 4) { ; } else if((creator[0] == 0 && hfs_type[0] == 0) || strcmp(creator, "--delete") == 0) { if(flag & 2) { strcpy(xorriso->info_text, "Attempt to use HFS+ file pseudo-creator '--delete' for searching"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); strcpy(xorriso->info_text, "Suitable are strings of length 4 or length 1"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); return(0); } if(flag & 1) return(1); ret= Xorriso_remove_hfsplus_crtp(xorriso, node, path, 0); if(ret < 0) return(ret); return(1); } else if((strlen(creator) != 4 && !(strlen(creator) == 1 && (flag & 3) == 3)) || (strlen(hfs_type) != 4 && !(strlen(hfs_type) == 1 && (flag & 3) == 3))) { if(flag & 2) { strcpy(xorriso->info_text, "HFS+ file creator code or type code for searching are not exactly 1 or 4 characters long"); } else { strcpy(xorriso->info_text, "HFS+ file creator code or type code are not exactly 4 characters long"); } Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(flag & 1) return(1); ret= Xorriso_remove_hfsplus_crtp(xorriso, node, path, 1); if(ret <= 0) return(ret); ret= Xorriso_set_hfsplus_crtp(xorriso, node, path, creator, hfs_type, 0); if(ret <= 0) return(ret); return(1); } /* @param node If node is NULL and path is empty, then the blessing will be revoked from any node which bears it. @param flag Bitfield for control purposes. bit0= Revoke blessing if node != NULL bears it. bit1= Revoke any blessing of the node, regardless of parameter blessing. If node is NULL, then revoke all blessings. bit2= Only check parameter blessing. Return blessing index + 1 instead of issuing the blessing. bit3= With bit2: Allow blessing "any" and map to index ISO_HFSPLUS_BLESS_MAX. Elsewise, blessing "none" is mapped to ISO_HFSPLUS_BLESS_MAX. */ int Xorriso_hfsplus_bless(struct XorrisO *xorriso, char *path, void *in_node, char *blessing, int flag) { int ret, bless_max; IsoNode *node, **blessed_nodes; IsoImage *volume= NULL; enum IsoHfsplusBlessings bless_code = ISO_HFSPLUS_BLESS_MAX; /* = invalid */ char *hb = ""; size_t l= 0; static char *name= "isofs.hb"; if(strcmp(blessing, "ppc_bootdir") == 0 || strcmp(blessing, "p") == 0 || strcmp(blessing, "P") == 0) { bless_code= ISO_HFSPLUS_BLESS_PPC_BOOTDIR; hb= "p"; } else if(strcmp(blessing, "intel_bootfile") == 0 || strcmp(blessing, "i") == 0 || strcmp(blessing, "I") == 0) { bless_code= ISO_HFSPLUS_BLESS_INTEL_BOOTFILE; hb= "i"; } else if(strcmp(blessing, "show_folder") == 0 || strcmp(blessing, "s") == 0 || strcmp(blessing, "S") == 0) { bless_code= ISO_HFSPLUS_BLESS_SHOWFOLDER; hb= "s"; } else if(strcmp(blessing, "os9_folder") == 0 || strcmp(blessing, "9") == 0) { bless_code= ISO_HFSPLUS_BLESS_OS9_FOLDER; hb= "9"; } else if(strcmp(blessing, "osx_folder") == 0 || strcmp(blessing, "x") == 0 || strcmp(blessing, "X") == 0) { bless_code= ISO_HFSPLUS_BLESS_OSX_FOLDER; hb= "x"; } else if((!(flag & 8)) && (strcmp(blessing, "none") == 0 || strcmp(blessing, "n") == 0 || strcmp(blessing, "N") == 0)) { bless_code= ISO_HFSPLUS_BLESS_MAX; flag |= 2; } else if((flag & 8) && (flag & 4) && (strcmp(blessing, "any") == 0 || strcmp(blessing, "a") == 0 || strcmp(blessing, "A") == 0)) { bless_code= ISO_HFSPLUS_BLESS_MAX; } else { sprintf(xorriso->info_text, "Unknown blessing type "); Text_shellsafe(blessing, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } if(flag & 4) return(1 + bless_code); if(in_node == NULL && path[0]) { ret= Xorriso_node_from_path(xorriso, NULL, path, &node, 0); if(ret <= 0) return(ret); } else node= (IsoNode *) in_node; ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret <= 0) return(ret); if(!(flag & 2)) { /* Remove persistent bless mark from current bearer */ ret= iso_image_hfsplus_get_blessed(volume, &blessed_nodes, &bless_max, 0); Xorriso_process_msg_queues(xorriso, 0); if(ret < 0) { Xorriso_report_iso_error(xorriso, "", ret, "Error when trying to bless a file", 0, "FAILURE", 1); return(0); } if((int) bless_code < bless_max) { if(blessed_nodes[(int) bless_code] != NULL) { ret= Xorriso_setfattr(xorriso, blessed_nodes[(int) bless_code], "", (size_t) 1, &name, &l, &hb, 4 | 8); if(ret <= 0) return(ret); } } } /* Bless node */ ret= iso_image_hfsplus_bless(volume, bless_code, node, flag & 3); Xorriso_process_msg_queues(xorriso, 0); if(ret == 0 && path[0]) { if((flag & 3)) { sprintf(xorriso->info_text, "Attempt to revoke blessing of unblessed file"); } else { sprintf(xorriso->info_text, "Multiple blessing to same file or inappropriate file type"); } if(path[0]) { strcat(xorriso->info_text, ": "); Text_shellsafe(path, xorriso->info_text, 1); } Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); return(0); } else if (ret < 0) { Xorriso_report_iso_error(xorriso, "", ret, "Error when trying to bless a file", 0, "FAILURE", 1); return(0); } /* Attach persistent AAIP bless mark to node */ if(!(flag & 3)) { l= 1; ret= Xorriso_setfattr(xorriso, node, path, (size_t) 1, &name, &l, &hb, 2 | 8); if(ret <= 0) return(ret); } Xorriso_set_change_pending(xorriso, 0); return(1); } int Xorriso_get_blessing(struct XorrisO *xorriso, IsoNode *node, int *bless_idx, char bless_code[17], int flag) { IsoNode **blessed_nodes; int bless_max, ret, i; if(xorriso->in_volset_handle == NULL) return(0); ret= iso_image_hfsplus_get_blessed((IsoImage *) xorriso->in_volset_handle, &blessed_nodes, &bless_max, 0); Xorriso_process_msg_queues(xorriso, 0); if(ret < 0) { Xorriso_report_iso_error(xorriso, "", ret, "Error when trying to inquire HFS+ file blessings", 0, "FAILURE", 1); return(-1); } for(i= 0; i < bless_max; i++) { if(blessed_nodes[i] == node) { switch (i) { case ISO_HFSPLUS_BLESS_PPC_BOOTDIR: strcpy(bless_code, "ppc_bootdir"); break; case ISO_HFSPLUS_BLESS_INTEL_BOOTFILE: strcpy(bless_code, "intel_bootfile"); break; case ISO_HFSPLUS_BLESS_SHOWFOLDER: strcpy(bless_code, "show_folder"); break; case ISO_HFSPLUS_BLESS_OS9_FOLDER: strcpy(bless_code, "os9_folder"); break; case ISO_HFSPLUS_BLESS_OSX_FOLDER: strcpy(bless_code, "osx_folder"); break; default: strcpy(bless_code, "unknown_blessing"); } *bless_idx= i; return(1); } } return(0); } /* @param flag bit0= use file addresses as search patterns */ int Xorriso_apply_sort_file(struct XorrisO *xorriso, char *path, int flag) { int ret, linecount= 0, filec= 0, zero, i; FILE *fp= NULL; char *sret, *line= NULL, *spt, *tpt, *patterns[1], **filev= NULL; char *sort_weight_args[4]; off_t mem= 0; IsoImage *volume; Xorriso_alloc_meM(line, char, SfileadrL); ret= Xorriso_get_volume(xorriso, &volume, 0); if(ret<=0) goto ex; ret= Xorriso_afile_fopen(xorriso, path, "rb", &fp, 2); if(ret <= 0) {ret= 0; goto ex;} while(1) { sret= Sfile_fgets_n(line, SfileadrL - 1, fp, 0); if(sret == NULL) { if(ferror(fp)) {ret= 0; goto ex;} break; } linecount++; /* Find first space or tab */ spt= strchr(line, ' '); tpt= strchr(line, '\t'); if(spt == NULL || (tpt != NULL && tpt < spt)) spt= tpt; if(spt == NULL) { sprintf(xorriso->info_text, "No space or tab character found in line %d of sort weight file ", linecount); Text_shellsafe(path, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); ret= 0; goto ex; } *spt= 0; patterns[0]= spt + 1; if(flag & 1) { /* Obtain list of matching files */ ret= Xorriso_expand_pattern(xorriso, 1, patterns, 0, &filec, &filev, &mem, 4); if(ret <= 0) {ret= 0; goto ex;} } else { filec= 1; } /* Apply weight to file or directory tree */ for(i= 0; i < filec; i++) { zero= 0; if(flag & 1) { sort_weight_args[0]= filev[i]; } else { sort_weight_args[0]= patterns[0]; } sort_weight_args[1]= "-exec"; sort_weight_args[2]= "sort_weight"; sort_weight_args[3]= line; ret= Xorriso_option_find(xorriso, 4, sort_weight_args, &zero, 2); if(ret <= 0) {ret= 0; goto ex;} } if(flag & 1) Sfile_destroy_argv(&filec, &filev, 0); } ret= 1; ex: if(fp != NULL) fclose(fp); Xorriso_free_meM(line); Sfile_destroy_argv(&filec, &filev, 0); return(ret); } /* @param flag bit0= tolerate truncated files of old length and mangle collisions */ int Xorriso_set_file_name_limit(struct XorrisO *xorriso, int value, int flag) { int ret; IsoImage *volume= NULL; struct FindjoB *job= NULL; struct stat dir_stbuf; ret= Xorriso_get_volume(xorriso, &volume, 1); if(ret < 0) goto ex; if (ret == 1 && volume != NULL) { /* Check whether there are non-refreshable truncated names */ ret= Findjob_new(&job, "/", 0); if(ret<=0) { Xorriso_no_findjob(xorriso, "xorriso", 0); {ret= -1; goto ex;} } Findjob_set_action_type(job, 55 + 2 * (flag & 1), value, 0); xorriso->find_unique_trunc_result= 2; ret= Xorriso_findi(xorriso, job, NULL, (off_t) 0, NULL, "/", &dir_stbuf, 0, 0); if(ret < 0) goto ex; xorriso->request_to_abort= 0; if(xorriso->find_unique_trunc_result == 0 && !(flag & 1)) { Xorriso_msgs_submit(xorriso, 0, "-file_name_limit may not be changed because truncated files exist or collisions would occur", 0, "SORRY", 0); ret= 0; goto ex; } xorriso->file_name_limit= value; iso_image_set_truncate_mode(volume, 1, value); /* truncations are necessary */; if(xorriso->find_unique_trunc_result == 1) { Findjob_set_action_type(job, 54 + 2 * (flag & 1), xorriso->file_name_limit, 0); xorriso->find_unique_trunc_result= 2; ret= Xorriso_findi(xorriso, job, NULL, (off_t) 0, NULL, "/", &dir_stbuf, 0, 0); if(ret < 0) goto ex; if(xorriso->find_unique_trunc_result == 0) { /* >>> Did not work . What to do ? */; } } } xorriso->file_name_limit= value; ret= 1; ex:; Findjob_destroy(&job, 0); return(ret); } /* @param flag bit0= test for uniqueness, do not change name bit1= tolerate existing truncated names and mangle collisions bit2= be silent about non-uniquely truncatables do not set xorriso->request_to_abort */ int Xorriso_truncate_uniquely(struct XorrisO *xorriso, int length, IsoNode *node, char *abs_path, char *show_path, int flag) { int ret, l, i; unsigned int mangleno; char *name, *trunc= NULL, *old_name= NULL; IsoDir *dir; IsoNode *collider; IsoImage *volume= NULL; name= (char *) iso_node_get_name(node); l= strlen(name); /* Check for truncated name */ if(l == xorriso->file_name_limit && l != length && !(flag & 2)) { i= 0; if(name[l - 33] == ':') { for(i= l - 32; i < l; i++) if((name[i] < '0' || name[i] > '9') && (name[i] < 'a' || name[i] > 'f')) break; } if(i == l) { if(!(flag & 4)) { sprintf(xorriso->info_text, "Truncated name of current limit found: "); Text_shellsafe(name, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } xorriso->find_unique_trunc_result= 0; {ret= 0; goto ex;} } } /* Check for need to truncate */ if(l <= length) {ret= 1; goto ex;} if(xorriso->find_unique_trunc_result > 1) xorriso->find_unique_trunc_result= 1; trunc= strdup(name); old_name= strdup(name); if(trunc == NULL || old_name == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } ret= iso_truncate_leaf_name(1, length, trunc, 0); if(ret < 0) { Xorriso_process_msg_queues(xorriso, 0); Xorriso_report_iso_error(xorriso, "", ret, "Error when truncating file name", 0, "SORRY", 1); xorriso->find_unique_trunc_result= 0; {ret= 0; goto ex;} } dir= iso_node_get_parent(node); if(dir != NULL) { /* (intentionally using deprecated call which does not truncate by itself)*/ ret= iso_dir_get_node(dir, trunc, &collider); if(ret == 1) { if((flag & 1) && !(flag & 2)) { if(!(flag & 4)) { sprintf(xorriso->info_text, "Truncated name collides with existing name: "); Text_shellsafe(name, xorriso->info_text, 1); strcat(xorriso->info_text, " -> "); Text_shellsafe(trunc, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); } xorriso->find_unique_trunc_result= 0; {ret= 0; goto ex;} } else { /* Mangle */ for(mangleno= 0; mangleno < 0xffffffff; mangleno++) { Sfile_flatten_utf8_heads(trunc, length - 33 - 9, 0); sprintf(trunc + length - 33 - 9, ":%-8.8X", mangleno); trunc [length - 33] = ':'; ret= iso_dir_get_node(dir, trunc, &collider); if(ret == 0) break; } } } } /* If only for testing: done now */ if(flag & 1) {ret= 1; goto ex;} if(xorriso->file_name_limit != length) {ret= -1; goto ex;} /* Programming error */ ret= Xorriso_get_volume(xorriso, &volume, 1); if(ret < 0) {ret= -1; goto ex;} /* Programming error */ /* Set truncated name */ ret= iso_image_set_node_name(volume, node, trunc, 0); if(ret < 0) { Xorriso_process_msg_queues(xorriso, 0); xorriso->find_unique_trunc_result= 0; {ret= 0; goto ex;} } Xorriso_set_change_pending(xorriso, 0); sprintf(xorriso->info_text, "Truncated: "); Text_shellsafe(old_name, xorriso->info_text, 1); strcat(xorriso->info_text, " -> "); Text_shellsafe(trunc, xorriso->info_text, 1); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); ret= 1; ex:; if(ret == 0 && (flag & 1) && !(flag & 4)) xorriso->request_to_abort= 1; Xorriso_free_meM(old_name); Xorriso_free_meM(trunc); return(ret); } libisoburn-1.5.4/xorriso/xorrisofs.info0000644000175700017510000036474714005266037015272 00000000000000This is xorrisofs.info, produced by makeinfo version 5.2 from xorrisofs.texi. xorrisofs - Emulation of ISO 9660 program mkisofs by program xorriso Copyright (C) 2011 - 2021 Thomas Schmitt Permission is granted to distribute this text freely. INFO-DIR-SECTION Archiving START-INFO-DIR-ENTRY * Xorrisofs: (xorrisofs). Emulates ISO 9660 program mkisofs END-INFO-DIR-ENTRY  File: xorrisofs.info, Node: Top, Next: Overview, Up: (dir) xorrisofs 1.5.4 *************** xorrisofs - Emulation of ISO 9660 program mkisofs by program xorriso * Menu: * Overview:: Overview * Standards:: ISO 9660, Rock Ridge, Joliet * Insert:: Inserting files into the ISO image * Xorriso:: Relation to program xorriso * Options:: Options * Examples:: Examples * Files:: Files * Environ:: Environment * Seealso:: See also * Bugreport:: Reporting bugs * Legal:: Author, Copyright, Credits * CommandIdx:: Alphabetic Command List * ConceptIdx:: Alphabetic List of Concepts and Objects  File: xorrisofs.info, Node: Overview, Next: Standards, Prev: Top, Up: Top 1 Overview ********** 'xorrisofs' produces Rock Ridge enhanced ISO 9660 filesystems and add-on sessions to such filesystems. Optionally it can produce Joliet directory trees too. 'xorrisofs' understands options of program mkisofs from cdrtools by Joerg Schilling. Its implementation is part of program xorriso which shares no source code with cdrtools.  File: xorrisofs.info, Node: Standards, Next: Insert, Prev: Overview, Up: Top 2 ISO 9660, Rock Ridge, Joliet, HFS+ ************************************ *ISO 9660* (aka *ECMA-119*) is a read-only filesystem that is mainly used for optical media CD, DVD, BD, but may also reside on other storage devices like disk files, USB sticks or disk partitions. It is widely readable by many operating systems and by boot facilities of personal computers. ISO 9660 describes directories and data files by very restricted filenames with no distinction of upper case and lower case. Its metadata do not comply to fundamental POSIX specifications. *Rock Ridge* is the name of a set of additional information which enhance an ISO 9660 filesystem so that it can represent a POSIX compliant filesystem with ownership, access permissions, symbolic links, and other attributes. Rock Ridge allows filenames of up to 255 bytes and paths of up to 1024 bytes. xorrisofs produces Rock Ridge information by default. It is strongly discouraged to disable this feature. *Joliet* is the name of an additional directory tree which provides filenames up to 64 characters encoded as UTF-16. A Joliet tree is mainly interesting for reading the ISO image by operating systems of Microsoft Corporation. Production of this directory tree may be enabled by option -J. *ISO 9660:1999* is the name of an additional directory tree which provides longer filenames. It allows single file names to have up to 207 characters. It might be of use with some older computer system boot facilities which read neither Rock Ridge nor Joliet but need longer filenames nevertheless. Production of this directory tree may be enabled by option -iso-level 4. *HFS+* is the name of a filesystem which is normally used for writing and reading on hard disks and similar devices. It is possible to embed a HFS+ partition into the emerging ISO 9660 image and to mark it by Apple Partition Map entries. This interferes with options which copy data into the first 32 KiB of the ISO image, like -G or -isohybrid-mbr. See option -hfsplus. The main purpose for having an embedded HFS+ partition is booting of certain models of Apple computers.  File: xorrisofs.info, Node: Insert, Next: Xorriso, Prev: Standards, Up: Top 3 Inserting files into the ISO image ************************************ 'xorrisofs' deals with two kinds of file addresses: *disk_path* is a path to an object in the local filesystem tree. *iso_rr_path* is the Rock Ridge address of a file object in the ISO image. If no Rock Ridge information shall be stored in an emerging ISO, then the names will get mapped to ISO 9660 names of limited length and character set. A program argument is handled as a *pathspec*, if it is not recognized as original mkisofs option or additional 'xorrisofs' option. A pathspec depicts an input file object by a disk_path. If option -graft-points is not present, then the behavior depends on the file type of disk_path. Directories get merged with the /-directory of the ISO image. Files of other types get copied into the /-directory. If -graft-points is present then each pathspec gets split at the first occurrence of the =-character. The part before the = is taken as *target*, i.e. the iso_rr_path for the file object in the ISO image. The part after the first = is taken as *source*, i.e. the disk_path of the input object. It is possible to make =-characters part of the iso_rr_path by preceding them with a \-character. The same must be done for \-characters which shall be part of the iso_rr_path. If the source part of the pathspec leads to a directory, then all files underneath this directory get inserted into the image, too. It is possible to exclude particular files from being inserted by help of option -m. In case that target already exists, the following rules apply: Directories and other files may overwrite existing non-directories. Directories get merged with existing directories. Non-directories may not overwrite existing directories.  File: xorrisofs.info, Node: Xorriso, Next: Options, Prev: Insert, Up: Top 4 Relation to program xorriso ***************************** 'xorrisofs' is actually a command mode of program *xorriso*, which gets entered either by xorriso command "-as mkisofs" or by starting the program by one of the names "xorrisofs", "mkisofs", "genisoimage", or "genisofs". This command mode can be left by argument "--" which leads to generic xorriso command mode. See *man xorriso* for its description. xorriso performs image reading and writing by help of libburn, which is mainly intended for optical drives, but also operates on all POSIX file types except directories. The program messages call any image file a "drive". File types which are not supported for reading are reported as "blank". The reported free media space may be quite fictional. Nevertheless 'xorrisofs' does not operate directly on optical drives, but rather forces libburn to regard them as general device files. So for writing of sequential optical media (CD, DVD-R, DVD+R, BD-R) one will have to use a burn program. E.g the cdrecord emulation of xorriso. See EXAMPLES.  File: xorrisofs.info, Node: Options, Next: Examples, Prev: Xorriso, Up: Top 5 Options ********* * Menu: * Loading:: Image loading * SetInsert:: Settings for file insertion * SetProduct:: Settings for image production * SetCompl:: Settings for standards compliance * SetExtras:: Settings for standards extensions * SetHide:: Settings for file hiding * ImageId:: ISO image ID strings * Bootable:: El Torito Bootable ISO images * SystemArea:: System Area, MBR, GPT, APM, other boot blocks * Charset:: Character sets * Jigdo:: Jigdo Template Extraction * Miscellaneous:: Miscellaneous options  File: xorrisofs.info, Node: Loading, Next: SetInsert, Prev: Options, Up: Options 5.1 Influencing the behavior of image loading ============================================= The following options control loading of an existing ISO image for the purpose of preparing a suitable add-on session. If they are missing then a new image is composed from scratch. -M disk_path Set the path from which to load the existing ISO image directory tree on which to base the upcoming directory tree as add-on session. The path must lead to a random-access readable file object. On GNU/Linux: regular data files or block device files. A special kind of pseudo disk_path has the form "/dev/fd/"number. It depicts the open file descriptor with the given number, regardless whether the operating system supports this feature by file nodes in /dev/fd or not. E.g. /dev/fd/3 is file descriptor 3 which was opened by the program that later started xorriso. -prev-session disk_path Alias of -M. -dev disk_path Alias of -M. -C last_session_start,next_writeable_address Set the 2 KiB block address last_session_start from where to read the ISO image out of the file given by option -M. Separated by a comma, set the next_writeable_address to which the add-on session will finally be written. Decisive is actually the block address which the intended readers will have to use as superblock address on the intended medium. Both values can be inquired from optical media by help of burn programs and cdrecord option -msinfo. xorriso itself can obtain it in its cdrecord emulation. values=$(xorriso -as cdrecord dev=/dev/... -msinfo) echo $values Option -C may be used without option -M to create an ISO image from scratch and prepare it for being finally written to a block address other than 0. Parameter last_session_start must then be set to 0. -cdrecord-params last_session_start,next_writeable_address Alias of -C.  File: xorrisofs.info, Node: SetInsert, Next: SetProduct, Prev: Loading, Up: Options 5.2 Settings for file insertion =============================== -path-list disk_path Read pathspecs line-by-line from disk_file and insert the depicted file objects into the ISO image. If disk_path is "-" then read the pathspecs from standard input. --quoted_path_list disk_path Like option -path-list but reading quoted words rather than plain lines. Whitespace outside of quotes will be discarded. On the other hand it is possible to represent pathspecs which contain newline characters. The double quotation mark " and the single quotation mark ' can be used to enclose whitespace and make it part of pathspecs. Each mark type can enclose the marks of the other type. A trailing backslash \ outside quotations or an open quotation cause the next input line to be appended. -f Resolve symbolic links on disk rather than storing them as symbolic links in the ISO image. -follow-links Alias of -f. -graft-points Enable interpretation of input file pathspecs as combination of iso_rr_path and disk_path, separated by a =-character. -m disk_pattern Exclude files from being inserted into the image. Silently ignored are those files of which the disk_path matches the given shell parser pattern. If no /-character is part of the pattern, then it gets matched against the leaf name of the disk file. It is possible to give more than one -m option. -exclude Alias of -m. -x Alias of -m. -old-exclude Alias of -m. -exclude-list disk_path Perform -m using each line out of file disk_path as argument disk_pattern. -z Enable recognition and proper processing of zisofs compressed files as produced by program mkzftree. These files will get equipped with the necessary meta data so that a Linux kernel will recognize them and deliver their content in uncompressed form. -transparent-compression Alias of -z. -zisofs-version-2 Enable the recognition and proper processing of experimental zisofs version 2 compressed files. The Linux kernel (as of 5.9) does not yet know this format and will complain like isofs: Unknown ZF compression algorithm: PZ This complaint can be prevented by option -zisofs2-susp-z2 . The files will be shown by unaware kernels as they were submitted to xorriso, i.e. with zisofs2 header, block pointer list, and compressed data. -zisofs-version-2 also enables -z. -zisofs2-susp-z2 Enable the production of SUSP entries "Z2" instead of "ZF" with zisofs2 compressed files. Unaware Linux kernels silently ignore "Z2" entries. -zisofs2-susp-zf Enable the production of SUSP entries "ZF" instead of "Z2" with zisofs2 compressed files. Unaware Linux kernels complain about zisofs2 "ZF" by "Unknown ZF compression algorithm" and thus leave a mark in the system log. -root iso_rr_path Insert all files under the given iso_rr_path. If option -graft-points is given, then iso_rr_path is prepended to each target part of a pathspec. The default for -root is "/". -old-root iso_rr_path Enable incremental insertion of files into the loaded image. The effective target and source addresses of given pathspecs get compared whether the target already exists in the ISO image and is still identical to the source on disk. Metadata in the ISO image will get adjusted, if they differ from those on disk. New files and files with changed content will get newly added. Target files which do not exist in any of the according pathspec sources will get removed from the ISO directory tree. If the effective setting of -root differs from the iso_rr_path given with -old-root, then the files underneath the -old-root directory get cloned underneath the -root directory. Cloning happens before file comparison. --old-root-no-ino Disable recording and use of disk inode numbers. If no disk inode numbers are recorded, then option -old-root will have to read disk file content and compare it with the MD5 checksum that is recorded in the ISO image. With recorded disk inode numbers and with credible ctime and mtime, it is possible to detect potential changes in the content without actually reading it. A loophole remains if multiple different filesystems may get mounted at the same directory, like it is habit with /mnt. In this case one has to use option --old-root-devno or disable the inode number shortcut by --old-root-no-ino. --old-root-devno Enable comparison of recorded device numbers together with recorded inode numbers. This works only with good old stable device numbers which get out of fashion, regrettably. If the hard disk has a different device number after each reboot, then this comparison will see all files as changed and thus prevent any incremental size saving. --old-root-no-md5 Disable recording and use of MD5 checksums for data file content. If neither checksums and nor disk inode numbers are recorded, then option -old-root will have to read ISO image file content when comparing it with disk file content.  File: xorrisofs.info, Node: SetProduct, Next: SetCompl, Prev: SetInsert, Up: Options 5.3 Settings for image production ================================= -o disk_path Set the output file address for the emerging ISO image. If the address exists as regular file, it will be truncated to length 0 when image production begins. It may not already exist as directory. If it does not exist yet then its parent directory must exist and a regular file will get created. A special kind of pseudo disk_path has the form "/dev/fd/"number. It depicts the open file descriptor with the given number, regardless whether the operating system supports this feature by file nodes in /dev/fd or not. E.g. /dev/fd/4 is file descriptor 4 which was opened by the program that later started xorriso. Default is standard output (/dev/fd/1) which may also be set by disk_path "-". -output disk_path Alias of -o. --stdio_sync "on"|"off"|"end"|number Set the number of bytes after which to force output to disk in order to keep the memory from being clogged with lots of pending data for slow devices. "on" is the same as "16m". Forced output can be disabled by "off", or be delayed by "end" until all data are produced. If a number is chosen, then it must be at least 64k. The default with xorriso mkisofs emulation is --stdio_sync "off". xorriso uses an inner fifo buffer with default size 4 MiB. So forcing the operating system i/o cache to disk does not necessarily block the simultaneous production of more image content. --emul-toc Write a second superblock with the first session into random-access files. If further sessions get appended and the first superblock gets updated, then the second superblock will not be overwritten. So it is still possible to mount the first session and to find the start blocks of the further sessions. The price is 64 KiB extra space consumption. If -partition_offset is non-zero, then it is 128 KiB plus twice the partition setup. --no-emul-toc Do not write a second superblock with the first session into random-access files. This is the default. --sort-weight weight_number iso_rr_path Attribute a LBA weight number to regular files. If iso_rr_path leads to a directory then all regular files underneath will get the weight_number. The weight_number may range from -2147483648 to 2147483647. The higher it is, the lower will be the block address of the file data in the emerging ISO image. Currently the El Torito boot catalog has a hardcoded weight of 1 billion. Normally it should occupy the block with the lowest possible address. Data files get added or loaded with initial weight 0. Boot image files have a default weight of 2. --sort-weight-list disk_path Read pairs of weight number and iso_rr_path from a file of the local filesystem. Apply each pair like with --sort-weight. Only the last --sort-weight-list or --sort-weight-patterns of a xorrisofs run gets into effect. The weight number is read from the start of the line. The iso_rr_path part of an input line begins immediately after the first blank or tab character of the line. Notes for the case that this feature is used within a sequence of generic xorriso commands (not an issue with a pure mkisofs emulation run): The addressed files must already be in the ISO image model when you execute -as mkisofs --sort-weight-list disk_path -- Several such commands may be used to apply more than one weight file. Data files which are loaded by -indev or -dev get a weight between 1 and 2 exp 28 = 268,435,456, depending on their block address. This shall keep them roughly in the same order if the write method of modifying is applied. --sort-weight-patterns disk_path Like --sort-weight-list , but expanding the iso_rr_paths as shell parser patterns and applying --sort-weight to each matching file. -uid number|name Use the given number or locally existing user name as owner id of all files and directories in the emerging filesystem. Empty name or name "-" revoke this feature. -gid number|name Use the given number or locally existing group name as group id of all files and directories in the emerging filesystem. Empty name or name "-" revoke this feature. -dir-mode mode Set the access permissions for all directories in the image to the given mode which is either an octal number beginning with "0" or a comma separated list of statements of the form [ugoa]*[+-=][rwxst]* . E.g. ug=rx,a-rwx -file-mode mode Like -dir-mode but for all regular data files in the image. -pad Add 300 KiB to the end of the produced ISO image. This circumvents possible read errors from ISO images which have been written to CD media in TAO mode. The additional bytes are claimed as part of the ISO image if not -emul-toc is given. Option -pad is the default. -no-pad Disable padding of 300 KiB to the end of the produced ISO image. This is safe if the image is not meant to be written on CD or if it gets written to CD as only track in write mode SAO. --old-empty Use the old way of of giving block addresses in the range of [0,31] to files with no own data content. The new way is to have a dedicated block to which all such files will point.  File: xorrisofs.info, Node: SetCompl, Next: SetExtras, Prev: SetProduct, Up: Options 5.4 Settings for standards compliance ===================================== -iso-level number Specify the ISO 9660 version which defines the limitations of file naming and data file size. The naming restrictions do not apply to the Rock Ridge names but only to the low-level ISO 9660 names. There are three conformance levels: Level 1 allows ISO names of the form 8.3 and file size up to 4 GiB - 1. Level 2 allows ISO names with up to 32 characters and file size up to 4 GiB - 1. Level 3 allows ISO names with up to 32 characters and file size of up to 400 GiB - 200 KiB. (This size limitation is set by the xorriso implementation and not by ISO 9660 which would allow nearly 8 TiB.) Pseudo-level 4 enables production of an additional ISO 9660:1999 directory tree. -disallow_dir_id_ext Do not follow a bad habit of mkisofs which allows dots in the ISO names of directories. On the other hand, some bootable GNU/Linux images depend on this bad habit. -U This option allows ISO file names without dot and up to 37 characters, ISO file paths longer than 255 characters, and all ASCII characters in file names. Further it omits the semicolon and the version numbers at the end of ISO names. This all violates ISO 9660 specs. -untranslated-filenames Alias of -U. -untranslated_name_len number Allow ISO file names up to the given number of characters without any character conversion. The maximum number is 96. If a file name has more characters, then image production will fail deliberately. This violates ISO 9660 specs. -allow-lowercase Allow lowercase character in ISO file names. This violates ISO 9660 specs. -relaxed-filenames Allow nearly all 7-bit characters in ISO file names. Not allowed are 0x0 and '/'. If not option -allow-lowercase is given, then lowercase letters get converted to uppercase. This violates ISO 9660 specs. -d Do not add trailing dot to ISO file names without dot. This violates ISO 9660 specs. -omit-period Alias of -d. -l Allow up to 31 characters in ISO file names. -full-iso9660-filenames Alias of -l. -max-iso9660-filenames Allow up to 37 characters in ISO file names. This violates ISO 9660 specs. -N Omit the semicolon and the version numbers at the end of ISO names. This violates ISO 9660 specs. -omit-version-number Alias of -N.  File: xorrisofs.info, Node: SetExtras, Next: SetHide, Prev: SetCompl, Up: Options 5.5 Settings for standards extensions ===================================== -R With mkisofs this option enables Rock Ridge extensions. 'xorrisofs' produces them by default. It is strongly discouraged to disable them by option --norock. -rock Alias of -R. -r Enable Rock Ridge and set user and group id of all files in the ISO image to 0. Grant r-permissions to all. Deny all w-permissions. If any x-permission is set, grant x-permission to all. Remove s-bit and t-bit. These attribute changes stay delayed until mkisofs emulation ends. Within the same -as mkisofs emulation command they can be revoked by a subsequent option --norock. For compatibility reasons, option -R does not revoke the changes ordered by -r. -rational-rock Alias of -r. --norock This option disables the production of Rock Ridge extensions for the ISO 9660 file objects. The multi-session capabilities of 'xorrisofs' depend much on the naming fidelity of Rock Ridge. So it is strongly discouraged to disable it by this option, except for the special use case to revoke the effect of -r by: --norock -R --set_all_file_dates timestring Set mtime, atime, and ctime of all files and directories to the given time. Valid timestring formats are: 'Nov 8 14:51:13 CET 2007', 110814512007.13, 2007110814511300. See also --modification-date= and man xorriso, Examples of input timestrings. If the timestring is "set_to_mtime", then the atime and ctime of each file and directory get set to the value found in their mtime. These actions stay delayed until actual ISO production begins. Up to then they can be revoked by --set_all_file_dates with empty timestring or timestring "default". The timestamps of the El Torito boot catalog file get refreshed when the ISO is produced. They can be influenced by --modification-date=. -file_name_limit number Set the maximum permissible length for file names in the range of 64 to 255. Path components which are longer than the given number will get truncated and have their last 33 bytes overwritten by a colon ':' and the hex representation of the MD5 of the first 4095 bytes of the whole oversized name. Potential incomplete UTF-8 characters will get their leading bytes replaced by '_'. Linux kernels up to at least 4.1 misrepresent names of length 254 and 255. If you expect such names in or under disk_paths and plan to mount the ISO by such Linux kernels, consider to set -file_name_limit 253. -D The standard ECMA-119 demands that no path in the image shall have more than 8 name components or 255 characters. Therefore it would be necessary to move deeper directory trees to a higher directory. Rock Ridge offers an opportunity to let these relocated directories appear at their original deep position, but this feature might not be implemented properly by operating systems which mount the image. Option -D disables this deep directory relocation, and thus violates ISO 9660 specs. xorrisofs has -D set by default. If given explicitly then it overrides the options -rr_reloc_dir and -hide-rr-moved. -disable-deep-relocation Alias of -D. -rr_reloc_dir name Enable the relocation of deep directories and thus avoid ECMA-119 file paths of more than 8 name components or 255 characters. Directories which lead to such file paths will get moved to a directory in the root directory of the image. Its name gets set by this option. It is permissible to use the root directory itself. The overall directory tree will appear originally deep when interpreted as Rock Ridge tree. It will appear as re-arranged if only ECMA-119 information is considered. If the given relocation target directory does not already exist when image production begins, then it will get created and marked for Rock Ridge as relocation artefact. At least on GNU/Linux it will not be displayed in mounted Rock Ridge images. The name must not contain a '/' character after its first character and it must not be longer than 255 bytes. This option has no effect if option -D is present. -hide-rr-moved Alias of -rr_reloc_dir "/.rr_moved" --for_backup Enable all options which improve backup fidelity: --acl, --xattr-any, --md5, --hardlinks. If you later restore a backup with xattr from non-user namespaces, then make sure that the target operating system and filesystem know what these attributes mean. Possibly you will need administrator privileges to record or restore such attributes. At recording time, xorriso will try to tolerate missing privileges and just record what is readable. Option -xattr after option -for_backup excludes non-user attributes from being recorded. --acl Enable recording and loading of ACLs from GNU/Linux or FreeBSD (see man getfacl, man acl). They will not be in effect with mounted ISO images. But xorriso can restore them on the same systems when extracting files from the ISO image. --xattr Enable recording and loading of GNU/Linux or FreeBSD extended attributes in user namespace (see man getfattr and man attr, man getextattr and man 9 extattr, respectively). They will not be in effect with mounted ISO images. But xorriso can restore them on the same systems when extracting files from the ISO image. --xattr-any Enable recording and loading of GNU/Linux or FreeBSD extended attributes in all namespaces. This might need administrator privileges, even if the owner of the disk file tries to read the attributes. --md5 Enable recording of MD5 checksums for the overall ISO image and for each single data file in the image. xorriso can check the content of an ISO image with these sums and raise alert on mismatch. See man xorriso, options -check_media, check_md5_r. xorriso can print recorded MD5 checksums. E.g. by: -find / -exec get_md5 --hardlinks Enable loading and recording of hardlink relations. Search for families of iso_rr files which stem from the same disk file, have identical content filtering and have identical properties. The members of each family get the same inode number in the ISO image. Whether these numbers are respected at mount time depends on the operating system. xorriso can create hardlink families when extracting files from the ISO image. --scdbackup_tag disk_path record_name Append a scdbackup checksum record to the image. This works only if the parameter next_writeable_address of option -C is 0 and -md5 is enabled. If disk_path is not an empty string, then append a scdbackup checksum record to the end of this file. record_name is a word that gets part of tag and record. Program scdbackup_verify will recognize and verify tag and file record. An empty record_name disables this feature. -J Enable the production of an additional Joliet directory tree along with the ISO 9660 Rock Ridge tree. -joliet Alias of -J. -joliet-long Allow 103 characters in Joliet file names rather than 64 as is prescribed by the specification. Allow Joliet paths longer than the prescribed limit of 240 characters. Oversized names get truncated. Without this option, oversized paths get excluded from the Joliet tree. -joliet-utf16 Encode Joliet file names in UTF-16BE rather than UCS-2. The difference is with characters which are not present in UCS-2 and get encoded in UTF-16 by 2 words of 16 bit each. Both words then stem from a reserved subset of UCS-2. -hfsplus Enable the production of an additional HFS+ filesystem inside the ISO 9660 image and mark it by Apple Partition Map (APM) entries in the System Area, the first 32 KiB of the image. This may collide with options like -G or -isohybrid-mbr which submit user data for inclusion in the same address range. The first 8 bytes of the System Area get overwritten by { 0x45, 0x52, 0x08 0x00, 0xeb, 0x02, 0xff, 0xff } which can be executed as x86 machine code without negative effects. So if an MBR gets combined with this feature, then its first 8 bytes should contain no essential commands. The next blocks of 2 KiB in the System Area will be occupied by APM entries. The first one covers the part of the ISO image before the HFS+ filesystem metadata. The second one marks the range from HFS+ metadata to the end of file content data. If more ISO image data follow, then a third partition entry gets produced. Other features of xorriso might cause the need for more APM entries. Be aware that HFS+ is case-insensitive although it can record file names with upper-case and lower-case letters. Therefore, file names from the iso_rr name tree may collide in the HFS+ name tree. In this case they get changed by adding underscore characters and counting numbers. In case of very long names, it might be necessary to map them to "MANGLED_...". WARNING: The HFS+ implementation in libisofs has a limit of 125,829,120 bytes for the size of the overall directory tree. This suffices for about 300,000 files of normal name length. If the limit gets exceeded, a FAILURE event will be issued and the ISO production will not happen. -hfsplus-serial-no Set a string of 16 digits "0" to "9" and letters "a" to "f", which will be used as unique serial number of an emerging HFS+ filesystem. -hfsplus-block-size number Set the allocation block size to be used when producing HFS+ filesystems. Permissible are 512, 2048, or 0. The latter lets the program decide. -apm-block-size number Set the block size to be used when describing partitions by an Apple Partition Map. Permissible are 512, 2048, or 0. The latter lets the program decide. Note that size 512 is not compatible with production of GPT, and that size 2048 will not be mountable -t hfsplus at least by older Linux kernels. -hfsplus-file-creator-type creator type iso_rr_path Set the HFS+ creator and type attributes of a file in the emerging image. These are two codes of 4 characters each. -hfs-bless-by blessing iso_rr_path Issue a HFS+ blessing. They are roles which can be attributed to up to four directories and a data file: "ppc_bootdir", "intel_bootfile", "show_folder", "os9_folder", "osx_folder". They may be abbreviated as "p", "i", "s", "9", and "x". Each such role can be attributed to at most one file object. "intel_bootfile" is the one that would apply to a data file. All others apply to directories. No file object can bear more than one blessing. -hfs-bless disk_path Issue HFS+ blessing "ppc_bootdir" to the directory which stems from the directory disk_path in the local filesystem tree. This works only if there is at least one data file underneath the directory. disk_path can become ambiguous if files from different local filesystem sub-trees are put into the same sub-tree of the ISO image. Consider to use -hfs-bless-by "p" for unambiguous addressing via iso_rr_path.  File: xorrisofs.info, Node: SetHide, Next: ImageId, Prev: SetExtras, Up: Options 5.6 Settings for file hiding ============================ -hide disk_path_pattern Make files invisible in the directory tree of ISO 9660 and Rock Ridge, if their disk_path matches the given shell parser pattern. The data content of such hidden files will be included in the resulting image, even if they do not show up in any directory. But you will need own means to find nameless data in the image. This command does not apply to the boot catalog. -hide-list disk_path Perform -hide using each line out of file disk_path as argument disk_path_pattern. -hide-joliet disk_path_pattern Like option -hide but making files invisible in the directory tree of Joliet, if their disk_path matches the given shell parser pattern. -hide-joliet-list disk_path Perform -hide-joliet using each line out of file disk_path as argument disk_path_pattern. -hide-hfsplus disk_path_pattern Like option -hide but making files invisible in the directory tree of HFS+, if their disk_path matches the given shell parser pattern. -hide-hfsplus-list disk_path Perform -hide-hfsplus using each line out of file disk_path as argument disk_path_pattern.  File: xorrisofs.info, Node: ImageId, Next: Bootable, Prev: SetHide, Up: Options 5.7 ISO image ID strings ======================== The following strings and file addresses get stored in the Primary Volume Descriptor of the ISO9660 image. The file addresses are ISO 9660 paths. These files should have iso_rr_paths which consist only of the characters [A-Z0-9_] and exactly one dot which separates at most 8 characters from at most 3 characters. -V text Set the Volume Id of the ISO image. xorriso accepts any text up to 32 characters, but according to rarely obeyed specs stricter rules apply: Conformant are ASCII characters out of [A-Z0-9_]. Like: "IMAGE_23" Joliet allows 16 UCS-2 characters. Like: "Windows name" Be aware that the volume id might get used automatically as name of the mount point when the medium is inserted into a playful computer system. -volid text Alias of -V. -volset text Set the Volume Set Id of the ISO image. Permissible are up to 128 characters. -P text Set the Publisher Id of the ISO image. This may identify the person or organisation who specified what shall be recorded. Permissible are up to 128 characters. -publisher text Alias of -P. -A text Set the Application Id of the ISO image. This may identify the specification of how the data are recorded. Permissible are up to 128 characters. The special text "@xorriso@" gets converted to the id string of xorriso which is normally written as Preparer Id. It is a wrong tradition to write the program id as Application Id. -appid text Alias of -A. -sysid text Set the System Id of the ISO image. This may identify the system which can recognize and act upon the content of the System Area in image blocks 0 to 15. Permissible are up to 32 characters. -p text Set the Preparer Id of the ISO image. This may identify the person or other entity which controls the preparation of the data which shall be recorded. Normally this should be the id of xorriso and not of the person or program which operates xorriso. Please avoid to change it. Permissible are up to 128 characters. The special text "@xorriso@" gets converted to the id string of xorriso which is default at program startup. -preparer text Alias of -p. -abstract iso_path Set the address of the Abstract File of the ISO image. This should be the ISO 9660 path of a file in the image which contains an abstract statement about the image content. Permissible are up to 37 characters. -biblio iso_path Set the address of the Biblio File of the ISO image. This should be the ISO 9660 path of a file in the image which contains bibliographic records. Permissible are up to 37 characters. -copyright iso_path Set the address of the Copyright File of the ISO image. This should be the ISO 9660 path of a file in the image which contains a copyright statement. Permissible are up to 37 characters. --modification-date=YYYYMMDDhhmmsscc Set a timestring that overrides ISO image creation and modification timestamps literally. It must consist of 16 decimal digits which form YYYYMMDDhhmmsscc, with YYYY between 1970 and 2999. Time zone is GMT. It is supposed to match this GRUB line: search --fs-uuid --set YYYY-MM-DD-hh-mm-ss-cc E.g. 2010040711405800 is 7 Apr 2010 11:40:58 (+0 centiseconds). Among the influenced timestamps are: isohybrid MBR id, El Torito boot catalog file, HFS+ superblock. --application_use character|0xXY|disk_path Specify the content of the Application Use field which can take at most 512 bytes. If the parameter of this command is empty, then the field is filled with 512 0-bytes. If it is a single character, then it gets repeated 512 times. If it begins by "0x" followed by two hex digits [0-9a-fA-F], then the digits are read as byte value which gets repeated 512 times. Any other parameter text is used as disk_path to open a data file and to read up to 512 bytes from it. If the file is smaller than 512 bytes, then the remaining bytes in the field get set to binary 0.  File: xorrisofs.info, Node: Bootable, Next: SystemArea, Prev: ImageId, Up: Options 5.8 El Torito Bootable ISO images ================================= The precondition for a bootable ISO image is to have in the ISO image the files of a boot loader. The boot facilities of computers get directed to such files, which usually execute further program files from the ISO image. 'xorrisofs' can produce several kinds of boot block or boot record, which become part of the ISO image, and get interpreted by the according boot facility. An *El Torito* boot record points the bootstrapping facility to a boot catalog with one or more boot images, which are binary program files stored in the ISO image. The content of the boot image files is not in the scope of El Torito. xorriso composes the boot catalog according to the boot image files given and structured by options -b, -e, -eltorito-alt-boot, and --efi-boot. Often it contains only one entry. Normally the boot images are data files inside the ISO filesystem. By special path "-interval:appended_partition_NNN:all::" it is possible to refer to an appended partition. The number NNN gives the partition number as used with the corresponding option -append_partition. E.g.: -append_partition 2 0xef /tmp/efi.img -e -interval:appended_partition_2:all:: El Torito gets interpreted by boot facilities PC-BIOS and EFI. Most bootable GNU/Linux CDs are equipped with ISOLINUX or GRUB boot images for PC-BIOS. 'xorrisofs' supports the example options out of the ISOLINUX wiki, the options used in GRUB script grub-mkrescue, and the example in the FreeBSD AvgLiveCD wiki. For CD booting via boot facilities other than PC-BIOS and EFI, and for booting from USB sticks or hard disks, see the next section about the System Area. -b iso_rr_path Specify the boot image file which shall be mentioned in the current entry of the El Torito boot catalog. It will be marked as suitable for PC-BIOS. With boot images from ISOLINUX and GRUB this option should be accompanied by options -c , -no-emul-boot , -boot-load-size 4 , -boot-info-table. -eltorito-boot iso_rr_path Alias of -b. -eltorito-alt-boot Finalize the current El Torito boot catalog entry and begin a new one. A boot image file and all its necessary options shall be specified before option -eltorito-alt-boot. All further El Torito boot options apply to the new catalog entry. Up to 32 catalog entries are possible. -e iso_rr_path Specify the boot image file which shall be mentioned in the current entry of the El Torito boot catalog. It will be marked as suitable for EFI. Option -e should be followed by option -no-emul-boot and no other El Torito options before an eventual -eltorito-alt-boot. --efi-boot iso_rr_path Perform -eltorito-alt-boot, option -e with the given iso_rr_path, -no-emul-boot, and again -eltorito-alt-boot. This gesture is used for achieving EFI-bootability of the GRUB2 rescue CD. -eltorito-platform "x86"|"PPC"|"Mac"|"efi"|0xnn|nnn Set the Platform Id number for the next option -b or -eltorito-boot. The number may be chosen by a platform name or by a number between 0 and 255 (0x00 and 0xFF). "x86" = 0 is for PC-BIOS, "PPC" = 1 for some PowerPC systems, "Mac" = 2 for some MacIntosh systems, "efi" = 0xEF for EFI on modern PCs with x86 compatible CPUs or others. If the new platform id differs from the previous one, -eltorito-alt-boot gets performed. -boot-load-size number|"full" Set the number of 512-byte blocks to be loaded at boot time from the boot image in the current catalog entry. Non-emulating BIOS bootimages usually need a load size of 4. Nevertheless the default setting of mkisofs is to use the full size of the boot image rounded up to a multiple of 4 512-byte blocks. This default may be explicitly enforced by the word "full" instead of a number. EFI boot images usually get set the number of blocks occupied by the boot image file. El Torito cannot represent load sizes higher than 65535. -hard-disk-boot Mark the boot image in the current catalog entry as emulated hard disk. (Not suitable for any known boot loader.) -no-emul-boot Mark the boot image in the current catalog entry as not emulating floppy or hard disk. (This is to be used with all known boot loaders.) If neither -hard-disk-boot nor -no-emul-boot is given, then the boot image will be marked as emulating a floppy. (Not suitable for any known boot loader.) -eltorito-id text|56_hexdigits Define the ID string of the boot catalog section where the boot image will be listed. If the value consists of 56 characters [0-9A-Fa-f] then it is converted into 28 bytes, else the first 28 characters become the ID string. The ID string of the first boot image becomes the overall catalog ID. It is limited to 24 characters. Other id_strings become section IDs. -eltorito-selcrit hexdigits Define the Selection Criteria of the boot image. Up to 20 bytes get read from the given characters [0-9A-Fa-f]. They get attributed to the boot image entry in the catalog. -boot-info-table Overwrite bytes 8 to 63 in the current boot image. The information will be supplied by xorriso in the course of image production: Block address of the Primary Volume Descriptor, block address of the boot image file, size of the boot image file. --grub2-boot-info Overwrite bytes 2548 to 2555 in the current boot image by the address of that boot image. The address is written as 64 bit little-endian number. It is the 2KB block address of the boot image content, multiplied by 4, and then incremented by 5. -c iso_rr_path Set the address of the El Torito boot catalog file within the image. This file address is not significant for the booting PC-BIOS or EFI, but it may later be read by other programs in order to learn about the available boot images. -eltorito-catalog iso_rr_path Alias of -c. --boot-catalog-hide Prevent the El Torito boot catalog from appearing as file in the directory trees of the image.  File: xorrisofs.info, Node: SystemArea, Next: Charset, Prev: Bootable, Up: Options 5.9 System Area, MBR, GPT, APM, other boot blocks ================================================= The first 16 blocks of an ISO image are the System Area. It is reserved for system dependent boot software. This may be the boot facilities and partition tables of various hardware architectures. A *MBR* (Master Boot Record) contains boot code and a partition table. It is read by PC-BIOS when booting from USB stick or hard disk, and by PowerPC CHRP or PReP when booting. An MBR partition with type 0xee indicates the presence of GPT. A *GPT* (GUID Partition Table) marks partitions in a more modern way. It is read by EFI when booting from USB stick or hard disk, and may be used for finding and mounting a HFS+ partition inside the ISO image. An *APM* (Apple Partition Map) marks the HFS+ partition. It is read by Macs for booting and for mounting. MBR, GPT and APM are combinable. APM occupies the first 8 bytes of MBR boot code. All three do not hamper El Torito booting from CDROM. 'xorrisofs' supports further boot facilities: MIPS Big Endian (SGI), MIPS Little Endian (DEC), SUN SPARC, HP-PA, DEC Alpha. Those are mutually not combinable and also not combinable with MBR, GPT, or APM. Several of the following options expect disk paths as input but also accept description strings for the libisofs interval reader, which is able to cut out data from disk files or -indev and to zeroize parts of the content: -G, -generic-boot, --embedded-boot, --grub2-mbr, -isohybrid-mbr, -efi-boot-part, -prep-boot-part, -B, -sparc-boot, -append_partition. The description string consists of the following components, separated by colon ':' "--interval:"Flags":"Interval":"Zeroizers":"Source The component "--interval" states that this is not a plain disk path but rather a interval reader description string. The component Flags modifies the further interpretation: "local_fs" demands to read from a file depicted by the path in Source. "imported_iso" demands to read from the -indev. This works only if -outdev is not the same as -indev. The Source component is ignored. "appended_partition_NNN" with a decimal number NNN works only for options which announce El Torito boot image paths: -b, -e, -efi-boot. The number gives the partition number as used with the corresponding option -append_partition. The component Interval consists of two byte address numbers separated by a "-" character. E.g. "0-429" means to read bytes 0 to 429. The component Zeroizers consists of zero or more comma separated strings. They define which part of the read data to zeroize. Byte number 0 means the byte read from the Interval start address. Each string may be one of: "zero_mbrpt" demands to zeroize the MBR partition table if bytes 510 and 511 bear the MBR signature 0x55 0xaa. "zero_gpt" demands to check for a GPT header in bytes 512 to 1023, to zeroize it and its partition table blocks. "zero_apm" demands to check for an APM block 0 and to zeroize its partition table blocks. Start_byte"-"End_byte demands to zeroize the read-in bytes beginning with number Start_byte and ending after End_byte. The component Source is the file path with flag "local_fs", and ignored with flag "imported_iso". Byte numbers may be scaled by a suffix out of {k,m,g,t,s,d} meaning multiplication by {1024, 1024k, 1024m, 1024g, 2048, 512}. A scaled value end number depicts the last byte of the scaled range. E.g. "0d-0d" is "0-511". Examples: "local_fs:0-32767:zero_mbrpt,zero_gpt,440-443:/tmp/template.iso" "imported_iso:45056d-47103d::" -G disk_path Copy at most 32768 bytes from the given disk file to the very start of the ISO image. Other than a El Torito boot image, the file disk_path needs not to be added to the ISO image. It will not show up as file in the directory trees. In multi-session situations, the special disk_path "." prevents reading of a disk file but nevertheless causes the adjustments in the existing MBR, which were ordered by other options. -generic-boot disk_path Alias of -G. --embedded-boot disk_path Alias of -G. --grub2-mbr disk_path Install disk_path in the System Area and treat it as modern GRUB2 MBR. The content start address of the first boot image is converted to a count of 512 byte blocks, and an offset of 4 is added. The result is written as 64 bit little-endian number to byte address 0x1b0. -isohybrid-mbr disk_path Install disk_path as ISOLINUX isohybrid MBR which makes the boot image given by option -b bootable from USB sticks and hard disks via PC-BIOS. This preparation is normally done by ISOLINUX program isohybrid on the already produced ISO image. The disk path should lead to one of the Syslinux files isohdp[fp]x*.bin . The MBR gets patched according to isohybrid needs. The first partition describes the range of the ISO image. Its start is at block 0 by default, but may be set to 64 disk blocks by option -partition_offset 16. For the meaning of special disk_path "." see option -G. -isohybrid-gpt-basdat Mark the current El Torito boot image (see options -b and -e) in an actually invalid GPT as partition of type Basic Data. This works only with -isohybrid-mbr and has the same impact on the system area as -efi-boot-part. It cannot be combined with -efi-boot-part or -hfsplus. The first three boot images which are marked by GPT will also show up as partition entries in MBR. The MBR partition of type 0xEF is what actually is used by EFI firmware for booting from USB stick. The MBR partition for PC-BIOS gets type 0x00 rather than 0x17 in this case. Often the further MBR entries are the ones which actually get used by EFI. -isohybrid-gpt-hfsplus Mark the current El Torito boot image (see options -b and -e) in GPT as partition of type HFS+. Impact and restrictions are like with -isohybrid-gpt-basdat. -isohybrid-apm-hfsplus Mark the current El Torito boot image (see options -b and -e) in Apple Partition Map as partition of type HFS+. This works only with -isohybrid-mbr and has a similar impact on the system area as -hfsplus. It cannot be combined with -efi-boot-part or -hfsplus. The ISOLINUX isohybrid MBR file must begin by a known pattern of 32 bytes of x86 machine code which essentially does nothing. It will get overwritten by 32 bytes of APM header mock-up. -part_like_isohybrid Control whether -isohybrid-gpt-basdat, -isohybrid-gpt-hfsplus, and -isohybrid-apm-hfsplus apply even if not -isohybrid-mbr is present. No MBR partition of type 0xee emerges, even if GPT gets produced. Gaps between GPT and APM partitions will not be filled by more partitions. Appended partitions get mentioned in APM if other APM partitions emerge. -iso_mbr_part_type "default"|number|type_guid Set the partition type of the MBR or GPT partition which represents the ISO or at least protects it. Number may be 0x00 to 0xff. The text "default" re-enables the default types of the various occasions to create an ISO MBR partition. This is without effect if no such partition emerges by other settings or if the partition type is prescribed mandatorily like 0xee for GPT protective MBR or 0x96 for CHRP. If instead a type_guid is given by a 32-digit hex string like a2a0d0ebe5b9334487c068b6b72699c7 or by a structured text like EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, then it will be used as partition type if the ISO filesystem appears as partition in GPT. In MBR, C12A7328-F81F-11D2-BA4B-00A0C93EC93B will be mapped to 0xef. Any other GUID will be mapped to 0x83. --protective-msdos-label Patch the System Area by a simple PC-DOS partition table where partition 1 claims the range of the ISO image but leaves the first block unclaimed. This is mutally exclusive to option -isohybrid-mbr. --mbr-force-bootable Enforce an MBR partition with "bootable/active" flag if options like --protective-msdos-label or --grub2-mbr are given. These options normally cause the flag to be set if there is an MBR partition of type other than 0xee or 0xef. If no such partition exists, then no bootflag is set, unless --mbr-force-bootable forces creation of a dummy partition of type 0x00 which covers only the first block of the ISO image. If no bootable MBR is indicated by other options and a partition gets created by -append_partition, then --mbr-force-bootable causes a bootflag like it would do with e.g. --protective-msdos-label. -partition_offset 2kb_block_adr Cause a partition table with a single partition that begins at the given block address. This is counted in 2048 byte blocks, not in 512 byte blocks. If the block address is non-zero then it must be at least 16. Values larger than 16 are hardly of use. A non-zero partition offset causes two superblocks to be generated and two sets of directory trees. The image is then mountable from its absolute start as well as from the partition start. The offset value of an ISO image gets preserved when a new session is added to a loaded image. So the value defined here is only in effect if a new ISO image gets written. -partition_hd_cyl number Set the number of heads per cylinder for the MBR partition table. 0 chooses a default value. Maximum is 255. -partition_sec_hd number Set the number of sectors per head for the MBR partition table. 0 chooses a default value. Maximum is 63. The product partition_sec_hd * partition_hd_cyl * 512 is the cylinder size. It should be divisible by 2048 in order to make exact alignment possible. With appended partitions and -appended_part_as_gpt there is no limit for the number of cylinders. Else there may be at most 1024 of them. If the cylinder size is too small to stay below the limit, then appropriate values of partition_hd_cyl are chosen with partition_sec_hd 32 or 63. If the image is larger than 8,422,686,720 bytes, then the cylinder size constraints cannot be fulfilled for MBR. They seem not overly important anyway. Flat block addresses in partition tables are good for 1 TiB. -partition_cyl_align mode Control image size alignment to an integer number of cylinders. It is prescribed by isohybrid specs and it seems to please program fdisk. Cylinder size must be divisible by 2048. Images larger than 8,323,596,288 bytes cannot be aligned in MBR partition table. Mode "auto" is default. Alignment by padding happens only if option -isohybrid-mbr is given. Mode "on" causes alignment by padding with option --protective-msdos-label too. Mode "all" is like "on" but also pads up partitions from -append_partition to an aligned size. Mode "off" disables alignment unconditionally. -append_partition partition_number type_code disk_path Cause a prepared filesystem image to be appended to the ISO image and to be described by a partition table entry in a boot block at the start of the emerging ISO image. The partition entry will bear the size of the submitted file rounded up to the next multiple of 2048 bytes or to the next multiple of the cylinder size. Beware of subsequent multi-session runs. The appended partition will get overwritten. partition_number may be 1 to 4. Number 1 will put the whole ISO image into the unclaimed space before partition 1. So together with most xorriso MBR or GPT features, number 2 would be the most natural choice. The type_code may be "FAT12", "FAT16", "Linux", or a hexadecimal number between 0x00 and 0xff. Not all those numbers will yield usable results. For a list of codes search the Internet for "Partition Types" or run fdisk command "L". If the partition appears in GPT then type_code 0xef is mapped to the EFI System Partition Type GUID. All others get mapped to Basic Data Type GUID. type_code may also be a type GUID as plain hex string like a2a0d0ebe5b9334487c068b6b72699c7 or as structured text like EBD0A0A2-B9E5-4433-87C0-68B6B72699C7. It will be used if the partition is mentioned in GPT. In MBR, C12A7328-F81F-11D2-BA4B-00A0C93EC93B will be mapped to 0xef. Any other GUID will be mapped to 0x83. In APM, 48465300-0000-11AA-AA11-00306543ECAC will be mapped to partition type "Apple_HFS", any other to "Data". If some other command causes the production of GPT, then the appended partitions will be mentioned there too, even if not -appended_part_as_gpt is given. -appended_part_as_gpt Marks partitions from -append_partition in GPT rather than in MBR. In this case the MBR shows a single partition of type 0xee which covers the whole output data. By default, appended partitions get marked in GPT only if GPT is produced because of other options. -appended_part_as_apm Marks partitions from -append_partition in Apple Partition Map, too. By default, appended partitions get marked in APM only if APM is produced because of other options and -part_like_isohybrid is enabled. -efi-boot-part disk_path Copy a file from disk into the emerging ISO image and mark it by a GPT entry as EFI System Partition. EFI boot firmware is supposed to use a FAT filesystem image in such a partition for booting from USB stick or hard disk. Instead of a disk_path, the word --efi-boot-image may be given. It exposes in GPT the content of the first El Torito EFI boot image as EFI system partition. EFI boot images are introduced by options -e or --efi-boot. The affected EFI boot image cannot show up in HFS+ because it is stored outside the HFS+ partition. --gpt_disk_guid value Control whether an emerging GPT shall get a randomly generated disk GUID or whether the GUID is supplied by the user. Value "random" is default. Value "modification-date" produces a low quality GUID from the value set by option --modification-date=. A string of 32 hex digits, or a RFC 4122 compliant GUID string may be used to set the disk GUID directly. UEFI prescribes the first three components of a RFC 4122 GUID string to be byte-swapped in the binary representation: E.g. --gpt_disk_guid 2303cd2a-73c7-424a-a298-25632da7f446 equals --gpt_disk_guid 2acd0323c7734a42a29825632da7f446 The partition GUIDs get generated by minimally varying the disk GUID. -chrp-boot-part Mark the block range of the whole emerging ISO image as MBR partition of type 0x96. This is not compatible with any other feature that produces MBR partition entries. It makes GPT unrecognizable. CHRP is often used in conjunction with HFS. It is not yet tested whether HFS+ filesystems produced with option -hfsplus would boot on any CHRP capable machine which does not boot pure ISO 9660 as well. -chrp-boot Alias of -chrp-boot-part. -prep-boot-part disk_path Copy a file from disk into the emerging ISO image and mark it by a MBR partition entry of type 0x41. PReP boot firmware is supposed to read the content of the partition as single ELF executable file. This option is compatible with other MBR partitions and with GPT. -mips-boot iso_rr_path Declare a data file in the image to be a MIPS Big Endian boot file and cause production of a MIPS Big Endian Volume Header. This is mutually exclusive with production of other boot blocks like MBR. It will overwrite the first 512 bytes of any data provided by -G. Up to 15 boot files can be declared by multiple -mips-boot options. -mipsel-boot iso_rr_path Declare a data file in the image to be the MIPS Little Endian boot file. This is mutually exclusive with other boot blocks. It will overwrite the first 512 bytes of any data provided by -G. Only a single boot file can be declared by -mipsel-boot. -B disk_path[,disk_path ...] Cause one or more data files on disk to be written after the end of the ISO image. A SUN Disk Label will be written into the first 512 bytes of the ISO image which lists this image as partition 1 and the given disk_paths as partition 2 up to 8. The disk files should contain suitable boot images for SUN SPARC systems. The pseudo disk_path "..." causes that all empty partition entries become copies of the last non-empty entry. If no other disk_path is given before "..." then all partitions describe the ISO image. In this case, the boot loader code has to be imported by option -G. -sparc-boot disk_path[,disk_path ...] Alias of -B. -sparc-label text Set the ASCII label text of a SUN Disk Label. --grub2-sparc-core iso_rr_path Cause the content address and size of the given data file in the image to be written after the SUN Disk Label. Both numbers are counted in bytes. The address is written as 64 bit big-endian number to byte 0x228. The size is written as 32 bit big-endian number to byte 0x230. -hppa-cmdline text Set the PALO command line for HP-PA. Up to 1023 characters are permitted by default. With -hppa-hdrversion 4 the limit is 127. Note that the first five -hppa options are mandatory, if any of the -hppa options is given. Only option -hppa-hdrversion is allowed to be missing. -hppa-bootloader iso_rr_path Designate the given path as HP-PA bootloader file. -hppa-kernel-32 iso_rr_path Designate the given path as HP-PA 32 bit kernel file. -hppa-kernel-64 iso_rr_path Designate the given path as HP-PA 64 bit kernel file. -hppa-ramdisk iso_rr_path Designate the given path as HP-PA RAM disk file. -hppa-hdrversion number Choose between PALO header version 5 (default) and version 4. For the appropriate value see in PALO source code: PALOHDRVERSION. -alpha-boot iso_rr_path Declare a data file in the image to be the DEC Alpha SRM Secondary Bootstrap Loader and cause production of a boot sector which points to it. This is mutually exclusive with production of other boot blocks like MBR.  File: xorrisofs.info, Node: Charset, Next: Jigdo, Prev: SystemArea, Up: Options 5.10 Character sets =================== Character sets should not matter as long as only english alphanumeric characters are used for file names or as long as all writers and readers of the medium use the same character set. Outside these constraints it may be necessary to let xorriso convert byte codes. A conversion from input character set to the output character set is performed when an ISO image gets written. Vice versa there is a conversion from output character set to the input character set when an ISO image gets loaded. The sets can be defined by options -input-charset and -output-charset, if needed. -input-charset character_set_name Set the character set from which to convert disk file names when inserting them into the ISO image. -output-charset character_set_name Set the character set from which to convert names of loaded ISO images and to which to convert names when writing ISO images.  File: xorrisofs.info, Node: Jigdo, Next: Miscellaneous, Prev: Charset, Up: Options 5.11 Jigdo Template Extraction ============================== From man genisoimage: "Jigdo is a tool to help in the distribution of large files like CD and DVD images; see http://atterer.net/jigdo/ for more details. Debian CDs and DVD ISO images are published on the web in jigdo format to allow end users to download them more efficiently." If the use of libjte was enabled at compile time of xorriso, then 'xorrisofs' can produce a .jigdo and a .template file together with a single-session ISO image. If not, then Jigdo options will cause a FAILURE event, which normally leads to program abort. One may determine the ability for Jigdo by: $ xorrisofs -version 2>&1 | grep '^libjte' && echo YES The .jigdo file contains checksums and symbolic file addresses. The .template file contains the compressed ISO image with reference tags instead of the content bytes of the listed files. Input for this process are the normal arguments for a 'xorrisofs' session with no image loaded, and a checksum file which lists those data files which may be listed in the .jigdo file and externally referenced in the .template file. Each designated file is represented in the checksum file by a single text line: Checksum as hex digits, 2 blanks, size as 12 decimal digits or blanks, 2 blanks, symbolic file address The kind of checksum is chosen by -jigdo "checksum_algorithm" with values "md5" (32 hex digits) or "sha256" (64 hex digits). It will also be used for the file address lines in the .jigdo file. The default is "md5". The file address in a checksum file line has to bear the same basename as the disk_path of the file which it shall match. The directory path of the file address is decisive for To=From mapping, not for file recognition. After To=From mapping, the file address gets written into the .jigdo file. Jigdo restore tools will convert these addresses into really reachable data source addresses from which they can read. If the list of jigdo parameters is not empty, then padding will be counted as part of the ISO image. -jigdo-checksum-algorithm "md5"|"sha256" Set the checksum algorithm which shall be used for the data file entries in the .jigdo file and is expected in the checksum file. Default is "md5". -jigdo-jigdo disk_path Set the disk_path for the .jigdo file with the checksums and download addresses for filling the holes in .template. -jigdo-template disk_path Set the disk_path for the .template file with the holed and compressed ISO image copy. -jigdo-min-file-size size Set the minimum size for a data file to be listed in the .jigdo file and being a hole in the .template file. size may be a plain number counting bytes, or a number with appended letter "k", "m", "g" to count KiB (1024 bytes), MiB (1024 KiB), or GiB (1024 MiB). -jigdo-force-checksum disk_path_pattern adds a regular expression pattern which will get compared with the absolute disk_path of any data file that was not found in the checksum file. A match causes a MISHAP event, which normally does not abort the program run but finally causes a non-zero exit value of the program. -jigdo-force-md5 disk_path_pattern Outdated alias of -jigdo-force-checksum. -jigdo-exclude disk_path_pattern Add a regular expression pattern which will get compared with the absolute disk_path of any data file. A match causes the file to stay in .template in any case. -jigdo-map To=From Add a string pair of the form To=From to the parameter list. If a data file gets listed in the .jigdo file, then it is referred by the file address from its line in the checksum file. This file address gets checked whether it begins with the From string. If so, then this string will be replaced by the To string and a ':' character, before it goes into the .jigdo file. The From string should end by a '/' character. -checksum-list disk_path Set the disk_path where to find the checksum file file with symbolic file addresses and checksums according to -jigdo-checksum-algorithm. -md5-list disk_path Outdated alias of -checksum-list. -jigdo-template-compress "gzip"|"bzip2" Choose one of "bzip2" or "gzip" for the compression of the template file. The jigdo file is put out uncompressed. -checksum_algorithm_iso list_of_names Choose one or more of "md5", "sha1", "sha256", "sha512" for the auxiliary "# Image Hex" checksums in the .jigdo file. The list_of_names may e.g. look like "md5,sha1,sha512". Value "all" chooses all available algorithms. Note that MD5 stays always enabled. -checksum_algorithm_template list_of_names Choose the algorithms for the "# Template Hex" checksums in the .jigdo file. The rules for list_of_names are the same as with -checksum_algorithm_iso.  File: xorrisofs.info, Node: Miscellaneous, Next: ExSimple, Prev: Jigdo, Up: Options 5.12 Miscellaneous options ========================== -print-size Print to stdandard output the foreseeable number of 2048 byte blocks in the emerging ISO image. Do not produce this image. The result depends on several settings. If option -emul-toc is given, then padding (see -pad) is not counted as part of the image size. In this case either use -no-pad or add 150 (= 300 KiB) to the resulting number. If mkisofs emulation ends after option -print-size, then the properties of the most recently specified boot image file cannot be edited by subsequent xorriso commands. --no_rc Only if used as first argument this option prevents reading and interpretation of startup files. See section FILES below. -help List supported options to stderr. Original mkisofs options bear their original mkisofs description texts. -quiet Suppress most messages of the program run, except those which indicate problems or errors. -gui Increase the frequency of pacifier messages while writing an ISO image. -log-file disk_path Truncate file disk_path to 0 size and redirect to it all messages which would normally appear on stderr. -log-file with empty text as disk_path re-enables output to stderr. -v Enable the output of informational program messages. -verbose Alias of -v. -version Print to standard output a text that begins with "mkisofs 2.01-Emulation Copyright (C)" and to standard error the version information of xorriso.  File: xorrisofs.info, Node: Examples, Next: Files, Prev: Options, Up: Top 6 Examples ********** * Menu: * ExSimple:: A simple image production run * ExGraft:: Set ISO image paths by -graft-points * ExMkisofs:: Perform multi-session runs * ExGrowisofs:: Let xorriso work underneath growisofs * ExIncBackup:: Incremental backup of a few directory trees * ExIncBckAcc:: Incremental backup with accumulated trees * ExBootable:: Create bootable images for PC-BIOS and EFI  File: xorrisofs.info, Node: ExSimple, Next: ExGraft, Prev: Miscellaneous, Up: Examples 6.1 A simple image production run ================================= A prepared file tree in directory ./for_iso gets copied into the root directory of the ISO image. File permissions get set to read-only for everybody. Joliet attributes for Microsoft systems get added. The resulting image gets written as data file ./image.iso on disk. $ xorrisofs -r -J -o ./image.iso ./for_iso  File: xorrisofs.info, Node: ExGraft, Next: ExMkisofs, Prev: ExSimple, Up: Examples 6.2 Set ISO image paths by -graft-points ======================================== Without option -graft-points each given disk file is copied into the root directory of the ISO image, maintaining its name. If a directory is given, then its files and sub-directories are copied into the root directory, maintaining their names. $ xorrisofs ... /home/me/datafile /tmp/directory yields in the ISO image root directory: /datafile /file_1_from_directory ... /file_N_from_directory With option -graft-points it is possible to put files and directories to arbitrary paths in the ISO image. $ xorrisofs ... -graft-points /home/me/datafile /dir=/tmp/directory yields in the ISO image root directory: /datafile /dir Eventually needed parent directories in the image will be created automatically: /datafiles/file1=/home/me/datafile yields in the ISO image: /datafiles/file1 The attributes of directory /datafiles get copied from /home/me on disk. Normally one should avoid = and \ characters in the ISO part of a pathspec. But if it must be, one may escape them: /with_\=_and_\\/file=/tmp/directory/file yields in the ISO image: /with_=_and_\/file  File: xorrisofs.info, Node: ExMkisofs, Next: ExGrowisofs, Prev: ExGraft, Up: Examples 6.3 Perform multi-session runs ============================== This example works for multi-session media only: CD-R[W], DVD-R[W], DVD+R, BD-R. Add cdrskin option --grow_overwriteable_iso to all -as cdrecord runs in order to enable multi-session emulation on overwritable media. The first session is written like this: $ xorrisofs -graft-points \ /tree1=prepared_for_iso/tree1 \ | xorriso -as cdrecord -v dev=/dev/sr0 blank=fast -multi -eject - Follow-up sessions are written like this (the run of dd is only to give demons a chance to spoil it): $ m=$(xorriso -as cdrecord dev=/dev/sr0 -msinfo) $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 $ xorrisofs -M /dev/sr0 -C $m -graft-points \ /tree2=prepared_for_iso/tree2 \ | xorriso -as cdrecord -v dev=/dev/sr0 -waiti -multi -eject - Always eject the drive tray between sessions. The run of xorriso -as mkisofs will read old sessions via the CD-ROM driver of /dev/sr0. This driver might not be aware of the changed content as long as the medium is not loaded again. In this case the previous session would not be properly assessed by xorriso and the new session would contain only the newly added files. Some systems have not enough patience with automatic tray loading and some demons may interfere with a first CD-ROM driver read attempt from a freshly loaded medium. When loading the tray manually, wait 10 seconds after the drive has stopped blinking. A safe automatic way seems to be a separate run of xorriso for loading the tray with proper waiting, and a subsequent run of dd which shall offer itself to any problems caused by demons assessing the changed drive status. If this does not help, insert a run of "sleep 10" between xorriso and dd.  File: xorrisofs.info, Node: ExGrowisofs, Next: ExIncBackup, Prev: ExMkisofs, Up: Examples 6.4 Let xorriso work underneath growisofs ========================================= growisofs expects an ISO formatter program which understands options -C and -M. A variable is defined to override the hardcoded default name. $ export MKISOFS="xorrisofs" $ growisofs -Z /dev/dvd /some/files $ growisofs -M /dev/dvd /more/files If no "xorrisofs" is available on your system, then you will have to create a link pointing to the xorriso binary and tell growisofs to use it. E.g. by: $ ln -s $(which xorriso) "$HOME/xorrisofs" $ export MKISOFS="$HOME/xorrisofs" One may quit mkisofs emulation by argument "--" and make use of all xorriso commands. growisofs dislikes options which start with "-o" but -outdev must be set to "-". So use "outdev" instead: $ growisofs -Z /dev/dvd --for_backup -- \ outdev - -update_r /my/files /files $ growisofs -M /dev/dvd --for_backup -- \ outdev - -update_r /my/files /files Note that --for_backup is given in the mkisofs emulation. To preserve the recorded extra data it must already be in effect, when the emulation loads the image.  File: xorrisofs.info, Node: ExIncBackup, Next: ExIncBckAcc, Prev: ExGrowisofs, Up: Examples 6.5 Incremental backup of a few directory trees =============================================== This changes the directory trees /open_source_project and /personal_mail in the ISO image so that they become exact copies of their disk counterparts. ISO file objects get created, deleted or get their attributes adjusted accordingly. ACL, xattr, hard links and MD5 checksums will be recorded. It is expected that inode numbers in the disk filesystem are persistent over cycles of mounting and booting. Files with names matching *.o or *.swp get excluded explicitly. To be used several times on the same medium, whenever an update of the two disk trees to the medium is desired. Begin with a blank medium and update it until he run fails gracefully due to lack of remaining space on the old one. Always eject the drive tray between sessions. A run of dd shall give demons a chance to spoil the first read on freshly loaded media. $ msinfo=$(xorriso -as cdrecord dev=/dev/sr0 -msinfo) $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 $ load_opts= $ test -n "$msinfo" && load_opts="-M /dev/sr0 -C $msinfo" $ xorrisofs $load_opts -o - --for_backup -m '*.o' -m '*.swp' \ -V PROJ_MAIL_"$(date '+%Y_%m_%d_%H%M%S')" -graft-points \ -old-root / \ /projects=/home/thomas/projects \ /personal_mail=/home/thomas/personal_mail \ | xorriso -as cdrecord dev=/dev/sr0 -v -multi -waiti -eject - This makes sense if the full backup leaves substantial remaining capacity on media and if the expected changes are much smaller than the full backup. *Better do not use your youngest backup for -old-root*. Have at least two media which you use alternatingly. So only older backups get endangered by the new write operation, while the newest backup is stored safely on a different medium. Always have a blank medium ready to perform a full backup in case the update attempt fails due to insufficient remaining capacity. This failure will not spoil the old medium, of course. If inode numbers on disk are not persistent, then use option --old-root-no-ino . In this case an update run will compare recorded MD5 sums against the current file content on hard disk. With *mount* option *-o "sbsector="* on GNU/Linux or *-s* on FreeBSD or NetBSD it is possible to access the session trees which represent the older backup versions. With CD media, GNU/Linux mount accepts session numbers directly by its option "session=". Multi-session media and most overwritable media written by xorriso can tell the sbsectors of their sessions by xorriso option -toc: $ xorriso -dev /dev/sr0 -toc xorriso can print the matching mount command for a session number: $ xorriso -mount_cmd /dev/sr0 session 12 /mnt or for a volume id that matches a search expression: $ xorriso -mount_cmd /dev/sr0 volid '*2008_12_05*' /mnt Both yield on standard output something like: mount -t iso9660 -o nodev,noexec,nosuid,ro,sbsector=1460256 '/dev/sr0' '/mnt' The superuser may let xorriso execute the mount command directly: # osirrox -mount /dev/sr0 "volid" '*2008_12_05*' /mnt  File: xorrisofs.info, Node: ExIncBckAcc, Next: ExBootable, Prev: ExIncBackup, Up: Examples 6.6 Incremental backup with accumulated trees ============================================= Solaris does not offer the option to mount older sessions. In order to keep them accessible, one may map all files to a file tree under a session directory and accumulate those directories from session to session. The -root tree is cloned from the -old-root tree before it gets compared with the appropriate trees on disk. This demands to know the previously used session directory name. With the first session: $ xorrisofs -root /session1 \ -o - --for_backup -m '*.o' -m '*.swp' \ -V PROJ_MAIL_"$(date '+%Y_%m_%d_%H%M%S')" -graft-points \ /projects=/home/thomas/projects \ /personal_mail=/home/thomas/personal_mail \ | xorriso -as cdrecord dev=/dev/sr0 -v blank=as_needed \ -multi -waiti -eject - With the second session, option -old-root refers to /session1 and the new -root is /session2. Always eject the drive tray between sessions. A run of dd shall give demons a chance to spoil the first read on freshly loaded media. $ msinfo=$(xorriso -as cdrecord dev=/dev/sr0 -msinfo) $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 $ load_opts= $ test -n "$msinfo" && load_opts="-M /dev/sr0 -C $msinfo" $ xorrisofs $load_opts -root /session2 -old-root /session1 \ -o - --for_backup -m '*.o' -m '*.swp' \ -V PROJ_MAIL_"$(date '+%Y_%m_%d_%H%M%S')" -graft-points \ /projects=/home/thomas/projects \ /personal_mail=/home/thomas/personal_mail \ | xorriso -as cdrecord dev=/dev/sr0 -v -multi -waiti -eject - With the third session, option -old-root refers to /session2. The new -root is /session3. And so on.  File: xorrisofs.info, Node: ExBootable, Prev: ExIncBckAcc, Up: Examples 6.7 Create bootable images for PC-BIOS and EFI ============================================== The SYSLINUX/ISOLINUX boot loader suite is popular for booting PC-BIOS. The ISOLINUX wiki prescribes to create on disk a directory ./CD_root and to copy all desired files underneath that directory. Especially file isolinux.bin shall be copied to ./CD_root/isolinux/isolinux.bin . This is the boot image file. The prescribed mkisofs options can be used unchanged with 'xorrisofs': $ xorrisofs -o output.iso \ -b isolinux/isolinux.bin -c isolinux/boot.cat \ -no-emul-boot -boot-load-size 4 -boot-info-table \ ./CD_root Put it on CD by a burn program. E.g.: $ xorriso -as cdrecord -v dev=/dev/sr0 blank=as_needed output.iso The image from above example will boot from CD, DVD or BD, but not from USB stick or other hard-disk-like devices. This can be done by help of an isohybrid MBR. Syslinux provides matching template files as isohdp[fp]x*.bin . E.g. /usr/lib/syslinux/isohdpfx.bin . If a few hundred KB of size do not matter, then option -partition_offset can be used to create a partition table where partition 1 starts not at block 0. This facilitates later manipulations of the USB stick by tools for partitioning and formatting. The image from the following example will be prepared for booting via MBR and its first partition will start at hard disk block 64. It will also boot from optical media. $ xorrisofs -o output.iso \ -b isolinux/isolinux.bin -c isolinux/boot.cat \ -no-emul-boot -boot-load-size 4 -boot-info-table \ -isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \ -partition_offset 16 \ ./CD_root Become superuser and copy the image to the unpartitioned base device file of the USB stick. On GNU/Linux this is e.g. /dev/sdb, not /dev/sdb1. CAUTION: This will overwrite any partitioning on the USB stick and make remaining data unaccessible. So first make sure you got the correct address of the intended device. E.g. by reading 100 MiB data from it and watching it blinking: # dd bs=2K if=/dev/sdb count=50K >/dev/null Now copy the image onto it # dd bs=2K if=output.iso of=/dev/sdb Now for EFI: The boot image file has to be the image of an EFI System Partition, i.e. a FAT filesystem with directory /EFI/BOOT and boot files with EFI prescribed names: BOOTIA32.EFI for 32 bit x86, BOOTx64.EFI for 64 bit AMD/x86 (in UEFI-2.4 there is indeed a lower case "x"), BOOTAA64.EFI for 64 bit ARM. The software in the FAT filesystem should be able to find and inspect the ISO filesystem for boot loader configuration and start of operating system. GRUB2 program grub-mkimage can produce such a FAT filesystem with suitable content, which then uses further GRUB2 software from the ISO filesystem. EFI boot equipment may be combined with above ISOLINUX isohybrid for PC-BIOS in a not really UEFI-2.4 compliant way, which obviously works well. It yields MBR and GPT partition tables, both with nested partitions. Assumed the EFI System Partition image is ready as ./CD_root/boot/grub/efi.img, add the following options before the directory address ./CD_root: -eltorito-alt-boot -e 'boot/grub/efi.img' -no-emul-boot \ -isohybrid-gpt-basdat \ More compliant with UEFI-2.4 is to decide for either MBR or GPT and to append a copy of the EFI System Partition in order to avoid overlap of ISO partition and EFI partition. Here for MBR: -eltorito-alt-boot -e 'boot/grub/efi.img' -no-emul-boot \ -append_partition 2 0xef ./CD_root/boot/grub/efi.img \ The resulting ISOs are supposed to boot from optical media and USB stick. One may omit option -eltorito-alt-boot if no option -b is used to make the ISO bootable via PC-BIOS. For ISOs with pure GRUB2 boot equipment consider to use GRUB2 tool grub-mkrescue as frontend to xorrisofs. If you have a bootable ISO filesystem and want to know its equipment plus a proposal how to reproduce it, try: $ xorriso -hfsplus on -indev IMAGE.iso \ -report_el_torito plain -report_system_area plain \ -print "" -print "======= Proposal for xorrisofs options:" \ -report_el_torito as_mkisofs  File: xorrisofs.info, Node: Files, Next: Environ, Prev: Examples, Up: Top 7 Files ******* 7.1 Startup Files ================= If not -no_rc is given as the first argument then 'xorrisofs' attempts on startup to read and execute lines from the following files: /etc/default/xorriso /etc/opt/xorriso/rc /etc/xorriso/xorriso.conf $HOME/.xorrisorc The files are read in the sequence given here, but none of them is required to exist. The lines are not interpreted as 'xorrisofs' options but as generic xorriso commands. See man xorriso. After the xorriso startup files, the program tries one by one to open for reading: ./.mkisofsrc $MKISOFSRC $HOME/.mkisofsrc $(dirname $0)/.mkisofsrc On success it interprets the file content and does not try further files. The last address is used only if start argument 0 has a non-trivial dirname. The reader currently interprets the following NAME=VALUE pairs: APPI default for -A PUBL default for -publisher SYSI default for -sysid VOLI default for -V VOLS default for -volset Any other lines will be silently ignored.  File: xorrisofs.info, Node: Environ, Next: Seealso, Prev: Files, Up: Top 8 Environ ********* The following environment variables influence the program behavior: HOME is used to find xorriso and mkisofs startup files. MKISOFSRC may be used to point the program to a mkisofs startup file. SOURCE_DATE_EPOCH belongs to the specs of reproducible-builds.org. It is supposed to be either undefined or to contain a decimal number which tells the seconds since january 1st 1970. If it contains a number, then it is used as time value to set the default of --modification-date=. --gpt_disk_guid defaults to "modification-date". The default of --set_all_file_dates is then "set_to_mtime". Further the "now" time for ISO nodes without disk source is then set to the SOURCE_DATE_EPOCH value. Startup files and program options can override the effect of SOURCE_DATE_EPOCH.  File: xorrisofs.info, Node: Seealso, Next: Bugreport, Prev: Environ, Up: Top 9 See also ********** For generic 'xorriso' command mode xorriso(1) For the cdrecord emulation of 'xorriso' xorrecord(1) For mounting xorriso generated ISO 9660 images (-t iso9660) mount(8) Other programs which produce ISO 9660 images mkisofs(8), genisoimage(1) Programs which burn sessions to optical media growisofs(1), cdrecord(1), wodim(1), cdrskin(1), xorriso(1) ACL and xattr getfacl(1), setfacl(1), getfattr(1), setfattr(1) MD5 checksums md5sum(1) On FreeBSD some commands differ: getextattr(8), setextattr(8), md5(1)  File: xorrisofs.info, Node: Bugreport, Next: Legal, Prev: Seealso, Up: Top 10 Reporting bugs ***************** To report bugs, request help, or suggest enhancements for 'xorriso', please send electronic mail to the public list . If more privacy is desired, mail to . Please describe what you expect 'xorriso' to do, the program arguments or dialog commands by which you tried to achieve it, the messages of 'xorriso', and the undesirable outcome of your program run. Expect to get asked more questions before solutions can be proposed.  File: xorrisofs.info, Node: Legal, Next: CommandIdx, Prev: Bugreport, Up: Top 11 Author, Copyright, Credits ***************************** 11.1 Author =========== Thomas Schmitt for libburnia-project.org 11.2 Copyright ============== Copyright (c) 2011 - 2021 Thomas Schmitt Permission is granted to distribute this text freely. It shall only be modified in sync with the technical properties of xorriso. If you make use of the license to derive modified versions of xorriso then you are entitled to modify this text under that same license. 11.3 Credits ============ 'xorrisofs' is in part based on work by Vreixo Formoso who provides libisofs together with Mario Danic who also leads the libburnia team. Vladimir Serbinenko contributed the HFS+ filesystem code and related knowledge. Compliments towards Joerg Schilling whose cdrtools served me for ten years.  File: xorrisofs.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top 12 Alphabetic Command List ************************** [index] * Menu: * --acl Recording of ACLs: SetExtras. (line 103) * --application_use set Application Use field: ImageId. (line 79) * --boot-catalog-hide Hide El Torito boot catalog: Bootable. (line 121) * --efi-boot El Torito EFI boot image: Bootable. (line 59) * --embedded-boot Fill System Area e.g. by MBR: SystemArea. (line 79) * --emul-toc enable table-of-content emulation: SetProduct. (line 33) * --for_backup Enable backup fidelity: SetExtras. (line 92) * --gpt_disk_guid GPT GUID: SystemArea. (line 250) * --grub2-boot-info Patch El Torito boot image: Bootable. (line 109) * --grub2-mbr Install modern GRUB2 MBR: SystemArea. (line 81) * --grub2-sparc-core SUN SPARC core file: SystemArea. (line 305) * --hardlinks Recording of hardlink relations: SetExtras. (line 130) * --mbr-force-bootable Enforce MBR bootable/active flag: SystemArea. (line 148) * --md5 Recording of MD5 checksums: SetExtras. (line 122) * --modification-date set ISO image timestamps: ImageId. (line 70) * --no-emul-toc no table-of-content emulation: SetProduct. (line 41) * --norock disable Rock Ridge production: SetExtras. (line 28) * --no_rc do not execute startup files: Miscellaneous. (line 18) * --old-empty old block addresses for empty files: SetProduct. (line 105) * --old-root-devno enable disk idevno with -old-root: SetInsert. (line 104) * --old-root-no-ino disable disk ino with -old-root: SetInsert. (line 93) * --old-root-no-md5 disable MD5 with -old-root: SetInsert. (line 111) * --protective-msdos-label Patch System Area partition table: SystemArea. (line 143) * --quoted_path_list read pathspecs from disk file: SetInsert. (line 12) * --scdbackup_tag Recording of MD5 checksum: SetExtras. (line 138) * --set_all_file_dates set all file timestamps: SetExtras. (line 35) * --sort-weight set block address sorting weight: SetProduct. (line 45) * --sort-weight-list set block address sorting weight: SetProduct. (line 56) * --sort-weight-patterns set block address sorting weight: SetProduct. (line 76) * --stdio_sync control forced output to disk files: SetProduct. (line 23) * --xattr Recording of any xattr: SetExtras. (line 116) * --xattr Recording of user xattr: SetExtras. (line 109) * --zisofs-version-2 enable recognition of zisofs2 files: SetInsert. (line 55) * --zisofs2-susp-z2 produce Z2 for version 2 instead of ZF: SetInsert. (line 66) * --zisofs2-susp-zf produce ZF for version 2 instead of Z2: SetInsert. (line 70) * -A set Application Id: ImageId. (line 34) * -abstract set Abstract File path: ImageId. (line 57) * -allow-lowercase lowercase in ISO file names: SetCompl. (line 42) * -alpha-boot DEC Alpha SRM bootloader: SystemArea. (line 328) * -appended_part_as_apm Appended partitions in APM: SystemArea. (line 234) * -appended_part_as_gpt Appended partitions in GPT: SystemArea. (line 228) * -append_partition Append MBR or GPT partition after image: SystemArea. (line 198) * -appid set Application Id: ImageId. (line 41) * -b El Torito PC-BIOS boot image: Bootable. (line 38) * -B SUN SPARC boot images: SystemArea. (line 290) * -biblio set Biblio File path: ImageId. (line 62) * -boot-info-table Patch El Torito boot image: Bootable. (line 104) * -boot-load-size El Torito boot image load size: Bootable. (line 72) * -c El Torito boot catalog name: Bootable. (line 114) * -C set load address and write address offset: Loading. (line 25) * -cdrecord-params set load address and write address offset: Loading. (line 41) * -checksum-list set path of input checksum file: Jigdo. (line 77) * -checksum_algorithm_iso choose .jigdo checksums: Jigdo. (line 86) * -checksum_algorithm_template choose .template checksums: Jigdo. (line 92) * -chrp-boot CHRP partition: SystemArea. (line 272) * -chrp-boot-part CHRP partition: SystemArea. (line 263) * -copyright set Copyright File path: ImageId. (line 66) * -D allow deep directory hierarchies: SetExtras. (line 60) * -d omit trailing dot in ISO file names: SetCompl. (line 50) * -dev set path for loading existing ISO image: Loading. (line 23) * -dir-mode permissions for all directories: SetProduct. (line 87) * -disable-deep-relocation allow deep directory hierarchies: SetExtras. (line 72) * -disallow_dir_id_ext enforce ISO level 1 directory names: SetCompl. (line 23) * -e El Torito EFI boot image: Bootable. (line 53) * -efi-boot-part EFI boot partition: SystemArea. (line 240) * -eltorito-alt-boot begin next boot catalog entry: Bootable. (line 47) * -eltorito-boot El Torito PC-BIOS boot image: Bootable. (line 45) * -eltorito-catalog El Torito boot catalog name: Bootable. (line 119) * -eltorito-id El Torito boot section id string: Bootable. (line 93) * -eltorito-platform El Torito Platform Id: Bootable. (line 63) * -eltorito-selcrit El Torito boot selection criteria: Bootable. (line 100) * -exclude exclude disk files from inserting: SetInsert. (line 37) * -exclude-list exclude disk files from inserting: SetInsert. (line 44) * -f follow symbolic links on disk: SetInsert. (line 22) * -file-mode permissions for all data files: SetProduct. (line 92) * -file_name_limit curbs length of file names: SetExtras. (line 49) * -follow-links follow symbolic links on disk: SetInsert. (line 26) * -full-iso9660-filenames allow 31 characters in ISO file names: SetCompl. (line 59) * -G Fill System Area e.g. by MBR: SystemArea. (line 68) * -generic-boot Fill System Area e.g. by MBR: SystemArea. (line 77) * -gid group assignment for all files: SetProduct. (line 83) * -graft-points enable target=source pathspecs: SetInsert. (line 28) * -gui increase frequency of pacifier messages: Miscellaneous. (line 29) * -hard-disk-boot El Torito boot image emulation: Bootable. (line 83) * -help list supported options: Miscellaneous. (line 21) * -hfs-bless HFS+ blessing ppc_bootdir: SetExtras. (line 221) * -hfs-bless-by HFS+ blessing: SetExtras. (line 211) * -hfsplus enable production of HFS+ partition: SetExtras. (line 164) * -hfsplus-block-size set APM block size: SetExtras. (line 201) * -hfsplus-block-size set HFS+ allocation block size: SetExtras. (line 197) * -hfsplus-file-creator-type HFS+ creator-type attribute: SetExtras. (line 208) * -hfsplus-serial-no set HFS+ serial number: SetExtras. (line 193) * -hide keep matching files invisible in ISO tree: SetHide. (line 8) * -hide-hfsplus keep matching files invisible in HFS+ tree: SetHide. (line 25) * -hide-hfsplus-list keep matching files invisible in HFS+ tree: SetHide. (line 28) * -hide-joliet keep matching files invisible in Joliet tree: SetHide. (line 18) * -hide-joliet-list keep matching files invisible in Joliet tree: SetHide. (line 22) * -hide-list keep matching files invisible in ISO tree: SetHide. (line 15) * -hide-rr-moved set deep directory relocation target: SetExtras. (line 90) * -hppa-bootloader HP-PA bootloader file: SystemArea. (line 317) * -hppa-cmdline HP-PA PALO command line: SystemArea. (line 311) * -hppa-hdrversion HP-PA PALO header version: SystemArea. (line 325) * -hppa-kernel_32 HP-PA kernel_32 file: SystemArea. (line 319) * -hppa-kernel_64 HP-PA kernel_64 file: SystemArea. (line 321) * -hppa-ramdisk HP-PA ramdisk file: SystemArea. (line 323) * -input-charset set character set of disk file names: Charset. (line 17) * -iso-level define ISO 9660 limitations: SetCompl. (line 7) * -iso-level define ISO 9660 limitations <1>: SetCompl. (line 8) * -isohybrid-apm-hfsplus Mark boot image in APM: SystemArea. (line 114) * -isohybrid-gpt-basdat Mark boot image in GPT: SystemArea. (line 98) * -isohybrid-gpt-hfsplus Mark boot image in GPT: SystemArea. (line 110) * -isohybrid-mbr Install ISOLINUX isohybrid MBR: SystemArea. (line 87) * -iso_mbr_part_type Set type of ISO MBR partition: SystemArea. (line 129) * -J enable production of Joliet directory tree: SetExtras. (line 147) * -jigdo-checksum-algorithm set data file checksum algorithm: Jigdo. (line 42) * -jigdo-exclude add exclusion pattern for checksum file: Jigdo. (line 65) * -jigdo-force-checksum add check pattern for checksum file: Jigdo. (line 57) * -jigdo-force-md5 add check pattern for checksum file: Jigdo. (line 63) * -jigdo-jigdo set name of .jigdo file: Jigdo. (line 46) * -jigdo-map add address translation for .jigdo: Jigdo. (line 69) * -jigdo-min-file-size set minimum extract size: Jigdo. (line 52) * -jigdo-template set name of .template file: Jigdo. (line 49) * -jigdo-template-compress choose compression algorithm: Jigdo. (line 83) * -joliet enable production of Joliet directory tree: SetExtras. (line 151) * -joliet-long allow longer Joliet names: SetExtras. (line 153) * -joliet-utf16 use UTF-16 with Joliet names: SetExtras. (line 159) * -l allow 31 characters in ISO file names: SetCompl. (line 56) * -log-file redirect stderr messages: Miscellaneous. (line 33) * -m exclude disk files from inserting: SetInsert. (line 31) * -M set path for loading existing ISO image: Loading. (line 11) * -max-iso9660-filenames allow 37 characters in ISO file names: SetCompl. (line 61) * -md5-list set path of input checksum file: Jigdo. (line 81) * -mips-boot MIPS Big Endian boot image: SystemArea. (line 279) * -mipsel-boot MIPS Little Endian boot image: SystemArea. (line 285) * -N omit version number in ISO file names: SetCompl. (line 64) * -no-emul-boot El Torito boot image emulation: Bootable. (line 86) * -no-pad do not add zeros to ISO tree: SetProduct. (line 101) * -o set output file address: SetProduct. (line 8) * -old-exclude exclude disk files from inserting: SetInsert. (line 42) * -old-root enable incremental insertion: SetInsert. (line 80) * -omit-period omit trailing dot in ISO file names: SetCompl. (line 54) * -omit-version-number omit version number in ISO file names: SetCompl. (line 69) * -output set output file address: SetProduct. (line 21) * -output-charset set character set of ISO file names: Charset. (line 21) * -p set Preparer Id: ImageId. (line 47) * -P set Publisher Id: ImageId. (line 28) * -pad add 300 KiB of zeros to ISO tree: SetProduct. (line 94) * -partition_cyl_align Image size alignment: SystemArea. (line 187) * -partition_hd_cyl MBR heads per cylinder: SystemArea. (line 170) * -partition_offset Make mountable by partition 1: SystemArea. (line 159) * -partition_sec_hd MBR sectors per head: SystemArea. (line 173) * -part_like_isohybrid Mark partitions like with isohybrid: SystemArea. (line 122) * -path-list read pathspecs from disk file: SetInsert. (line 8) * -prep-boot-part PReP partition: SystemArea. (line 274) * -preparer set Preparer Id: ImageId. (line 55) * -prev-session set path for loading existing ISO image: Loading. (line 21) * -print-size predict ISO image size: Miscellaneous. (line 8) * -publisher set Publisher Id: ImageId. (line 32) * -quiet suppress most messages: Miscellaneous. (line 25) * -R Rock Ridge (is enabled by default): SetExtras. (line 8) * -r Rock Ridge with altered owner and permission: SetExtras. (line 16) * -rational-rock Rock Ridge with altered owner and permission: SetExtras. (line 26) * -relaxed-filenames 7-bit special characters in ISO file names: SetCompl. (line 45) * -rock Rock Ridge (is enabled by default): SetExtras. (line 13) * -root redirect ISO root directory: SetInsert. (line 75) * -rr_reloc_dir set deep directory relocation target: SetExtras. (line 74) * -sparc-boot SUN SPARC boot images: SystemArea. (line 301) * -sparc-label SUN Disk Label text: SystemArea. (line 303) * -sysid set System Id: ImageId. (line 43) * -transparent-compression enable recognition of zisofs files: SetInsert. (line 53) * -U very relaxed filename rules: SetCompl. (line 27) * -uid ownership for all files: SetProduct. (line 79) * -untranslated-filenames very relaxed filename rules: SetCompl. (line 34) * -untranslated_name_len untranslated file names: SetCompl. (line 36) * -v enable verbose messages: Miscellaneous. (line 38) * -V set Volume Id: ImageId. (line 13) * -verbose enable verbose messages: Miscellaneous. (line 41) * -version report program version: Miscellaneous. (line 43) * -volid set Volume Id: ImageId. (line 23) * -volset set Volume Set Id: ImageId. (line 25) * -x exclude disk files from inserting: SetInsert. (line 39) * -z enable recognition of zisofs files: SetInsert. (line 47)  File: xorrisofs.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top 13 Alphabetic List of Concepts and Objects ****************************************** [index] * Menu: * Abstract File, set path, -abstract: ImageId. (line 57) * ACL, record and load, --acl: SetExtras. (line 103) * APM, mark appended partitions, -appended_part_as_apm: SystemArea. (line 234) * APM, _definition: SystemArea. (line 16) * Application Id, set, -A, -appid: ImageId. (line 34) * Backup, enable fidelity, --for_backup: SetExtras. (line 92) * Biblio File, set path, -biblio: ImageId. (line 62) * Block address, set sorting weight, --sort-weight: SetProduct. (line 45) * Block address, set sorting weight, --sort-weight-list: SetProduct. (line 56) * Block address, set sorting weight, --sort-weight-patterns: SetProduct. (line 76) * Bootability, boot catalog hidden, --boot-catalog-hide: Bootable. (line 121) * Bootability, boot catalog name, -c, -eltorito-catalog: Bootable. (line 114) * Bootability, boot image emulation, -hard-disk-boot: Bootable. (line 83) * Bootability, boot image load size, -boot-load-size: Bootable. (line 72) * Bootability, boot image patching, --grub2-boot-info: Bootable. (line 109) * Bootability, boot image patching, -boot-info-table: Bootable. (line 104) * Bootability, bootable MBR partition, --mbr-force-bootable: SystemArea. (line 148) * Bootability, control, --grub2-sparc-core: SystemArea. (line 305) * Bootability, control, --efi-boot: Bootable. (line 59) * Bootability, control, -alpha-boot: SystemArea. (line 328) * Bootability, control, -b, -eltorito-boot: Bootable. (line 38) * Bootability, control, -B, -sparc-boot: SystemArea. (line 290) * Bootability, control, -e: Bootable. (line 53) * Bootability, control, -eltorito-platform: Bootable. (line 63) * Bootability, control, -hppa-bootloader: SystemArea. (line 317) * Bootability, control, -hppa-cmdline: SystemArea. (line 311) * Bootability, control, -hppa-hdrversion: SystemArea. (line 325) * Bootability, control, -hppa-kernel_32: SystemArea. (line 319) * Bootability, control, -hppa-kernel_64: SystemArea. (line 321) * Bootability, control, -hppa-ramdisk: SystemArea. (line 323) * Bootability, control, -mips-boot: SystemArea. (line 279) * Bootability, control, -mipsel-boot: SystemArea. (line 285) * Bootability, El Torito section id string, -eltorito-id: Bootable. (line 93) * Bootability, El Torito selection criteria, -eltorito-selcrit: Bootable. (line 100) * Bootability, fill System Area e.g. by MBR, -G, --embedded-boot, -generic-boot: SystemArea. (line 68) * Bootability, for CHRP, -chrp-boot-part: SystemArea. (line 263) * Bootability, for EFI, -efi-boot-part: SystemArea. (line 240) * Bootability, for PReP, -prep-boot-part: SystemArea. (line 274) * Bootability, install ISOLINUX isohybrid MBR, -isohybrid-mbr: SystemArea. (line 87) * Bootability, install modern GRUB2 MBR, --grub2-mbr: SystemArea. (line 81) * Bootability, mark boot image in APM, -isohybrid-apm-hfsplus: SystemArea. (line 114) * Bootability, mark boot image in GPT, -isohybrid-gpt-basdat: SystemArea. (line 98) * Bootability, mark boot image in GPT, -isohybrid-gpt-hfsplus: SystemArea. (line 110) * Bootability, next entry, -eltorito-alt-boot: Bootable. (line 47) * Bootability, no boot image emulation, -no-emul-boot: Bootable. (line 86) * Bootability, partitions like with isohybrid, -part_like_isohybrid: SystemArea. (line 122) * Bootability, patch System Area partition table, --protective-msdos-label: SystemArea. (line 143) * Bootability, SUN Disk Label text, -sparc-label: SystemArea. (line 303) * Bootability, type of ISO MBR partition, -iso_mbr_part_type: SystemArea. (line 129) * Bugs, reporting: Bugreport. (line 6) * Character Set, for disk file names, -input-charset: Charset. (line 17) * Character Set, for ISO file names, -output-charset: Charset. (line 21) * Character sets, _definition: Charset. (line 6) * Copyright File, set path, -copyright: ImageId. (line 66) * Deep directories, allow, -D, -disable-deep-relocation: SetExtras. (line 60) * Deep directories, relocation target, -hide-rr-moved: SetExtras. (line 90) * Deep directories, relocation target, -rr_reloc_dir: SetExtras. (line 74) * Disk files, exclude, -hide-list: SetInsert. (line 44) * Disk files, exclude, -m, -exclude, -x, -old-exclude: SetInsert. (line 31) * Disk GUID, for GPT, --gpt_disk_guid: SystemArea. (line 250) * disk_path, _definition: Insert. (line 7) * ECMA-119, _definition: Standards. (line 6) * El Torito, _definition: Bootable. (line 13) * Examples: Examples. (line 6) * File names, curb length, -file_name_limit: SetExtras. (line 49) * File timestamps, set all, --set_all_file_dates: SetExtras. (line 35) * Forced output, control, --stdio_sync: SetProduct. (line 23) * GPT, mark appended partitions, -appended_part_as_gpt: SystemArea. (line 228) * GPT, _definition: SystemArea. (line 13) * Group, for all files, -gid: SetProduct. (line 83) * HFS+, enables production: SetExtras. (line 164) * HFS+, issue blessing ppc_bootdir, -hfs-bless: SetExtras. (line 221) * HFS+, issue blessing, -hfs-bless-by: SetExtras. (line 211) * HFS+, set allocation block size: SetExtras. (line 197) * HFS+, set APM block size: SetExtras. (line 201) * HFS+, set creator and type of file, -hfsplus-file-creator-type: SetExtras. (line 208) * HFS+, set serial number: SetExtras. (line 193) * HFS+, _definition: Standards. (line 32) * Hiding, from HFS+, -hide-hfsplus: SetHide. (line 25) * Hiding, from HFS+, -hide-hfsplus-list: SetHide. (line 28) * Hiding, from ISO and Rock Ridge, -hide: SetHide. (line 8) * Hiding, from ISO and Rock Ridge, -hide-list: SetHide. (line 15) * Hiding, from Joliet, -hide-joliet: SetHide. (line 18) * Hiding, from Joliet, -hide-joliet-list: SetHide. (line 22) * Image size, alignment, -partition_cyl_align: SystemArea. (line 187) * Incremental insertion, disable disk ino, --old-root-no-ino: SetInsert. (line 93) * Incremental insertion, disable MD5, --old-root-no-md5: SetInsert. (line 111) * Incremental insertion, enable disk devno, --old-root-devno: SetInsert. (line 104) * Incremental insertion, enable, -old-root: SetInsert. (line 80) * Interval reader for system area and partitions: SystemArea. (line 24) * ISO 9660, _definition: Standards. (line 6) * ISO 9660:1999, _definition: Standards. (line 26) * ISO file names, 7-bit special characters, -relaxed-filenames: SetCompl. (line 45) * ISO file names, allow 31 characters, -l, -full-iso9660-filenames: SetCompl. (line 56) * ISO file names, allow 37 characters, -max-iso9660-filenames: SetCompl. (line 61) * ISO file names, allow lowercase, -allow-lowercase: SetCompl. (line 42) * ISO file names, omit trailing dot, -d, -omit-period: SetCompl. (line 50) * ISO file names, omit version number, -N, -omit-version-number: SetCompl. (line 64) * ISO file names, untranslated, -untranslated_name_len: SetCompl. (line 36) * ISO file names, very relaxed rules, -U, -untranslated-filenames: SetCompl. (line 27) * ISO image size, predict, -print-size: Miscellaneous. (line 8) * ISO image, set Application Use field, --application_use: ImageId. (line 79) * ISO image, set timestamps, --modification-date=: ImageId. (line 70) * ISO level 1, enforce directory names, -disallow_dir_id_ext: SetCompl. (line 23) * ISO level, specify, -iso-level: SetCompl. (line 7) * ISO level, specify, -iso-level <1>: SetCompl. (line 8) * ISO root directory, redirect, -root: SetInsert. (line 75) * iso_rr_path, _definition: Insert. (line 8) * Jigdo Template Extraction, -checksum-list: Jigdo. (line 77) * Jigdo Template Extraction, -checksum_algorithm_iso: Jigdo. (line 86) * Jigdo Template Extraction, -checksum_algorithm_template: Jigdo. (line 92) * Jigdo Template Extraction, -jigdo-checksum-algorithm: Jigdo. (line 42) * Jigdo Template Extraction, -jigdo-exclude: Jigdo. (line 65) * Jigdo Template Extraction, -jigdo-force-checksum: Jigdo. (line 57) * Jigdo Template Extraction, -jigdo-force-md5: Jigdo. (line 63) * Jigdo Template Extraction, -jigdo-jigdo: Jigdo. (line 46) * Jigdo Template Extraction, -jigdo-map: Jigdo. (line 69) * Jigdo Template Extraction, -jigdo-min-file-size: Jigdo. (line 52) * Jigdo Template Extraction, -jigdo-template: Jigdo. (line 49) * Jigdo Template Extraction, -jigdo-template-compress: Jigdo. (line 83) * Jigdo Template Extraction, -md5-list: Jigdo. (line 81) * Jigdo Template Extraction, _definition: Jigdo. (line 6) * Joliet, allows longer names, -joliet-long: SetExtras. (line 153) * Joliet, enable, -J, -joliet: SetExtras. (line 147) * Joliet, _definition: Standards. (line 21) * Links, follow on disk, -f, -follow-links: SetInsert. (line 22) * Links, record and load hard links, --hardlinks: SetExtras. (line 130) * MBR, GPT, append partition, -append_partition: SystemArea. (line 198) * MBR, sectors per head, -partition_sec_hd: SystemArea. (line 170) * MBR, sectors per head, -partition_sec_hd <1>: SystemArea. (line 173) * MBR, _definition: SystemArea. (line 9) * MD5, record and load, --md5: SetExtras. (line 122) * Message output, increase frequency, -gui: Miscellaneous. (line 29) * Message output, redirect stderr, -log-file: Miscellaneous. (line 33) * Message output, suppress, -quiet: Miscellaneous. (line 25) * Mountability, by non-trivial partition 1, -partition_offset: SystemArea. (line 159) * Options, list, -help: Miscellaneous. (line 21) * Output file, set address, -o, -output: SetProduct. (line 8) * Ownership, for all files, -uid: SetProduct. (line 79) * Padding, 300 KiB, -pad: SetProduct. (line 94) * Padding, disable, --old-empty: SetProduct. (line 105) * Padding, disable, -no-pad: SetProduct. (line 101) * pathspec, enable target=source, -graft-points: SetInsert. (line 28) * pathspec, read list of, --quoted_path_list: SetInsert. (line 12) * pathspec, read list of, -path-list: SetInsert. (line 8) * pathspec, _definition: Insert. (line 11) * Permissions, for all data files, -file-mode: SetProduct. (line 92) * Permissions, for all directories, -dir-mode: SetProduct. (line 87) * Preparer Id, set, -p: ImageId. (line 47) * Problems, reporting: Bugreport. (line 6) * Program version, report, -version: Miscellaneous. (line 43) * Publisher Id, set, -P, -publisher: ImageId. (line 28) * Rock Ridge, (enabled by default), -R, -rock: SetExtras. (line 8) * Rock Ridge, altered owner and permission, -r, -rational-rock: SetExtras. (line 16) * Rock Ridge, disable production, --norock: SetExtras. (line 28) * Rock Ridge, _definition: Standards. (line 14) * scdbackup, record checksum tag, --scdbackup_tag: SetExtras. (line 138) * Session, select path, -M, -prev-session, -dev: Loading. (line 11) * Session, set load and write address, -C, -cdrecord-params: Loading. (line 25) * Startup files, suppress, --no_rc: Miscellaneous. (line 18) * System Area, _definition: SystemArea. (line 6) * System Id, set, -sysid: ImageId. (line 43) * Table-of-content, emulation off, --no-emul-toc: SetProduct. (line 41) * Table-of-content, emulation, --emul-toc: SetProduct. (line 33) * UTF-16, for Joliet paths, -joliet-utf16: SetExtras. (line 159) * Verbosity, high, -v, -verbose: Miscellaneous. (line 38) * Volume Id, set, -V, -volid: ImageId. (line 13) * Volume Set Id, set, -volset: ImageId. (line 25) * xattr, record and load, --xattr: SetExtras. (line 109) * xattr, record and load, --xattr-any: SetExtras. (line 116) * xorriso, mkisofs emulation: Xorriso. (line 6) * xorriso, options: Options. (line 6) * Z2 instead of ZF for version 2, -zisofs2-susp-z2: SetInsert. (line 66) * ZF instead of Z2 for version 2, -zisofs2-susp-zf: SetInsert. (line 70) * zisofs file, enable recognition, -z, -transparent-compression: SetInsert. (line 47) * zisofs2 file, enable recognition, -zisofs-version-2: SetInsert. (line 55)  Tag Table: Node: Top391 Node: Overview1131 Node: Standards1573 Node: Insert3770 Node: Xorriso5616 Node: Options6762 Node: Loading7489 Node: SetInsert9530 Node: SetProduct14900 Node: SetCompl20471 Node: SetExtras23063 Node: SetHide34672 Node: ImageId35976 Node: Bootable40258 Node: SystemArea46544 Node: Charset65074 Node: Jigdo66099 Node: Miscellaneous71069 Node: Examples72714 Node: ExSimple73208 Node: ExGraft73691 Node: ExMkisofs74991 Node: ExGrowisofs76799 Node: ExIncBackup77989 Node: ExIncBckAcc81165 Node: ExBootable82870 Node: Files87052 Node: Environ88147 Node: Seealso89020 Node: Bugreport89671 Node: Legal90264 Node: CommandIdx91161 Node: ConceptIdx107943  End Tag Table libisoburn-1.5.4/xorriso/findjob.h0000644000175700017510000003274113701321754014125 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2016 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of classes FindjoB, ExprnodE, ExprtesT which perform tree searches in libisofs or in POSIX filesystem. */ #ifndef Xorriso_pvt_findjob_includeD #define Xorriso_pvt_findjob_includeD yes #define Xorriso_findjob_on_expR yes #ifdef Xorriso_findjob_on_expR /* A single Testnode. */ struct ExprtesT { struct FindjoB *boss; int invert; /* 0=normal 1=invert result */ /* 0= -false (with invert : -true) 1= -name char *arg1 (regex_t in *arg2) 2= -type char *arg1 3= -damaged 4= -lba_range int *arg1 int *arg2 5= -has_acl 6= -has_xattr 7= -has_aaip 8= -has_filter 9= -wanted_node IsoNode *arg1 (for internal use, arg1 not allocated) 10= -pending_data 11= -decision char *arg1 ("yes", "no") 12= -prune 13= -wholename char *arg1 (regex_t in *arg2) 14= -has_any_xattr 15= -has_md5 16= -disk_name char *arg1 (regex_t in *arg2) 17= -hidden int *arg1 (bit0=iso_rr, bit1=joliet) 18= -has_hfs_crtp char *creator char *type 19= -has_hfs_bless int bless_index 20= -disk_path char *arg1 21= -bad_outname int namespace 22= -use_pattern char *arg1 ("on" [or "ls"], "off") 23= -or_use_pattern char *arg1 ("on" [or "ls"], "off") 24= -name_limit_blocker int *arg1 25= -maxdepth int *arg1 26= -mindepth int *arg1 */ int test_type; void *arg1; void *arg2; }; /* A computational node. A tree of these nodes forms the expression. Sequences of AND/OR operations form branches, brackets spawn new branches, NOT inverts node's test resp. subtree result. */ struct ExprnodE { struct ExprnodE *up; char origin[8]; /* Operators */ int invert; /* 0=normal 1=invert own result (subtree or test, but not op) */ int assoc; /* 0= left : compute own value, combine with left value, compute right value, combine with current value 1= right: compute own value, compute right value, combine own and right, combine with left value */ int use_shortcuts; /* 0= evaluate all tests of -and and -or, 1= evaluate only until the combined result is known */ struct ExprnodE *left; int left_op; /* 0=OR , 1=AND */ struct ExprnodE *right; int right_op; /* see left_op */ /* Brackets : a pointer to the first node in a subchain */ struct ExprnodE *sub; int is_if_then_else; struct ExprnodE *true_branch; struct ExprnodE *false_branch; /* elementary test : if sub!=NULL , test is ignored */ struct ExprtesT *test; /* Result */ int own_value; int composed_value; }; struct FindjoB { char *start_path; struct ExprnodE *test_tree; struct ExprnodE *cursor; int invert; /* 0=normal 1=set invert-property for next new test node */ int use_shortcuts; /* 0= echo 1= rm (also rmdir) 2= rm_r >>> 3= mv target 4= chown user 5= chgrp group 6= chmod mode_and mode_or 7= alter_date type date 8= lsdl 9= chown_r user 10= chgrp_r group 11= chmod_r mode_and mode_or 12= alter_date_r type date 13= find 14= compare disk_equivalent_of_start_path 15= in_iso iso_rr_equivalent_of_start_path 16= not_in_iso iso_rr_equiv 17= update disk_equiv 18= add_missing iso_rr_equiv 19= empty_iso_dir iso_rr_equiv 20= is_full_in_iso iso_rr_equiv 21= report_damage 22= report_lba 23= internal: memorize path of last matching node in found_path 24= getfacl 25= setfacl access_acl default_acl 26= getfattr 27= setfattr 28= set_filter name 29= show_stream 30= internal: count by xorriso->node_counter 31= internal: register in xorriso->node_array 32= internal: widen_hardlinks disk_equiv: update nodes marked in di_do_widen 33= get_any_xattr 34= get_md5 35= check_md5 36= make_md5 37= mkisofs_r 38= sort_weight number 39= hide on|iso_rr|joliet|off 40= estimate_size 41= update_merge disk_equiv 42= rm_merge 43= clear_merge 44= list_extattr 45= set_hfs_crtp creator type 46= get_hfs_crtp 47= set_hfs_bless blessing 48= get_hfs_bless 49= internal: update creator, type, and blessings from persistent isofs.* 50= print_outname namespace 51= report_sections 52= show_stream_id 53= internal: show_hfs_cmd , controlled by xorriso->show_hfs_cmd* 54= internal: truncate_names 55= internal: unique_trunc_test length test for not uniquely truncatable names, result delivered in XorrisO.find_unique_trunc_result 56= like 54 but tolerating existing truncated names 57= like 55 but tolerating existing truncated names 58= internal: last_data_file_block 59= set_to_mtime */ int action; int prune; int use_pattern; /* action specific parameters */ char *target; char *text_2; uid_t user; gid_t group; mode_t mode_and, mode_or; int type; /* see Xorriso_set_time flag, also used as weight and truncate_length */ time_t date; char *found_path; off_t estim_upper_size; off_t estim_lower_size; struct FindjoB *subjob; uint32_t last_data_file_block; /* Errors */ char errmsg[4096]; int errn; /* >0 = UNIX errno -1 = close_bracket: no bracket open -2 = binary operator or closing bracket expected -3 = unexpected binary operator or closing bracket -4 = unsupported command -5 = -then -elseif -else -endif without -if or at wrong place */ /* Counts the test matches */ unsigned long match_count; /* Current depth of tree walking. Relative to start path. */ int depth; }; int Exprnode_destroy(struct ExprnodE **fnode, int flag); int Exprnode_tree_value(struct XorrisO *xorriso, struct ExprnodE *fnode, int left_value, void *node, char *name, char *path, struct stat *boss_stbuf, struct stat *stbuf, int flag); int Findjob_new(struct FindjoB **o, char *start_path, int flag); int Findjob_destroy(struct FindjoB **o, int flag); int Findjob_set_start_path(struct FindjoB *o, char *start_path, int flag); int Findjob_get_start_path(struct FindjoB *o, char **start_path, int flag); int Findjob_set_commit_filter_2(struct FindjoB *o, int flag); int Findjob_set_num_filter(struct FindjoB *o, int test_type, int num1, int num2, int flag); int Findjob_set_lba_range(struct FindjoB *o, int start_lba, int count, int flag); int Findjob_set_wanted_node(struct FindjoB *o, void *wanted_node, int flag); /* @param value -1= only undamaged files, 1= only damaged files */ int Findjob_set_damage_filter(struct FindjoB *o, int value, int flag); int Findjob_set_test_hidden(struct FindjoB *o, int mode, int flag); int Findjob_set_crtp_filter(struct FindjoB *o, char *creator, char *hfs_type, int flag); int Findjob_set_bless_filter(struct XorrisO *xorriso, struct FindjoB *o, char *blessing, int flag); int Findjob_set_arg1(struct FindjoB *o, int test_type, char *arg1, int flag); int Findjob_open_bracket(struct FindjoB *job, int flag); int Findjob_close_bracket(struct FindjoB *job, int flag); int Findjob_not(struct FindjoB *job, int flag); int Findjob_and(struct FindjoB *job, int flag); int Findjob_or(struct FindjoB *job, int flag); int Findjob_if(struct FindjoB *job, int flag); int Findjob_then(struct FindjoB *job, int flag); int Findjob_else(struct FindjoB *job, int flag); int Findjob_elseif(struct FindjoB *job, int flag); int Findjob_endif(struct FindjoB *job, int flag); int Findjob_test_2(struct XorrisO *xorriso, struct FindjoB *o, void *node, char *name, char *path, struct stat *boss_stbuf, struct stat *stbuf, int flag); int Findjob_set_action_found_path(struct FindjoB *o, int flag); /* @param flag bit0= recursive */ int Findjob_set_action_target(struct FindjoB *o, int action, char *target, int flag); /* @param flag bit0= recursive */ int Findjob_set_action_ad(struct FindjoB *o, int type, time_t date, int flag); /* @param flag bit0= recursive */ int Findjob_set_action_chgrp(struct FindjoB *o, gid_t group, int flag); /* @param flag bit0= recursive */ int Findjob_set_action_chmod(struct FindjoB *o, mode_t mode_and, mode_t mode_or, int flag); /* @param flag bit0= recursive */ int Findjob_set_action_chown(struct FindjoB *o, uid_t user,int flag); /* @param flag bit0= -wholename rather than -name */ int Findjob_set_name_expr(struct FindjoB *o, char *name_expr, int flag); int Findjob_set_file_type(struct FindjoB *o, char file_type, int flag); /* @param value -1= files without ACL, 1= only files with ACL */ int Findjob_set_acl_filter(struct FindjoB *o, int value, int flag); /* @param value -1= files without xattr, 1= only files with xattr @param flag bit0=-has_any_xattr rather than -has_xattr */ int Findjob_set_xattr_filter(struct FindjoB *o, int value, int flag); /* @param value -1= files without aaip, 1= only files with aaip */ int Findjob_set_aaip_filter(struct FindjoB *o, int value, int flag); /* @param value -1= files without filter, 1= files with filter */ int Findjob_set_filter_filter(struct FindjoB *o, int value, int flag); /* @param value -1= only without property, 1= only with property @param flag bit0= pseudo-test: if no operator is open, do nothing and return 2 */ int Findjob_set_prop_filter(struct FindjoB *o, int test_type, int value, int flag); /* @param value -1= true, 1= false @param flag bit0= pseudo-test: if no operator is open, do nothing and return 2 */ int Findjob_set_false(struct FindjoB *o, int value, int flag); int Findjob_set_prune(struct FindjoB *o, int flag); int Findjob_set_action_subjob(struct FindjoB *o, int action, struct FindjoB *subjob, int flag); int Findjob_set_action_text_2(struct FindjoB *o, int action, char *target, char* text_2, int flag); int Findjob_set_action_type(struct FindjoB *o, int action, int type, int flag); int Findjob_get_action(struct FindjoB *o, int flag); int Findjob_get_action_parms(struct FindjoB *o, char **target, char **text_2, uid_t *user, gid_t *group, mode_t *mode_and, mode_t *mode_or, int *type, time_t *date, struct FindjoB **subjob, int flag); int Findjob_set_found_path(struct FindjoB *o, char *path, int flag); int Findjob_get_found_path(struct FindjoB *o, char **path, int flag); int Findjob_get_last_data_file_block(struct FindjoB *o, uint32_t *lba, int flag); #else /* Xorriso_findjob_on_expR */ struct FindjoB; int Findjob_new(struct FindjoB **o, char *start_path, int flag); int Findjob_destroy(struct FindjoB **job, int flag); /* @return 0=no match , 1=match , <0 = error */ int Findjob_test(struct FindjoB *job, char *name, struct stat *boss_stbuf, struct stat *stbuf, int depth, int flag); /* @return <0 error, >=0 see xorriso.c struct FindjoB.action */ int Findjob_get_action(struct FindjoB *o, int flag); /* @return <0 error, >=0 see xorriso.c struct FindjoB.action */ int Findjob_get_action_parms(struct FindjoB *o, char **target, char **text_2, uid_t *user, gid_t *group, mode_t *mode_and, mode_t *mode_or, int *type, time_t *date, struct FindjoB **subjob, int flag); /* @param flag bit0= recursive */ int Findjob_set_action_target(struct FindjoB *o, int action, char *target, int flag); /* @param flag bit0= recursive */ int Findjob_set_action_chgrp(struct FindjoB *o, gid_t group, int flag); /* @param flag bit0= recursive */ int Findjob_set_action_chmod(struct FindjoB *o, mode_t mode_and, mode_t mode_or, int flag); /* @param flag bit0= recursive */ int Findjob_set_action_ad(struct FindjoB *o, int type, time_t date, int flag); int Findjob_set_start_path(struct FindjoB *o, char *start_path, int flag); int Findjob_set_action_found_path(struct FindjoB *o, int flag); int Findjob_get_start_path(struct FindjoB *o, char **start_path, int flag); int Findjob_set_lba_range(struct FindjoB *o, int start_lba, int count, int flag); int Findjob_get_lba_damage_filter(struct FindjoB *o, int *start_lba, int *end_lba, int *damage_filter, int flag); int Findjob_get_commit_filter(struct FindjoB *o, int *commit_filter, int flag); int Findjob_get_acl_filter(struct FindjoB *o, int *acl_filter, int flag); int Findjob_get_xattr_filter(struct FindjoB *o, int *xattr_filter, int flag); int Findjob_get_aaip_filter(struct FindjoB *o, int *aaip_filter, int flag); int Findjob_get_filter_filter(struct FindjoB *o, int *value, int flag); int Findjob_set_wanted_node(struct FindjoB *o, void *wanted_node, int flag); int Findjob_get_wanted_node(struct FindjoB *o, void **wanted_node, int flag); int Findjob_set_found_path(struct FindjoB *o, char *path, int flag); int Findjob_get_found_path(struct FindjoB *o, char **path, int flag); int Findjob_get_last_data_file_block(struct FindjoB *o, uint32_t *lba, int flag); #endif /* ! Xorriso_findjob_on_expR */ #endif /* ! Xorriso_pvt_findjob_includeD */ libisoburn-1.5.4/xorriso/match.h0000644000175700017510000000532213701321754013601 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2010 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the implementation of functions for pattern matching. */ #ifndef Xorriso_pvt_match_includeD #define Xorriso_pvt_match_includeD yes int Xorriso_prepare_regex(struct XorrisO *xorriso, char *adr, int flag); /* @return 0=match , else no match */ int Xorriso_regexec(struct XorrisO *xorriso, char *to_match, int *failed_at, int flag); int Xorriso_is_in_patternlist(struct XorrisO *xorriso, struct Xorriso_lsT *patternlist, char *path, int flag); char *Xorriso_get_pattern(struct XorrisO *xorriso, struct Xorriso_lsT *patternlist, int index, int flag); int Xorriso_prepare_expansion_pattern(struct XorrisO *xorriso, char *pattern, int flag); /* @param flag bit0= count results rather than storing them @return <=0 error , 1 is root (end processing) , 2 is not root (go on processing) */ int Xorriso_check_for_root_pattern(struct XorrisO *xorriso, int *filec, char **filev, int count_limit, off_t *mem, int flag); /* @param flag bit0= count result rather than storing it bit1= unexpected change of number is a FATAL event */ int Xorriso_register_matched_adr(struct XorrisO *xorriso, char *adr, int count_limit, int *filec, char **filev, off_t *mem, int flag); int Xorriso_eval_nonmatch(struct XorrisO *xorriso, char *pattern, int *nonconst_mismatches, off_t *mem, int flag); /* @param flag bit0= a match count !=1 is a SORRY event */ int Xorriso_check_matchcount(struct XorrisO *xorriso, int count, int nonconst_mismatches, int num_patterns, char **patterns, int flag); int Xorriso_no_pattern_memory(struct XorrisO *xorriso, off_t mem, int flag); int Xorriso_alloc_pattern_mem(struct XorrisO *xorriso, off_t mem, int count, char ***filev, int flag); /* @param flag bit0= command without pattern capability bit1= disk_pattern rather than iso_rr_pattern */ int Xorriso_warn_of_wildcards(struct XorrisO *xorriso, char *path, int flag); /* @param flag bit0= a match count !=1 is a FAILURE event bit1= with bit0 tolerate 0 matches if pattern is a constant */ int Xorriso_expand_disk_pattern(struct XorrisO *xorriso, int num_patterns, char **patterns, int extra_filec, int *filec, char ***filev, off_t *mem, int flag); #endif /* ! Xorriso_pvt_match_includeD */ libisoburn-1.5.4/xorriso/xorriso.h0000644000175700017510000026672614005265525014234 00000000000000 /* xorriso - libisoburn higher level API which creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2021 Thomas Schmitt, Provided under GPL version 2 or later. This file contains the public API of xorriso which covers all of its operations. An example of its usage is xorriso_main.c which checks version compatibility, creates a xorriso object, initializes the libraries, and runs the command interpreters of the API to constitute the command line oriented batch and dialog tool xorriso. Alternatively to command interpreters it is possible to run all options of xorriso directly via the calls of the "Command API". The "Problem Status and Message API" shall then be used to obtain the text output of the options. Mandatory calls are: Xorriso_new(), Xorriso_startup_libraries(), Xorriso_destroy() This architecture is fully public since version 0.5.8. From then on, new features get marked by @since major.minor.micro The option calls may have older "since" marks which then tell when the corresponding command was introduced in the command interpreter. Please note that struct XorrisO and its API calls are _not_ thread-safe in general. It is not permissible to run two API calls on the same XorrisO object concurrently. The only exception is Xorriso_fetch_outlists() in order to learn about the ongoing text output of other API calls. There is a lower level of API which consists of libisofs.h, libburn.h and libisoburn.h. One should not mix those calls with the ones of xorriso.h . */ /* Important: If you add a public API function then add its name to file libisoburn/libisoburn.ver */ #ifndef Xorriso_includeD #define Xorriso_includeD yes #ifdef __cplusplus extern "C" { #endif /** Opaque handle of the xorriso runtime context */ struct XorrisO; /* This may be changed to Xorriso_GNU_xorrisO in order to create GNU xorriso under GPLv3+ derived from above GPLv2+. */ #define Xorriso_libburnia_xorrisO yes /* --------------------- Fundamental Management ------------------- */ /** These three release version numbers tell the revision of this header file and of the API which it describes. They shall be memorized by applications at build time. @since 0.5.8 */ #define Xorriso_header_version_majoR 1 #define Xorriso_header_version_minoR 5 #define Xorriso_header_version_micrO 4 /** If needed: Something like ".pl01" to indicate a bug fix. Normally empty. @since 0.5.8 */ #define Xorriso_program_patch_leveL "" /** Obtain the three release version numbers of the library. These are the numbers encountered by the application when linking with libisoburn, i.e. possibly not before run time. Better do not base the fundamental compatibility decision of an application on these numbers. For a reliable check use Xorriso__is_compatible(). @since 0.5.8 @param major The maturity version (0 for now, as we are still learning) @param minor The development goal version. @param micro The development step version. This has an additional meaning: Pare numbers indicate a version with frozen API. I.e. you can rely on the same set of features to be present in all published releases with that major.minor.micro combination. Features of a pare release will stay available and ABI compatible as long as the SONAME of libisoburn stays "1". Currently there are no plans to ever change the SONAME. Odd numbers indicate that API upgrades are in progress. I.e. new features might be already present or they might be still missing. Newly introduced features may be changed incompatibly or even be revoked before release of a pare version. So micro revisions {1,3,5,7,9} should never be used for dynamic linking unless the proper library match can be guaranteed by external circumstances. @return 1 success, <=0 might in future become an error indication */ void Xorriso__version(int *major, int *minor, int *micro); /** Check whether all features of header file xorriso.h from the given major.minor.micro revision triple can be delivered by the library version which is performing this call. if (! Xorriso__is_compatible(Xorriso_header_version_majoR, Xorriso_header_version_minoR, Xorriso_header_version_micrO, 0)) ...refuse to start the program with this dynamic library version... @since 0.5.8 @param major obtained at build time @param minor obtained at build time @param micro obtained at build time @param flag Bitfield for control purposes. Unused yet. Submit 0. @return 1= library can work for caller 0= library is not usable in some aspects. Caller must restrict itself to an earlier API version or must not use this library at all. */ int Xorriso__is_compatible(int major, int minor, int micro, int flag); /* Get the patch level text (e.g. "" or ".pl01") of the program code. @param flag unused yet, submit 0 @return readonly character string */ char *Xorriso__get_patch_level_text(int flag); /* Choose how Xorriso_startup_libraries() and the XorrisO object shall prepare for eventual signals. @param behavior Default is behavior 1. 0= no own signal handling. The main application has to do that. Do not start burn runs without any handling ! 1= use libburn signal handler. Most time with action 0. During writing, formatting, blanking: 0x30. Only usable with a single xorriso object. 2= Enable system default reaction on all signals @since 1.0.9 3= Try to ignore nearly all signals @since 1.0.9 @param flag unused yet, submit 0 @return <= 0 is error, >0 is success */ int Xorriso__preset_signal_behavior(int behavior, int flag); /* Mandatory call: Create a new xorriso object and tell it the program name to be used with messages and for decision of special behavior. @param xorriso returns the newly created XorrisO object @param progname typically argv[0] of main(). Some leafnames of the progname path have special meaning and trigger special behavior: "osirrox" allows image-to-disk copying: -osirrox "on" "xorrisofs" activates -as "mkisofs" emulation from start "genisofs" alias of "xorrisofs" "mkisofs" alias of "xorrisofs" "genisoimage" alias of "xorrisofs" "xorrecord" activates -as "cdrecord" emulation from start "cdrecord" alias of "xorrecord" "wodim" alias of "xorrecord" "cdrskin" alias of "xorrecord" @param flag unused yet, submit 0 @return >0 success , <=0 failure, no object created */ int Xorriso_new(struct XorrisO ** xorriso, char *progname, int flag); /* Note: Between Xorriso_new() and the next call Xorriso_startup_libraries() there may be called the special command interpreter Xorriso_prescan_args(). The other command interpreters may be used only after Xorriso_startup_libraries(). The same restriction applies to the calls of the Command API further below. */ /* Mandatory call: It has to be made before calling any function listed below this point. Only exception is the special command interpreter Xorriso_prescan_args(). Make global library initializations. This must be done with the first xorriso object that gets created and with the first xorriso object that gets created after Xorriso_destroy(,1). @param xorriso The context object. @param flag unused yet, submit 0 @return <=0 error , >0 success */ int Xorriso_startup_libraries(struct XorrisO *xorriso, int flag); /* Note: After library startup, you may run Command Interpreters or call functions from the Command API. Wenn all desired activities are done, you may check whether there are uncommitted changes pending, compute an exit value, destroy the XorrisO object, and exit your program. */ /* Inquire whether option -commit would make sense. @param xorriso The context object to inquire. @param flag @since 0.6.6 bit0= do not return 1 if -as mkisofs -print-size was performed on the current image. @return 0= -commit would have nothing to do 1= a new image session would emerge at -commit */ int Xorriso_change_is_pending(struct XorrisO *xorriso, int flag); /* Compute the exit value from the recorded maximum event severity. @param xorriso The context object to inquire. @param flag unused yet, submit 0 @return The computed exit value */ int Xorriso_make_return_value(struct XorrisO *xorriso, int flag); /* Mandatory call: Destroy xorriso object when it is no longer needed. @param xorriso The context object to destroy. *xorriso will become NULL. @param flag bit0= Perform global library shutdown. Use only with last xorriso object to be destroyed. @return <=0 error, >0 success */ int Xorriso_destroy(struct XorrisO **xorriso, int flag); /* --------------------- Command Interpreters ------------------- */ /* This special interpreter may be called between Xorriso_new() and Xorriso_startup_libraries(). It interprets certain commands which shall get into effect before the libraries get initialized: -abort_on , -report_about , -return_with , -scsi_log , -signal_handling This is the only occasion where command -x has an effect: -x Some commands get executed only if they are the only command in argv: -prog_help , -help The following is recognized only if it is the first of all arguments: -no_rc Some get examined for the need to redirect stdout messages: -dev , -outdev , -indev , -as Commands -backslash_codes , -list_delimiter , -add_plainly get into effect during this call. But their setting at begin of the call gets restored before the call returns. @param xorriso The context object in which to perform the commands. @param argc Number of arguments. @param argv The arguments. argv[0] contains the program name. argv[1] to argv[argc-1] contain commands and parameters. @param idx Argument cursor. When this function is called, *idx must be at least 1, argv[*idx] must be a command. *idx will iterate over commands and parameters until this function aborts or until argc is reached. @param flag bit0= do not interpret argv[1] bit1= produce FAILURE events on unknown commands @since 1.1.0 @return <0 error 0 end program 1 ok, go on */ int Xorriso_prescan_args(struct XorrisO *xorriso, int argc, char **argv, int flag); /* Read and interpret commands from eventual startup files as listed in man xorriso. @param xorriso The context object in which to perform the commands. @param flag unused yet, submit 0 @return <=0 = error 1 = success 3 = end program run (e.g. because command -end was encountered) */ int Xorriso_read_rc(struct XorrisO *xorriso, int flag); /* Check whether program arguments shall be backslash decoded. If so, then replace *argv by a new argument vector. The old one will not be freed by this call. If it is dynamic memory then you need to keep a copy of the pointer and free it yourself after this call. @since 1.3.2: This call internally interprets the commands -backslash_codes and -list_delimiter if it encounters them among the arguments. The decoding of backslashes can thus be enabled and disabled by the arguments themselves. The state of the xorriso object in respect to these commands gets preserved at the start of the call and restored when the call ends. (*argv)[0] never gets decoded. The old *argv will always be replaced by a new one. @param xorriso The context object @param argc Number of arguments. @param argv The arguments. (*argv)[0] contains the program name. (*argv)[1] to (*argv)[argc-1] contain commands and parameters If argv after the call differs from argv before the call, then one should dispose it later by: Xorriso__dispose_words(argc, argv); @param flag unused yet, submit 0 @return <= 0 error , > 0 success */ int Xorriso_program_arg_bsl(struct XorrisO *xorriso, int argc, char ***argv, int flag); /* Interpret argv as xorriso command options and their parameters. (An alternative is to call functions of the options API directly and to perform own error status evaluation. See below: Command API.) After the first command and its parameters there may be more commands and parameters. All parameters must be given in the same call as their command. @since 1.2.2: Commands may get arranged in a sequence that is most likely to make sense. E.g. image loading settings before drive aquiration, then commands for adding files, then settings for writing, then writing. This feature may be enabled by command "-x" in Xorriso_prescan_args() or by parameter flag of this call. @param xorriso The context object in which to perform the commands. @param argc Number of arguments. @param argv The arguments. argv[0] contains the program name. argv[1] to argv[argc-1] contain commands and parameters. @param idx Argument cursor. When this function is called, *idx must be at least 1, argv[*idx] must be a command. *idx will iterate over commands and parameters until this function aborts, or until argc is reached, or only once if flag bit2 is set. @param flag bit0= reserved. Indicates recursion. Submit 0. bit1= Indicates that these are the main() program start arguments. This enables their use with emulations which where set with Xorriso_new(), or argument arranging. bit2= Only execute the one command argv[*idx] and advance *idx to the next command if successful. Then return. This prevents any argument arranging. @since 1.2.2 bit3= With bit1 and not bit2: Enable argument arranging as with Xorriso_prescan_args() and command "-x". @since 1.2.2 bit4= With bit1: Surely disable argument arranging. @since 1.2.2 @return <=0 = error 1 = success 2 = problem event ignored 3 = end program run (e.g. because command -end was encountered) */ int Xorriso_interpreter(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Parse a command line into words and use them as argv for a call of Xorriso_interpreter(). Put out some info lines about the outcome. @param xorriso The context object in which to perform the commands. @param line A text of one or more words according to man xorriso paragraph "Command processing" up to and including "Backslash Interpretation". @param flag bit0 to bit15 are forwarded to Xorriso_interpreter() bit16= no pageing of info lines bit17= print === bar even if xorriso->found<0 @return see return of Xorriso_interpreter() */ int Xorriso_execute_option(struct XorrisO *xorriso, char *line, int flag); /* Parse a text line into words. This parsing obeys the same rules as command line parsing but allows to skip a prefix, to use a user provided set of separator characters, and to restrict the number of parsed words. If parameter xorriso is NULL, then this call is safe for usage by a concurrent thread while a xorriso API call is being executed. @since 1.2.6 @param xorriso The context object which provides settings for parsing and output channels for error messages. May be NULL in order to allow concurrent execution e.g. by a callback function of Xorriso_start_msg_watcher(). If xorriso is NULL then: flag bit1-bit4 are in effect even if bit0 is not set. flag bit5 and bit6 may not be set. @param line A text of one or more words according to man xorriso paragraph "Command processing" up to and including "Backslash Interpretation". @param prefix If not empty then the line will only be parsed if it begins by the prefix text. Parsing will then begin after the end of the prefix. If the prefix does not match, then 0 will be returned in *argc, argv will be NULL, and the return value will be 2. @param separators If not empty this overrides the default list of word separating characters. Default set is the one of isspace(3). @param max_words If not 0: Maximum number of words to parse. If there remains line text after the last parsed word and its following separators, then this remainder is copied unparsed into a final result word. In this case *argc will be larger than max_words by one. Note that trailing separators are considered to be followed by an empty word. @param argc Will return the number of allocated and filled word strings. @param argv Will return the array of word strings. Do not forget to dispose the allocated memory by a call to Xorriso__dispose_words(). @param flag Bitfield for control purposes bit0= Override setting of -backslash_codes. bit1-4= With bit0: backslash behavior 0= off 1= in_double_quotes 2= in_quotes 3= with_quoted_input bit5= Prepend the program name as (*argv)[0], so that *argv is suitable for Xorriso_interpreter() and other calls which expect this. Not allowed if xorriso is NULL. bit6= Issue failure message in case of return 0 Not allowed if xorriso is NULL. @return <=0 means error and invalidity of *argv: 0 = Input format error. E.g. bad quotation mark. -1 = Lack of resources. E.g. memory. -2 = Improper combination of call parameters. >0 means success but not necessarily a valid result: 1 = Result in argc and argv is valid (but may be empty by argc == 0, argv == NULL). 2 = Line did not match prefix. Result is invalid and empty. */ int Xorriso_parse_line(struct XorrisO *xorriso, char *line, char *prefix, char *separators, int max_words, int *argc, char ***argv, int flag); /* Dispose a list of strings as allocated by Xorriso_parse_line() or Xorriso_program_arg_bsl(), or Xorriso_sieve_get_result(). @since 1.2.6 @param argc A pointer to the number of allocated and filled word strings. *argc will be set to 0 by this call. @param argv A pointer to the array of word strings. *argv will be set to NULL by this call. */ void Xorriso__dispose_words(int *argc, char ***argv); /* Enter xorriso command line dialog mode, using libreadline if configured at build time and not disabled at run time. This call returns immediately if not option -dialog "on" was performed before. @param xorriso The context object in which to perform the commands. @param flag unused yet, submit 0 @return <=0 error, 1= dialog mode ended normally , 3= dialog mode ended normally,interpreter asks to end program */ /* @since 0.1.0 */ int Xorriso_dialog(struct XorrisO *xorriso, int flag); /* --------------------- Problem Status and Message API ------------------- */ /** Submit a problem message to the xorriso problem reporting and handling system. This will eventually increase problem status rank, which may at certain stages in the program be pardoned and reset to 0. The pardon is governed by Xorriso_option_abort_on() and by the anger of the affected program part. If no pardon has been given, then the problem status reaches the caller of option functions. Problem status should be inquired by Xorriso_eval_problem_status() and be reset before next option execution by Xorriso_set_problem_status(). The problem status itself does not cause the failure of option functions. But in case of failures for other reasons, a remnant overly severe problem status can cause overly harsh program reactions. @param xorriso The environment handle @param error_code The unique error code of your message. Submit 0 if you do not have reserved error codes within the libburnia project. @param msg_text Not more than 8196 characters of message text. A final newline character gets appended automatically. @param os_errno Eventual errno related to the message. Submit 0 if the message is not related to a operating system error. @param severity One of "ABORT", "FATAL", "FAILURE", "MISHAP", "SORRY", "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG". Defaults to "FATAL". @param flag Bitfield for control purposes bit0= use pager (as with result) bit1= permission to suppress output @return 1 if message was delivered, <=0 if failure */ int Xorriso_msgs_submit(struct XorrisO *xorriso, int error_code, char msg_text[], int os_errno, char severity[], int flag); /** Alternative call interface of Xorriso_msgs_submit with void* instead of struct XorrisO* */ int Xorriso_msgs_submit_void(void *xorriso, int error_code, char msg_text[], int os_errno, char severity[], int flag); /** Evaluate an advise whether to abort or whether to go on with option processing. This should be called after any option function was processed. It updates the problem status by processing the library message queues and then it uses this status and the submitted return value of the option function to evaluate the situation. @param xorriso The environment handle @param ret The return value of the previously called option function @param flag bit0= do not issue own event messages bit1= take xorriso->request_to_abort as reason for abort @return Gives the advice: 2= pardon was given, go on 1= no problem, go on 0= function failed but xorriso would not abort, go on <0= do abort -1 = due to xorriso->problem_status or due to ret<0 -2 = due to xorriso->request_to_abort */ int Xorriso_eval_problem_status(struct XorrisO *xorriso, int ret, int flag); /** Set the current problem status of the xorriso handle. @param xorriso The environment handle @param severity A severity text. Empty text resets to "No Problem". @param flag Unused yet. Submit 0. @return <=0 failure (e.g. wrong severity text), 1 success. */ int Xorriso_set_problem_status(struct XorrisO *xorriso, char *severity, int flag); /* The next three functions are part of Xorriso_eval_problem_status(). You may use them to build an own advisor function. */ /** Compare two severity texts for their severeness. Unknown severity texts get defaulted to "FATAL". @since 1.2.6 @param sev1 First severity text to compare @param sev2 Second severity text to compare @return -1 sev1 is less severe than sev2 0 sev1 is equally severe to sev2 1 sev1 is more severe than sev2 */ int Xorriso__severity_cmp(char *sev1, char *sev2); /** Return a blank separated list of severity names. Sorted from low to high severity. @since 1.2.6 @param flag Bitfield for control purposes (unused yet, submit 0) @return A constant string with the severity names */ char *Xorriso__severity_list(int flag); /** Obtain the current problem status of the xorriso handle. @param xorriso The environment handle @param severity The severity text matching the current problem status @param flag Unused yet. Submit 0. @return The severity rank number. 0= no problem occurred. */ int Xorriso_get_problem_status(struct XorrisO *xorriso, char severity[80], int flag); /** Forward any pending messages from the library message queues to the xorriso message system which puts out on info channel. This registers the severity of the library events like the severity of a message submitted via Xorriso_msgs_submit(). xorriso sets the message queues of the libraries to queuing "ALL". Many inner functions of xorriso call Xorriso_process_msg_queues() on their own because they expect library output pending. Nevertheless, a loop of xorriso option calls should either call Xorriso_eval_problem_status() or Xorriso_process_msg_queues() with each cycle. @param xorriso The environment handle @param flag Unused yet. Submit 0. @return 1 on success, <=0 if failure */ int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag); /** Write a message for option -errfile_log. @param xorriso The environment handle @param error_code The unique error code of your message. Submit 0 if you do not have reserved error codes within the libburnia project. @param msg_text Not more than 8196 characters of message text. @param os_errno Eventual errno related to the message. Submit 0 if the message is not related to a operating system error. @param flag bit0-7= meaning of msg_text ( 0= ERRFILE path , for internal use mainly ) 1= mark line text (only to be put out if enabled) @return <=0 error , >0 success */ int Xorriso_process_errfile(struct XorrisO *xorriso, int error_code, char msg_text[], int os_errno, int flag); /* Message output evaluation xorriso is basically a dialog software which reacts on commands by side effects and by messages. The side effects manipulate the state of the ISO image model and of drives. This state can be inquired by commands which emit messages. There are several approaches how a program that uses xorriso via this API can receive and use the message output of xorriso. - The message sieve may be programmed to pick certain information snippets out of the visible message stream. This covers all messages on the result channel and those info channel messages which get not suppressed by command -report_about. All important info messages have severity NOTE or higher. Much of the message interpretation is supposed to happen by the sieve filter rules which describe the interesting message lines and the positions of the interesting message parts. The call Xorriso_sieve_big() installs a sieve that looks out for most model state messages which xorriso can emit. After a few commands the user will ask the sieve for certain text pieces that might have been caught. - The outlist stack may be used to catch messages in linked lists rather than putting them out on the message channels. All interpretation of the messages has to be done by the user of the xorriso API. Function Xorriso_parse_line() is intended to help with splitting up messages into words. The outlist stack is handy for catching the results of information commands with large uniform output or no well recognizable message prefix. Like -lsl, -getfacl, -status, -find ... -exec get_md5. One should push the stack before the command, pull it afterwards, examine the text list by Xorriso_lst_get_*(), and finally dispose the list. - The message watcher is a separate program thread which uses the outlist stack to catch the messages and to call user provided handler functions. These functions can use Xorriso_parse_line() too, if they submit the xorriso parameter as NULL. They may not use the struct XorrisO object in any way. Synchronization between watcher and emitters of commands can be achieved by Xorriso_peek_outlists(). The main motivation for the message watcher is to inspect and display messages of long lasting xorriso commands while they are still executing. E.g. of -commit, -blank, -format. One would normally start it before such a command and stop it afterwards. But of course, the watcher can stay activated all the time and process all message output via its handler calls. The message sieve does not interfere with outlists and message watcher. The message watcher will only see messages which are not caught by outlists which were enabled after the watcher thread was started. */ /* The programmable message sieve picks words out of the program messages of xorriso. The sieve is a collection of filter rules. Each one is defined by a call of Xorriso_sieve_add_filter(). The sieve watches the given output channels for messages which begin by the given text prefixes of the filters. Matching lines get split into words by Xorriso_parse_line() using the given separators. The words described by the filter's word index array get recorded by the filter and can be inquired by Xorriso_sieve_get_result() after one or more xorriso commands have been performed. The recorded results may be disposed by Xorriso_sieve_clear_results without giving up the sieve. The whole sieve may be disposed by Xorriso_sieve_dispose(). Default at library start is an inactive sieve without any filter rules. */ /** Add a filter rule to the message sieve. Start watching output messages, if this is not already enabled. @since 1.2.6 @param xorriso The environment handle @param name The filter name by which its recorded results shall be inquired via Xorriso_sieve_get_result() @param channels Which of the output channels the filter shall watch bit0= result channel bit1= info channel bit2= mark channel @param prefix The line start to watch for. Will also be handed over to Xorriso_parse_line(). Empty text matches all lines. If the prefix begins by '?' characters, then these match any character at the beginning of a message. The prefix of the filter rule will then be adapted to really match the line, before it gets handed over to Xorriso_parse_line(). @param separators List of separator characters for Xorriso_parse_line() @param num_words Number of word indice in word_idx @param word_idx Array with the argv indice to be picked from the the result of Xorriso_parse_line(). Must at least contain num_words elements. @param max_results If not 0, then the maximum number of line results that shall be recorded by the filter. When this number is exceeded, then results of older lines get discarded when new results get recorded. @param flag Bitfield for control purposes bit0= Last result word shall contain the remainder of the message line @return <=0 error , >0 success */ int Xorriso_sieve_add_filter(struct XorrisO *xorriso, char *name, int channels, char *prefix, char *separators, int num_words, int *word_idx, int max_results, int flag); /** Inquire recorded results from a particular filter rule. @param xorriso The environment handle @param name The filter name as given by Xorriso_sieve_add_filter() @param argc Will return the number of allocated and filled word strings. @param argv Will return the array of word strings. Do not forget to dispose the allocated memory by a call to Xorriso__dispose_words(). @param available Will return the number of results which are still available for further calls of Xorriso_sieve_get_result() with the given name. @param flag Bitfield for control purposes: bit0= Reset reading to first matching result. bit1= Only inquire number of available results. Do not allocate memory. bit2= If *argv is not NULL, then free it before attaching new memory. bit3= Do not read recorded data but rather list all filter names. @return <0 error: -1 = memory shortage -2 = no filter rule found 0 No more data available for the given name With bit3: No filter rules installed. >0 argc and argv are valid */ int Xorriso_sieve_get_result(struct XorrisO *xorriso, char *name, int *argc, char ***argv, int *available, int flag); /** Dispose all recorded results. Keep filter rules. Continue watching and recording. @since 1.2.6 @param xorriso The environment handle @param flag Unused yet. Submit 0. @return <=0 error , >0 success */ int Xorriso_sieve_clear_results(struct XorrisO *xorriso, int flag); /** Dispose all filter rules. End watching and recording. This is the default state at library startup. @since 1.2.6 @param xorriso The environment handle @param flag Unused yet. Submit 0. @return <=0 error , >0 success */ int Xorriso_sieve_dispose(struct XorrisO *xorriso, int flag); /** Install a large sieve with filters for about any interesting message of xorriso. The filter rule names are mostly the same as the prefixes they search for. If you do not find the message prefix of your desire, then you may add a filter rule by Xorriso_sieve_add_filter(). If you do not want all these filter any more, call Xorriso_sieve_dispose(). You should obtain your recorded data often and then call Xorriso_sieve_clear_results(). It is nevertheless ok to perform several different xorriso information commands and to then obtain results from the sieve. The installed filters in particular: Name Recorded values, returned by Xorriso_sieve_get_result() ------------------------------------------------------------------------ "-changes_pending" up to 1 result from -changes_pending show_status argv[0]= "yes" or "no" "? -dev" up to 10 results from -devices or -device_links (records drives with single digit index number) argv[0]= drive address argv[1]= permissions argv[2]= drive vendor argv[3]= product id "?? -dev" up to 90 results from -devices or -device_links (records drives with double digit index number) argv[0]= drive address argv[1]= permissions argv[2]= drive vendor argv[3]= product id "Abstract File:" up to 1 result from -pvd_info argv[0]= file name (Note: prefix is "Abstract File: ") "After commit :" up to 1 result from -tell_media_space argv[0]= number of blocks with "s" appended "App Id :" up to 1 result from -pvd_info argv[0]= id (Note: prefix is "App Id : ") "Biblio File :" up to 1 result from -pvd_info argv[0]= file name (Note: prefix is "Biblio File : ") "Build timestamp :" up to 1 result from -version argv[0]= timestamp (Note: prefix is "Build timestamp : ") "CopyrightFile:" up to 1 result from -pvd_info argv[0]= file name (Note: prefix is "CopyrightFile: ") "Creation Time:" up to 1 result from -pvd_info argv[0]= YYYYMMDDhhmmsscc (Note: prefix is "Creation Time: ") "DVD obs 64 kB:" up to 1 result from -list_extras argv[0]= "yes" or "no" "Drive access: " up to 2 result from -dev, -indev, -toc argv[0]= "exclusive", "shared" argv[1]= "readonly","restricted" "Drive current:" up to 2 results from -dev, -indev, -toc, others argv[0]= command ("-dev", "-outdev", "-indev") argv[1]= drive address "Drive type :" up to 2 results from -toc argv[0]= vendor argv[1]= product argv[2]= revision "Eff. Time :" up to 1 result from -pvd_info argv[0]= YYYYMMDDhhmmsscc (Note: prefix is "EffectiveTime: ") "Expir. Time :" up to 1 result from -pvd_info argv[0]= YYYYMMDDhhmmsscc (Note: prefix is "Expir. Time : ") "Ext. filters :" up to 1 result from -list_extras argv[0]= "yes" or "no" , possibly more info (Note: prefix is "Ext. filters : ") "File damaged :" up to 10000 results from -find ... -exec report_damage argv[0]= damage start byte in file argv[1]= damage range size in file argv[2]= file size argv[3]= path in ISO image "File data lba:" up to 10000 results from -find ... -exec report_lba argv[0]= extent number (all extents of same path together are the content of one file) argv[1]= start block number of extent argv[2]= number of blocks of extent argv[3]= overall file content size in all extents argv[4]= path in ISO image "Format idx :" up to 100 results from -list_formats argv[0]= index argv[1]= MMC code argv[2]= number of blocks with "s" appended argv[3]= roughly the size in MiB (Note: prefix is "Format idx ") "Format status:" up to 1 result from -list_formats argv[0]= status argv[1]= capacity "ISO session :" up to 10000 results from -toc argv[0]= Idx argv[1]= sbsector argv[2]= Size argv[3]= Volume Id "Image size :" up to 1 result from -print_size argv[0]= number of blocks with "s" appended "Jigdo files :" up to 1 result from -list_extras argv[0]= "yes" or "no" "Local ACL :" up to 1 result from -list_extras argv[0]= "yes" or "no" "Local xattr :" up to 1 result from -list_extras argv[0]= "yes" or "no" "MD5 MISMATCH:" up to 10000 results from -check_md5* argv[0]= path of mismatching file "MD5 tag range:" up to 10000 results from -check_media argv[0]= lba argv[1]= size in blocks argv[2]= result text (starting with "+", "-", or "0") "Media blocks :" up to 2 results from -toc argv[0]= readable argv[1]= writable argv[2]= overall "Media current:" up to 2 results from -dev, -indev, -toc, others argv[0]= media type / MMC profile name (Note: prefix is "Media current: " which eats extra blank) "Media nwa :" up to 1 result from -toc argv[0]= next writable address "Media product:" up to 2 results from -toc argv[0]= product id argv[1]= manufacturer "Media region :" up to 10000 results from -check_media argv[0]= lba argv[1]= size in blocks argv[2]= quality text (starting with "+", "-", or "0") "Media space :" up to 1 result from -tell_media_space argv[0]= number of blocks with "s" appended "Media status :" up to 2 results from -dev, -indev, -toc, others argv[0]= status description (Note: prefix is "Media status : ") "Media summary:" up to 2 results from -dev, -indev, -toc, others argv[0]= sessions argv[1]= data blocks (full count) argv[2]= data (with unit letter k,m,g) argv[3]= free (with unit letter k,m,g) "Modif. Time :" up to 1 result from -pvd_info argv[0]= YYYYMMDDhhmmsscc (Note: prefix is "Modif. Time : ") "PVD address :" up to 1 result from -pvd_info argv[0]= block address with "s" appended "Preparer Id :" up to 1 result from -pvd_info argv[0]= id (Note: prefix is "Preparer Id : ") "Profile :" up to 256 results from -list_profiles argv[0]= MMC code argv[1]= profile name in round brackets possibly appended: " (current)" "Publisher Id :" up to 1 result from -pvd_info argv[0]= id (Note: prefix is "Publisher Id : ") "Readline :" up to 1 result from -list_extras argv[0]= "yes" or "no" "Size lower :" up to 1 result from -findx ... -exec estimate_size argv[0]= size with appended "s" "Size upper :" up to 1 result from -findx ... -exec estimate_size argv[0]= size with appended "s" "System Id :" up to 1 result from -pvd_info argv[0]= id (Note: prefix is "System Id : ") "Version timestamp :" up to 1 result from -version argv[0]= timestamp "Volume Id :" up to 1 result from -pvd_info argv[0]= id (Note: Not output from -dev or -toc but from -pvd_info) "Volume Set Id:" up to 1 result from -pvd_info argv[0]= id (Note: prefix is "Volume Set Id: ") "Volume id :" up to 2 results from -dev, -indev, -toc, others argv[0]= volume id (Note: Not output from -pvd_info but from -dev or -toc) "Write speed :" up to 100 results from -list_speeds argv[0]= kilobytes per second argv[1]= speed factor "Write speed H:" up to 1 result from -list_speeds see "Write speed :" "Write speed L:" up to 1 result from -list_speeds see "Write speed :" "Write speed h:" up to 1 result from -list_speeds see "Write speed :" "Write speed l:" up to 1 result from -list_speeds see "Write speed :" "libburn in use :" up to 1 result from -version argv[0]= version text argv[1]= minimum version requirement "libburn OS adapter:" up to 1 result from -version argv[0]= adapter description (Note: prefix is "libburn OS adapter: ") "libisoburn in use :" up to 1 result from -version argv[0]= version text argv[1]= minimum version requirement "libisofs in use :" up to 1 result from -version argv[0]= version text argv[1]= minimum version requirement "libjte in use :" up to 1 result from -version argv[0]= version text argv[1]= minimum version requirement "xorriso version :" up to 1 result from -version argv[0]= version text "zisofs :" up to 1 result from -list_extras argv[0]= "yes" or "no" ------------------------------------------------------------------------ @since 1.2.6 @param xorriso The environment handle @param flag Unused yet. Submit 0. @return <=0 error , >0 success */ int Xorriso_sieve_big(struct XorrisO *xorriso, int flag); /* The outlist stack allows to redirect the info and result messages from their normal channels into a pair of string lists which can at some later time be retrieved by the application. These redirection caches can be stacked to allow stacked applications. xorriso itself uses them for internal purposes. The call Xorriso_start_msg_watcher() starts a concurrent thread which uses outlists to collect messages and to hand them over by calling application provided functions. */ /* A list item able of forming double chained lists */ struct Xorriso_lsT; /** Maximum number of stacked redirections */ #define Xorriso_max_outlist_stacK 32 /** Enable a new redirection of info and/or result channel. The normal message output and eventual older redirections will not see new messages until the redirection is ended by a call to Xorriso_pull_outlists() with the stack_handle value returned by this call. If Xorriso_option_pkt_output() is set to "on", then it will consolidate output in the result_list of Xorriso_fetch_outlists() and Xorriso_pull_outlists(). @param xorriso The environment handle @param stack_handle returns an id number which is unique as long as its redirection is stacked. Do not interpret it and do not use it after its redirection was pulled from the stack. @param flag Bitfield for control purposes bit0= redirect result channel bit1= redirect info channel If bit0 and bit1 are 0, both channels get redirected. @return 1 on success, <=0 if failure */ int Xorriso_push_outlists(struct XorrisO *xorriso, int *stack_handle, int flag); /** Obtain the currently collected text messages of redirected info and result channel. The messages are handed out as two lists. Both lists have to be disposed via Xorriso_lst_destroy_all() when they are no longer needed. The message lists are either NULL or represented by their first Xorriso_lsT item. This call is safe for being used by a concurrent thread while a xorriso API call is being executed on the same struct XorrisO. In such a situation, it should not be used with high frequency in order not to hamper the ongoing xorriso operation by blocking its message output facility. A hundred times per second should be enough. @since 1.2.6 @param xorriso The environment handle @param stack_handle An id number returned by Xorriso_push_outlists() and not yet revoked by Xorriso_pull_outlists(). Submit -1 to address the most recent valid id. @param result_list Result and mark messages (usually directed to stdout) @param info_list Info and mark messages (usually directed to stderr) @param flag Bitfield for control purposes bit0= fetch result channel bit1= fetch info channel If bit0 and bit1 are 0, both channels get fetched. @return 1 on success, <=0 if failure */ int Xorriso_fetch_outlists(struct XorrisO *xorriso, int stack_handle, struct Xorriso_lsT **result_list, struct Xorriso_lsT **info_list, int flag); /** Inquire whether messages are pending in redirected result and info channel. This may be used to determine whether a concurrent message watcher already has obtained all pending messages. @since 1.2.6 @param xorriso The environment handle @param stack_handle An id number returned by Xorriso_push_outlists() and not yet revoked by Xorriso_pull_outlists(). Submit -1 to address the most recent valid id. @param timeout Number of seconds after which to return despite flag bit 2 @param flag Bitfield for control purposes bit0= fetch result channel bit1= fetch info channel bit2= wait and retry until return is 0 or -1 If bit0 and bit1 are 0, both channels get fetched. @return If > 0: bit0= messages are pending in outlists bit1= message watcher is processing fetched messages Else: 0= no messages are pending anywhere -1= inappropriate stack_handle -2= locking failed */ int Xorriso_peek_outlists(struct XorrisO *xorriso, int stack_handle, int timeout, int flag); /** Disable the redirection given by stack_handle. If it was the current receiver of messages then switch output to the next older redirection, or to the normal channels if no redirections are stacked any more. The messages collected by the disabled redirection are handed out as two lists. Both lists have to be disposed via Xorriso_lst_destroy_all() when they are no longer needed. The message lists are either NULL or represented by their first Xorriso_lsT item. @param xorriso The environment handle @param stack_handle An id number returned by Xorriso_push_outlists() and not yet revoked by Xorriso_pull_outlists(). This handle is invalid after the call. Submit -1 to address the most recent valid id. @param result_list Result and mark messages (usually directed to stdout) @param info_list Info and mark messages (usually directed to stderr) @param flag unused yet, submit 0 @return 1 on success, <=0 if failure */ int Xorriso_pull_outlists(struct XorrisO *xorriso, int stack_handle, struct Xorriso_lsT **result_list, struct Xorriso_lsT **info_list, int flag); /** Redirect output by Xorriso_push_outlists() and start a thread which fetches this output and performs a call of a given function with each message that is obtained. @since 1.2.6 @param xorriso The environment handle @param result_handler Pointer to the function which shall be called with each result message. A NULL pointer causes output to be directed to stdout or to be interpreted as -pkt_output format if this is enabled by Xorriso_option_pkt_output(). The function should return 1. A return value of -1 urges not to call again with further lines. @param result_handle The first argument of (*result_handler)(). It shall point to a memory object that knows all necessary external parameters for running (*result_handler)(). Submit NULL if result_handler is NULL. @param info_handler Pointer to the function which shall be called with each info message. A NULL pointer causes output to be directed to stderr or to -as mkisofs -log-file. The function should return 1. A return value of -1 urges not to call again with further lines. @param info_handle The first argument of (*info_handler)(). It shall point to a memory object that knows all necessary external parameters for running (*info_handler)(). Submit NULL if info_handler is NULL. @param flag unused yet, submit 0 @return 1 on success, <=0 if failure (e.g. there is already a watcher active) */ int Xorriso_start_msg_watcher(struct XorrisO *xorriso, int (*result_handler)(void *handle, char *text), void *result_handle, int (*info_handler)(void *handle, char *text), void *info_handle, int flag); /** Revoke output redirection by Xorriso_start_msg_watcher() and end the watcher thread. If text messages are delivered when Xorriso_pull_outlists() is called, then they get put out through the active handler functions. @since 1.2.6 @param xorriso The environment handle @param flag Bitfield for control purposes: bit0= do not issue SORRY message if no message watcher is active @return 1 on success, <=0 if failure */ int Xorriso_stop_msg_watcher(struct XorrisO *xorriso, int flag); /** Obtain the text message from the current list item. @param entry The current list item @param flag unused yet, submit 0 @return Pointer to the text content of the list item. This pointer does not have to be freed. */ char *Xorriso_lst_get_text(struct Xorriso_lsT *entry, int flag); /** Obtain the address of the next item in the chain of messages. An iteration over the output of Xorriso_pull_outlists() starts at the returned result_list or info_list and ends when this function returns NULL. @param entry The current list item @param flag unused yet, submit 0 @return Pointer to the next list item or NULL if end of list. This pointer does not have to be freed. */ struct Xorriso_lsT *Xorriso_lst_get_next(struct Xorriso_lsT *entry, int flag); /** Obtain the address of the previous item in the chain of messages. @param entry The current list item @param flag unused yet, submit 0 @return Pointer to the previous list item or NULL if start of list. This pointer does not have to be freed. */ struct Xorriso_lsT *Xorriso_lst_get_prev(struct Xorriso_lsT *entry, int flag); /** Destroy all list items which are directly or indirectly connected to the given link item. All pointers obtained by Xorriso_lst_get_text() become invalid by this. Apply this to each of the two list handles obtained by Xorriso_pull_outlists() when the lists are no longer needed. @param lstring *lstring will be freed and set to NULL. It is not dangerous to submit a pointer to a NULL-pointer. @param flag unused yet, submit 0 @return -1= lstring was NULL (i.e. wrong use of this call), 0= *lstring was already NULL, 1= item actually disposed */ int Xorriso_lst_destroy_all(struct Xorriso_lsT **lstring, int flag); /* ---------------------------- Command API ------------------------ */ /* See man 1 xorriso for explanation of the particular commands */ /* Before each call to a command function, there should happen: Xorriso_set_problem_status() with empty severity text. After each call to a command function, there should happen: Xorriso_eval_problem_status() One should follow its eventual advice to abort. Commands with a varying number of arguments get then passed like Xorriso_interpreter(). E.g.: int Xorriso_option_add(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); The command functions will begin to read the arguments at position *idx and will see the list end either at the next argv which contains the -list_delimiter text or at argv[argc-1]. After the call, *idx will be the index of the first not yet interpreted argv. Do not set any flag bits which are not described by "@param flag". I.e. if flag is not mentioned, then submit 0. Yet undefined flag bits might get a meaning in future. Unset bits will then produce the traditional behavior, whereas set bits might bring surprises to inadverted callers. The API is available @since 0.5.8 Earlier "since" marks refer to availability in the command interpreter. */ /* Command -abort_on */ /* @since 0.1.0 */ int Xorriso_option_abort_on(struct XorrisO *xorriso, char *severity, int flag); /* Command -abstract_file */ /* @since 0.6.0 */ int Xorriso_option_abstract_file(struct XorrisO *xorriso, char *name, int flag); /* Command -acl "on"|"off" */ /* @since 0.3.4 */ int Xorriso_option_acl(struct XorrisO *xorriso, char *mode, int flag); /* Command -add */ /* @param flag bit0=do not report the added item bit1=do not reset pacifier, no final pacifier message */ /* @since 0.1.0 */ int Xorriso_option_add(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -add_plainly "on"|"off" */ /* @since 0.1.0 */ int Xorriso_option_add_plainly(struct XorrisO *xorriso, char *mode, int flag); /* Command -alter_date, -alter_date_r */ /* @param flag bit0=recursive (-alter_date_r) */ /* @since 0.1.0 */ int Xorriso_option_alter_date(struct XorrisO *xorriso, char *time_type, char *timestring, int argc, char **argv, int *idx, int flag); /* Command -append_partition */ /* @since 0.6.4 */ int Xorriso_option_append_partition(struct XorrisO *xorriso, char *partno_text, char *type_text, char *image_path, int flag); /* Command -application_id */ /* @since 0.3.0 */ int Xorriso_option_application_id(struct XorrisO *xorriso, char *name, int flag); /* Command -application_use */ /* @since 1.3.2 */ int Xorriso_option_application_use(struct XorrisO *xorriso, char *path, int flag); /* Command -as */ /* @param flag bit0=do not report the added item bit1=do not reset pacifier, no final pacifier message */ /* @since 0.1.2 */ int Xorriso_option_as(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -assert_volid */ /* @since 0.3.2 */ int Xorriso_option_assert_volid(struct XorrisO *xorriso, char *pattern, char *severity, int flag); /* Command -auto_charset "on"|"off" */ /* @since 0.3.8 */ int Xorriso_option_auto_charset(struct XorrisO *xorriso, char *mode, int flag); /* Command -backslash_codes */ /* @since 0.3.0 */ int Xorriso_option_backslash_codes(struct XorrisO *xorriso, char *mode, int flag); /* Command -ban_stdio_write */ /* @since 0.1.0 */ int Xorriso_option_ban_stdio_write(struct XorrisO *xorriso, int flag); /* Command -biblio_file */ /* @since 0.6.0 */ int Xorriso_option_biblio_file(struct XorrisO *xorriso, char *name, int flag); /* Command -blank and -format */ /* @param flag bit0= format rather than blank @return <=0 error , 1 success, 2 revoked by -reassure */ /* @since 0.1.0 */ int Xorriso_option_blank(struct XorrisO *xorriso, char *mode, int flag); /* Command -boot_image */ /* @since 0.1.0 */ int Xorriso_option_boot_image(struct XorrisO *xorriso, char *form, char *treatment, int flag); /* Command -calm_drive */ /* @since 0.4.2 */ int Xorriso_option_calm_drive(struct XorrisO *xorriso, char *which, int flag); /* Command -cd alias -cdi */ /* @since 0.1.0 */ int Xorriso_option_cdi(struct XorrisO *xorriso, char *iso_rr_path, int flag); /* Command -cdx */ /* @since 0.1.0 */ int Xorriso_option_cdx(struct XorrisO *xorriso, char *disk_path, int flag); /* Command -changes_pending */ /* @since 1.2.2 */ int Xorriso_option_changes_pending(struct XorrisO *xorriso, char *state, int flag); /* Commands -charset, -in_charset, -out_charset, -local_charset */ /* @param flag bit0= set in_charset bit1= set out_charset bit2= set local_charset */ /* @since 0.3.0 */ int Xorriso_option_charset(struct XorrisO *xorriso, char *name, int flag); /* Command -check_md5 and -check_md5_r @param flag bit0= issue summary message bit1= do not reset pacifier, no final pacifier message bit2= do not issue pacifier messages at all bit3= recursive: -check_md5_r */ /* @since 0.4.2 */ int Xorriso_option_check_md5(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -check_media */ /* @since 0.2.4 */ int Xorriso_option_check_media(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -check_media_defaults */ /* @since 0.2.6 */ int Xorriso_option_check_media_defaults(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -chgrp alias -chgrpi , chgrp_r alias chgrp_ri */ /* @param flag bit0=recursive (-chgrp_r) */ /* @since 0.1.0 */ int Xorriso_option_chgrpi(struct XorrisO *xorriso, char *gid, int argc, char **argv, int *idx, int flag); /* Command -chmod alias -chmodi , -chmod_r alias chmod_ri */ /* @param flag bit0=recursive (-chmod_r) */ /* @since 0.1.0 */ int Xorriso_option_chmodi(struct XorrisO *xorriso, char *mode, int argc, char **argv, int *idx, int flag); /* Command -chown alias -chowni , chown_r alias chown_ri */ /* @param flag bit0=recursive (-chown_r) */ /* @since 0.1.0 */ int Xorriso_option_chowni(struct XorrisO *xorriso, char *uid, int argc, char **argv, int *idx, int flag); /* Command -clone */ /* @since 1.0.2 */ int Xorriso_option_clone(struct XorrisO *xorriso, char *origin, char *dest, int flag); /* Command -close "on"|"off"| @since 1.3.4 "as_needed" */ /* @since 0.1.0 */ int Xorriso_option_close(struct XorrisO *xorriso, char *mode, int flag); /* Command -close_damaged */ /* @since 1.1.0 */ int Xorriso_option_close_damaged(struct XorrisO *xorriso, char *mode, int flag); /* Command -close_filter_list */ /* @since 0.3.8 */ int Xorriso_option_close_filter_list(struct XorrisO *xorriso, int flag); /* Command -commit */ /* @param flag bit0= leave indrive and outdrive acquired as they were, i.e. do not acquire outdrive as new in-out-drive bit1= do not perform eventual -reassure @return <=0 error , 1 success, 2 revoked by -reassure */ /* @since 0.1.0 */ int Xorriso_option_commit(struct XorrisO *xorriso, int flag); /* Command -commit_eject */ /* @return <=0 error , 1 success, 2 revoked by -reassure */ /* @since 0.1.0 */ int Xorriso_option_commit_eject(struct XorrisO *xorriso, char *which, int flag); /* Command -compare and -compare_r @param flag bit0= issue summary message bit1= do not reset pacifier, no final pacifier message bit2= do not issue pacifier messages at all bit3= recursive: -compare_r */ /* @since 0.1.2 */ int Xorriso_option_compare(struct XorrisO *xorriso, char *disk_path, char *iso_path, int flag); /* Command -compliance */ /* @since 0.3.0 */ int Xorriso_option_compliance(struct XorrisO *xorriso, char *mode, int flag); /* Command -concat */ /* @since 1.3.8 */ int Xorriso_option_concat(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -copyright_file */ /* @since 0.6.0 */ int Xorriso_option_copyright_file(struct XorrisO *xorriso, char *name, int flag); /* Command -cp_clone */ /* @since 1.0.2 */ int Xorriso_option_cp_clone(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -cpr alias -cpri */ /* @since 0.1.0 */ int Xorriso_option_cpri( struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -cpx , -cpax, -cp_rx , -cp_rax */ /* @param flag bit0= recursive (-cp_rx, -cp_rax) @since 0.2.0 bit1= full property restore (-cpax, -cp_rax) @since 0.2.0 */ /* @since 0.1.8 */ int Xorriso_option_cpx(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -cut_out */ /* @since 0.1.2 */ int Xorriso_option_cut_out(struct XorrisO *xorriso, char *disk_path, char *start, char *count, char *iso_rr_path, int flag); /* Command -dev , -indev, -outdev */ /* @param flag bit0=use as indev , bit1= use as outdev @return <=0 error , 1 success, 2 revoked by -reassure */ /* @since 0.1.0 */ int Xorriso_option_dev(struct XorrisO *xorriso, char *adr, int flag); /* Command -data_cache_size */ /* @since 1.2.2 */ int Xorriso_option_data_cache_size(struct XorrisO *xorriso, char *num_tiles, char *tile_blocks, int flag); /* Command -devices */ /* @param flag bit0= perform -device_links rather than -devices @since 1.1.4 @return <=0 error , 1 success, 2 revoked by -reassure */ /* @since 0.1.0 */ int Xorriso_option_devices(struct XorrisO *xorriso, int flag); /* Command -dialog "on"|"off" */ /* @since 0.2.8 */ /* (since 0.1.0 there was -dialog and -dialog_reset without arg) */ int Xorriso_option_dialog(struct XorrisO *xorriso, char *mode, int flag); /* Command -disk_dev_ino "on"|"off" */ /* @since 0.3.4 */ int Xorriso_option_disk_dev_ino(struct XorrisO *xorriso, char *mode, int flag); /* Command -disk_pattern "on"|"ls"|"off" */ /* @since 0.1.0 */ int Xorriso_option_disk_pattern(struct XorrisO *xorriso, char *mode, int flag); /* Command -displacement [-]offset */ /* @since 0.6.6 */ int Xorriso_option_displacement(struct XorrisO *xorriso, char *value, int flag); /* Command -drive_access "exclusive"|"shared":"readonly"|"unrestricted" */ /* @since 1.5.2 */ int Xorriso_option_drive_access(struct XorrisO *xorriso, char *mode, int flag); /* Command -drive_class */ /* @since 0.3.2 */ int Xorriso_option_drive_class(struct XorrisO *xorriso, char *d_class, char *pattern, int flag); /* Command -dummy "on"|"off" */ /* @since 0.1.0 */ int Xorriso_option_dummy(struct XorrisO *xorriso, char *mode, int flag); /* Command -dvd_obs "default"|"32k"|"64k" */ /* @since 0.4.8 */ int Xorriso_option_dvd_obs(struct XorrisO *xorriso, char *obs, int flag); /* Command -early_stdio_test */ /* @since 1.0.6 */ int Xorriso_option_early_stdio_test(struct XorrisO *xorriso, char *mode, int flag); /* Command -ecma119_map */ /* @since 1.4.2 */ int Xorriso_option_ecma119_map(struct XorrisO *xorriso, char *mode, int flag); /* Command -eject */ /* @param flag bit0=do not report toc of eventually remaining drives */ /* @since 0.1.0 */ int Xorriso_option_eject(struct XorrisO *xorriso, char *which, int flag); /* Command -end , and -rollback_end */ /* @param flag bit0= discard pending changes @return <=0 error , 1 success, 2 revoked by -reassure */ /* @since 0.1.0 */ int Xorriso_option_end(struct XorrisO *xorriso, int flag); /* Command -errfile_log marked|plain path|-|"" */ /* @since 0.1.2 */ int Xorriso_option_errfile_log(struct XorrisO *xorriso, char *mode, char *path, int flag); /* Command -error_behavior */ /* @since 0.1.6 */ int Xorriso_option_error_behavior(struct XorrisO *xorriso, char *occasion, char *behavior, int flag); /* Command -external_filter */ /* @since 0.3.8 */ int Xorriso_option_external_filter(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -extract , -extract_single */ /* @param flag bit0=do not report the restored item bit1=do not reset pacifier, no final pacifier message bit5= -extract_single: do not insert directory tree */ /* @since 0.2.0 */ int Xorriso_option_extract(struct XorrisO *xorriso, char *disk_path, char *iso_path, int flag); /* Command -extract_boot_images */ /* @sice 1.5.4 */ int Xorriso_option_extract_boot_images(struct XorrisO *xorriso, char *disk_dir_path, int flag); /* Command -extract_cut */ /* @since 0.2.6 */ int Xorriso_option_extract_cut(struct XorrisO *xorriso, char *iso_rr_path, char *start, char *count, char *disk_path, int flag); /* Command -file_name_limit */ /* @since 1.4.2 */ int Xorriso_option_file_name_limit(struct XorrisO *xorriso, char *value, int flag); /* Command -file_size_limit */ /* @since 0.2.6 */ int Xorriso_option_file_size_limit(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -find alias -findi, and -findx */ /* @param flag bit0= -findx rather than -findi bit1= do not reset pacifier, no final pacifier message do not reset find_compare_result */ /* @since 0.1.0 */ int Xorriso_option_find(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -follow */ /* @since 0.1.0 */ int Xorriso_option_follow(struct XorrisO *xorriso, char *mode, int flag); /* Command -for_backup is a shortcut for Xorriso_option_hardlinks(xorriso, "on", 0); Xorriso_option_acl(xorriso, "on", 0); Xorriso_option_xattr(xorriso, "any", 0); Xorriso_option_md5(xorriso, "on", 0); */ /* @since 0.4.0 */ /* xattr "any" @since 1.5.0 */ /* Command -fs */ /* @since 0.1.0 */ int Xorriso_option_fs(struct XorrisO *xorriso, char *size, int flag); /* Commands -getfacl alias -getfacli, -getfacl_r alias -getfacl_ri -getfattr alias getfattri */ /* @param flag bit0=recursive -getfacl_r bit1= getfattr rather than getfacl bit3= with bit1: do not ignore eventual non-user attributes */ /* @since 0.3.4 */ int Xorriso_option_getfacli(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -gid */ /* @since 0.1.0 */ int Xorriso_option_gid(struct XorrisO *xorriso, char *gid, int flag); /* Command -grow_blindly */ /* @since 0.2.2 */ int Xorriso_option_grow_blindly(struct XorrisO *xorriso, char *msc2, int flag); /* Command -hardlinks "on"|"off" */ /* @since 0.4.0 */ int Xorriso_option_hardlinks(struct XorrisO *xorriso, char *mode, int flag); /* Command -help and part of -prog_help */ /* @since 0.1.0 */ int Xorriso_option_help(struct XorrisO *xorriso, int flag); /* Option -hfsplus "on"|"off" */ /* @since 1.2.4 */ int Xorriso_option_hfsplus(struct XorrisO *xorriso, char *mode, int flag); /* Command -hide */ /* @since 0.6.0 */ int Xorriso_option_hide(struct XorrisO *xorriso, char *hide_state, int argc, char **argv, int *idx, int flag); /* Command -history */ /* @since 0.1.0 */ int Xorriso_option_history(struct XorrisO *xorriso, char *line, int flag); /* Command -iso_nowtime "dynamic"|timespec */ /* @since 1.5.2 */ int Xorriso_option_iso_nowtime(struct XorrisO *xorriso, char *text, int flag); /* Command -iso_rr_pattern "on"|"ls"|"off" */ /* @since 0.1.0 */ int Xorriso_option_iso_rr_pattern(struct XorrisO *xorriso, char *mode, int flag); /* Command -jigdo aspect argument */ /* @since 0.6.4 */ int Xorriso_option_jigdo(struct XorrisO *xorriso, char *aspect, char *arg, int flag); /* Command -joliet "on"|"off" */ /* @since 0.1.0 */ int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag); /* Command -joliet_map "unmapped" | "stripped" */ int Xorriso_option_joliet_map(struct XorrisO *xorriso, char *mode, int flag); /* Command -launch_frontend */ /* @since 1.2.6 */ int Xorriso_option_launch_frontend(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -list_arg_sorting */ /* @since 1.2.2 */ int Xorriso_option_list_arg_sorting(struct XorrisO *xorriso, int flag); /* Command -list_delimiter */ /* @since 0.2.6 */ int Xorriso_option_list_delimiter(struct XorrisO *xorriso, char *text, int flag); /* Command -list_extras */ /* @since 1.1.6 */ int Xorriso_option_list_extras(struct XorrisO *xorriso, char *mode, int flag); /* Command -list_formats */ /* @since 0.1.6 */ int Xorriso_option_list_formats(struct XorrisO *xorriso, int flag); /* Command -list_profiles */ /* @since 0.4.2 */ int Xorriso_option_list_profiles(struct XorrisO *xorriso, char *which, int flag); /* Command -list_speeds */ /* @since 1.1.2 */ int Xorriso_option_list_speeds(struct XorrisO *xorriso, int flag); /* Command -lns alias -lnsi */ /* @since 1.2.6 */ int Xorriso_option_lnsi(struct XorrisO *xorriso, char *target, char *path, int flag); /* Command -load session|track|sbsector value */ /* @param flag bit0= with adr_mode sbsector: adr_value is possibly 16 too high @return <=0 error , 1 success, 2 revoked by -reassure */ /* @since 0.1.6 */ int Xorriso_option_load(struct XorrisO *xorriso, char *adr_mode, char *adr_value, int flag); /* Command -logfile */ /* @since 0.1.0 */ int Xorriso_option_logfile(struct XorrisO *xorriso, char *channel, char *fileadr, int flag); /* Command -ls alias -lsi and -lsl alias -lsli and -lsd alias -lsdi and -lsdl alias -lsdli and -du alias -dui and -dus alias -dusi @param flag bit0= long format (-lsl , -du, not -dus, not -ls) bit1= do not expand patterns but use literally bit2= -du rather than -ls bit3= list directories as themselves (-lsd) */ /* @since 0.1.0 */ int Xorriso_option_lsi(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -lsx, -lslx, -lsdx , -lsdlx , -dux , -dusx @param flag bit0= long format (-lslx , -dux) bit1= do not expand patterns but use literally bit2= du rather than ls bit3= list directories as themselves (ls -d) */ /* @since 0.1.0 */ int Xorriso_option_lsx(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Commandis -map , -map_single */ /* @param flag bit0=do not report the added item bit1=do not reset pacifier, no final pacifier message bit5= -map_single: do not insert directory tree */ /* @since 0.1.6 */ int Xorriso_option_map(struct XorrisO *xorriso, char *disk_path, char *iso_path, int flag); /* Command -map_l , -compare_l , -update_l , -extract_l */ /* @param flag bit8-11= mode 0= -map_l 1= -compare_l 2= -update_l 3= -extract_l 4= -update_lxi @since 1.4.8 5= -update_li @since 1.4.8 */ /* @since 0.2.0 */ int Xorriso_option_map_l(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -mark */ /* @since 0.1.0 */ int Xorriso_option_mark(struct XorrisO *xorriso, char *mark, int flag); /* Command -md5 */ /* @since 0.4.2 */ int Xorriso_option_md5(struct XorrisO *xorriso, char *mode, int flag); /* Command -mkdir alias -mkdiri */ /* @since 0.1.0 */ int Xorriso_option_mkdiri(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -modesty_on_drive */ /* @since 1.4.2 */ int Xorriso_option_modesty_on_drive(struct XorrisO *xorriso, char *mode, int flag); /* Command -mount , -mount_cmd , -session_string */ /* @param bit0= -mount_cmd: print mount command to result channel rather than performing it bit1= perform -session_string rather than -mount_cmd */ /* @since 0.3.2 */ int Xorriso_option_mount(struct XorrisO *xorriso, char *dev, char *adr_mode, char *adr, char *cmd, int flag); /* Command -mount_opts option[:...] */ /* @since 0.4.4 */ int Xorriso_option_mount_opts(struct XorrisO *xorriso, char *mode, int flag); /* Command -move */ /* @since 1.2.8 */ int Xorriso_option_move(struct XorrisO *xorriso, char *origin, char *dest, int flag); /* Command -msg_op */ /* @since 1.2.6 */ int Xorriso_option_msg_op(struct XorrisO *xorriso, char *what, char *arg, int flag); /* Command -mv alias -mvi */ /* @since 0.1.0 */ int Xorriso_option_mvi(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Option -named_pipe_loop */ /* @since 1.3.2 */ int Xorriso_option_named_pipe_loop(struct XorrisO *xorriso, char *mode, char *stdin_pipe, char *stdout_pipe, char *stderr_pipe, int flag); /* Command -no_rc */ /* @since 0.1.0 */ int Xorriso_option_no_rc(struct XorrisO *xorriso, int flag); /* Command -not_leaf , -as mkisofs -hide without '/' */ /* @param flag bit0= add to iso_rr hide list rather than to disk exclusions @since 0.6.0 bit1= add to joliet hide list rather than disk exclusions @since 0.6.0 bit2= add to HFS+ hide list rather than disk exclusions @since 1.2.4 */ /* @since 0.1.6 */ int Xorriso_option_not_leaf(struct XorrisO *xorriso, char *pattern, int flag); /* Command -not_list , -quoted_not_list */ /* @param flag bit0= -quoted_not_list @since 0.3.0 */ /* @since 0.1.6 */ int Xorriso_option_not_list(struct XorrisO *xorriso, char *adr, int flag); /* Command -not_mgt */ /* @since 0.1.6 */ int Xorriso_option_not_mgt(struct XorrisO *xorriso, char *setting, int flag); /* Command -not_paths , -as mkisofs -hide with '/' */ /* @param flag bit0= add to iso_rr hide list rather than to disk exclusions @since 0.6.0 bit1= add to joliet hide list rather than disk exclusions @since 0.6.0 bit2= enable disk pattern expansion regardless of -disk_pattern bit8-13= consolidated hide state bits, duplicating bit0-1 @since 1.2.4 bit8= add to iso_rr_hidings, same as bit0 bit9= add to joliet_hidings, same as bit1 bit10= add to hfsplus_hidings */ /* @since 0.1.6 */ int Xorriso_option_not_paths(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -options_from_file */ /* @return <=0 error , 1 = success , 3 = request to end program run */ /* @since 0.1.0 */ int Xorriso_option_options_from_file(struct XorrisO *xorriso, char *adr, int flag); /* Command -osirrox "on"|"off" */ /* @since 0.1.8 */ int Xorriso_option_osirrox(struct XorrisO *xorriso, char *mode, int flag); /* Command -overwrite "on"|"nondir"|"off" */ /* @since 0.1.0 */ int Xorriso_option_overwrite(struct XorrisO *xorriso, char *mode, int flag); /* Command -pacifier */ /* @since 0.2.2 */ int Xorriso_option_pacifier(struct XorrisO *xorriso, char *style, int flag); /* Command -padding */ /* @since 0.1.0 */ int Xorriso_option_padding(struct XorrisO *xorriso, char *size, int flag); /* Command -page */ /* @since 0.1.0 */ int Xorriso_option_page(struct XorrisO *xorriso, int len, int width, int flag); /* Command -paste_in */ /* @since 0.2.0 */ int Xorriso_option_paste_in(struct XorrisO *xorriso, char *iso_rr_path, char *disk_path, char *start, char *count, int flag); /* Command -path_list , -quoted_path_list */ /* @param flag bit0= -quoted_path_list @since 0.3.0 */ /* @since 0.1.0 */ int Xorriso_option_path_list(struct XorrisO *xorriso, char *adr, int flag); /* Command -pathspecs */ /* @since 0.1.0 */ int Xorriso_option_pathspecs(struct XorrisO *xorriso, char *mode, int flag); /* Command -pkt_output */ /* Note: If output is redirected by Xorriso_push_outlists() then mode "on" consolidates output in the result output list, not on stdout. */ /* @since 0.1.0 */ int Xorriso_option_pkt_output(struct XorrisO *xorriso, char *mode, int flag); /* Command -preparer_id */ /* @since 0.6.2 */ int Xorriso_option_preparer_id(struct XorrisO *xorriso, char *name, int flag); /* Command -print, -print_info , -print_mark */ /* @param flag bit0-1= output channel: 0= result channel 1= info channel @since 1.0.6 2= mark channel @since 1.0.6 */ /* @since 1.0.6 */ int Xorriso_option_print(struct XorrisO *xorriso, char *text, int flag); /* Command -print_size @param flag bit0= report in mkisofs compatible form on real stdout */ /* @since 0.1.0 */ int Xorriso_option_print_size(struct XorrisO *xorriso, int flag); /* Command -prog */ /* @since 0.1.0 */ int Xorriso_option_prog(struct XorrisO *xorriso, char *name, int flag); /* Command -prompt */ /* @since 0.1.0 */ int Xorriso_option_prompt(struct XorrisO *xorriso, char *text, int flag); /* Command -prog_help */ /* @since 0.1.0 */ int Xorriso_option_prog_help(struct XorrisO *xorriso, char *name, int flag); /* Command -publisher */ /* @since 0.1.2 */ int Xorriso_option_publisher(struct XorrisO *xorriso, char *name, int flag); /* Command -pvd_info */ /* @since 0.4.4 */ int Xorriso_option_pvd_info(struct XorrisO *xorriso, int flag); /* Command -pwd alias -pwdi */ /* @since 0.1.0 */ int Xorriso_option_pwdi(struct XorrisO *xorriso, int flag); /* Command -pwdx */ /* @since 0.1.0 */ int Xorriso_option_pwdx(struct XorrisO *xorriso, int flag); /* Command -read_fs */ /* @since 1.4.2 */ int Xorriso_option_read_fs(struct XorrisO *xorriso, char *mode, int flag); /* Command -read_mkisofsrc */ /* @since 0.6.0 */ int Xorriso_option_read_mkisofsrc(struct XorrisO *xorriso, int flag); /* Command -reassure "on"|"tree"|"off" */ /* @since 0.1.0 */ int Xorriso_option_reassure(struct XorrisO *xorriso, char *mode, int flag); /* Command -report_about */ /* @since 0.1.0 */ int Xorriso_option_report_about(struct XorrisO *xorriso, char *severity, int flag); /* Command -report_el_torito */ /* @since 1.3.8 */ int Xorriso_option_report_el_torito(struct XorrisO *xorriso, char *form, int flag); /* Command -report_system_area */ /* @since 1.3.8 */ int Xorriso_option_report_system_area(struct XorrisO *xorriso, char *form, int flag); /* Command -return_with */ /* @since 0.1.0 */ int Xorriso_option_return_with(struct XorrisO *xorriso, char *severity, int exit_value, int flag); /* Command -rm alias -rmi , -rm_r alias -rm_ri , -rmdir alias -rmdiri */ /* @param flag bit0=recursive bit2= remove empty directory: rmdiri */ /* @since 0.1.0 */ int Xorriso_option_rmi(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag); /* Command -rockridge "on"|"off" */ /* @since 1.2.4 */ int Xorriso_option_rockridge(struct XorrisO *xorriso, char *mode, int flag); /* Command -rollback */ /* @param flag bit0= do not -reassure @return <=0 error , 1 success, 2 revoked by -reassure */ /* @since 0.1.0 */ int Xorriso_option_rollback(struct XorrisO *xorriso, int flag); /* Command -rom_toc_scan */ /* @since 0.1.6 */ int Xorriso_option_rom_toc_scan(struct XorrisO *xorriso, char *mode, int flag); /* Command -rr_reloc_dir */ /* @since 1.2.2 */ int Xorriso_option_rr_reloc_dir(struct XorrisO *xorriso, char *name, int flag); /* Command -scdbackup_tag */ /* @since 0.4.4 */ int Xorriso_option_scdbackup_tag(struct XorrisO *xorriso, char *list_path, char *record_name, int flag); /* Command -scsi_dev_family */ /* @since 1.4.4 */ int Xorriso_option_scsi_dev_family(struct XorrisO *xorriso, char *mode, int flag); /* Command -scsi_log */ /* @since 0.5.0 */ int Xorriso_option_scsi_log(struct XorrisO *xorriso, char *mode, int flag); /* Command -session_log */ /* @since 0.1.4 */ int Xorriso_option_session_log(struct XorrisO *xorriso, char *path, int flag); /* Command -setfacl_list alias -setfacl_listi */ /* @since 0.3.4 */ int Xorriso_option_setfacl_listi(struct XorrisO *xorriso, char *disk_path, int flag); /* Command -setfacl alias -setfacli , -setfacl_r alias -setfacl_ri */ /* @param flag bit0=recursive -setfacl_r */ /* @since 0.3.4 */ int Xorriso_option_setfacli(struct XorrisO *xorriso, char *acl_text, int argc, char **argv, int *idx, int flag); /* Command -setfattr alias -setfattri, -setfattr_r alias -setfattr_ri */ /* @param flag bit0=recursive -setfattr_r */ /* @since 0.3.4 */ int Xorriso_option_setfattri(struct XorrisO *xorriso, char *name, char *value, int argc, char **argv, int *idx, int flag); /* Command -setfattr_list alias -setfattr_listi */ /* @since 0.3.4 */ int Xorriso_option_setfattr_listi(struct XorrisO *xorriso, char *path, int flag); /* Command -set_filter , -set_filter_r , -show_stream , -show_stream_r */ /* @param flag bit0=recursive -set_filter_r bit1= do not reset pacifier, no final pacifier message bit2= -show_stream rather than -set_filter */ /* @since 0.3.8 */ int Xorriso_option_set_filter(struct XorrisO *xorriso, char *name, int argc, char **argv, int *idx, int flag); /* Option -sh_style_result */ /* @since 1.3.2 */ int Xorriso_option_sh_style_result(struct XorrisO *xorriso, char *mode, int flag); /* Command -signal_handling */ /* @param flag bit0= do not yet install the eventual handler @since 1.1.0 */ int Xorriso_option_signal_handling(struct XorrisO *xorriso, char *mode, int flag); /* Command -sleep */ /* @since 1.1.8 */ int Xorriso_option_sleep(struct XorrisO *xorriso, char *duration, int flag); /* Command -speed , -read_speed */ /* @param flag bit0= @since 1.3.4 -read_speed rather than -speed */ /* @since 0.1.0 */ int Xorriso_option_speed(struct XorrisO *xorriso, char *speed, int flag); /* Command -split_size */ /* @since 0.1.4 */ int Xorriso_option_split_size(struct XorrisO *xorriso, char *s, int flag); /* Command -status */ /* @since 0.1.0 */ int Xorriso_option_status(struct XorrisO *xorriso, char *mode, int flag); /* Command -status_history_max */ /* @since 0.1.0 */ int Xorriso_option_status_history_max(struct XorrisO *xorriso, int num1, int flag); /* Command -stdio_sync "on"|"off"|"end"|size */ /* @since 0.4.6 */ int Xorriso_option_stdio_sync(struct XorrisO *xorriso, char *rhythm, int flag); /* Command -stream_recording */ /* @since 0.1.8 */ int Xorriso_option_stream_recording(struct XorrisO *xorriso, char *mode, int flag); /* Command -system_id */ /* @since 0.4.4 */ int Xorriso_option_system_id(struct XorrisO *xorriso, char *name, int flag); /* Command -tell_media_space */ /* @since 0.1.0 */ int Xorriso_option_tell_media_space(struct XorrisO *xorriso, int flag); /* Command -temp_mem_limit */ /* @since 0.1.0 */ int Xorriso_option_temp_mem_limit(struct XorrisO *xorriso, char *size, int flag); /* Command -toc */ /* @param flag bit0= short report form as with -dev, no table-of-content */ /* @since 0.1.0 */ int Xorriso_option_toc(struct XorrisO *xorriso, int flag); /* Command -toc_of */ /* @since 1.2.6 */ int Xorriso_option_toc_of(struct XorrisO *xorriso, char *which, int flag); /* Command -truncate_overwritable */ /* @since 1.5.4 */ int Xorriso_option_truncate_overwritable(struct XorrisO *xorriso, char *adr_mode, char *adr_value, char *adjust, int flag); /* Command -uid */ /* @since 0.1.0 */ int Xorriso_option_uid(struct XorrisO *xorriso, char *uid, int flag); /* Command -unregister_filter */ /* @since 0.3.8 */ int Xorriso_option_unregister_filter(struct XorrisO *xorriso, char *name, int flag); /* Command -update and -update_r @param flag bit0= issue summary message bit1= do not reset pacifier, no final pacifier message bit2= do not issue pacifier messages at all bit3= recursive: -update_r */ /* @since 0.1.2 */ int Xorriso_option_update(struct XorrisO *xorriso, char *disk_path, char *iso_path, int flag); /* Command -use_readline */ /* @since 0.1.0 */ int Xorriso_option_use_readline(struct XorrisO *xorriso, char *mode, int flag); /* Command -use_immed_bit */ /* @since 1.4.6 */ int Xorriso_option_use_immed_bit(struct XorrisO *xorriso, char *mode, int flag); /* Command -version */ /* @since 0.1.0 */ int Xorriso_option_version(struct XorrisO *xorriso, int flag); /* Command -volid */ /* @param flag bit0= do not warn of problematic volid */ int Xorriso_option_volid(struct XorrisO *xorriso, char *volid, int flag); /* Command -volset_id */ /* @since 0.4.4 */ int Xorriso_option_volset_id(struct XorrisO *xorriso, char *name, int flag); /* Command -volume_date */ /* @since 0.5.4 */ int Xorriso_option_volume_date(struct XorrisO *xorriso, char *time_type, char *timestring, int flag); /* Command -write_type */ /* @since 1.2.4 */ int Xorriso_option_write_type(struct XorrisO *xorriso, char *mode, int flag); /* There is no Xorriso_option_x() because -x has an effect only in Xorriso_prescan_args(). Use the flag bits of Xorriso_interpreter() if you want to impose command sorting on your own. @since 1.2.2 */ /* Command -xattr "on"|"off" */ /* @since 0.3.4 */ int Xorriso_option_xattr(struct XorrisO *xorriso, char *mode, int flag); /* Command -zisofs */ /* @since 0.3.8 */ int Xorriso_option_zisofs(struct XorrisO *xorriso, char *mode, int flag); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* Xorriso_includeD */ libisoburn-1.5.4/xorriso/changelog.txt0000644000175700017510000204357514005266475015050 00000000000000------------------------------------------------------------------------------ libburnia-project.org libisoburn , xorriso ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Changelog ------------------------------------------------------------------------------ 1 Sep 2007 [983] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/burn_wrap.c libisoburn/isofs_wrap.c Initial content of libisoburn 1 Sep 2007 [985] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c Should have used copy+paste when writing Vreixos name 5 Sep 2007 [990] libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/burn_wrap.c Implemented use of stdio-pseudo-drives 5 Sep 2007 [993] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/burn_wrap.c Changes in plans as discussed up to Sep 5 2007 5 Sep 2007 [994] libisoburn/libisoburn.h Updated explanations about the usage principles of libisoburn 6 Sep 2007 [998] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/burn_wrap.c Updated to state of discussion 9 Sep 2007 [1025] libisoburn/burn_wrap.c New wrapper isoburn_disc_erasable() declares ISO DVD-RAM, DVD+RW erasable 10 Sep 2007 [1027] libisoburn/libisoburn.h New wrapper isoburn_disc_erasable() declares ISO DVD-RAM, DVD+RW erasable 11 Sep 2007 [1029] libisoburn/burn_wrap.c libisoburn/isoburn.h New inner function isoburn_set_start_byte() 12 Sep 2007 [1031] libisoburn/libisoburn.h libisoburn/burn_wrap.c Removed isoburn_write_opts_set_start_byte() 13 Sep 2007 [1043] libisoburn/burn_wrap.c Took into respect fabricated_disc_status 21 Sep 2007 [1092] Makefile.am Removed libburn file addresses 22 Sep 2007 [1093] + doc/doxygen.conf.in Added file demanded by build system 22 Sep 2007 [1094] src/burn_wrap.c Prevented SIGSEGV in isoburn_drive_scan_and_grab() 22 Sep 2007 [1095] src/burn_wrap.c Enabled treatment==2 in isoburn_drive_scan_and_grab() 22 Sep 2007 [1099] src/burn_wrap.c Made use of burn_msgs_submit() for error messages 23 Sep 2007 [1102] src/burn_wrap.c Removed all references to isoburn.treatment from burn_wrap.c 23 Sep 2007 [1105] src/burn_wrap.c Called isoburn_create_data_source() and isoburn_free_data_source() 28 Sep 2007 [1129] libisofs libisofs/libiso_msgs.h Removed apostrophes which my compiler does not like 29 Sep 2007 [1133] src/burn_wrap.c Added optional code for a pseudo CD-RW to test the code for MMC multi-session 29 Sep 2007 [1134] src/burn_wrap.c Released drive in case welcome_media fails 1 Oct 2007 [1141] src/burn_wrap.c Allowed isoburn_disc_get_msc1() for closed media 2 Oct 2007 [1149] test/test.c Function graft_point(),some general polishing, call of iso_volset_free disabled 8 Oct 2007 [1169] src/libisoburn.h src/isoburn.h src/isoburn.c src/burn_wrap.c Introduced fifo reference into isoburn object 8 Oct 2007 [1170] test/test.c Several directories and files in one session, added display of fifo 12 Oct 2007 [1171] + test/xorriso.h + test/xorriso.c + test/xorriso.txt The stub of new application xorriso 12 Oct 2007 [1172] + test/compile_xorriso.sh + test/make_timestamp.sh + test/xorriso_timestamp.h A build facility to circumvent autotools during development 12 Oct 2007 [1173] test/xorriso.c Introduced version and build timestamps, library headers 13 Oct 2007 [1174] test/xorriso.c + test/changelog.txt Made -dialog and -options_from_file work 2007.10.13.141503 [1175] test/xorriso.c Implemented -speed and enlarged -status list 2007.10.13.152252 [1176] test/xorriso.c test/xorriso.txt Implemented xorriso setter level of -fs, -gid, -uid 2007.10.14.110003 [1177] test/xorriso.c Implemented setter level of -abort_on, fixed bugs about -f,-no_rc,startup files 2007.10.14.122456 [1178] test/xorriso.c + test/xorriso_private.h + test/xorrisoburn.h + test/xorrisoburn.c Began to implement interface to our libraries 2007.10.15.152705 [1183] test/xorriso.h test/xorriso.c test/xorriso_private.h test/xorrisoburn.h test/xorrisoburn.c Implemented -dev, -add, -commit 2007.10.15.160303 [1184] test/xorriso.c Made -end give up drives 2007.10.15.203554 [1185] test/xorriso.c Some safety precautions against malicious input, enabled -cdx, -cdi for -add 2007.10.15.203714 [1186] test/xorrisoburn.c Corrected image path bug with -add of regular files, and -add /=/some/dir 2007.10.15.224005 [1187] test/xorriso.c test/xorrisoburn.c Implemented -rollback 2007.10.16.210911 [1188] test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c Worked on failure severities, message system, program abort decision 2007.10.17.130041 [1190] [1191 test/xorriso.h test/xorriso_private.h test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c Worked on failure severities, message system, program abort decision 2007.10.17.130311 [1192] src/isofs_wrap.c Told burn_read_data() to stay silent on non-existent drive or read error 2007.10.17.150142 [1193] test/xorriso.c test/xorrisoburn.c Reinstated the distinction of message sources, respected '#' in dialog 2007.10.17.165352 [1194] test/xorriso.c Prepended a "-" to any input line if missing 2007.10.17.183024 [1195] test/xorriso_private.h test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c Implemented core of option -toc 2007.10.17.200241 [1196] test/xorrisoburn.c Continued work with -toc 2007.10.17.213852 [1197] test/compile_xorriso.sh Forgot to make off_t 64 bit 2007.10.17.214228 [1198] src/libisoburn.h src/burn_wrap.c test/xorrisoburn.c Rounding up fabricated nwa to full 32k addresses, API call for exact image size 2007.10.17.215809 [1199] test/xorriso.c Activated -ban_stdio_write 2007.10.17.224924 [1200] test/xorrisoburn.c Fixed obvious bug with -J. (Still wondering wether it works) 2007.10.17.225039 [1201] test/xorriso.c Fixed bug with -speed. 2007.10.17.225837 [1202] test/xorriso.c Fixed bug with -prompt. Fixed bug with # comments. (of rev 1194) 18 Oct 2007 [1203] test/changelog.txt Updated changelog and todo list 2007.10.18.144841 [1205] src/isofs_wrap.c test/xorrisoburn.c isoburn_read_volset() now hands out an official volset reference 2007.10.18.171415 [1206] test/xorriso.c test/xorriso.txt test/xorrisoburn.h test/xorrisoburn.c Implemented option -devices 2007.10.18.183200 [1207] test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c Implemented option -tell_media_space 2007.10.18.185731 [1208] test/xorriso_private.h test/xorriso.c test/xorrisoburn.c Fixed a SIGSEGV with xorriso -version run 2007.10.18.221756 [1211] test/xorrisoburn.c src/libisoburn.h Took care of disposal of burn_disc ovbject 18 Oct 2007 [1212] test/test.c Silenced compile warning 2007.10.18.225654 [1213] src/isofs_wrap.c test/xorriso.c test/xorrisoburn.c Fixed a SIGSEGV with empty drive 2007.10.19.140031 [1218] test/xorrisoburn.c Made reports with -add normal infos (formerly NOTE events) 2007.10.19.151339 [1219] test/xorriso.c test/xorrisoburn.c test/xorriso.txt Implemented -print-size 2007.10.19.164957 [1220] test/xorriso_private.h test/xorriso.c test/xorriso.h test/xorrisoburn.c test/xorriso.txt Implemented verbosity control by option -report_about 2007.10.19.173547 [1221] test/xorriso.c test/xorrisoburn.c test/xorriso.txt Implemented option -eject 2007.10.19.204155 [1222] test/xorriso_private.h test/xorriso.h test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c Implemented option -blank 2007.10.20.170731 [1223] src/burn_wrap.c Directed write mode failure message to libburn queue, repaired wrote_well 2007.10.20.171046 [1224] test/xorrisoburn.c test/xorriso_private.h test/xorriso.c Implemented options -format and -blank deformat, -close and closed media 20 Oct 2007 [1225] test/xorriso.txt + test/xorriso.1 test/changelog.txt Splitted think text from emerging man page, formatted man page 2007.10.20.194918 [1226] test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c Completed -tell_media_space, checked space before burn, failed -end exits >0 20 Oct 2007 [1227] test/xorriso.1 Polished man page 2007.10.21.094818 [1228] test/xorriso_private.h test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c test/xorriso.1 Implemented -rm and -rm_r 2007.10.21.105228 [1229] src/data_source.c Silenced compiler warning about C++ style comment 2007.10.21.124315 [1230] test/xorriso.c test/xorrisoburn.c test/xorrisoburn.h Began to implement -ls and -ls_l, enhanced -cdi, not done yet 2007.10.21.151124 [1231] test/xorriso_private.h test/xorriso.c test/xorrisoburn.c test/xorrisoburn.h Hopefully completed -cd alias -cdi 2007.10.21.185248 [1232] test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c test/xorriso.1 Hopefully completed -cdx 2007.10.21.213303 [1233] test/xorriso_private.h test/xorriso.c test/xorrisoburn.c test/xorriso.1 Implemented sorting of -ls by node name, implemented leaf name search patterns 2007.10.22.211928 [1237] test/xorrisoburn.c test/xorriso.1 Implemented file size and mtime for -ls_l 2007.10.23.122349 [1238] src/libisoburn.h src/isoburn.c Added fifo_size to struct isoburn_source_opts 2007.10.23.122753 [1239] test/xorrisoburn.c test/xorriso.c test/xorriso.1 Made use of isoburn_source_opts.fifo_size 2007.10.24.100156 [1244] test/xorriso.c test/xorrisoburn.c Normalized paths to target and source before adding or removing from image 2007.10.24.105424 [1245] test/xorriso.c test/xorriso.h Implemented option -path-list 2007.10.24.175337 [1247] test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c Made -cd useable with no image loaded 2007.10.27.224148 [1257] test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c test/xorriso.1 Implemented option -mv 2007.10.27.230512 [1258] test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c Bug fixes with option -mv 2007.10.28.125501 [1260] test/xorriso.c test/xorrisoburn.c Prevented some interesting pitfalls with -mv 2007.10.28.165516 [1261] test/xorriso.c test/xorriso.1 test/xorrisoburn.h test/xorrisoburn.c Implemented option -mkdir 2007.10.28.174550 [1262] test/xorriso.c Warning of wildcards in paths 28 Oct 2007 [1263] test/xorriso.1 Updated man page about -path-list 2007.10.29.213920 [1273] test/xorriso_private.h test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c test/xorriso.1 Structured patterns for options -ls and -ls_l 2007.10.30.214242 [1274] test/xorriso_private.h test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c test/xorriso.1 test/compile_xorriso.sh Multiple structured patterns, changed option -ls from single to multi args 2007.10.31.103338 [1275] test/xorriso_private.h test/xorriso.h test/xorriso.c test/xorrisoburn.c test/xorriso.1 Implemented new option -temp_mem_limit 2007.10.31.165413 [1276] test/xorriso.c test/xorrisoburn.c test/xorrisoburn.h Gave simple -ls an implemention with minimal memory consumption 31 Oct 2007 [1277] test/xorriso.1 Overhauled info paragraphs of man page 2007.10.31.175916 [1278] test/xorriso_private.h Overhauled comments in struct XorrisO 31 Oct 2007 [1279] test/changelog.txt Updating changelog 2007.11.01.111351 [1280] test/xorrisoburn.c Got rid of bad pacifier text at end of CD writing 2007.11.01.191106 [1281] test/xorriso.h test/xorriso.c test/xorrisoburn.c test/xorrisoburn.h test/xorriso.1 Implemented option -du 2007.11.02.143549 [1282] test/xorrisoburn.h test/xorrisoburn.c Clearer status messages after reading new volume and after burning 2007.11.02.143658 [1283] test/xorriso.c Made -abort_on and -report_about complain with bad severity names 2007.11.02.184705 [1284] test/xorrisoburn.c test/xorriso.1 Polished write success message and man page 2007.11.06.163305 [1285] test/xorriso_private.h test/xorriso.h test/xorriso.c test/xorrisoburn.c test/xorriso.1 Implemented -overwrite control 2007.11.06.163929 [1286] src/libisoburn.h Corrected a typo in a comment 2007.11.06.164029 [1287] src/isoburn.c Closed memory leak by freeing session and track in isoburn_prepare_disc_aux() 2007.11.07.123744 [1288] test/xorriso_private.h test/xorriso.h test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c test/xorriso.1 Implemented option -reassure 2007.11.07.150157 [1289] test/xorriso.h test/xorriso.c test/xorrisoburn.c test/xorriso.1 Implemented option -rmdir 2007.11.07.191915 [1290] test/xorriso.h test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c Implemented option -chmod (does not get written into image, though) 2007.11.07.225624 [1291] test/xorriso.c test/xorrisoburn.c test/xorrisoburn.h Implemented options -chown and -chgrp (not written into image, though) 2007.11.08.144451 [1292] test/xorriso.c test/xorrisoburn.c test/xorrisoburn.h test/xorriso.1 Implemented option -alter_date, corrected write problem with mode and ownership 2007.11.08.145016 [1293] test/xorriso_private.h Forgotten source file for rev 1292 8 Nov 2007 [1294] test/xorriso.1 Enhanced man page text for options -chmod, -chown, -chgrp 2007.11.08.160302 [1295] test/xorriso.c Fixed bug with -chmod go=r 2007.11.08.161215 [1296] test/xorriso.c test/xorrisoburn.c Enlarged string size limit of Text_shellsafe() 2007.11.09.193142 [1297] test/xorriso_private.h test/xorriso.h test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c test/xorriso.1 New option -iso_rr_pattern, influencing several options with multiple args 2007.11.11.112321 [1298] test/xorriso.h test/xorriso.c test/xorrisoburn.c Gave problem handling finer granularity within loops 11 Nov 2007 [1299] test/xorriso.1 Clarified man page 2007.11.11.154453 [1300] test/xorriso.c Added missing commit to normal end of program 11 Nov 2007 [1301] test/xorriso.1 Added some examples to man page 2007.11.14.142904 [1302] src/libisoburn.h src/isofs_wrap.c src/isoburn.c test/test.c New API call isoburn_attach_volset(), changes with isoburn_read_volset() 2007.11.14.143119 [1303] test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c test/xorriso.1 Implemented options -outdev and -indev 2007.11.14.175446 [1304] test/xorriso.c Corrected premature abort bug with misspelled command words 14 Nov 2007 [1305] test/xorriso.1 Polished xorriso man page 14 Nov 2007 [1306] test/changelog.txt Updated xorriso changelog 2007.11.26.192113 [1311] test/xorriso.c test/xorrisoburn.c Reacted on warnings on a 64 bit system 2007.12.04.074340 [1314] test/xorriso.h test/xorriso_private.h test/xorriso.c test/xorrisoburn.c test/xorriso.1 Implemented -disk_pattern, -lsx, ls_lx, -dux, -du_lx 2007.12.04.205919 [1315] test/xorrisoburn.c test/xorriso_private.h test/xorriso.c Removed some redundancy of disk_pattern and iso_rr_pattern matching 4 Dec 2007 [1316] test/xorriso.1 Polished man page 2007.12.05.090438 [1317] test/xorriso.h test/xorriso.c test/xorriso.1 Option -f-off as counterpart of option -f 2007.12.05.143632 [1318] test/xorriso.c Made dashes at options optional 5 Dec 2007 [1319] test/xorriso.1 Overhauled description of media types, states and expansion methods 2007.12.06.150102 [1320] test/xorriso.h test/xorriso.c test/xorriso.1 Changed -f, -f-off to -follow, -graft-points, -graf-points-off to -pathspecs 6 Dec 2007 [1321] test/xorriso.1 Removed references to option -graft-points 2007.12.06.192437 [1322] test/xorriso.c Corrected warning function about wildcards 8 Dec 2007 [1326] test/xorriso.1 Explained result pager 2007.12.08.175117 [1327] test/xorriso.c test/xorriso_private.h test/xorrisoburn.c Removed more code redundancies and fd leak with Xorriso_obtain_pattern_files_x() 2007.12.15.162039 [1328] test/compile_xorriso.sh Added -O0 to -g to get better gdb behavior on my new system 2007.12.15.183022 [1329] test/xorriso_private.h test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c test/xorriso.1 Implemented option -follow 2007.12.16.103456 [1330] test/xorriso.c test/xorriso.1 Added link hop limit to option -follow 2007.12.16.122626 [1331] test/xorrisoburn.c Added copying of attributes from symbolic link into image 2007.12.16.144615 [1332] test/xorrisoburn.c Removed waste of time in Xorriso_show_du_subs() 2007.12.18.175924 [1333] test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c test/xorriso.1 Changed options -ls* to -lsd*, introduced new family of -ls* without d 2007.12.20.111338 [1334] test/xorriso.h test/xorriso.c test/xorrisoburn.c test/xorriso.1 Changed -du_s* into -dus* 2007.12.21.131538 [1335] test/xorriso.h test/xorriso_private.h test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c test/xorriso.1 Implemented option -find alias -findi 2007.12.21.132017 [1336] test/xorriso.c test/xorriso.1 Corrected documentation about -find 2007.12.22.143803 [1337] test/xorriso.h test/xorriso.c test/xorrisoburn.c test/xorriso.1 Implemented option -findx 2007.12.24.161107 [1339] test/xorriso.c Repaired options -dus and -dusx 24 Dec 2007 [1340] test/changelog.txt Updated changelog 2007.12.25.160100 [1341] test/xorriso.h test/xorriso.c test/xorriso.1 Implemented option -cpr 2007.12.26.160040 [1342] test/xorriso.h test/xorriso_private.h test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c test/xorriso.1 Changed option -J to -joliet "on"|"off", implemented option -volid 2007.12.28.132741 [1343] test/xorriso_private.h test/xorriso.c test/xorrisoburn.c Made leaner the local memory of recursive functions (because of ulimit -s) 2007.12.30.190138 [1344] test/xorriso.h test/xorriso_private.h test/xorriso.c test/xorrisoburn.c test/xorriso.1 Implemented -find option -exec echo, chown, chgrp, chmod, alter_date, lsdl 2007.12.30.203336 [1345] test/xorriso.c Corrected superuser behavior of Sfile_lookup_permissions() 2007.12.31.095229 [1346] test/xorriso.c test/xorrisoburn.c Repaired some bugs in -find and -findx 2007.12.31.135237 [1347] test/xorriso.h test/xorriso.c test/xorriso.1 Implemented options -chown_r, -chgrp_r, -chmod_r, -alter_date_r 2007.12.31.135330 [1348] test/xorrisoburn.c Repaired a bug in -find 2008.01.01.123118 [1349] test/xorriso.h test/xorriso_private.h test/xorriso.c test/xorrisoburn.h test/xorrisoburn.c test/xorriso.1 Implemented -find actions chown_r, chgrp_r, chmod_r, alter_date_r, find 2008.01.02.175011 [1350] test/xorriso.c test/xorriso.1 Implemented -find test -type 2008.01.09.175418 [1351] test/xorrisoburn.c Corrections made during porting to nglibisofs 2008.01.10.114451 [1352] + test/ng_xorrisoburn.h + test/ng_xorrisoburn.c test/compile_xorriso.sh Begin of porting to next generation libisofs 2008.01.10.151924 [1353] Makefile.am + ng_src + ng_src/libisoburn.h + ng_src/isoburn.h + ng_src/isoburn.c + ng_src/isofs_wrap.c + ng_src/data_source.c + ng_src/burn_wrap.c Begin of porting to next generation libisofs 2008.01.10.152353 [1354] test/ng_xorrisoburn.c test/compile_xorriso.sh Made compile_xorriso.sh -nglibisofs work on ./ng_src 2008.01.10.154948 [1355] test/ng_xorrisoburn.c test/compile_xorriso.sh Made compile_xorriso.sh -oglibisofs work on ./og_src 2008.01.11.133319 [1356] test/compile_xorriso.sh Adapted to existence of nglibisofs eltorito.o 2008.01.11.133631 [1357] test/xorriso.c test/ng_xorrisoburn.c test/xorrisoburn.c Removed old and new bugs 2008.01.11.174733 [1358] test/xorriso.c test/ng_xorrisoburn.c test/xorrisoburn.c Tracing the different behavior of isoburn_read_image() 2008.01.11.175423 [1359] test/ng_xorrisoburn.c ng_src/isoburn.c ng_src/libisoburn.h Changed isoburn_source_opts.ouput_charset to output_charset 2008.01.11.212545 [1361] ng_src/isofs_wrap.c Made initialization of iso_read_opts safer 13 Jan 2008 [1364] + og_src - src src/burn_wrap.c - src/isoburn.c - src/isoburn.h - src/data_source.c - src/isofs_wrap.c - src/libisoburn.h + og_src/burn_wrap.c + og_src/isoburn.c + og_src/isoburn.h + og_src/data_source.c + og_src/isofs_wrap.c + og_src/libisoburn.h Moved src to og_src and installed symbolic link instead 13 Jan 2008 [1365] ng_src/isofs_wrap.c Changes about blanking loaded image 2008.01.13.224929 [1366] test/ng_xorrisoburn.c Allowed all filetypes as input, silenced debug during image read 14 Jan 2008 [1367] test/compile_xorriso.sh Added forgotten source module 14 Jan 2006 [1368] ng_src/libisoburn.h ng_src/isoburn.c New members in isoburn_source_opts 2008.01.14.163814 [1369] test/ng_xorrisoburn.c Closed memory leak, adapted to new members in isoburn_source_opts 2008.01.14.164628 [1370] test/ng_xorrisoburn.c Repaired memory hog and a freshly introduced bug 2008.01.14.190220 [1371] test/xorriso.c test/ng_xorrisoburn.c test/xorriso.1 Removed some bugs and made adaptions to nglibisofs 2008.01.14.224645 [1372] test/xorriso_private.h test/xorriso.c test/ng_xorrisoburn.h test/ng_xorrisoburn.c test/xorriso.1 Made improvements around volume id 2008.01.15.174409 [1373] test/xorriso.h test/xorriso_private.h test/xorriso.c test/ng_xorrisoburn.h test/ng_xorrisoburn.c test/xorrisoburn.h test/xorrisoburn.c Made improvements about pattern matching .., closed small memory leaks 2008.01.15.204057 [1374] test/xorriso.c test/ng_xorrisoburn.h test/ng_xorrisoburn.c test/xorrisoburn.h test/xorrisoburn.c Closed a small memory leak 2008.01.15.211511 [1375] test/ng_xorrisoburn.c Added a forgotten iso_dir_iter_free() 2008.01.16.132909 [1376] ng_src/isofs_wrap.c Repaired bug about MMC multi-session image loading 2008.01.16.141631 [1378] ng_src/isoburn.c Changed default name of initial image to ISOIMAGE 16 Jan 2008 [1378] libisoburn.pc.in Set correct name of library 2008.01.16.200942 [1379] test/xorriso.c test/ng_xorrisoburn.c Adaption to Xorriso_standalonE, some consequences from compiler warnings 16 Jan 2008 [1380] + test/make_xorriso_standalone.sh + test/xorriso_makefile_am.txt + test/configure_ac.txt + test/xorriso_pc_in.txt A sketch of a xorriso source standalone release generator 16 Jan 2008 [1381] test/configure_ac.txt test/xorriso_makefile_am.txt Added a test for readline.h and eventually enabled use of libreadline 2008.01.17.145135 [1382] test/ng_xorrisoburn.c Silenced -pedantic compiler warnings about type punning 17 Jan 2008 [1385] test/make_xorriso_standalone.sh Silenced most compiler warnings of libisofs in xorriso-standalone 17 Jan 2008 [1386] + test/README Began a README file for xorriso 18 Jan 2008 [1387] test/make_xorriso_standalone.sh test/README + test/xorriso_eng.html Worked on documentation 2008.01.18.101933 [1388] test/xorriso.c Changed -report_about default to "UPDATE" 18 Jan 2008 [1389] test/xorriso.1 test/make_xorriso_standalone.sh + test/convert_man_to_html.sh Made a generator for HTML man page 2008.01.19.090417 [1390] ng_src/libisoburn.h ng_src/isoburn.c ng_src/isofs_wrap.c test/ng_xorrisoburn.c test/compile_xorriso.sh test/xorriso_makefile_am.txt Adaptions to revision 241 of nglibisofs 2008.01.19.090546 [1391] test/xorriso.c Added startup message. Removed helptext sentence about unimplemented options 19 Jan 2008 [1392] test/xorriso_eng.html test/make_xorriso_standalone.sh Producing a bootstrapped xorriso standalone tarball 19 Jan 2008 [1393] test/README test/xorriso.1 test/xorriso_eng.html Some polishing of xorriso documentation 2008.01.19.162244 [1394] test/xorriso.c test/ng_xorrisoburn.c Small corrections with version number and write counter report 19 Jan 2008 [1395] test/changelog.txt Updated SVN copy of changelog 2008.01.20.102946 [1397] ng_src/burn_wrap.c ng_src/data_source.c ng_src/isoburn.c ng_src/isofs_wrap.c Made forgotten adaption to Xorriso_standalonE 2008.01.20.131050 [1398] test/xorriso.h test/xorriso_private.h test/xorriso.c test/ng_xorrisoburn.c test/xorriso.1 Made -outdev stdio:/dev/fd/1 safe for single session runs 2008.01.20.200254 [1399] test/xorriso.h test/xorriso_private.h test/xorriso.c test/xorriso.1 New option -add_plainly 2008.01.21.221939 [1400] test/xorriso.c test/xorriso.1 Rejected unsuitable addresses "stdio:" , "stdio:/", "stdio:-", "stdio:." 22 Jan 2008 [1401] + test/compare_file.c Program which compares two files in different trees. Attributes and content. 22 Jan 2008 [1402] test/configure_ac.txt Copied test for tm.tm_gmtim from libisofs configure.ac 22 Jan 2008 [1403] test/compare_file.c Prepended type indication letter to report lines 2008.01.22.224321 [1404] test/ng_xorrisoburn.c Better attributes with directories 2008.01.23.195855 [] ng_src/burn_wrap.c test/ng_xorrisoburn.c Adapted to libisofs revision 261 24 Jan 2008 [1410] test/make_xorriso_standalone.sh Removed remover of C++ comment lines 2008.01.24.202206 [1411] ng_src/isoburn.c ng_src/burn_wrap.c ng_src/isoburn.h Gave up use of libburn fifo. Attached -fs and pacifier to libisofs fifo. 2008.01.25.150902 [1413] test/xorriso.h test/xorriso.c test/xorriso.1 New option -rollback_end 25 Jan 2008 [1414] test/compare_file.c Fixed bug about file content comparison. 25 Jan 2008 [1415] test/compare_file.c Better handling of various content difference situations 2008.01.25.175353 [1416] test/xorriso.h test/xorriso.c test/xorriso.1 test/ng_xorrisoburn.c New option -commit_eject 2008.01.26.002011 [1417] - og_src/libisoburn.h - og_src/isoburn.h - og_src/isoburn.c - og_src/isofs_wrap.c - og_src/burn_wrap.c - og_src/data_source.c - og_src/ + libisoburn/ - ng_src/libisoburn.h - ng_src/isoburn.h - ng_src/isoburn.c - ng_src/isofs_wrap.c - ng_src/burn_wrap.c - ng_src/data_source.c + libisoburn/libisoburn.h + libisoburn/isoburn.h *+ libisoburn/isoburn.c *+ libisoburn/isofs_wrap.c *+ libisoburn/burn_wrap.c *+ libisoburn/data_source.c + xorriso/ - test/README - test/changelog.txt - test/compare_file.c - test/compile_xorriso.sh - test/configure_ac.txt - test/convert_man_to_html.sh - test/make_timestamp.sh - test/make_xorriso_standalone.sh - test/ng_xorrisoburn.c - test/ng_xorrisoburn.h - test/xorriso.1 - test/xorriso.c - test/xorriso.h - test/xorriso_eng.html - test/xorriso_makefile_am.txt - test/xorriso_pc_in.txt - test/xorriso_private.h - test/xorriso_timestamp.h - test/xorrisoburn.c - test/xorrisoburn.h + xorriso/README + xorriso/changelog.txt + xorriso/compare_file.c *+ xorriso/compile_xorriso.sh + xorriso/configure_ac.txt *+ xorriso/convert_man_to_html.sh *+ xorriso/make_timestamp.sh *+ xorriso/make_xorriso_standalone.sh + xorriso/xorriso.1 *+ xorriso/xorriso.c + xorriso/xorriso.h + xorriso/xorriso_eng.html + xorriso/xorriso_makefile_am.txt + xorriso/xorriso_pc_in.txt + xorriso/xorriso_private.h + xorriso/xorriso_timestamp.h *+ xorriso/xorrisoburn.c + xorriso/xorrisoburn.h Makefile.am Gave up adapter to old libisofs. Renaming libisoburn and xorriso dirs. 2008.01.26.113604 [1418] libisoburn/libisoburn.h libisoburn/burn_wrap.c xorriso/xorrisoburn.c INCOMPATIBLE API CHANGE: isoburn_initialize(char msg[1024], int flag) 2008.01.26.120534 [1419] libisoburn/libisoburn.h configure.ac version.h.in libisoburn/isoburn.c libisoburn/burn_wrap.c Introduced versioning (still pre-release) and new API function isoburn_version() 2008.01.26.140005 [1423] xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_eng.html Adapted standalone tarball to version functions 2008.01.26.142130 [1424] xorriso/xorriso.c Set program revision to 0.0.1 (previous 0.1.0 was too early) 2008.01.26.171156 [1425] libisoburn/libisoburn.h libisoburn/isoburn.c libisoburn/burn_wrap.c xorriso/xorrisoburn.c INCOMPATIBLE API CHANGE: isoburn_prepare_new_image() now gets output drive 2008.01.27.174454 [1434] xorriso/xorriso.c xorriso/xorriso.1 Changed meaning of -add relative/path 2008.01.28.105404 [1435] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Made use of iso_set_abort_severity() with option -abort_on 2008.01.28.140149 [1436] libisoburn/libisoburn.h Updated API introduction and marked API instabilities for mending (soon) 2008.01.28.171915 [1437] libisoburn/isoburn.c libisoburn/isofs_wrap.c xorriso/xorrisoburn.c xorriso/compile_xorriso.sh xorriso/make_xorriso_standalone.sh Adapted to libisofs revison 294 2008.01.28.235717 [1438] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c xorriso/xorrisoburn.c Changed struct isoburn_source_opts to opaque handle struct isoburn_imgen_opts 2008.01.29.125956 [1439] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c xorriso/xorrisoburn.c Changed struct isoburn_read_opts to opaque handle 2008.01.29.184356 [1440] configure.ac version.h.in libisoburn/libisoburn.h libisoburn/isoburn.c libisoburn/burn_wrap.c xorriso/xorrisoburn.c xorriso/configure_ac.txt New API call isoburn_is_compatible() 29 Jan 2008 [1441] libisoburn/libisoburn.h Some API documentation enhancements 2008.01.29.211543 [1443] libisoburn/burn_wrap.c Made use of newest libburn version features 2008.01.31.152131 [1449] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c xorriso/make_xorriso_standalone.sh Adapted to libisofs revision 313 2008.01.31.214647 [1450] xorriso/xorrisoburn.h libisoburn/libisoburn.h libisoburn/burn_wrap.c xorriso/make_xorriso_standalone.sh Compile time and runtime checks for library compatibility 2008.02.01.195817 [1455] configure.ac Makefile.am - libisoburn.pc.in + libisoburn-1.pc.in xorriso/README Enabled build of dynamically linked xorriso, joined -1.pc club 2008.02.01.200153 [1456] xorriso/xorriso_makefile_am.txt Corrected some false paths in xorriso-standalone Makefile.am 2008.02.02.131049 [1457] configure.ac Added version checks for libburn and libisofs (by Vreixo) 2008.02.02.131903 [1458] xorriso/xorriso.h xorriso/xorriso.c Added argument to option -commit_eject 2 Feb 2008 [1459] xorriso/xorriso_eng.html Updated to current state of development 2008.02.02.181200 [1460] xorriso/xorrisoburn.c Compile time check of libisoburn. Enforced minimum track size of 300 sectors. 2008.02.03.131525 [1466] libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/burn_wrap.c libisoburn/isofs_wrap.c xorriso/xorrisoburn.c Made use of ISO_ERR_SEV() and ISO_ERR_PRIO() 2008.02.03.155704 [1467] libisoburn/isofs_wrap.c Adapted to libisofs revisio 328 2008.02.03.164038 [1468] libisoburn/libisoburn.h libisoburn/isoburn.c xorriso/xorrisoburn.c New API call isoburn_cancel_prepared_write() 2008.02.03.164916 [1469] xorriso/xorrisoburn.c Reacted on compiler warning 2008.02.03.181259 [1470] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Made -abort_on and -report_about preemptive if given as dashed start arguments 2008.02.04.093106 [1471] libisoburn/burn_wrap.c xorriso/xorrisoburn.c Adapted to libisofs revision 332 2008.02.04.154405 [1472] libisoburn/libisoburn.h libisoburn/isoburn.c xorriso/xorrisoburn.c New API call isoburn_sync_after_write() 2008.02.04.184038 [1475] libisoburn/libisoburn.h libisoburn/isoburn.c libisoburn/burn_wrap.c libisoburn/isofs_wrap.c xorriso/xorrisoburn.c Inserted problem messages where libisoburn API produces own failures 2008.02.04.214133 [1476] libisoburn/libisoburn.h libisoburn/isoburn.c xorriso/xorrisoburn.c Added parameter to new API calls isoburn_cancel_prepared_write, isoburn_sync_after_write 2008.02.05.162621 [1477] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New option -padding 2008.02.05.175733 [1478] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorriso.1 Implemented reassure for -rollback, -rollback_end, -end, -commit, -commit_eject 2008.02.05.191456 [1479] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorriso.1 Implemented reassure for -blank, -format, -dev, -indev, -devices 2008.02.06.131028 [1480] xorriso/xorriso.c xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorrisoburn.c libisoburn/libisoburn.h libisoburn/burn_wrap.c Now loading libraries before -version, pacifier for -add 2008.02.06.153709 [1481] libisoburn/burn_wrap.c xorriso/xorriso.c xorriso/xorriso.1 xorriso/xorrisoburn.c Rectified SORRY,FAILURE,FATAL classification 2008.02.06.183423 [1484] libisoburn/burn_wrap.c xorriso/xorrisoburn.c Adapted to libisofs revision 337 2008.02.06.183557 [1485] xorriso/xorriso.c Removed some unused code 2009.02.06.184008 [1486] libisoburn/burn_wrap.c xorriso/xorrisoburn.c Added a missing 0 digit 2008.02.06.214426 [1487] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c xorriso/xorrisoburn.c Pacifier for isoburn_read_image() 2008.02.07.074248 [1489] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso_private.h Added final message to image read pacifier 2008.02.07.154947 [1490] libisoburn/data_source.c Implemented a primitive single tile cache for image reading 2008.02.07.211424 [1491] libisoburn/data_source.c Stuffed memory leak with read cache. Economized on error retries. 8 Feb 2008 [1494] - xorriso/compare_file. + test/compare_file.c - ng_src Cleaning up remainings of move to ng_src 8 Feb 2008 [1495] test/compare_file.c Fixed an endless cycle with early EOF 2008.02.08.102122 [1496] xorriso/xorriso_makefile_am.txt xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/README Added test/compare_file.c to xorriso-standalone tarball 2008.02.08.173928 [1497] 2008.02.08.174126 [1498] libisoburn/data_source.c Renamed macro which controls read caching 2008.02.08.175152 [1499] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Protecting volume ids from getting overwritten by predecessor 2008.02.08.195627 [1500] xorriso/xorriso.c Warning of -volid which are not ECMA 119 compliant 2008.02.08.215113 [1501] xorriso/xorriso.h xorriso/xorriso.c Silenced misleading toc messages with -commit_eject "in" 2008.02.09.092805 [1502] libisoburn/libisoburn.h libisoburn/isoburn.c Adapted to libisofs revision 346 2008.02.09.100750 [1503] libisoburn/libisoburn.h libisoburn/burn_wrap.c xorriso/xorriso.c xorriso/xorrisoburn.c New API function isoburn_disc_available_space() fixes bug with DVD+RW capacity 10 Feb 2008 [1504] xorriso/README Some adjustments in description of compare_file and libisoburn 2008.02.10.122020 [1505] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Fixed bugs about -mv /im/age . -cdx / -cpr di/sk im/age -- -cpr di/sk . -- 2008.02.10.130852 [1506] Makefile.am Added build of test/compare_file as noinst binary 2008.02.10.135822 [1507] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Better handling of not-yet-existing -cd 2008.02.11.094742 [1509] xorriso/xorriso_private.h xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Discarding, keeping or patching boot images from existing ISO images 2008.02.11.112917 [1510] xorriso/xorrisoburn.c Corrected message about isolinux patch option 2008.02.11.113235 [1511] xorriso/xorriso.h xorriso/xorriso.c Final UPDATE message after grafting in files from disk 2008.02.11.135418 [1512] xorriso/xorriso_private.h xorriso/xorriso.h xorriso/xorriso.c xorriso/xorriso.1 New option -return_with 2008.02.11.150123 [1513] xorriso/xorrisoburn.c isoburn_igopt_allow_full_ascii for -bootimage any keep 2008.02.11.150700 [1514] xorriso/xorriso.c xorriso/xorriso.1 Clarifications about -volid rules 11 Feb 2008 [1515] xorriso/README Adjustments about libisoburn and xorriso dynamic dependencies, compare_file 2008.02.11.162406 [1516] xorriso/xorrisoburn.c xorriso/xorriso.c Changed failure to find a file for removal from FAILURE to SORRY 2008.02.11.174517 [1517] xorriso/xorriso.c Corrected a bug about -status -return_with 2008.02.11.194807 [1519] libisoburn/burn_wrap.c xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New severity MISHAP 2008.02.11.213918 [1520] xorriso/xorrisoburn.c Mapping in burn runs -abort_on MISHAP to SORRY 2008.02.12.215327 [1521] libisoburn/burn_wrap.c xorriso/xorriso.c xorriso/xorrisoburn.c Improved MISHAP - SORRY mapping and tunneling 2008.02.14.084342 [1525] + README + COPYING + COPYRIGHT + INSTALL libisoburn/libisoburn.h Completing documentation 2008.02.14.101916 [1526] Makefile.am Adjusted EXTRA_DIST list of files 2008.02.14.120557 [1527] xorriso/xorrisoburn.c Made a final abort check before burning begins 2008.02.14.175623 [1528] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c Imprinting version of xorriso and libraries into ISO preparer_id 2008.02.14.182351 [1529] xorriso/xorrisoburn.c Made preparer_id more safe against oversize 14 Feb 2008 [1530] xorriso/xorriso.1 Polished man page 14 Feb 2008 [1531] xorriso/changelog.txt Updated changelog 2008.02.15.100001 [branch 1533] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/compile_xorriso.sh xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Made version number leap to 0.1.0 15 Feb 2008 [branch 1534] xorriso/changelog.txt Documented initial release and timestamp 15 Feb 2008 [1536] configure.ac Increased libisofs requirement to 0.6.2 ----------------------------- release - xorriso-0.1.0.pl00 - 2008.02.15.100001 * Operates on an existing ISO image or creates a new one. * Copies files from filesystem into the ISO image. * Renames or deletes file objects in the ISO image. * Changes file properties in the ISO image. * Can write result as completely new image to optical media or filesystem objects. * Can write result as add-on session to appendable multi-session media, to overwriteable media, to regular files, and to block devices. * Scans for optical drives, blanks re-useable optical media. * Reads its instructions from command line arguments, dialog, and batch files. * Provides navigation commands for interactive ISO image manipulation. * Adjustable thresholds for abort, exit value, and problem reporting. 2008.02.15.211836 [1537] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/compile_xorriso.sh xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.1.1 15 Feb 2008 [1538] COPYRIGHT Corrected according to content of libisofs/COPYRIGHT 2008.02.15.212030 [1539] xorriso/xorriso.c Changed pacifier text for 0 nodes read from blank image ------------------------------------ cycle - xorriso-0.1.1 - 2008.02.15.212030 15 Feb 2008 [1540] xorriso/changelog.txt Updated changelog 16 Feb 2008 [1543] xorriso/xorriso.1 Adjusted CREDITS text 2008.02.16.202533 [1544] xorriso/xorriso_private.h xorriso/xorrisoburn.c Transfering properties from disk to implicit directories in image path 2008.02.16.211549 [1545] xorriso/xorriso_eng.html xorriso/changelog.txt Mentioned better directory attribute copying ------------------------------------ cycle - xorriso-0.1.1 - 2008.02.16.211549 * Improved attribute transfer from disk for implicit target directories 2008.02.18.210343 [1546] xorriso/xorriso.c Bug fix: -report_about higher than NOTE did not report at all 19 Feb 2008 [1547] test/compare_file.c Improved report format 2008.02.19.184432 [1548] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option -as cdrecord emulates a narrow set of cdrecord gestures 2008.02.19.212322 [1549] xorriso/xorriso.c xorriso/xorriso_private.h xorriso/xorrisoburn.c xorriso/xorriso.1 Improved -as cdrecord 20 Feb 2008 [1550] test/compare_file.c Revoked inflation of file type characters to words 2008.02.20.234726 [1551] libisoburn/libisoburn.h libisoburn/burn_wrap.c xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New option -as mkisofs emulates a narrow set of mkisofs gestures ------------------------------------ cycle - xorriso-0.1.1 - 2008.02.21.090014 * Bug fix: -report_about HINT or higher did not report at all * Bug fix: speed=number without unit or media type letter was always CD speed * Bug fix: it was possible to write to appendable media which was not -indev * New option -as "cdrecord" emulates a narrow set of cdrecord gestures * New option -as "mkisofs" emulates a narrow set of mkisofs gestures 2008.02.21.090014 [1552] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c New option -publisher 2008.02.21.185203 [1553] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/burn_wrap.c xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Implemented a more reasonable solution for drive truncation with regular files 2008.02.21.204613 [1558] libisoburn/burn_wrap.c xorriso/xorrisoburn.c Introduced new severity ERRFILE 2008.02.21.211101 [1559] xorriso/xorriso.c Updated -help text 2008.02.22.114917 [1561] libisoburn/burn_wrap.c xorriso/xorriso.c xorriso/xorrisoburn.c Producing ERRFILE messages where appropriate 2008.02.23.101619 [1568] libisoburn/libisoburn.h Changed libisofs requirements to 0.6.3 2008.02.23.101619 [1569] libisoburn/burn_wrap.c xorriso/xorrisoburn.c Testwise implementation of libisofs.0.6.3 features 2008.02.23.101619 [1570] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorriso.1 New option -errfile_log 2008.02.23.102903 [1571] xorriso/configure_ac.txt Made libisofs version leap in xorriso-standalone 2008.02.23.113902 [1572] xorriso/xorriso.h xorriso/xorriso.c Directed -as mkisofs -print-size to real stdout 2008.02.23.125537 [1573] xorriso/xorrisoburn.c Various bugs and deviations around -as mkisofs -print-size 2008.02.23.131825 [1574] xorriso/xorrisoburn.c Wrong description text 2008.02.25.090001 [ZeroOneZero-pl01 1576 1577] libisoburn/burn_wrap.c xorriso/xorriso_timestamp.h Safety cap for ABI usage bug towards libisofs >= 0.6.2 2008.02.25.174229 [1579] libisoburn/burn_wrap.c xorriso/xorrisoburn.c Adapted to libisofs 362 from Vreixo bzr 2008.02.25.204402 [1580] xorriso/xorriso.c Adaptions of -as mkisofs and -as cdrecord to enable full use by scdbackup 25 Feb 2008 [1581] xorriso/changelog.txt Updated changelog ------------------------------------ cycle - xorriso-0.1.1 - 2008.02.25.204402 * New option -publisher * New option -errfile_log 26 Feb 2008 [1582] test/compare_file.c Avoided to read content of non-regular files 2008.02.26.213437 [1583] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option -compare 2008.02.27.185744 [1584] xorriso/xorriso.c Installed pacifier for data reading 2008.02.28.132656 [1587] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Added new action "compare" to -find 28 Feb 2008 [1588] xorriso/xorriso_eng.html Mentioned capability to write DVD+R/DL. 2008.02.28.212210 [1589] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c New option -compare_r 28 Feb 2008 [1590] xorriso/xorriso.1 New option -compare_r, new -findx -exec in_iso, -exec no_in_iso 28 Feb 2008 [1591] test/compare_file.c Micro bug fix ported from xorriso 2008.02.28.215343 [1592] xorriso/xorriso.c Better handling of disk to iso address mapping during compare runs 2008.02.29.200510 [1593] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option -update (not yet completed) 2008.03.01.151219 [1594] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option update_r, -find actions "update" and "add_missing" (not yet completed) 2008.03.02.172751 [1596] xorriso/xorrisoburn.c Made -update_r and -find -exec update safe against IsoDirIter pitfalls 2008.03.02.201455 [1597] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Made IsoDirIter workaround obey -temp_mem_limit 4 Mar 2008 [libisofs_thomas 1599 1600] Switch to Vreixo development branch 378 2008.03.04.174107 [1601] xorriso/make_xorriso_standalone.sh xorriso/xorriso_makefile_am.txt Adapted to libisofs Vreixo 378 2008.03.04.180738 [1602] xorriso/xorriso.c xorriso/xorrisoburn.c Improvements about -update_r and -compare_r 2008.03.05.125118 [1603] xorriso/xorrisoburn.c Bug fix: -follow param did not work for symbolic links ------------------------------------ cycle - xorriso-0.1.1 - 2008.03.05.125118 * Support for DVD+R/DL media * Bug fix: -follow param did not work for adding non-directory symbolic links 2008.03.05.173329 [1604] xorriso/xorriso.c xorriso/xorrisoburn.c Made -compare* and -update* obey -follow links (-follow mount still not correct) 5 Mar 2008 [1605] xorriso/xorriso.1 Some man page clarification 2008.03.06.114233 [1606] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New -find actions "rm" and "rm_r", silenced comparison results with -update* 2008.03.06.174724 [1608] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Fixed bug about non existing disk_path with -update_r 7 Mar 2008 [1609] xorriso/xorriso_eng.html Re-arranged development download part 2008.03.07.075325 [1610] xorriso/xorriso.c xorriso/xorrisoburn.c New -findx -type "m" for active mount points 2008.03.07.182411 [1611] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New -findx -exec action "empty_iso_dir", workaround for ticket 132 2008.03.07.220442 [1612] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 Made -update_r and -compare_r obey disabling of -follow "mount" 8 Mar 2008 [libisofs_thomas 1613] Switch to Vreixo development branch 383 2008.03.08.104231 [1614] xorriso/xorrisoburn.c Adapted to iso_tree_add_new_node() 8 Mar 2008 [1615] xorriso/xorriso.1 Example use case for -update_r "Incremental backup of a few directory trees" ------------------------------------ cycle - xorriso-0.1.1 - 2008.03.08.122747 * Bug fix: It was not possible to -add /THIS=a /b=THIS * New options -compare, -compare_r and according -find -exec action * New options -update, -update_r and according -find -exec action * New -find actions "rm", "rm_r", new -findx -type "m" -exec "empty_iso_dir" 2008.03.09.142200 [1616] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option -cut_out 9 Mar 2008 [libisofs_thomas 1617] Switch to Vreixo development branch 386 2008.03.09.211041 [1618] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Some polishing about -cut_out 2008.03.11.113444 [1619] xorriso/xorriso.c xorriso/xorrisoburn.c Sketched split file scheme with partno,totalparts,offset,count,totalsize 11 Mar 2008 [1620] xorriso/xorriso.1 Updated description of -cut_out ------------------------------------ cycle - xorriso-0.1.1 - 2008.03.11.113444 * New option -cut_out 2008.03.12.100001 [XorrisoZeroOneTwo 1626] xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to xorriso-0.1.2 ---------------------------------- release - xorriso-0.1.2 - 2008.03.12.100001 * Bug fix: -report_about HINT or higher did not report at all * Bug fix: speed=number without unit or media type letter was always CD speed * Bug fix: it was possible to write to appendable media which was not -indev * Bug fix: -follow param did not work for adding non-directory symbolic links * Bug fix: It was not possible to -add /THIS=a /b=THIS * Improved attribute transfer from disk for implicit target directories * New option -as "cdrecord" emulates a narrow set of cdrecord gestures * New option -as "mkisofs" emulates a narrow set of mkisofs gestures * New option -publisher * New option -errfile_log * Support for DVD+R/DL media * New options -compare, -compare_r and according -find -exec action * New options -update, -update_r and according -find -exec action * New -find actions "rm", "rm_r", new -findx -type "m" -exec "empty_iso_dir" * New option -cut_out 2008.03.12.130605 [1627] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.1.3 ------------------------------------ cycle - xorriso-0.1.3 - 2008.03.12.130605 12 Mar 2008 [XorrisoZeroOneTwo 1628] [1629] xorriso/changelog.txt Documented changes and release timestamp 2008.03.19.081837 [1637] xorriso/xorriso.c Bug fix: -as mkisofs -nopad must be -no-pad 19 Mar 2008 [1638] xorriso/xorriso.1 Added a hint about alternating media with -update_r ------------------------------------ cycle - xorriso-0.1.3 - 2008.03.19.081837 * Bug fix: -as mkisofs -no-pad was misspelled -nopad 20 Mar 2008 [1639] xorriso/README Added -commit_eject all to an example which involves mount 2008.03.20.192317 [1640] xorriso/xorriso.c Changed messages of -update and -update_r 2008.03.20.210522 [1641] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c Better handling of attempt to manipulate non-existent ISO image 2008.03.22.130031 [1642] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Working towards coordination of -compare, -update and -cut_out 2008.03.22.130128 [1643] xorriso/xorrisoburn.c Bug fix: Implicite directory attribute copying with -cut_out was wrong ------------------------------------ cycle - xorriso-0.1.3 - 2008.03.22.130128 * Bug fix: Implicite directory attribute copying with -cut_out was wrong 22 Mar 2008 [1644] xorriso/xorriso.1 Correction about Linux mount which does not accept session= with DVD. 2008.03.25.170747 [1645] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Working towards coordination of -compare, -update and -cut_out 2008.03.26.092120 [1646] xorriso/xorrisoburn.c Gave up obsoleted macros and their code branches 2008.03.27.103344 [1647] xorriso/xorriso.c xorriso/xorrisoburn.c Working towards coordination of -update and -cut_out 27 Mar 2008 [1648] xorriso/xorriso.1 Published coordination rules for -cut_out, -compare and -update 2008.03.29.164038 [1649] xorriso/xorriso_private.h xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option -split_size, automated splitting of oversized files ------------------------------------ cycle - xorriso-0.1.3 - 2008.03.29.164038 * Coordination of -cut_out, -compare and -update * New option -split_size, automated splitting of oversized files 2008.03.31.081347 [1650] xorriso/xorriso.c xorriso/xorriso.1 Adjusted documentation of -split_size 2008.04.01.213121 [1652] libisoburn/data_source.c Replaced single 128 kB cache tile by 32 tiles of 64 kB each 2 Apr 2008 [1653] COPYRIGHT Corrected GPL version ------------------------------------ cycle - xorriso-0.1.3 - 2008.04.03.074309 * Improved performance with reading directory trees 2008.04.03.204051 [1657] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New option -session_log 5 Apr 2008 [1658] xorriso/xorriso.1 Mentioned that drives close full media automatically 2008.04.05.112055 [1659] xorriso/xorrisoburn.c Reporting amount of non-data with -toc media summary 5 Apr 2008 [1660] xorriso/xorriso_eng.html Mentioned new features ------------------------------------ cycle - xorriso-0.1.3 - 2008.04.05.112055 * New option -session_log 2008.04.07.185727 [1662] xorriso/xorriso.h Added prototype of Xorriso_option_session_log() 2008.04.07.201253 [1664] xorriso/xorriso.c xorriso/xorrisoburn.c Removed some unused code 8 Apr 2008 [1677] xorriso/configure_ac.txt Followed version leaps of libburn 2008.04.08.153508 [1678] libisoburn/libisoburn.h xorriso/xorrisoburn.c Made libisoburn and xorriso require libburn >= 0.4.4 2008.04.09.114815 [1679] xorriso/xorriso.c xorriso/xorrisoburn.c Corrected behavior around image data read error 2008.04.12.112159 [1682] xorriso/xorriso.c Changed behavior of -commit_eject "" 2008.04.18.184517 [1690] libisoburn/data_source.c Restricted ds_read_block() messages about unreadable data to actual data block 2008.04.20.111054 [1692] libisoburn/data_source.c Corrected maximum age value for read buffer tiles 20 Apr 2008 [1693] xorriso/xorriso.1 Mentioned stdin with option -path_list 2008.04.20.111419 [1694] libisoburn/burn_wrap.c xorriso/xorrisoburn.c Displaying free space rather than "non-data" on drive aquiry and -toc 28 Apr 2008 [1709] xorriso/configure_ac.txt Updated libisofs version number in xorriso-standalone ------------------------------------ cycle - xorriso-0.1.3 - 2008.04.28.082539 * Now depending on libisofs-0.6.4 2008.04.28.120001 [branch 1711] configure.ac README libisoburn/libisoburn.h (isoburn_header_version_*) xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h (xorriso_libisoburn_req_*) xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.1.4 28 Apr 2008 [branch 1712] xorriso/changelog.txt Documented changes and release timestamp ---------------------------------- release - xorriso-0.1.4 - 2008.04.28.120001 * Bug fix: -as mkisofs -no-pad was misspelled -nopad * Bug fix: Implicite directory attribute copying with -cut_out was wrong * Coordination of -cut_out, -compare and -update * New option -split_size, automated splitting of oversized files * Improved performance with reading directory trees * New option -session_log * Dynamically linkable with release version 0.6.4 of libisofs 2008.04.28.122244 [1713] configure.ac README libisoburn/libisoburn.h (isoburn_header_version_*) xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h (xorriso_libisoburn_req_*) xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.1.5 28 Apr 2008 [1714] xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-0.1.5 - 2008.04.28.122244 2008.05.01.124248 [1716] libisoburn/isofs_wrap.c xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New option -error_behavior with a first occasion 'image_loading' 1 May 2008 [1717] xorriso/convert_man_to_html.sh Fine tuning of HTML man page appearance 1 May 2008 [1718] xorriso/xorriso.1 Clarified "best_effort" behavior 2008.05.01.135421 [1719] libisoburn/data_source.c Adjusted ds_read_block() to inofficial libisofs expectations 2008.05.01.174110 [1720] libisoburn/data_source.c Adjusted ds_read_block() to inofficial libisofs expectations 2008.05.02.072505 [1721] libisoburn/data_source.c Adjusted ds_read_block() to inofficial libisofs expectations 2008.05.02.204942 [1722] xorriso/xorriso_private.h xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.c Working towards exclusion of user defined absolute paths and leaf patterns 2008.05.03.151106 [1724] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c Working towards exclusion of user defined absolute paths and leaf patterns 2008.05.03.223204 [1725] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c Working towards exclusion of user defined absolute paths and leaf patterns 2008.05.04.133525 [1726] xorriso/xorriso.c xorriso/xorriso.1 New options -not_paths, -not_leaf, -not_list, -not_mgt, -as mkisofs -m 4 May 2008 [1727] xorriso/xorriso_eng.html xorriso/changelog.txt Mentioned new options ------------------------------------ cycle - xorriso-0.1.5 - 2008.05.04.133525 * New option -error_behavior with a first occasion 'image_loading' * New options -not_paths, -not_leaf, -not_list, -not_mgt, -as mkisofs -m 2008.05.05.210317 [1728] xorriso/xorrisoburn.c After formatting DVD-RW write 128 MB and close track to end Intermediate State 2008.05.06.084439 [1731] xorriso/xorrisoburn.c Calling isoburn_cancel_prepared_write() after failed isoburn_disc_write() 2008.05.06.144606 [1732] libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c libisoburn/burn_wrap.c Experiment for TOC on overwriteables: Keep a target_head copy of session #1 2008.05.07.071427 [1737] libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/burn_wrap.c libisoburn/isofs_wrap.c Removed some outdated ifdef cases 2008.05.07.175508 [1738] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/burn_wrap.c Reading emulated toc info from overwriteable media, new API isoburn_toc_*() 2008.05.07.175640 [1739] xorriso/xorrisoburn.c Making use of new isoburn_toc_* functions 2008.05.07.214343 [1740] libisoburn/libisoburn.h libisoburn/burn_wrap.c New API function isoburn_read_iso_head() 2008.05.07.214442 [1741] xorriso/xorrisoburn.c New format with -toc is more concise and shows volume id 2008.05.08.141054 [1742] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/burn_wrap.c Try to read header chain from alleged -ROM media (e.g. DVD+RW in -ROM drive) 2008.05.08.141920 [1743] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 xorriso/xorriso_eng.html New TOC layout with volume id and sbsector=, new option -rom_toc_scan 8 May 2008 [1744] xorriso/xorriso_eng.html Mentioned new features ------------------------------------ cycle - xorriso-0.1.5 - 2008.05.08.141920 * Emulated TOC on overwriteable media * New TOC layout with volume id and sbsector= * New option -rom_toc_scan 2008.05.08.185350 [1745] libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/burn_wrap.c Adjusted reply of isoburn_disc_get_msc1() to eventual -rom_toc_scan result 8 May 2008 [1746] xorriso/xorriso.1 Updated man page examples 8 May 2008 [1747] xorriso/xorriso.1 Updated man page examples ------------------------------------ cycle - xorriso-0.1.5 - 2008.05.08.205551 9 May 2008 [1751] xorriso/xorriso_eng.html Updated details in web page 2008.05.09.205517 [1752] libisoburn/isofs_wrap.c Trying to better handle non ISO images on -indev 10 May 2008 [1761] xorriso/configure_ac.txt Adapted xorriso standalone production to new libburn cycle 0.4.7 10 May 2008 [1762] xorriso/xorriso.1 xorriso/xorriso_eng.html Minor change in -update_r example 2008.05.10.194336 [1763] xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.c Better behavior of update_r with no image present 2008.05.12.080812 [1765] configure.ac libisoburn/libisoburn.h Switched requirements to libburn-0.4.6 2008.05.12.081331 [1766] libisoburn/libisoburn.h libisoburn/burn_wrap.c New API call isoburn_set_msc1() 2008.05.12.082733 [1767] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 xorriso/xorriso_eng.html New option -load session|track|sbsector|volid ------------------------------------ cycle - xorriso-0.1.5 - 2008.05.12.082733 * New option -load session|track|sbsector|volid * Now depending on libburn-0.4.6 2008.05.12.193341 [1768] libisoburn/burn_wrap.c Reacted on harmless compiler warning 2008.05.12.193642 [1769] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New -blank and -format modes as_needed 2008.05.13.115901 [1770] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 xorriso/xorriso_eng.html New option -list_formats 2008.05.13.135251 [1771] libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c libisoburn/burn_wrap.c xorriso/xorrisoburn.c xorriso/xorriso.1 Corrected strange behavior with non-ISO images on overwriteable media 2008.05.13.153837 [1772] xorriso/xorrisoburn.c Prepared Xorriso_get_profile() for potential call without flag bit1 2008.05.13.180624 [1773] xorriso/xorrisoburn.c Handled -list_format with non MMC drives 2008.05.13.180912 [1774] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorriso.1 Eat up leading dashes with command options, convert inner dashes to underscores ------------------------------------ cycle - xorriso-0.1.5 - 2008.05.13.180912 * New -blank and -format modes as_needed * New option -list_formats 2008.05.14.114548 [1775] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New -format types by_index and fast_by_index 2008.05.14.173201 [1779] configure.ac libisoburn/libisoburn.h Required libburn version is now 0.4.7 (because of DVD-RAM BD-RE bug fix) 2008.05.14.173430 [1780] xorriso/xorrisoburn.c Automatic fast format on attempt to write to unformatted DVD-RAM or BD-RE 2008.05.14.174846 [1781] xorriso/xorriso_private.h Uploaded forgotten enhancements 2008.05.15.092028 [1783] xorriso/xorriso.c Enabled a pacifier for compare_r 2008.05.15.150041 [1784] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 xorriso/xorriso_eng.html New options -map and -map_single 2008.05.15.192118 [1785] xorriso/xorriso.c Bug fix: -update_r and others did not work properly with relative paths ------------------------------------ cycle - xorriso-0.1.5 - * New options -map and -map_single * Bug fix: -update_r and others did not work properly with relative paths 2008.05.17.162753 [1794] xorriso/xorriso.c xorriso/xorrisoburn.c Corrected ugly message with -update_r and root directory 2008.05.17.170001 [1796] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.1.6, requiring libburn-0.4.8 now 2008.05.18.070001 [1797] xorriso/xorriso.c xorriso/xorrisoburn.c Bug fix: -findi operated on nodes which ceased existence shortly before 18 May 2008 [1799] xorriso/changelog.txt Documented changes and release timestamp ---------------------------------- release - xorriso-0.1.6 - 2008.05.18.070001 * New option -error_behavior with a first occasion 'image_loading' * New options -not_paths, -not_leaf, -not_list, -not_mgt, -as mkisofs -m * Emulated TOC on overwriteable media * New TOC layout with volume id and sbsector= * New option -rom_toc_scan * New option -load session|track|sbsector|volid * Now depending on libburn-0.4.8 * New -blank and -format modes as_needed * New option -list_formats * New options -map and -map_single * Bug fix: -update_r and others did not work properly with relative paths * Bug fix: -findi operated on nodes which ceased existence shortly before 2008.05.18.082208 [1798] xorriso/xorriso.c xorriso/xorrisoburn.c Bug fix: -findi operated on nodes which ceased existence shortly before 2008.05.18.084729 [1800] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/changelog.txt Version leap to 0.1.7, requiring libburn-0.4.8 now ------------------------------------ cycle - xorriso-0.1.7 - 2008.05.18.084729 2008.05.20.075142 [1804] xorriso/xorriso.c Making Xorriso_prescan_args() safe against misunderstandings 2008.05.22.192618 [1808] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c First experiments of osirrox ISO-to-disk copying 2008.05.22.192737 [1809] libisoburn/data_source.c Removed outdated code branch 2008.05.22.210835 [1810] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New options -osirrox and -cpx 2008.05.24.092546 [1812] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Enabled osirrox of more file types, curbed with device files 2008.05.24.092853 [1813] libisoburn/isoburn.c Bug fix: modifying to overwriteable target yielded unmountable results ------------------------------------ cycle - xorriso-0.1.7 - 2008.05.24.092853 * Bug fix: Modifying to overwriteable target yielded unmountable results * New options -osirrox and -cpx 2008.05.24.170109 [1814] xorriso/xorriso.c xorriso/xorrisoburn.c Some polishing with -cpx 26 May 2008 [1815] xorriso/configure_ac.txt standalone version switch to libisofs-0.6.5 2008.05.26.181210 [1816] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c Improved access permission restauration by osirrox 2008.05.27.201513 [1817] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 xorriso/xorriso_eng.html New option -stream_recording 2008.05.31.174045 [1819] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 Implemented concatenation of split files during -cpx ------------------------------------ cycle - xorriso-0.1.7 - 2008.05.31.174045 * New option -stream_recording 2008.06.01.134322 [1820] xorriso/xorrisoburn.c Reacted on harmless compiler warning 2008.06.01.145038 [1821] xorriso/configure_ac.txt standalone version switch to libisofs-0.6.6 2008.06.01.145155 [1822] configure.ac libisoburn/libisoburn.h Switched requirements to libisofs-0.6.6 ------------------------------------ cycle - xorriso-0.1.7 - 2008.06.01.145155 * Bug fix: major,minor numbers of device files appeared as 0,1 in next session 2008.06.02.070301 [1824] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.1.8 2 Jun 2008 [1825] xorriso/changelog.txt Documented changes and release timestamp ---------------------------------- release - xorriso-0.1.8 - 2008.06.02.070301 * Bug fix: Modifying to overwriteable target yielded unmountable results * Bug fix: major,minor numbers of device files appeared as 0,1 in next session * New option -stream_recording for full speed with DVD-RAM and BD-RE * New options -osirrox and -cpx allow to extract single files from ISO image 2008.06.02.141334 [1826] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.1.9 2 Jun 2008 [1827] xorriso/changelog.txt Documented changes and release timestamp 2 Jun 2008 [1828] xorriso/xorriso.1 Beautified documentation of -osirrox ------------------------------------ cycle - xorriso-0.1.9 - 2008.06.02.141334 5 Jun 2008 [1834] xorriso/convert_man_to_html.sh Beautified HTML man page 2008.06.05.165023 [1835] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New options -cpax, -cp_rx, -cp_rax to restore files and trees from ISO to disk 2008.06.06.083432 [1839] xorriso/xorriso.c Bug fix: -chmod unintentionally performed o-x as first operation 2008.06.06.103735 [1840] xorriso/xorrisoburn.c xorriso/xorriso.1 Fine tuning of directory attribute copying with -cp_rx ------------------------------------ cycle - xorriso-0.1.9 - * New options -cpax, -cp_rx, -cp_rax to restore files and trees from ISO to disk * Bug fix: -chmod unintentionally performed o-x as first operation 2008.06.09.134432 [1841] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Allowing to restore from image with pending changes 2008.06.09.165735 [1842] xorriso/xorriso.c xorriso/xorrisoburn.c Removed some outdated code parts 2008.06.10.094304 [1844] libisoburn/isoburn.c libisoburn/burn_wrap.c Removed outdated code parts 2008.06.10.100231 [1845] xorriso/xorrisoburn.c Removed outdated code parts 2008.06.11.131607 [1846] xorriso/xorrisoburn.c xorriso/xorriso.1 Proper handling of restore overwrite situations with directories and softlinks ------------------------------------ cycle - xorriso-0.1.9 - 2008.06.11.131607 2008.06.12.112644 [1847] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Corrections about restoring of directories ------------------------------------ cycle - xorriso-0.1.9 - 2008.06.12.112644 2008.06.13.151630 [1848] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option -paste_in 2008.06.14.104745 [1849] xorriso/xorriso.c xorriso/xorriso.1 xorriso/xorriso_eng.html New options -extract and -extract_single 14 Jun 2008 [1850] xorriso/convert_man_to_html.sh Beautification of HTML man page 2008.06.14.140459 [1851] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Correction about -extract / / 2008.06.14.184512 [1854] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorriso.1 xorriso/convert_man_to_html.sh Gave up the unusual parameter sequences of -extract and -paste_in ------------------------------------ cycle - xorriso-0.1.9 - 2008.06.14.184512 * New option -paste_in to copy ISO files into parts of disk files * New option -extract restores with arguments of -map or -update_r 2008.06.17.121524 [1857] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorriso.1 New options -map_l, -compare_l, -update_l, -extract_l 2008.06.17.133914 [1858] xorriso/xorriso.c Reacted on harmless compiler warning 2008.06.17.170622 [1859] xorriso/xorriso.c xorriso/xorrisoburn.c Fixed a bug about -update_l 2008.06.18.132057 [1860] libisoburn/isoburn.h libisoburn/burn_wrap.c Made -rom_toc_scan work on closed DVD-R in a DVD-ROM drive 2008.06.18.161512 [1861] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c libisoburn/burn_wrap.c libisoburn/data_source.c New API functions isoburn_preset_msgs_submit(), isoburn_set_msgs_submit() 2008.06.18.161723 [1862] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.c Made use of isoburn_preset_msgs_submit() ------------------------------------ cycle - xorriso-0.1.9 - 2008.06.18.161723 * New options -map_l, -compare_l, -update_l, -extract_l * New API functions isoburn_set_msgs_submit(), isoburn_drive_set_msgs_submit() 2008.06.18.192913 [1863] libisoburn/burn_wrap.c Improved pacifier with -rom_toc_scan 2008.06.19.090436 [1864] libisoburn/libisoburn.h libisoburn/burn_wrap.c xorriso/xorrisoburn.c Renamed isoburn_*set_msgs_submit() and slightly changed meaning 2008.06.19.092458 [1865] libisoburn/burn_wrap.c Corrected wrong size unit MB to kB in toc scan pacifier text 2008.06.20.091647 [1866] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New -osirrox option auto_chmod_on ------------------------------------ cycle - xorriso-0.1.9 - 2008.06.20.091647 2008.06.20.164105 [1867] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Fixed several bugs with restore operations 2008.06.21.180701 [1870] xorriso/xorriso.1 Corrected mistake in xorriso man page ------------------------------------ cycle - xorriso-0.1.9 - 2008.06.21.180701 2008.06.22.080000 [1872] xorriso/xorriso.c Removed duplicated help text snippet 2008.06.22.090001 [1873] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.2.0 22 Jun 2008 [1874] xorriso/changelog.txt Documented changes and release timestamp ---------------------------------- release - xorriso-0.2.0 - 2008.06.22.090001 * Bug fix: -chmod unintentionally performed o-x as first operation * New options -cpax, -cp_rx, -cp_rax to restore files and trees from ISO to disk * New option -extract restores with arguments of -map or -update_r * New option -paste_in to copy ISO files into parts of disk files * New options -map_l, -compare_l, -update_l, -extract_l * New API functions isoburn_set_msgs_submit(), isoburn_drive_set_msgs_submit() 2008.06.22.111236 [1875] xorriso/xorriso.c Removed duplicated help text snippet 2008.06.22.135202 [1876] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.2.1 22 Jun 2008 [1877] xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-0.2.1 - 2008.06.22.135202 2008.06.27.124201 [1880] xorriso/xorrisoburn.c Bug fix: -as cdrecord -atip falsely announced overwriteable DVD-RW to sdvdbackup 2008.06.27.130235 [1881] xorriso/xorriso.c Extended -as cdrecord blank= by blank type format_overwrite ------------------------------------ cycle - xorriso-0.2.1 - 2008.06.27.130235 2008.07.03.133023 [1882] xorriso/xorriso.c Flushing stdout after each result text to deconfuse stdout/stderr with SSH 2008.07.04.070001 [1884] xorriso/xorriso.c Supporting option -as cdrecord -waiti 2008.07.05.132528 [1885] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c libisoburn/burn_wrap.c libisoburn/data_source.c New API function isoburn_prepare_blind_grow() for -as mkisofs -multi 2008.07.05.133721 [1886] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New option -grow_blindly 2008.07.05.180241 [1887] libisoburn/isoburn.c Fixed a bug with -grow_blindly to overwriteable media 2008.07.05.182424 [1888] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorriso.1 New options -C and -M for -as mkisofs 2008.07.05.184434 [1889] xorriso/xorriso.c Cared for a peculiarity of growisofs when using mkisofs -C 5 Jul 2008 [1890] xorriso/xorriso_eng.html Updated xorriso homepage ------------------------------------ cycle - xorriso-0.2.1 - 2008.07.05.184434 * New API function isoburn_prepare_blind_grow() * New option -grow_blindly * New options -C and -M for -as mkisofs emulation 2008.07.06.110336 [1891] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Improved effective drive address with -as mkisofs -M 2008.07.07.095531 [1892] xorriso/xorriso.c Fixed bug about -as mkisofs without -C 2008.07.07.102941 [1893] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c Semi-permanent emulation by start names xorrisofs,genisofs,mkisofs,genioimage ------------------------------------ cycle - xorriso-0.2.1 - 2008.07.07.102941 2008.07.07.150241 [1894] xorriso/xorriso.c Correction about -as mkisofs -C if already an input device was set 2008.07.07.150337 [1895] libisoburn/isoburn.c Correction about isoburn_igopt_get_effective_lba() with blind growing 7 Jul 2008 [1896] xorriso/xorriso.1 Clarification about -grow_blindly predicted_nwa 2008.07.07.150337 [1897] xorriso/xorriso.c xorriso/xorriso.1 Made leafname triggered emulation more similar to -as emulation 2008.07.08.092732 [1898] Makefile.am README xorriso/xorriso_makefile_am.txt xorriso/README Installing softlinks xorrisofs and osirrox pointing to the xorriso binary 2008.07.08.102622 [1899] xorriso/xorriso_private.h Header file forgotten with rev 1897 2008.07.08.132054 [1900] xorriso/xorriso.c xorriso/xorrisoburn.c Avoided misleading message about emptied ISO image during -as mkisofs -C 8 Jul 2008 [1901] xorriso/xorriso_eng.html Documented newest progress ------------------------------------ cycle - xorriso-0.2.1 - 2008.07.08.132054 * Can serve growisofs if started as xorrisofs, genisofs, mkisofs, genisoimage * make install creates xorriso aliases as symbolic links: osirrox, xorrisofs 2008.07.09.055133 [1901] xorriso/xorriso.c Avoided to use MMC code with -as mkisofs -M by prepending stdio: to address 2008.07.09.055133 [1902] xorriso/xorriso.h xorriso/xorriso.c Fixed bug with -as mkisofs -x and pattern expansion ------------------------------------ cycle - xorriso-0.2.1 - 2008.07.09.055133 2008.07.09.155540 [1903] Makefile.am xorriso/xorriso_private.h + xorriso/xorriso_buildstamp.h + xorriso/xorriso_buildstamp_none.h xorriso/xorriso_makefile_am.txt xorriso/make_xorriso_standalone.sh Opportunity to generate build timestamp via make buildstamped 9 Jul 2008 [1904] xorriso/xorriso_makefile_am.txt Completed (unused) dist rule of standalone-xorriso 2008.07.10.141731 [1905] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 Enabled -multi and -msinfo with -as cdrecord 2008.07.10.141913 [1906] libisoburn/libisoburn.h Small correction in API introduction text 2008.07.10.144535 [1907] xorriso/xorriso_private.h Header file forgotten with rev 1903 2008.07.10.162809 [1908] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorriso.1 cdrecord emulation by start names xorrecord, cdrecord, wodim, cdrskin 2008.07.10.164015 [1909] xorriso/xorriso.c Reacted on compiler warning 2008.07.10.164412 [1910] Makefile.am README xorriso/xorriso_makefile_am.txt xorriso/README Installing softlink xorrecord pointing to the xorriso binary 10 Jul 2008 [1911] xorriso/xorriso.1 xorriso/xorriso_eng.html xorriso/convert_man_to_html.sh Some documentation updates ------------------------------------ cycle - xorriso-0.2.1 - 2008.07.10.164412 * New options -multi and -msinfo for -as cdrecord emulation * make install creates xorriso alias as symbolic link: xorrecord 2008.07.12.181846 [1912] libisoburn/libisoburn.h libisoburn/burn_wrap.c New info mode 2 with isoburn_read_iso_head() 2008.07.12.184833 [1913] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New options --grow_overwriteable_iso and write_start_address= with -as cdrecord 2008.07.14.114515 [1918] libisoburn/libisoburn.h Required libburn version is now 0.4.9 2008.07.14.114613 [1919] configure.ac Did LT_CURRENT++, LT_AGE++ which was forgotten with revision 1885 2008.07.14.120527 [1920] libisoburn/libisoburn.h libisoburn/burn_wrap.c New flag options with isoburn_read_iso_head() 2008.07.14.125133 [1921] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New option -isosize with -as cdrecord 14 Jul 2008 [1923] xorriso/convert_man_to_html.sh Small correction with a sed expression 2008.07.15.063040 [1924] xorriso/xorriso_makefile_am.txt Generating automatic build timestamp 2008.07.15.121754 [1925] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option tsize= with -as cdrecord ------------------------------------ cycle - xorriso-0.2.1 - 2008.07.15.121754 * New options --grow_overwriteable_iso and write_start_address= with -as cdrecord * New options -isosize and tsize= with -as cdrecord 2008.07.16.130711 [1933] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New option -pacifier, more compatible pacifier with -as mkisofs 2008.07.16.130758 [1934] xorriso/configure_ac.txt Updated xorriso standalone configure.ac version number BURN_*_VERSION 2008.07.16.130841 [1935] libisoburn/libisoburn.h Required libburn version is now 0.5.0 2008.07.16.131110 [1936] configure.ac Required libburn version is now 0.5.0 2008.07.16.140043 [1937] xorriso/xorriso.c xorriso/xorriso.1 Recognizing "b" as speed factor for BD media ------------------------------------ cycle - xorriso-0.2.1 - 2008.07.16.140043 * New option -pacifier, more compatible pacifier with -as mkisofs 2008.07.17.110812 [1939] libisoburn/libisoburn.h libisoburn/burn_wrap.c Ability to emulate a featured bug with mkisofs -C : read 16 block too early 2008.07.17.111411 [1940] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Rectified usage of original xorriso options underneath growisofs 2008.07.17.183024 [1941] libisoburn/burn_wrap.c Recognizing growisofs follow-up sessions on xorriso overwriteables 2008.07.17.184520 [1942] libisoburn/burn_wrap.c xorriso/xorriso.c xorriso/xorrisoburn.c Removed MULTI construction site remarks ------------------------------------ cycle - xorriso-0.2.1 - 2008.07.17.184520 2008.07.18.120001 [1944] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt 18 Jul 2008 [1946] README xorriso/README Corrected outdated statement about minimum library requirements ---------------------------------- release - xorriso-0.2.2 - 2008.07.18.120001 * New API function isoburn_prepare_blind_grow() * New option -grow_blindly * Options -C and -M for -as mkisofs emulation * Can serve growisofs if started as xorrisofs, genisofs, mkisofs, genisoimage * make install creates aliases as symbolic links: osirrox, xorrisofs, xorrecord * Options for -as cdrecord emulation: -multi, -msinfo, -isosize, tsize, --grow_overwriteable_iso, write_start_address, * New option -pacifier, more compatible pacifier with -as mkisofs 2008.07.18.135540 [1947] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/changelog.txt Version leap to 0.2.3 ------------------------------------ cycle - xorriso-0.2.3 - 2008.07.18.135540 2008.07.19.113048 [1949] Makefile.am xorriso/compile_xorriso.sh Introduced automatic buildstamp generation for dynamic library version 2008.07.21.155324 [1950] Makefile.am xorriso/xorriso_makefile_am.txt Reacting on ticket 138 by stick, revoked buildstamp due to ugly make install 2008.07.21.161826 [1951] Makefile.am xorriso/xorriso_makefile_am.txt Used quotation marks as does ./bootstrap when generating Makefile.in ------------------------------------ cycle - xorriso-0.2.3 - 2008.07.21.161826 * Bug fix: Variable DESTDIR was not properly respected during make install 2008.07.23.080001 [xorriso-0.2.2.pl01] Makefile.in xorriso/xorriso_timestamp.h xorriso/changelog.txt * Bug fix: external make variable DESTDIR was not used by xorriso link creation ------------------------------- patch - xorriso-0.2.2.pl01 - 2008.07.23.080001 * Bug fix: Variable DESTDIR was not properly respected during make install 2008.07.26.075027 [1953] libisoburn/burn_wrap.c Producing on overwriteables a partial TOC up to first damaged superblock 2008.08.01.101355 [1955] xorriso/xorrisoburn.c Better finish time estimation with -pacifier mkisofs 2008.08.01.141210 [1956] xorriso/xorrisoburn.c Better finish time estimation with -pacifier mkisofs 2008.08.06.143825 [1967] xorriso/xorriso_private.h Removed obsolete type definition 2008.08.06.143922 [1968] xorriso/xorrisoburn.c Removed obsolete function 2008.08.07.112529 [1972] xorriso/xorriso.c Minor changes around display of time and byte counts 2008.08.09.160515 [1977] configure.ac libisoburn/libisoburn.h Demanding libburn-0.5.1 now 2008.08.09.160947 [1978] libisoburn/burn_wrap.c Create emulated toc entry for simple ISO session on overwriteable media 2008.08.09.161311 [1979] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Evaluating readability of media 2008.08.11.201604 [1980] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Adapted media evaluation to CD peculiarities 2008.08.13.185434 [1981] libisoburn/libisoburn.h Corrected documentation of isoburn_disc_get_msc1() 2008.08.13.190704 [1982] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c New capability to redirect program output used for toc in sector map file 2008.08.14.220520 [1983] libisoburn/burn_wrap.c Changed wrong update message from MB to kB 2008.08.14.221412 [1984] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option -check_media 2008.08.15.102849 [1985] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c Allowed independent redirecton of result and info channel 2008.08.15.155421 [1986] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 Enabled printing of sector bitmaps by use=sector_map 15 Aug 2008 [1987] xorriso/xorriso_eng.html Mentioned progress of development version 2008.08.17.220043 [1988] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 -find tests -damaged and -lba_range, new -find action report_damage 2008.08.17.221350 [1989] xorriso/xorrisoburn.c xorriso/xorriso_eng.html Reacted on compiler warning ------------------------------------ cycle - xorriso-0.2.3 - * Included libburn has enhanced Linux drive access and listing code * New option -check_media * New -find test -damaged, new -find action "report_damage" 2008.08.18.134140 [1990] xorriso/xorrisoburn.c xorriso/README xorriso/xorriso.1 New -find action report_lba 2008.08.20.101410 [2000] xorriso/configure_ac.txt Adopted to new libburn version 0.5.3 2008.08.20.121008 [2002] libisoburn/libisoburn.h configure.ac Demanding libburn-0.5.2 now 2008.08.20.181734 [2003] xorriso/xorrisoburn.c Made -check_media process first 32 blocks of a multi-session overwriteable 2008.08.21.070602 [2004] xorriso/xorriso.c Synced -lsl display of major,minor numbers with /usr/include/sys/sysmacros.h 2008.08.22.231051 [2005] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New -check_media option -patch_lba0= 2008.08.24.100552 [2007] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 xorriso/xorriso_eng.html New -error_behavior behavior occasion "file_extraction" 2008.08.24.124424 [2008] xorriso/xorrisoburn.c Fixed a bug with -check_media use=outdev 2008.08.24.125257 [2009] xorriso/xorrisoburn.c Reacted on compiler warning ------------------------------------ cycle - xorriso-0.2.3 - 2008.08.24.125257 * New -find action "report_lba" * New -error_behavior behavior occasion "file_extraction" 2008.08.24.160001 [2011] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.2.4 24 Aug 2008 [2012] xorriso/changelog.txt Documented changes and release timestamp 24 Aug 2008 [2013] configure.ac Corrected ISOBURN_MICRO_VERSION ---------------------------------- release - xorriso-0.2.4 - 2008.08.24.160001 * Included libburn has enhanced Linux drive access and listing code * New option -check_media * New -find test -damaged, new -find actions "report_damage", "report_lba" * New -error_behavior occasion "file_extraction" 2008.08.24.173217 [2014] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.2.5 24 Aug 2008 [2015] xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-0.2.5 - 2008.08.24.173217 26 Aug 2008 [2017] xorriso/convert_man_to_html.sh Adjusted HTML generator to recent man page changes 2008.08.26.163254 [2018] libisoburn/libisoburn.h libisoburn/data_source.c xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/configure_ac.txt Adopting next development step of libisofs 26 Aug 2008 [2019] xorriso/xorriso.1 Adjusted man page statements about file size limits 2008.08.27.121211 [2020] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New option -file_size_limit, -as mkisofs now supports -iso-level 1 to 3 2008.08.27.122127 [2021] xorriso/xorriso.c Reacted on compiler warning ------------------------------------ cycle - xorriso-0.2.5 - 2008.08.27.122127 * Capability to insert and extract files far larger than 4 GB * New option -file_size_limit, -as mkisofs now supports -iso-level 1 to 3 27 Aug 2008 [2022] xorriso/xorriso.1 Corrected a typo in man page 2008.09.02.164803 [2025] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option -extract_cut 2008.09.03.143218 [2026] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New -error_behavior "file_extraction" behavior "best_effort" 2008.09.04.100158 [2027] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New option -check_media_defaults ------------------------------------ cycle - xorriso-0.2.5 - 2008.09.04.100158 * New option -extract_cut * New -error_behavior "file_extraction" behavior "best_effort" * New option -check_media_defaults 2008.09.05.095344 [2028] xorriso/xorriso_private.h xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New option -list_delimiter 5 Sep 2008 [2029] xorriso/xorriso_eng.html Updated development feature list 2008.09.05.114936 [2030] xorriso/xorriso.c -commit_eject, -alter_date, -alter_date_r, -pacifier, -prog_help had wrong argument count prediction 5 Sep 2008 [2031] xorriso/xorriso.1 Documented forgotten option -publisher 5 Sep 2008 [2032] xorriso/xorriso_eng.html xorriso/xorriso.1 Minor documentation polishing ------------------------------------ cycle - xorriso-0.2.5 - 2008.09.05.114936 * New option -list_delimiter 6 Sep 2008 [2033] xorriso/xorriso_eng.html xorriso/xorriso.1 Documentation polishing 2008.09.07.144714 [2034] xorriso/xorrisoburn.c Removed outdated alternative code for support of libisofs-0.6.6 2008.09.08.094748 [2035] xorriso/xorriso.c xorriso/xorrisoburn.c Made use of new libisofs call iso_image_update_sizes() 2008.09.08.121548 [2036] xorriso/xorrisoburn.c Bug fix: -format full did not re-format already formatted DVD+RW 2008.09.09.082406 [2037] xorriso/xorrisoburn.c Smoothened time estimation with pacifier mkisofs style 9 Sep 2008 [2038] xorriso/xorriso_eng.html Updated web page ------------------------------------ cycle - xorriso-0.2.5 - 2008.09.09.082406 * Bug fix: -format full did not re-format already formatted DVD+RW 2008.09.11.114227 [2040] xorriso/xorrisoburn.c Issuing message at begin of image loading 2008.09.13.204455 [2047] xorriso/xorrisoburn.c Correction about -check_media report and message about image loading 2008.09.16.060427 [2053] xorriso/xorriso.c xorriso/xorrisoburn.c Corrected pacifier text (Ticket 141) 2008.09.16.185206 [2054] xorriso/xorriso_private.h xorriso/xorriso.1 Corrected falsely computed default setting of -file_size_limit 2008.09.17.193824 [2056] xorriso/xorrisoburn.c Corrected message duplication about emulated sessions on overwriteable media 2008.09.19.090619 [2057] [2058] xorriso/configure_ac.txt standalone version switch to libisofs-0.6.8 19 Sep 2008 [2059] xorriso/xorriso.1 Small change in man page 2008.09.19.104424 [2060] configure.ac libisoburn/libisoburn.h Switched requirements to libisofs-0.6.8 ------------------------------------ cycle - xorriso-0.2.5 - 2008.09.19.104424 2008.09.19.122656 [2061] xorriso/xorrisoburn.c Changed WARNING about non-writeable media to NOTE severity of blank messages 2008.09.19.180001 [2066] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.2.6 20 Sep 2008 [2067] xorriso/changelog.txt Documented changes and release timestamp ---------------------------------- release - xorriso-0.2.6 - 2008.09.19.180001 * Capability to insert and extract files far larger than 4 GB * New option -file_size_limit, -as mkisofs now supports -iso-level 1 to 3 * New option -extract_cut * New -error_behavior "file_extraction" behavior "best_effort" * New option -check_media_defaults * New option -list_delimiter * Bug fix: -format full did not re-format already formatted DVD+RW 2008.09.20.093140 [2068] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.2.7 20 Sep 2008 [2069] xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-0.2.7 - 2008.09.20.093140 2008.09.24.155424 [2077] xorriso/xorrisoburn.c Trying to get pacifiers of simultaneously running emulations into sync 2008.09.26.120934 [2082] xorriso/xorriso.c Bug fix: -as mkisofs -iso-level was accused to be an unknown option 2008.09.26.161331 [2083] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 A first attempt on making bootable ISO images 2008.09.28.112850 [2084] xorriso/configure_ac.txt Standalone version switch to libisofs-0.6.9 (vreixoml 387) to avoid SIGSEGV 2008.09.28.113256 [2085] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 xorriso/convert_man_to_html.sh xorriso/xorriso_eng.html Made -boot_image isolinux activation obey -overwrite setting 2008.09.30.102243 [2088] libisoburn/libisoburn.h Requiring libisofs-0.6.9 because of bug fixes with El Torito 2008.09.30.102753 [2089] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Adjustments about -boot_image after testing with various media types 30 Sep 2008 [2090] xorriso/xorriso_eng.html Mentioned progress and bug fixes in 0.2.7 ------------------------------------ cycle - xorriso-0.2.7 - 2008.09.30.102753 * Bug fix: -as mkisofs -iso-level was accused to be an unknown option * Ability to write and maintain bootable ISO images based on ISOLINUX 2008.09.30.174925 [2091] xorriso/xorrisoburn.c xorriso/xorriso.1 Small adjustments about -boot_image 2008.10.02.092354 [2092] xorriso/xorrisoburn.c xorriso/xorriso.1 Small adjustments about -boot_image 2008.10.02.092635 [2093] xorriso/xorriso.c Enabled -as cdrecord blank=as_needed 2008.10.02.105442 [2094] xorriso/README xorriso/configure_ac.txt Introduced xorriso-standalone ./configure option --disable-libreadline 2008.10.02.110828 [2095] README xorriso/README xorriso/configure_ac.txt Fine tuning about ./configure option --disable-libreadline ------------------------------------ cycle - xorriso-0.2.7 - 2008.10.02.110828 * New ./configure option --disable-libreadline to make binary more portable 4 Oct 2008 [2099] xorriso/convert_man_to_html.sh xorriso/xorriso.1 Relocated the El Torito paragraph in man xorriso 2008.10.05.075432 [2101] libisoburn/libisoburn.h libisoburn/burn_wrap.c xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 -rom_toc_scan nonrom_off disables toc emulation on overwriteables 2008.10.05.093703 [2105] xorriso/xorrisoburn.c Bug fix: Random target filenames with looping symbolic links 2008.10.05.125046 [2109] xorriso/configure_ac.txt Adapted standalone BURN_*_VERSION to libburn 0.5.5 2008.10.05.125242 [2110] configure.ac libisoburn/libisoburn.h libisoburn now demands libburn-0.5.4 ------------------------------------ cycle - xorriso-0.2.7 - 2008.10.05.125242 * Bug fix: -follow link attributed random target filenames to looping links 2008.10.06.114114 [2113] xorriso/configure_ac.txt Adapted standalone LIBISOFS_*_VERSION to libisofs 0.6.10 2008.10.06.114845 [2114] configure.ac libisoburn/libisoburn.h libisoburn now demands libisofs-0.6.10 ------------------------------------ cycle - xorriso-0.2.7 - 2008.10.06.114845 7 Oct 2008 [2115] xorriso/xorriso.1 Polished man xorriso 2008.10.08.135848 [2116] xorriso/xorriso.c xorriso/xorriso.1 Changed newly introduced -rom_toc_scan nonrom_off to off:emul_off 2008.10.09.145926 [2117] configure.ac README Introduced libburn ./configure option --disable-libreadline 9 Oct 2008 [2118] xorriso/compile_xorriso.sh Introduced xorriso development compiler script option -no_libreadline ------------------------------------ cycle - xorriso-0.2.7 - 2008.10.09.145926 2008.10.10.131102 [2119] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorriso.1 Enabled dialog for multi-lines and newline characters in quotation marks 2008.10.10.134020 [2120] xorriso/xorriso.c Polishing multi-line dialog 2008.10.12.120001 [2122] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.2.8 12 Oct 2008 [2123] xorriso/changelog.txt Documented changes and release timestamp ---------------------------------- release - xorriso-0.2.8 - 2008.10.12.120001 * Bug fix: -as mkisofs -iso-level was accused to be an unknown option * Bug fix: -follow link attributed random target filenames to looping links * Ability to write and maintain bootable ISO images based on ISOLINUX * New ./configure option --disable-libreadline to make binary more portable 2008.10.12.133957 [2124] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.2.9 12 Oct 2008 [2125] xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-0.2.9 - 2008.10.12.133957 15 Oct 2008 [2128] xorriso/xorriso_eng.html Corrected a typo in xorriso web page 2008.10.15.182605 [2130] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New options -quoted_path_list, -quoted_not_list. Multiline for -options_from_file 2008.10.17.074953 [2131] xorriso/xorriso_private.h xorriso/xorriso.h xorriso/xorriso.c xorriso/xorriso.1 New option -backslash_codes for expressing weird file names 2008.10.17.123308 [2132] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorriso.1 Adjustments and documentation about -backslash_codes 17 Oct 2008 [2133] xorriso/xorriso_eng.html Updated xorriso web page ------------------------------------ cycle - xorriso-0.2.9 - 2008.10.17.123308 * New options -quoted_path_list, -quoted_not_list * New option -backslash_codes for weird file names and terminal safety 18 Oct 2008 [2134] xorriso/make_isohybrid_mbr.c Exposed function make_isohybrid_mbr() for discussion 19 Oct 2008 [2135] xorriso/make_isohybrid_mbr.c Corrected a bug in make_isohybrid_mbr() 2008.10.19.172237 [2136] xorriso/configure_ac.txt xorriso/xorriso_makefile_am.txt Adapted to libisofs 0.6.11 19 Oct 2008 [2137] xorriso/compile_xorriso.sh Adapted to libisofs 0.6.11 19 Oct 2008 [2138] - xorriso/make_isohybrid_mbr.c The make_isohybrid_mbr() function is now part of libisofs development 2008.10.19.182512 [2139] libisoburn/libisoburn.h libisoburn now depends on libisofs-0.6.11 2008.10.20.180747 [2140] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Made use of new libisofs isohybrid capability ------------------------------------ cycle - xorriso-0.2.9 - 2008.10.20.180747 * Suitable ISOLINUX boot images are made alternatively bootable via MBR 21 Oct 2008 [2141] xorriso/xorriso_eng.html Mentioned isohybrid capability in xorriso homepage 2008.10.21.112523 [2142] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c Implemented in xorriso provisory 1 MB alignement for MBR enhanced ISO images 2008.10.21.123226 [2143] xorriso/xorrisoburn.c Showing a "Media summary:" with blank media ------------------------------------ cycle - xorriso-0.2.9 - 2008.10.21.123226 2008.10.22.110204 [2144] xorriso/xorriso.c xorriso/xorriso.1 New options --quoted_path_list , isolinux_mbr= for -as mkisofs 2008.10.22.201702 [2145] xorriso/xorriso.1 xorriso/xorrisoburn.c Gave up automatic switch to -boot_image "isolinux" "patch" after writing ------------------------------------ cycle - xorriso-0.2.9 - 2008.10.22.201702 2008.10.24.130124 [2146] xorriso/xorrisoburn.c Fixed image size aligment to 1 MB with follow-up sessions ------------------------------------ cycle - xorriso-0.2.9 - 2008.10.24.130124 2008.10.25.123133 [2147] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Eventually reporting boot info with TOC of -indev, redirected drive aquiration TOC to info channel 2008.10.25.170010 [2148] xorriso/xorrisoburn.c Fixed SIGSEGV introduced with previous revision 2008.10.26.134421 [2149] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 Introduced info option -boot_image "any" "show_status" 2008.10.26.142422 [2150] xorriso/xorrisoburn.c Precautions against patching deleted boot images ------------------------------------ cycle - xorriso-0.2.9 - 2008.10.26.142422 2008.10.27.142720 [2151] xorriso/xorrisoburn.c Trying to recognize isohybrid MBR for "Boot record :" message ------------------------------------ cycle - xorriso-0.2.9 - 2008.10.27.142720 2008.10.30.110049 [2152] xorriso/xorriso.c Made -as mkisofs -path-list and --quoted_path_list switch pacifier mode 2008.10.30.114313 [2153] xorriso/xorriso.c Enabled @ as indicator of UTC seconds in timestrings 2008.11.03.115721 [2159] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 xorriso/convert_man_to_html.sh New options -charset, -in_charset, -out_charset 2008.11.04.162214 [2162] xorriso/xorriso_private.h xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option -application_id 4 Nov 2008 [2163] xorriso/xorriso_eng.html Mentioned new options in xorriso homepage 2008.11.06.183736 [2164] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option -local_charset ------------------------------------ cycle - xorriso-0.2.9 - 2008.11.06.183736 * New options -charset, -in_charset, -out_charset * New option -application_id * New option -local_charset 2008.11.07.173315 [2170] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Copying -out_charset to -in_charset after -commit 2008.11.07.201909 [2171] xorriso/xorrisoburn.c Removed some defunct code from xorrisoburn.c 2008.11.09.102554 [2176] xorriso/xorriso.c Added a setlocale() call to xorriso main() ------------------------------------ cycle - xorriso-0.2.9 - 2008.11.09.102554 * Bug fix in libisofs: ISOLINUX boot images were not patched correctly 2008.11.10.123332 [2177] xorriso/xorrisoburn.c Disabled experimental weight sorting with MBR generation 2008.11.10.123713 [2178] xorriso/xorriso.c xorriso/xorriso.1 Eventual backslash output conversion outside quotes for more terminal-safety 11 Nov 2008 [2179] xorriso/xorriso_eng.html Updated xorriso home page ------------------------------------ cycle - xorriso-0.2.9 - 2008.11.10.123713 12 Nov 2008 [2190] xorriso/configure_ac.txt Version leap to libburn-0.5.7 2008.11.12.153437 [2192] xorriso/xorriso.c Added forgotten exit value registration to -return_with. Thanks to Steve Dodd. ------------------------------------ cycle - xorriso-0.2.9 - 2008.11.12.153437 * Bug fix: Forgot exit value registration to -return_with. Thanks to Steve Dodd. 15 Nov 2008 [2195] xorriso/xorriso.1 Took into respect that xorriso loads non-RR images 2008.11.15.133724 [2196] xorriso/xorriso.c Adaptions to FreeBSD. Thanks to J.R. Oldroyd. 2008.11.15.231831 [2198] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c Introduced new relax flag isoburn_igopt_always_gmt 2008.11.15.232058 [2199] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c Making use of new relax flag isoburn_igopt_always_gmt ------------------------------------ cycle - xorriso-0.2.9 - 2008.11.18.110100 18 Nov 2008 [2204] test/aaip.c Demo of the emerging Arbitrary Attribute Interchange Protocol format 18 Nov 2008 [2205] README xorriso/README xorriso/xorriso.1 xorriso/xorriso_eng.html Mentioned FreeBSD peculiarities in our docs 2008.11.21.160019 [2206] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c Making use of experimental libisofs calls _rrip_version_1_10() _dir_rec_mtime() 2008.11.21.160632 [2207] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 xorriso/xorriso_eng.html New option -relax_compliance 22 Nov 2008 [2209] - test/aaip.c Revoked proposal AAIP 0.0 in favor of 0.2 which is nearly like RRIP field SL ------------------------------------ cycle - xorriso-0.2.9 - 2008.11.21.160632 26 Nov 2008 [2210] xorriso/configure_ac.txt Promoted standalone libisofs copy to 0.6.12 2008.11.26.174940 [2211] xorriso/xorrisoburn.c Disabled "Starting up libraries ..." message 2008.11.26.180935 [2212] xorriso/xorriso.c Augmented version message by "and burn program" ------------------------------------ cycle - xorriso-0.2.9 - 2008.11.26.180935 2008.11.29.091030 [2216] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Renamed new option -relax_compliance to -compliance, added _off rules ------------------------------------ cycle - xorriso-0.2.9 - 2008.11.29.091030 * New option -compliance allows certain deviations from standards 2008.11.29.140837 [2219] xorriso/xorrisoburn.c Bug fix: -format as_needed did not recognize unformatted BD-RE 2008.11.29.165843 [2220] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c Re-aquiring outdev after formatting and blanking already in xorrisoburn 2008.11.29.214208 [2221] xorriso/xorriso.c New -as cdrecord option stream_recording=on|off 2008.11.30.095007 [2222] xorriso/xorrisoburn.c Reporting BD speed units with pacifier rather than DVD units 2008.11.30.123700 [2223] xorriso/xorriso.c Gave -as mkisofs problem handlers rather than to let it abort on any error 2008.11.30.214121 [2224] xorriso/xorriso.c xorriso/xorrisoburn.c Changed layout of xorriso style write pacifier line 2008.12.01.110022 [2225] xorriso/xorriso.c xorriso/xorrisoburn.c Removed outdated macro case Xorriso_fat_local_meM 2008.12.01.122825 [2226] xorriso/xorriso.c Bug fix: disk patterns with relative addresses were not properly resolved 1 Dec 2008 [2227] xorriso/xorriso_eng.html Updated list of bugfixes in xorriso home page ------------------------------------ cycle - xorriso-0.2.9 - * Bug fix: -format as_needed did not recognize unformatted BD-RE * Bug fix: disk patterns with relative addresses were not properly resolved 1 Dec 2008 [2228] Branching for libisoburn release 0.3.0 2008.12.01.200001 [2229] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.3.0 1 Dec 2008 [2230] xorriso/changelog.txt Documented changes and release timestamp 1 Dec 2008 [2231] configure.ac Corrected values of LIB*_REQUIRED ---------------------------------- release - xorriso-0.3.0 - 2008.12.01.200001 * New options -quoted_path_list, -quoted_not_list * New option -backslash_codes for weird file names and terminal safety * New options -charset, -in_charset, -out_charset * New option -local_charset allows to override locale * New option -application_id * New option -compliance allows certain deviations from standards * Suitable ISOLINUX boot images are made alternatively bootable via an MBR * Bug fix in libisofs: ISOLINUX boot images were not patched correctly * Bug fix in libisofs: mkisofs images with empty files got damaged * Bug fix: Forgot exit value registration to -return_with. Thanks to Steve Dodd. * Bug fix: -format as_needed did not recognize unformatted BD-RE * Bug fix: disk patterns with relative addresses were not properly resolved 2008.12.01.202911 [2232] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.3.1 1 Dec 2008 [2233] xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-0.3.1 - 2008.12.01.202911 2 Dec 2008 [2234] Promoted libisoburn 0.3.0 from branch to tag 2 Dec 2008 [2235] [2236] [2237] [2238] Deleted obsoleted branches 2008.12.04.175459 [2240] [2241] xorriso/xorriso.c Bug fix: Options -extract and -extract_single were enabled with -osirrox off 2008.12.05.171005 [2242] libisoburn/libisoburn.h libisoburn/burn_wrap.c New API function isoburn_get_mount_params() 2008.12.05.171700 [2243] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New options -mount and -mount_cmd 2008.12.06.140828 [2244] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso_eng.html Using uname() rather than #ifdef __FreeBSD__ 2008.12.07.122439 [2245] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Got rid of call system() in Xorriso_mount(), new option -session_string Dec 7 2008 [2246] [2247] xorriso/xorriso_eng.html xorriso/xorriso.1 Small documentation adjustments ------------------------------------ cycle - xorriso-0.3.1 - 2008.12.07.122439 * Bug fix: Options -extract and -extract_single were enabled with -osirrox off * New API function isoburn_get_mount_params() * New options -mount , -mount_cmd , -session_string 2008.12.08.120712 [2256] xorriso/configure_ac.txt Standalone version switch to libburn-0.5.9 2008.12.08.121106 [2257] README configure.ac libisoburn/libisoburn.h xorriso/README Requiring at least libburn-0.5.8 8 Dec 2008 [2258] xorriso/xorriso.1 Small documentation adjustments 2008.12.08.154521 [2259] Makefile.am xorriso/xorriso_private.h xorriso/compile_xorriso.sh xorriso/xorriso_makefile_am.txt Got rid of Xorriso_with_regeX 2008.12.10.093424 [2272] xorriso/xorrisoburn.c Enabled formatting of BD-R media to SRM-POW default size 10 Dec 2008 [2275] xorriso/xorriso.1 Mentioned BD-R in man xorriso 2008.12.11.072427 [2277] xorriso/xorrisoburn.c Proper message after failed or refused formatting 2008.12.13.142726 [2281] [2282] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New -format modes by_size_ and fast_by_size_ 2008.12.13.144622 [2283] configure.ac libisoburn/libisoburn.h Demanding libburn-0.5.9 now ------------------------------------ cycle - xorriso-0.3.1 - 2008.12.13.144622 * By using libburn-0.5.9: support for BD-R media * New -format modes by_size_ and fast_by_size_ 2008.12.13.161650 [2285] xorriso/xorrisoburn.c xorriso/xorriso.1 Revoked -format mode by_size for DVD-RW 12 Dec 2008 [2286] xorriso/xorriso_eng.html Updated xorriso web page 2008.12.14.093125 [2288] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New option -assert_volid 2008.12.14.151550 [2291] xorriso/xorriso.c Removed outdated alternative code 2008.12.14.231145 [2293] xorriso/xorriso.c xorriso/xorriso.1 Options for -as mkisofs: -input-charset, -output-charset 2008.12.16.130139 [2295] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option -drive_class for safety management of pseudo-drive access 16 Dec 2008 [2296] xorriso/README xorriso/xorriso_eng.html Updated xorriso documentation ------------------------------------ cycle - xorriso-0.3.1 - 2008.12.16.130139 * New option -assert_volid * New option -drive_class for safety management of pseudo-drive access 17 Dec 2008 [2299] + doc/comments Preparations for a more presentable online API documentation 2008.12.17.102216 [2300] Makefile.am Delivering doxygen input for API documentation with releases 17 Dec 2008 [2301] doc/comments Corrected list of authors in libisoburn API documentation 2008.12.21.101705 [2317] xorriso/xorrisoburn.c Corrected message about non-matching volume id ------------------------------------ cycle - xorriso-0.3.1 - 2008.12.21.154636 21 Dec 2008 [2318] + test/aaip_0_2.h + test/aaip_0_2.c + test/aaip_0_2_test.c A first implementation of AAIP 0.2 encoding and decoding 23 Dec 2008 [2326] test/aaip_0_2.h test/aaip_0_2.c test/aaip_0_2_test.c Gave aaip_0_2 a ring buffer rather than a shifted fifo 25 Dec 2008 [2336] test/aaip_0_2.h test/aaip_0_2.c test/aaip_0_2_test.c Encoder for ACL long text form 26 Dec 2008 [2338] test/aaip_0_2.h test/aaip_0_2.c test/aaip_0_2_test.c Decoder for ACL to long text form 1 Jan 2009 [2343] test/aaip_0_2.h test/aaip_0_2.c test/aaip_0_2_test.c + test/aaip-os-linux.c + test/aaip-os-freebsd.c + doc/susp_aaip_0_2.txt Introduced system adapters for getting and setting EA and ACL 1 Jan 2009 [2344] test/aaip_0_2.c Corrected some bugs with attribute list decoding 1 Jan 2009 [2345] test/aaip_0_2.c Corrected some more bug with attribute list decoding 4 Jan 2009 [2355] xorriso/configure_ac.txt Standalone version switch to libburn-0.6.1 5 Jan 2009 [2357] svn copy -m "Branching for libisoburn release 0.3.2 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/ZeroThreeTwo 2009.01.05.120643 [2358] COPYRIGHT libisoburn/burn_wrap.c libisoburn/data_source.c libisoburn/isoburn.c libisoburn/isofs_wrap.c xorriso/compile_xorriso.sh xorriso/xorrisoburn.c xorriso/xorriso.h Updated copyright marks to 2009 2009.01.05.123001 [2359] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.3.2 5 Jan 2009 [2360] [2361] xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-0.3.2 - 2009.01.05.123001 * Bug fix: Options -extract and -extract_single were enabled with -osirrox off * New API function isoburn_get_mount_params() * New options -mount , -mount_cmd , -session_string * New -format modes by_size_ and fast_by_size_ * New option -assert_volid * New option -drive_class for safety management of pseudo-drive access * By using libburn-0.6.0: support for BD-R media 2009.01.05.145703 [2362] COPYRIGHT libisoburn/burn_wrap.c libisoburn/data_source.c libisoburn/isoburn.c libisoburn/isofs_wrap.c xorriso/compile_xorriso.sh xorriso/xorrisoburn.c xorriso/xorriso.h Updated copyright marks to 2009 2009.01.05.153105 [2363] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_timestamp.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt Version leap to 0.3.3 5 Jan 2009 [2364] xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-0.3.3 - 2009.01.05.153105 5 Jan 2009 [2365] svn move http://svn.libburnia-project.org/libisoburn/branches/ZeroThreeTwo http://svn.libburnia-project.org/libisoburn/tags/ZeroThreeTwo Promoted branch to tag 2009.01.06.123047 [2368] xorriso/xorriso.c xorriso/xorriso_eng.html Some small corrections of documentation 9 Jan 2009 [2382] xorriso/xorriso_eng.html Mentioned bug fix and pl01 ------------------------------------ cycle - xorriso-0.3.3 - 2009.01.09.103251 2009.01.10.154018 [2386] xorriso/xorriso.h xorriso/xorriso.c Avoiding use of function parameter name "class" 14 Jan 2009 [2395] doc/susp_aaip_0_2.txt Clarified that AAIP is only allowed if RRIP is present 2009.01.14.110935 [2396] Makefile.am xorriso/compile_xorriso.sh xorriso/xorriso_makefile_am.txt Introduced AAIP code. Now linking with libacl. 2009.01.17.181500 [2400] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c New option -getfacl 2009.01.18.213952 [2401] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Restoring ACLs with -extract and others 2009.01.21.150243 [2402] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c New API macro isoburn_ropt_noaaip controls enabling of AAIP loading 2009.01.21.203852 [2403] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c libisoburn/burn_wrap.c Had to split isoburn_ropt_noaaip into isoburn_ropt_noacl and isoburn_ropt_noea 2009.01.21.204513 [2404] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c New option -acl enables ACL loading 2009.01.22.130107 [2405] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c Now it is isoburn_ropt_noaaip , isoburn_ropt_noacl and isoburn_ropt_noea 2009.01.22.130255 [2406] xorriso/xorrisoburn.c Adapted to new macro situation in libisoburn 2009.01.22.143210 [2407] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New macro isoburn_igopt_aaip controls writing of AAIP info into images 2009.01.22.143253 [2408] xorriso/xorrisoburn.c Making use of new libisoburn macro isoburn_igopt_aaip 2009.01.22.152252 [2409] xorriso/xorrisoburn.c xorriso/xorriso.1 Restoring ACL only if -acl "on" 2009.01.22.155049 [2410] xorriso/xorrisoburn.c Removing leading slash from -getfacl output of file path ------------------------------------ cycle - xorriso-0.3.3 - 2009.01.22.155049 * New option -acl enables ACL import and export 2009.01.23.101305 [2411] xorriso/configure_ac.txt Promoted standalone libisofs to 0.6.13 2009.01.23.102843 [2412] libisoburn/libisoburn.h libisoburn/burn_wrap.c Demanding libisofs 0.6.13 now 2009.01.23.140824 [2413] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New find tests -has_acl, -has_no_acl, new action getfacl, new option getfacl_r 23 Jan 2009 [2414] xorriso/xorriso_eng.html Updated xorriso web page ------------------------------------ cycle - xorriso-0.3.3 - 2009.01.23.140824 * New find tests -has_acl, -has_no_acl , new find action getfacl * New option -getfacl_r 2009.01.23.172652 [2415] configure.ac Makefile.am xorriso/configure_ac.txt xorriso/xorriso_makefile_am.txt xorriso compilation detects availability of libacl and of Linux listxattr call 2009.01.23.172757 [2416] xorriso/xorrisoburn.c Silenced a FAILURE message with -acl if no image is loaded 23 Jan 2009 [2417] xorriso/xorriso_eng.html Updated xorriso web page ------------------------------------ cycle - xorriso-0.3.3 - 2009.01.23.172757 24 Jan 2009 [2418] xorriso/compile_xorriso.sh Took into respect changed .o file names of libisofs 2009.01.25.141124 [2424] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 xorriso/xorriso_eng.html New option -setfacl, -setfacl_r, new -find action setfacl ------------------------------------ cycle - xorriso-0.3.3 - 2009.01.25.141124 * New option -setfacl, -setfacl_r, new -find action setfacl 25 Jan 2009 [2425] - test/aaip_0_2.h - test/aaip_0_2.c - test/aaip-os-freebsd.c - test/aaip-os-linux.c - test/aaip_0_2_test.c - doc/susp_aaip_0_2.txt AAIP code now resides in libisofs 2009.01.26.173254 [2426] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New macro isoburn_igopt_aaip_susp_1_10 controls writing of AAIP ER and ES 2009.01.26.173606 [2427] xorriso/xorrisoburn.c xorriso/xorriso.1 Gave user control over isoburn_igopt_aaip_susp_1_10 26 Jan 2009 [2428] xorriso/make_xorriso_standalone.sh Including doc/susp_aaip_0_2.txt in xorriso-standalone 2009.01.27.121417 [2432] libisoburn/libisoburn.h Mentioned the need for 64 bit file i/o 2009.01.28.074917 [2434] xorriso/xorrisoburn.c Bug fixes and enhancements about "default" ACL 2009.01.28.114755 [2435] xorriso/xorrisoburn.c Bug fixes and enhancements about "default" ACL ------------------------------------ cycle - xorriso-0.3.3 - 2009.01.28.114755 2009.01.28.190140 [1436] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c Made -getfacl file name escaping more similar to shell command behavior 2009.01.29.165339 [2437] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorriso.1 New option -setfacl_list 28 Jan 2009 [2438] xorriso/xorriso_eng.html Updated xorriso web page ------------------------------------ cycle - xorriso-0.3.3 - 2009.01.29.165339 * New option -setfacl_list 29 Jan 2009 [2439] xorriso/xorriso_makefile_am.txt Added aaip-os-dummy.c to xorriso-standalone 2009.01.29.210606 [2440] xorriso/xorrisoburn.c Bug fix: included sys/wait.h rather than wrong wait.h 2009.01.30.145624 [2442] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Followed changes in iso_node_*acl_text API ------------------------------------ cycle - xorriso-0.3.3 - 2009.01.30.200825 2009.01.31.101122 [2443] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c Equipped output of lsl with '+' perm if ACL is present 2009.02.02.134346 [2444] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New options -xattr, -getfattr, find -has_xattr, -has_aaip, -exec getfattr 2009.02.02.201124 [2445] xorriso/xorrisoburn.c xorriso/xorriso.1 Enabled restoring of xattr ------------------------------------ cycle - xorriso-0.3.3 - 2009.02.02.201124 * New options -xattr, -getfattr, find -has_xattr, -has_aaip, -exec getfattr 2009.02.03.162440 [2446] Makefile.am xorriso/xorriso_makefile_am.txt Linking with $LIBBURN_ARCH_LIBS to get -lcam on FreeBSD ------------------------------------ cycle - xorriso-0.3.3 - 2009.02.03.162440 2009.02.04.200055 [2449] xorriso/xorrisoburn.c Took into respect eventual resolution of symbolic links 2009.02.04.200653 [2450] configure.ac xorriso/configure_ac.txt Checking for iconv(3) in separate libiconv (e.g. on FreeBSD) 2009.02.07.090104 [2453] xorriso/xorrisoburn.c Correct group permission bits with -acl off and -extract file that has ACL 2009.02.07.142605 [2454] xorriso/xorrisoburn.c Correct group permission bits with -acl off and disk file that has ACL 2009.02.08.132116 [2455] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h First code for -setfattr (have to fix some ACL problems before going on) 2009.02.08.151354 [2456] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Displaying "+" with lslx if ACL is detected ------------------------------------ cycle - xorriso-0.3.3 - 2009.02.08.151354 ------------------------------------ cycle - xorriso-0.3.3 - 2009.02.09.103308 ------------------------------------ cycle - xorriso-0.3.3 - 2009.02.09.170857 2009.02.09.185940 [2458] xorriso/xorriso.c xorriso/xorrisoburn.c New options -setfattr, -setfattr_r, new find -exec setfattr 10 Feb 2009 [2459] xorriso/xorriso_eng.html Updated xorriso home page 2009.02.10.125831 [2460] xorriso/xorrisoburn.c Closed a memory leak with unreleased IsoImage in boot image inquiry ------------------------------------ cycle - xorriso-0.3.3 - 2009.02.10.195106 12 Feb 2009 [2461] xorriso/convert_man_to_html.sh Adapted html man page generator to textchanges 2009.02.12.110516 [2462] xorriso/xorriso.h xorriso/xorriso.c New -as mkisofs options --acl and --xattr 12 Feb 2009 [2463] xorriso/xorriso.1 Updated xorriso man page 2009.02.13.202539 [2464] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 xorriso/xorriso_eng.html New option -setfattr_list ------------------------------------ cycle - xorriso-0.3.3 - 2009.02.13.202539 * New -as mkisofs options --acl and --xattr * New option -setfattr_list 2009.02.14.133013 [2465] xorriso/xorriso.c -as mkisofs --acl and --xattr was not properly recognized 2009.02.16.082645 [2466] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 Took into respect ACL and xattr with -compare and -update ------------------------------------ cycle - xorriso-0.3.3 - 2009.02.16.082645 2009.02.17.184231 [2467] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 xorriso/xorriso_eng.html New option -disk_dev_ino 2009.02.19.123524 [2475] libisoburn/isofs_wrap.c Adapted to removal of Libburn_with_aaiP macro 2009.02.19.123607 [2476] xorriso/xorrisoburn.c Adapted to removal of Libburn_with_aaiP macro 19 Feb 2009 [2477] xorriso/configure_ac.txt Adapted to version leap libisofs-0.6.14 ------------------------------------ cycle - xorriso-0.3.3 - 2009.02.19.123607 * New option -disk_dev_ino accelerates incremental backups 2009.02.19.183707 [2478] xorriso/xorriso_private.h Committing forgotten xorriso_private.h 20 Feb 2009 [2487] xorriso/configure_ac.txt Adapted to version leap libburn-0.6.2 2009.02.25.144045 [2496] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 -disk_dev_ino mode ino_only 2009.02.28.175747 [2502] configure.ac Requiring libisofs-0.6.14 now, libburn-0.6.0 still suffices 2009.02.28.175926 [2503] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New API function isoburn_igopt_get_data_start() 2009.02.28.181358 [2504] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New -stream_recording mode with start address, "on" is now 32s 2009.02.28.181750 [2505] xorriso/configure_ac.txt Switched standalone version to libisofs-0.6.15 ------------------------------------ cycle - xorriso-0.3.3 - 2009.02.28.181750 01 Mar 2009 [2506] svn copy -m Branching for libisoburn release 0.3.4 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/ZeroThreeFour 2009.03.01.103001 [2507] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/xorriso.1 xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to 0.3.4 1 Mar 2009 [2508] xorriso/changelog.txt Documented changes and release timestamp 1 Mar 2009 [2509] README xorriso/README Correction about libisofs.so version requirement ----------------------------------- release - xorriso-0.3.4 - 2009.03.01.103001 * New option -acl enables ACL import and export * New options -getfacl, -getfacl_r, -setfacl, -setfacl_r, -setfacl_list * New find tests -has_acl, -has_no_acl , new find actions getfacl, setfacl * New option -xattr enables import and export of Extended Attributes * New options -getfattr, -getfattr_r, -setfattr, -setfattr_r, -setfattr_list * New find tests -has_xattr, -has_aaip, new find actions getfattr, setfattr * New -as mkisofs options --acl and --xattr * New option -disk_dev_ino accelerates incremental backups 2009.03.01.113444 [2510] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/xorriso.1 xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to 0.3.5 1 Mar 2009 [2511] xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-0.3.5 - 2009.03.01.113444 1 Mar 2009 [2512] svn move -m 'Promoted branch to tag' http://svn.libburnia-project.org/libisoburn/branches/ZeroThreeFour http://svn.libburnia-project.org/libisoburn/tags/ZeroThreeFour 2009.03.03.103421 [2517] libisoburn/libisoburn.h isoburn_igopt_get_data_start() @since 0.3.6 because not announced in 0.3.4 2009.03.03.103706 [2518] xorriso/configure_ac.txt Making optional use of statvfs() in sg-dummy ------------------------------------ cycle - xorriso-0.3.5 - 2009.03.03.103706 2009.03.05.121700 [2519] acinclude.m4 Lifted the ban on operating systems other than Linux and FreeBSD ------------------------------------ cycle - xorriso-0.3.5 - 2009.03.05.121700 * Dummy MMC adapter for compilation on systems other than Linux, FreeBSD 2009.03.08.140002 [2521] xorriso/xorriso.c xorriso/xorrisoburn.c test/compare_file.c Reacted on compiler warnings of SchilliX-0.6.7 (based on Solaris 5.11) 2009.03.10.092227 [2523] xorriso/xorrisoburn.c xorriso/xorriso.1 Made -compliance old_rr imply -compliance aaip_susp_1_10 ------------------------------------ cycle - xorriso-0.3.5 - 2009.03.10.092227 2009.03.11.170125 [2524] configure.ac libisoburn/libisoburn.h libisoburn/isoburn.c Requiring libisofs-0.6.16 now 2009.03.11.170236 [2525] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libisofs-0.6.16 11 Mar 2009 [2526] xorriso/xorriso_eng.html Mentioned bug fixes in libisofs 11 Mar 2009 [2527] xorriso/xorriso.1 Minor changes in xorriso man page ------------------------------------ cycle - xorriso-0.3.5 - 2009.03.11.170236 2009.03.12.141647 [2528] xorriso/xorrisoburn.c xorriso/xorriso.1 Made -compliance old_rr the default 2009.03.13.150731 [2536] xorriso/xorrisoburn.c Defaulting -stream_recording "data" to "100m" 2009.03.13.150838 [2537] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libburn-0.6.5 2009.03.14.113811 [2539] xorriso/xorriso.c Fixed the inappropriate refusal on paths like /u/test/../.. 2009.03.14.115711 [2540] configure.ac libisoburn/libisoburn.h Requiring libburn-0.6.4 now ------------------------------------ cycle - xorriso-0.3.5 - 2009.03.14.115711 * default of -compliance has been changed to "old_rr", new rule "new_rr" 16 Mar 2009 [2541] svn copy -m "Branching for libisoburn release 0.3.6" \ http://svn.libburnia-project.org/libisoburn/trunk \ http://svn.libburnia-project.org/libisoburn/branches/ZeroThreeSix 2009.03.16.090001 [2542] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.3.6 16 Mar 2009 [2543] xorriso/changelog.txt Documented changes and release timestamp 16 Mar 2009 [2544] configure.ac Adjusted forgotten version number ----------------------------------- release - xorriso-0.3.6 - 2009.03.16.090001 * Dummy MMC adapter for compilation on systems other than Linux, FreeBSD * Default of -compliance has been changed to "old_rr", new rule "new_rr" * New -stream_recording modes with start address or "data". "on" is now 32s. 2009.03.16.112837 [2545] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.3.7 16 Mar 2009 [2546] xorriso/changelog.txt Documented changes and release timestamp 17 Mar 2009 [2548] svn move -m 'Promoted branch to tag' \ http://svn.libburnia-project.org/libisoburn/branches/ZeroThreeSix \ http://svn.libburnia-project.org/libisoburn/tags/ZeroThreeSix ------------------------------------ cycle - xorriso-0.3.7 - 2009.03.16.112837 2009.03.18.103858 [2550] configure.ac acinclude.m4 Makefile.am Get on FreeBSD pkgconfigdir=.../libdata , on Linux and others: .../lib 2009.03.18.104037 [2551] xorriso/configure_ac.txt xorriso/xorriso_makefile_am.txt Adapted xorriso-standalone to version leap libisofs-0.6.17 and FreeBSD libdata 18 Mar 2009 [2552] configure.ac Removed useless libisoburn configure options --enable-libacl --enable-xattr 2009.03.19.172806 [2555] xorriso/xorriso.c Unified -status filtering decision 2009.03.20.192910 [2557] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c New API functions isoburn_ropt_[sg]et_auto_incharset() 2009.03.20.193334 [2558] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New option -auto_charset based on xattr "isofs.cs" ------------------------------------ cycle - xorriso-0.3.7 - 2009.03.21.131424 * New option -auto_charset based on xattr "isofs.cs" 22 Mar 2009 [2559] xorriso/xorriso.1 Clarification about -auto_charset pitfalls 2009.03.22.090232 [2560] xorriso/xorriso.c xorriso/xorrisoburn.c Stuffed memory leaks on -commit and loading of El Torito records 2009.03.29.164336 [2561] configure.ac Revoked revision 2552. Dynamic xorriso did not get linked with -lacl any more. 2009.03.29.164411 [2562] libisoburn/libisoburn.h libisoburn now demands libisofs-0.6.17 2009.03.29.164703 [2563] xorriso/compile_xorriso.sh xorriso/xorriso_makefile_am.txt Adapted to new libisofs feature iso_file_add_external_filter() 2009.03.29.164931 [2564] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 Experimental -find action -exec set_filter with some hardcoded filter commands 2009.04.02.162530 [2565] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 xorriso/xorriso_eng.html New options -external_filter , -unregister_filter, -set_filter , -set_filter_r ------------------------------------ cycle - xorriso-0.3.7 - 2009.04.02.162530 * New options -external_filter , -unregister_filter, -set_filter , -set_filter_r 2009.04.03.172034 [2566] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Fixed a potential blind spot of 1 second in -disk_dev_ino comparison 2009.04.04.082636 [2567] xorriso/xorrisoburn.c Fixed a bug with the error message about external filters and setuid 2009.04.04.144009 [2568] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New option -close_filter_list 2009.04.04.144241 [2569] configure.ac Makefile.am README xorriso/configure_ac.txt xorriso/xorriso_makefile_am.txt xorriso/compile_xorriso.sh xorriso/README configure options to control availability of external filters in xorriso 2009.04.05.110534 [2570] xorriso/xorriso.c Reporting number of processed filters with -set_filter and -set_filter_r 2009.04.05.110652 [2571] xorriso/xorrisoburn.c Fixed a bug about detection of failure with -set_filter 2009.04.05.131536 [2572] xorriso/xorriso.c Included sys/select.h as prescribed by POSIX and Linux, FreeBSD man pages 2009.04.05.143043 [2573] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorriso.1 New -osirrox mode "banned" 5 Apr 2009 [2574] xorriso/xorriso_eng.html Updated xorriso web page ------------------------------------ cycle - xorriso-0.3.7 - 2009.04.05.143043 * New option -close_filter_list * New -osirrox mode "banned" 2009.04.06.100802 [2575] xorriso/xorrisoburn.c xorriso/xorriso.1 Suffix rollback with -set_filter --remove-all-filters 2009.04.06.132007 [2576] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New options -show_stream, -show_stream_r, -exec show_stream 2009.04.06.143109 [2577] xorriso/xorrisoburn.c xorriso/xorriso.1 Changed appearance of -show_stream, fixed bug introduced with rev 2575 2009.04.06.161541 [2578] xorriso/xorrisoburn.c Fixed bug introduced with 2575 ------------------------------------ cycle - xorriso-0.3.7 - 2009.04.06.161541 * New options -show_stream, -show_stream_r, new -find -exec show_stream 2009.04.07.120250 [2579] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New -find tests -has_filter, -has_no_filter 2009.04.07.122117 [2580] xorriso/xorriso.c xorriso/xorrisoburn.c Removed some unused old code branches 2009.04.10.102558 [2581] configure.ac Makefile.am xorriso/configure_ac.txt xorriso/xorriso_makefile_am.txt xorriso/compile_xorriso.sh Took into respect optional libz dependency of libisofs 2009.04.10.103130 [2582] xorriso/xorrisoburn.c Introduced builtin filters --zisofs and --zisofs-decode 11 Apr 2009 [2583] xorriso/make_xorriso_standalone.sh Included a copy of doc/zisofs_format.txt in xorriso-standalone 2009.04.11.125331 [2584] xorriso/xorrisoburn.c Adjustments with filter --zisofs-decode 2009.04.11.172644 [2585] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option -zisofs, builtin filters --zisofs and --zisofs-decode 12 Apr 2009 [2586] xorriso/xorriso_eng.html Updated xorriso web page ------------------------------------ cycle - xorriso-0.3.7 - 2009.04.12.142252 * New option -zisofs, builtin filters --zisofs and --zisofs-decode 14 Apr 2009 [2588] README xorriso/README Updated README texts of libisoburn and xorriso 2009.04.14.092306 [2589] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New -zisofs option by_magic=on ------------------------------------ cycle - xorriso-0.3.7 - 2009.04.14.092306 2009.04.15.071944 [2590] xorriso/compile_xorriso.sh xorriso/xorriso_makefile_am.txt xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Adopted new libisofs filter module gzip.c, builtin filters --gzip, --gunzip 2009.04.15.185131 [2591] libisoburn/isofs_wrap.c xorriso/xorrisoburn.c Removed dependency on Libisofs_has_auto_input_charseT 2009.04.15.185238 [2592] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.18 now 2009.04.15.185359 [2593] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libisofs-0.6.18 2009.04.16.145617 [2594] xorriso/make_xorriso_standalone.sh xorriso/xorriso_makefile_am.txt Fixed bugs with rarely used make dist 2009.04.18.090616 [2596][2597] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libisofs-0.6.19 ------------------------------------ cycle - xorriso-0.3.7 - 2009.04.18.090616 2009.04.18.120001 [2598] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.3.8 18 Apr 2009 [2599][2600] xorriso/xorriso.1 Last minute correction in xorriso man page 18 Apr 2009 [2601] xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-0.3.8 - 2009.04.18.120001 * New options -set_filter , -set_filter_r, -find -exec set_filter * New option -zisofs, builtin filters --zisofs , --gzip , --gunzip * New options -external_filter , -unregister_filter, -close_filter_list, * New options -show_stream, -show_stream_r * New -osirrox mode "banned" * New option -auto_charset based on xattr "isofs.cs" 2009.04.18.150555 [2602] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.3.9 18 Apr 2009 [2603] xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-0.3.9 - 2009.04.18.150555 19 Apr 2009 [2608] svn move -m 'Promoted branch to tag' \ http://svn.libburnia-project.org/libisoburn/branches/ZeroThreeEight \ http://svn.libburnia-project.org/libisoburn/tags/ZeroThreeEight 2009.04.21.173600 [2612] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Enhanced -find testing by operators -not, -or, -and, (, ), -if, -else, -endif 2009.04.21.184214 [2613] xorriso/xorriso.c Allowed implicit -and operator with -not, -if and -sub 22 Apr 2009 [2614] xorriso/xorriso_eng.html Updated xorriso web page ------------------------------------ cycle - xorriso-0.3.9 - 2009.04.21.184214 * Operators with option -find : -not, -or, -and, (, ), -if, -then, -else 2009.04.22.173603 [2615] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/burn_wrap.c New API call isoburn_toc_track_get_emul() 2009.04.22.173648 [2616] xorriso/xorrisoburn.c Made use of new libisoburn call to accelerate option -toc for large TOC 2009.04.23.103301 [2617] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New -find tests -wholename, -prune 2009.04.25.160022 [2618] libisoburn/burn_wrap.c Used isoburn_toc_track_get_emul() in isoburn_set_msc1() 2009.04.25.162210 [2619] xorriso/xorrisoburn.c Moved call of isoburn_set_msgs_submit() to Xorriso_startup_libraries() 2009.04.25.162858 [2620] libisoburn/burn_wrap.c Issueing pacifier messages from within isoburn_set_msc1() ------------------------------------ cycle - xorriso-0.3.9 - 2009.04.25.162858 * New -find tests -wholename, -prune 2009.05.06.173600 [2626] xorriso/xorrisoburn.c Bug fix: SIGSEGV with option -status and no search string 2009.05.06.174222 [2627] xorriso/xorrisoburn.c Bug fix: -load volid did not perform pattern search 2009.05.08.073642 [2638] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libburn-0.6.7 2009.05.09.201241 [2639] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c New API options isoburn_ropt_noino and isoburn_igopt_hardlinks 2009.05.09.201742 [2640] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New option -hardlinks 2009.05.14.082045 [2641] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Enhanced option -extract_cut for handling filtered files 2009.05.16.165616 [2642] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c LBA sorted processing of -compare_r and -update_r for smoother MMC reading 2009.05.16.165940 [2643] xorriso/xorrisoburn.c Disabled use of iso_tree_add_new_symlink() in favor of iso_tree_add_new_node() 2009.05.17.115101 [2644] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New pseudo test with -find : -sort_lba which is actually an option 2009.05.26.140055 [2647] xorriso/xorrisoburn.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Enabled -hardlinks for options -extract, -extract_l and -cp*x 2009.05.26.142912 [2648] xorriso/xorriso.c Revoked LBA sorted reading with -compare_r. It was ugly. ------------------------------------ cycle - xorriso-0.3.9 - 2009.05.26.172355 Bug fix: SIGSEGV with option -status and no search string Bug fix: -load volid did not perform pattern search New option -hardlinks Improved reading performance with -update_r and -extract 2009.05.29.110831 [2649] xorriso/xorriso.c xorriso/xorriso.1 xorriso/xorriso_eng.html New option -for_backup as shortcut for -acl -xattr -hardlinks 2009.05.29.162300 [2650] xorriso/xorrisoburn.c Avoided unnecessary sorting during -extract 2009.05.30.161808 [2561] xorriso/xorriso.c Avoided unconditional output of -hardlinks with option -status 2009.05.31.100140 [2652] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.20 now 2009.05.31.100315 [2653] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libisofs-0.6.20 2009.05.31.185819 [2654] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libisofs-0.6.21 13 Jun 2009 [2668] xorriso/configure_ac.txt xorriso/xorriso_makefile_am.txt xorriso/make_xorriso_standalone.sh Removed xorriso.pc.in from xorriso-standalone tarball 2009.06.15.121525 [2670] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 With -update_r : detecting hardlink splits and fusions on disk 2009.06.20.063853 [2671] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Wider scope of hardlink reconstruction with extract operations 2009.06.22.112850 [2672] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 Gave up risky direct update of hardlink siblings 2009.06.23.065744 [2673] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c + xorriso/makefile_libxorriso_am.txt Introduced alternative Makefile.am for libxorriso production 2009.06.23.070934 [2674] xorriso/xorriso_private.h Added missing function declaration 2009.06.23.123147 [2675] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c Removed from xorriso main() any dependency on non-API features 2009.06.23.133210 [2676] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c Rough test for compile time and run time libxorriso version mismatches 2009.06.23.164351 [2677] xorriso/xorriso.c xorriso/xorrisoburn.c Deprecated -hardlinks modes "start_update", "end_update" for "perform_update" 23 Jun 2009 [2678] xorriso/xorriso.1 Updated xorriso man page 2009.06.24.133521 [2679] xorriso/xorriso.c Reverted order of memorized hardlink update parameters 2009.06.25.125048 [2680] libisoburn/burn_wrap.c Bug fix: Copies of overwriteable media onto sequential were mistaken in ROM drives 2009.06.27.112408 [2681] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 With -extract : made hardlink registration combinable with sort_lba ------------------------------------ cycle - xorriso-0.3.9 - 2009.06.27.112408 New option -for_backup as shortcut for -acl -xattr -hardlinks Bug fix: Copies of overwriteable media on sequential were mistaken in ROM drives 28 Jun 2009 [2681] svn copy -m "Branching for libisoburn release 0.4.0" \ http://svn.libburnia-project.org/libisoburn/trunk \ http://svn.libburnia-project.org/libisoburn/branches/ZeroFourZero 2009.06.28.090001 [2683] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.4.0 28 Jun 2009 [2684] xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-0.4.0 - 2009.06.28.090001 * New option -hardlinks * Improved reading performance with -update_r and -extract * New option -for_backup as shortcut for -acl -xattr -hardlinks * Operators with option -find : -not, -or, -and, (, ), -if, -then, -else * New -find tests -wholename, -prune * Bug fix: SIGSEGV with option -status and no search string * Bug fix: -load volid did not perform pattern search * Bug fix: Copies of overwriteable media on sequential were mistaken in ROM drives 2009.06.28.100124 [2685] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.4.1 28 Jun 2009 [2686] xorriso/changelog.txt Documented changes and release timestamp 28 Jun 2009 [2687] svn move -m 'Promoted branch to tag' \ http://svn.libburnia-project.org/libisoburn/branches/ZeroFourZero \ http://svn.libburnia-project.org/libisoburn/tags/ZeroFourZero ------------------------------------ cycle - xorriso-0.4.1 - 2009.06.28.100124 2009.06.30.120311 [2688] configure.ac xorriso/configure_ac.txt Provisory patch on ticket 152: GNU libiconv needs -liconv but offers no iconv() 2009.06.30.154606 [2689] xorriso/xorriso.c Bug fix: Ticket 149, one byte overflow of local variable. 2009.07.07.175748 [2690] configure.ac xorriso/configure_ac.txt Aligned configure --help texts provided by own code in configure.ac 2009.07.07.193955 [2693] acinclude.m4 configure.ac xorriso/configure_ac.txt configure options --enable-libdir-pkgconfig and --enable-pkgconfig-path=DIR 2009.07.14.134423 [2701] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libburn-0.6.9 2009.07.19.214008 [2703] xorriso/xorriso.c Bug fix: xorriso -as mkisofs did not understand the -C option of growisofs any more ------------------------------------ cycle - xorriso-0.4.1 - 2009.07.19.214008 Bug fix: xorriso -as mkisofs did not understand the -C option of growisofs any more ------------------------------ release - xorriso-0.4.0.pl01 - 2009.07.20.060001 Bug fix: xorriso -as mkisofs did not understand the -C option of growisofs any more 23 Jul 2009 [2704] xorriso/xorriso.1 More emphasis on early use of -hardlinks, -acl, -xattr etc. 2009.07.23.103339 [2705] xorriso/compile_xorriso.sh xorriso/xorriso_makefile_am.txt Adopted new libisofs source module md5.[cho] 2009.07.23.103728 [2706] xorriso/xorriso.c xorriso/xorrisoburn.c Showing a better link count with -hardlinks on -lsl 2009.07.25.181857 [2707] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso_eng.html Updating sorted link array before usage after image manipulations ------------------------------------ cycle - xorriso-0.4.1 - 2009.07.25.181857 Options -lsl and lsdl now display correct link counts if -hardlinks is on 2009.08.03.075954 [2708] xorriso/xorrisoburn.c Bug fix: Use of freed memory with -hardlinks on and -update 03 Aug 2009 [2709] xorriso/xorriso.1 Hints about -hardlinks and file content filtering 2009.08.10.123146 [2710] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New find actions get_md5, get_any_xattr, test -has_any_xattr 2009.08.10.192240 [2711] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c New write options session_md5, file_md5, read option nomd5 2009.08.10.193843 [2712] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New option -md5, new -as mkisofs option --md5 2009.08.10.194416 [2713] xorriso/xorriso.h xorriso/xorrisoburn.h Missing changes in rev 2710 and 2712 2009.08.11.194836 [2714] configure.ac libisoburn/libisoburn.h Requiring at least libisofs-0.6.21 now 2009.08.11.194836 [2715] xorriso/xorriso_private.h xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New options -check_md5, -check_md5_r, find action check_md5, test -has_md5 2009.08.12.130401 [2716] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Completed find action check_md5 2009.08.12.202423 [2717] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 Checking MD5 of whole session with -check_md5 and empty path list 2009.08.13.203718 [2718] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Better reaction wich -check_md5 if no MD5 array is loaded 2009.08.14.102355 [2719] xorriso/xorriso.c xorriso/xorrisoburn.c More timely abort of find jobs if the result pager gets aborted 2009.08.14.211648 [2720] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorriso.1 Letting -check_media look for session checksum tags 2009.08.15.173403 [2724] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso.1 Introduced -check_media event= for mismatch events 2009.08.16.200906 [2725] xorriso/xorriso.c xorriso/xorrisoburn.c Adapted to a change in iso_util_decode_md5_tag() 2009.08.17.162456 [2726] libisoburn/burn_wrap.c Giving overwriteable media a single-session toc with isoburn_drive_aquire(bit4) 2009.08.17.162834 [2727] xorriso/xorrisoburn.c -check_media recognizes relocated 64kB superblock tag and hops over session gaps 2009.08.18.173453 [2728] xorriso/xorrisoburn.c Making use of new API call iso_md5_match() and adapted to MD5 image mismatches 2009.08.18.191013 [2729] xorriso/xorriso.c xorriso/xorriso.1 Included -md5 on with option -for_backup ------------------------------------ cycle - xorriso-0.4.1 - 2009.08.18.191013 New option -md5, new -as mkisofs option --md5 New options -check_md5, -check_md5_r New find actions check_md5 get_md5, get_any_xattr New find tests -has_md5, -has_any_xattr libisoburn: New write options session_md5, file_md5, read option nomd5 2009.08.19.180632 [2730] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c Adapted to enhanced iso_write_opts_set_record_md5() 2009.08.19.180842 [2731] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New -md5 mode "all" 19 Aug 2009 [2732] xorriso/xorriso_eng.html Corrections with xorriso web page 2009.08.20.204309 [2733] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 Made -compare and -update work with recorded MD5 sums 2009.08.22.184241 [2734] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New -find action make_md5 to equip files from old images with MD5 2009.08.24.182839 [2738] configure.ac libisoburn/libisoburn.h Demanding libburn-0.6.9 now 2009.08.24.183750 [2739] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option -calm_drive 2009.08.25.191217 [2741] xorriso/xorrisoburn.c More timely report of library messages with -check_md5 2009.08.25.191325 [2742] xorriso/xorriso.1 Updated incremental backup example 2009.08.25.191433 [2743] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.22 now 2009.08.25.191543 [2744] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libisofs-0.6.23 ------------------------------------ cycle - xorriso-0.4.1 - 2009.08.25.191543 Options -compare, -compare_r, -update, update_r now can use recorded MD5 New -find action make_md5 to equip files from old images with MD5 New option -calm_drive 2009.08.27.175608 [2752] xorriso/xorriso.c Updated helptext about -find actions, new -as mkisofs option --for_backup 2009.08.27.175719 [2753] libisoburn/libisoburn.h configure.ac Requiring libburn-0.7.0 now 2009.08.27.175806 [2754] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libburn-0.7.1 2009.08.28.100829 [2756] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option -list_profiles 2009.08.28.101405 [2757] xorriso/xorriso.c Forgot to store before committing 2009.08.28.101716 [2758] xorriso/xorriso_private.h Forgot to commit xorriso_private.h 2009.08.28.112825 [2759] xorriso/xorrisoburn.c Small correction with reporting profile "Removable disk" ------------------------------------ cycle - xorriso-0.4.1 - 2009.08.28.112825 New option -list_profiles 29 Aug 2009 [2760] svn copy -m "Branching for libisoburn release 0.4.2" http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/ZeroFourTwo 2009.08.29.143001 [2761] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.4.2 29 Aug 2009 [2762] xorriso/xorriso.1 Some updates and corrections in xorriso man page 29 Aug 2009 [2765] xorriso/changelog.txt Document changes and release timestamp ----------------------------------- release - xorriso-0.4.2 - 2009.08.29.143001 * libisoburn: New write options session_md5, file_md5, file_stability * libisoburn: New read option nomd5 * Bug fix: xorriso -as mkisofs did not understand the -C option of growisofs any more * Options -lsl and lsdl now display correct link counts if -hardlinks is on * New option -md5, new -as mkisofs option --md5 * New options -check_md5, -check_md5_r * New find actions check_md5 get_md5, get_any_xattr * New find tests -has_md5, -has_any_xattr * Options -compare, -compare_r, -update, update_r now can use recorded MD5 * New -find action make_md5 to equip files from old images with MD5 * New option -calm_drive * New option -list_profiles 29 Aug 2009 [2763] xorriso/xorriso.1 Some updates and corrections in xorriso man page 2009.08.29.180146 [2764] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.4.3 29 Aug 2009 [2766] xorriso/changelog.txt Documented changes and release timestamp 30 Aug 2009 [2767] move -m 'Promoted branch to tag' http://svn.libburnia-project.org/libisoburn/branches/ZeroFourTwo http://svn.libburnia-project.org/libisoburn/tags/ZeroFourTwo ------------------------------------ cycle - xorriso-0.4.3 - 2009.08.29.180146 31 Aug 2009 [2768] xorriso/make_xorriso_standalone.sh Added libisofs/doc/checksums.txt to xorriso standalone tarball 2009.08.31.162746 [2769] xorriso/xorriso.c Bug fix: -for_backup did not enable -xattr and -md5 if no drive was chosen yet 31 Aug 2009 [2770] configure.ac Requiring libisofs-0.6.23 now 2009.08.31.210528 [2771] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New API call iso_write_opts_set_scdbackup_tag() 2009.08.31.211005 [2772] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New option -scdbackup_tag 2009.09.01.110102 [2776] xorriso/compile_xorriso.sh xorriso/xorriso_makefile_am.txt Removed libburn/lec.c from xorriso standalone and development scripts ------------------------------------ cycle - xorriso-0.4.3 - 2009.09.01.110102 * Bug fix: -for_backup did not enable -xattr and -md5 if no drive was chosen yet * New option -scdbackup_tag 2009.09.06.094209 [2796] configure.ac libisoburn/libisoburn.h Requiring libburn-0.7.1 now 2009.09.06.112851 [2798] xorriso/xorrisoburn.c Reporting "Media product:" with xorriso option -toc 2009.09.06.144813 [2799] xorriso/xorrisoburn.c Reporting media product info with -as cdrecord -atip 2009.09.07.161247 [2800] xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Avoided to use MD5 on filtered streams with compare and update ------------------------------------ cycle - xorriso-0.4.3 - 2009.09.07.161247 * Option -toc now reports "Media product:" 2009.09.13.095136 [2811] libisoburn/burn_wrap.c xorriso/xorrisoburn.c Eventually truncate stdio: track size to file size and issue warning 2009.09.16.162424 [2812] xorriso/xorriso.h xorriso/xorriso.c Avoiding a potential memory leak in xorriso main() 2009.09.17.144453 [2813] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c Expanded new API call isoburn_igopt_set_scdbackup_tag 2009.09.17.144849 [2814] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c Changing new option -scdbackup_tag 2009.09.19.161026 [2817] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New -osirrox sub-options o_excl_on/off. Program osirrox starts with o_excl_off. 2009.09.20.092811 [2818] xorriso/xorriso.c xorriso/xorrisoburn.c Bug fix: Corrected handling of -as cdrecord -mode2, -xa, -xa2, -xa2, -xamix, xorrisofs -help, xorrecord -help 2009.09.20.110715 [2819] xorriso/xorriso.c xorriso/xorrisoburn.c Adjusted xorriso -as cdrecord fifo chunk size to -xa1 ------------------------------------ cycle - xorriso-0.4.3 - 2009.09.20.110715 * Bug fix: With -as cdrecord : -xa1 and -xamix were ignored although they do matter * Bug fix: xorrisofs -help, xorrecord -help displayed original xorriso -help 2009.09.22.143534 [2821] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c Bug fix: -cut_out deleted previously cut-out pieces of the same file ------------------------------------ cycle - xorriso-0.4.3 - 2009.09.22.143534 * Bug fix: -cut_out deleted previously cut-out pieces of the same file 2009.09.27.080401 [2827] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 Narrowed rules for recognizing split file parts 2009.09.28.173322 [2828] xorriso/xorrisoburn.c xorriso/xorriso.1 Restricted split part recognition to directories with a complete part set 2009.09.30.092640 [2829] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New -check_media sub options bad_limit=, slow_limit=, chunk_size= ------------------------------------ cycle - xorriso-0.4.3 - 2009.09.30.092640 2009.10.05.165632 [2831] libisoburn/isofs_wrap.c libisoburn/burn_wrap.c Avoided FAILURE event with welcoming empty disk files 2009.10.05.172143 [2832] xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option -pvd_info 2009.10.05.183619 [2833] xorriso/xorrisoburn.c Adjusted -pvd_info to the peculiarities of -volid 2009.10.05.190215 [2834] xorriso/xorrisoburn.c Added code to xorriso for repairing "_" in all three PVD id file names ------------------------------------ cycle - xorriso-0.4.3 - 2009.10.05.190215 * New option -pvd_info 2009.10.06.071704 [2835] xorriso/xorrisoburn.c Made sure that -pvd_info reports the actual PVD address 2009.10.07.072645 [2836] libisoburn/isofs_wrap.c Declared as closed those media which have read errors in the first 64 kB 2009.10.07.075634 [2837] libisoburn/libisoburn.h libisoburn/burn_wrap.c New bit7 with isoburn_drive_aquire(): pretend read-only 2009.10.07.080042 [2838] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New -rom_toc_scan sub option "force" to get DVD/BD table-of-content on Solaris ------------------------------------ cycle - xorriso-0.4.3 - 2009.10.07.080042 2009.10.07.124047 [2839] xorriso/xorriso.c xorriso/xorrisoburn.c Aligned sessions on overwriteables to full 32 blocks 2009.10.07.140521 [2840] libisoburn/burn_wrap.c Avoided FATAL event with -rom_toc_scan force and non-ISO media 2009.10.07.180552 [2841] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New options -system_id , -volset_id ------------------------------------ cycle - xorriso-0.4.3 - 2009.10.07.180552 * New options -system_id , -volset_id * Bug fix libisofs: Filenames could lose blanks during a multi-session cycle ------------------------------- patch - xorriso-0.4.2.pl02 - 2009.10.08.080001 * Bug fix: -for_backup did not enable -xattr and -md5 if no drive was chosen yet * Bug fix: xorrisofs -help, xorrecord -help displayed original xorriso -help * Bug fix libisofs: Filenames could lose blanks during a multi-session cycle 2009.10.08.155605 [2845] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.24 now 2009.10.08.155749 [2846] xorriso/configure_ac.txt xorriso/xorriso_eng.html Adapted xorriso-standalone to version leap libisofs-0.6.25 2009.10.10.142353 [2851] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 xorriso/xorriso_eng.html New option -mount_opts 2009.10.11.141528 [2852] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c Made -application_id, -publisher, -system_id, -volset_id pending image changes 2009.10.11.141815 [2853] xorriso/xorriso.c Changed FreeBSD mount command to mount_cd9660 2009.10.14.114830 [2862] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libburn-0.7.3 2009.10.14.115223 [2863] README xorriso/README configure.ac libisoburn/libisoburn.h Requiring libburn-0.7.2 now ------------------------------------ cycle - xorriso-0.4.3 - 2009.10.14.115223 * New option -mount_opts 2009.10.17.191225 [2866] xorriso/compile_xorriso.sh xorriso/xorriso_makefile_am.txt Added libburn/ecma130ab.[cho] to xorriso standalone and development scripts 2009.10.22.155746 [2869] xorriso/xorrisoburn.c Added a "NOT READBLE" result line to -check_md5 22 Oct 2009 [2870] xorriso/xorriso.1 Added man page example: Burn an existing ISO image file to media 27 Oct 2009 [2873] xorriso/xorriso.1 Adjustments of xorriso man page 27 Oct 2009 [2874] svn copy -m "Branching for libisoburn release 0.4.4" \ http://svn.libburnia-project.org/libisoburn/trunk \ http://svn.libburnia-project.org/libisoburn/branches/ZeroFourFour 2009.10.27.153001 [2875] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.4.4 27 Oct 2009 [2876] xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-0.4.4 - 2009.10.27.153001 * Bug fix: -cut_out deleted previously cut-out pieces of the same file * Bug fix libisofs: Filenames could lose blanks during a multi-session cycle * Bug fix: -for_backup did not enable -xattr and -md5 if no drive was chosen yet * Bug fix: With -as cdrecord : -xa1 and -xamix were ignored although they do matter * Bug fix: xorrisofs -help, xorrecord -help displayed original xorriso -help * New option -pvd_info * Option -toc now reports "Media product:" * New options -system_id , -volset_id * New option -mount_opts * New option -scdbackup_tag 2009.10.27.205410 [2877] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.4.5 28 Oct 2009 [2878] xorriso/changelog.txt Documented changes and release timestamp 28 Oct 2009 [2879] svn move -m "Promoted branch to tag" http://svn.libburnia-project.org/libisoburn/branches/ZeroFourFour http://svn.libburnia-project.org/libisoburn/tags/ZeroFourFour ------------------------------------ cycle - xorriso-0.4.5 - 2009.10.27.205410 2009.11.12.204523 [2897] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New -calm_drive mode "revoke" ------------------------------- patch - xorriso-0.4.4.pl01 - 2009.11.13.120001 * libburn: Workaround for Pioneer DVR-216D which got stuck on DVD-R burns * libburn: Workaround for Pioneer DVR-216D refusal to eject 2009.11.17.123150 [2909] configure.ac libisoburn/libisoburn.h Requiring libburn-0.7.3 now 2009.11.17.134239 [2910] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.1 New options -dvd_obs and -stdio_sync 2009.11.17.142447 [2911] configure.ac Makefile.am xorriso/configure_ac.txt xorriso/makefile_libxorriso_am.txt New configure option --enable-dvd-obs-64k ------------------------------------ cycle - xorriso-0.4.5 - 2009.11.17.142447 * New options -dvd_obs and -stdio_sync * New configure option --enable-dvd-obs-64k 2009.11.28.123903 [2927] xorriso/xorrisoburn.c Made use of burn_fifo_source_new() flag bit0 and of burn_os_open_track_src() 2009.11.28.124241 [2928] README xorriso/README xorriso/configure_ac.txt xorriso/xorriso_makefile_am.txt New configure option --enable-track-src-odirect ------------------------------------ cycle - xorriso-0.4.5 - 2009.11.28.124241 ------------------------------------ cycle - xorriso-0.4.5 - 2009.12.05.141523 * Bug fix: SIGSEGV with option -toc on LG GH22LS30 07 Dec 2009 [2944] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libburn-0.7.5 2009.12.07.082130 [2945] README xorriso/README configure.ac libisoburn/libisoburn.h Requiring libburn-0.7.4 now 08 Dec 2009 [2947] svn copy -m Branching for libisoburn release 0.4.6 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/ZeroFourSix 2009.12.08.130001 [2948] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.4.6 08 Dec 2009 [2949] xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-0.4.6 - 2009.12.08.130001 * libburn: Bug fix: SIGSEGV from NULL pointer with option -toc on LG GH22LS30 * libburn: Workaround for Pioneer DVR-216D which got stuck on DVD-R burns * libburn: Workaround for Pioneer DVR-216D refusal to eject * New options -dvd_obs and -stdio_sync * New configure option --enable-dvd-obs-64k 2009.12.08.144237 [2950] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.4.7 08 Dec 2009 [2961] xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-0.4.7 - 2009.12.08.144237 2009.12.10.120734 [2953] xorriso/xorrisoburn.c Silenced harmless compiler warning of FreeBSD 6.3 10 Dec 2009 [2954] xorriso/configure_ac.txt Corrected a harmless name error in xorriso standalone configuration 2009.12.14.121636 [2955] xorriso/xorriso.c Mentioned stream_recording=number in helptext of xorriso -as cdrecord 2009.12.26.224409 [2977] configure.ac libisoburn/libisoburn.h Requiring libburn-0.7.5 now 2009.12.26.231134 [2978] xorriso/configure_ac.txt xorriso/xorriso_makefile_am.txt xorriso/xorrisoburn.c Made xorriso-standalone aware of libcdio system adaptor 2009.12.27.095045 [2980] xorriso/xorrisoburn.c Reporting system adapter id with xorriso -version 2009.12.30.163643 [2989] xorriso/xorriso.c Handling -mount on Debian kfreebsd like on FreeBSD 2009.12.31.114951 [2991] xorriso/xorrisoburn.c Changed report title "System adapter" to "libburn OS adapter" 2009.12.31.142331 [2992] xorriso/xorriso.c Reacted on compiler warning of Debian buildd 2009.12.31.144342 [2993] libisoburn/libisoburn.h Reacted on doxygen errors of Debian buildd 2010.01.01.124622 [2996] libisoburn/isoburn.c xorriso/xorriso.c xorriso/xorrisoburn.c Reacted on compiler warnings of Debian kfreebsd-amd64 buildd 2010.01.01.125742 [2997] libisoburn/burn_wrap.c libisoburn/isofs_wrap.c Do not believe libburn if it says a role 2 drive is empty 2010.01.01.130215 [2998] README COPYRIGHT libisoburn/data_source.c xorriso/README xorriso/compile_xorriso.sh xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorrisoburn.h Updated copyright marks to 2010 01 Jan 2010 [2999] xorriso/xorriso.1 Removed a stray option argument from xorriso man page 01 Jan 2010 [3000] xorriso/xorriso_eng.html Updated xorriso homepage ------------------------------------ cycle - xorriso-0.4.7 - 2010.01.01.130215 * New configure option --enable-libcdio for system adapter to libcdio-0.83git 2010.01.07.090517 [3003] configure.ac xorriso/configure_ac.txt Changed configure test for zlib from compress2() to compressBound() 2010.01.11.113303 [3007] libisoburn/isofs_wrap.c Re-enabled recognition of missing or empty disk files as blank drive (rev 2997) 2010.01.11.113457 [3008] xorriso/xorrisoburn.c Changed a comment in xorrisoburn.c 2010.01.17.145019 [3020] libisoburn/burn_wrap.c Bug fix: xorriso did not blank CD-RW with images that were prepared on hard disk 2010.01.17.145139 [3021] xorriso/xorrisoburn.c Made xorriso issue a filure message if blanking was not successful 2010.01.17.145751 [3022] configure.ac Fixed a bug in configure.ac introduced with rev 3003 2010.01.19.133712 [3023] xorriso/xorrisoburn.c Avoided SORRY event for missing disk file during hardlink update 2010.01.20.105755 [3025] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.26 now 2010.01.20.105928 [3026] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libisofs-0.6.27 20 Jan 2010 [3027] xorriso/xorriso_eng.html Updated xorriso webpage ------------------------------------ cycle - xorriso-0.4.7 - 2010.01.20.105928 * Bug fix: xorriso did not blank CD-RW with images that were prepared on hard disk 2010.01.23.153510 [3039] README xorriso/README configure.ac libisoburn/libisoburn.h Requiring libburn-0.7.6 now 2010.01.23.153601 [3040] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libburn-0.7.7 25 Jan 2010 [3041] svn copy -m Branching for libisoburn release 0.4.8 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/ZeroFourEight 2010.01.25.120001 [3042] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.4.8 25 Jan 2010 [3043] xorriso/xorriso_private.h test/compare_file.c Lifted ban to derive GPLv3, extended copyright range to 2010 25 Jan 2010 [3045] configure.ac Corrected wrong micro version number 25 Jan 2010 [3048] xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-0.4.8 - 2010.01.25.120001 * Bug fix: xorriso did not blank CD-RW with images that were prepared on hard disk * New configure option --enable-libcdio for system adapter to libcdio-0.83git 2010.01.25.142705 [3046] configure.ac README libisoburn/libisoburn.h xorriso/README xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.4.9 25 Jan 2010 [3047] xorriso/xorriso_private.h test/compare_file.c Lifted ban to derive GPLv3, extended copyright range to 2010 25 Jan 2010 [3049] ([3044]) xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-0.4.9 - 2010.01.25.142705 25 Jan 2010 [3050] move -m Promoted branch to tag \ http://svn.libburnia-project.org/libisoburn/branches/ZeroFourEight \ http://svn.libburnia-project.org/libisoburn/tags/ZeroFourEight 27 Jan 2010 [3051] README Changed leftover text which disallowed GPLv3 04 Feb 2010 [3052] xorriso/xorriso.1 Small corrections in xorriso man page 2010.02.04.082710 [3053] acinclude.m4 configure.ac xorriso/configure_ac.txt Forcing use of /usr/local on FreeBSD by LDFLAGS and CPPFLAGS 2010.02.08.110814 [3055] xorriso/xorrisoburn.c Removed surplus quotes from an error message 8 Feb 2010 [3056] svn move -m 'Marked libisofs SVN copy as outdated (use bzr on lp)' http://svn.libburnia-project.org/libisofs http://svn.libburnia-project.org/libisofs_outdated 2010.02.10.150252 [3057] README Updated license statement about our legal view and future licenses 2010.02.10.150501 [3058] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.28 now 2010.02.10.150547 [3059] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libisofs-0.6.29 10 Feb 2010 [3060] xorriso/xorriso_eng.html Updated xorriso web page ------------------------------------ cycle - xorriso-0.4.9 - 2010.02.10.150547 Bug fix: Regression in libisofs introduced with xorriso-0.4.2 in August 2009: -boot_image could lead to SIGSEGV 12 Feb 2010 [3061] xorriso/README Switched from xorriso-standalone GPLv2+ to GNU xorriso GPLv3+ svn move -m 'Renamed xorriso/README to xorriso/README_gnu_xorriso' \ xorriso/README xorriso/README_gnu_xorriso 2010.02.12.153945 [3062] xorriso/xorriso.c xorriso/make_xorriso_standalone.sh xorriso/README_gnu_xorriso + xorriso/COPYING_gnu_xorriso xorriso/xorriso_eng.html Switched from xorriso-standalone GPLv2+ to GNU xorriso GPLv3+ 2010.02.12.213121 [3065] xorriso/xorriso.1 libisoburn/libisoburn.h xorriso/xorriso_eng.html Changed docs and comments to "GNU/Linux" where appropriate ------------------------------------ cycle - xorriso-0.4.9 - 2010.02.12.213121 2010.02.14.151045 [3067] README COPYRIGHT libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/data_source.c libisoburn/burn_wrap.c libisoburn/isofs_wrap.c Added or adjusted copyright and license statements in single files 2010.02.14.151610 [3068] xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_makefile_am.txt xorriso/xorriso.1 xorriso/xorriso_eng.html + xorriso/AUTHORS_gnu_xorriso + xorriso/COPYRIGHT_gnu_xorriso Added or adjusted copyright and license statements in single files 2010.02.14.172124 [3070] README xorriso/make_xorriso_standalone.sh xorriso/xorriso_makefile_am.txt Excluded unused libburn source module crc.c from GNU xorriso tarball 2010.02.15.204530 [3072] xorriso/xorriso_eng.html Adjustments with web page of GNU xorriso ------------------------------------ cycle - xorriso-0.4.9 - 2010.02.15.204530 2010.02.17.140002 [3074] xorriso/xorriso.c Bug fix for FreeBSD: xorriso could leave the drive tray locked 2010.02.18.125019 [3076] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.1 New option -scsi_log 2010.02.19.172125 [3077] xorriso/xorrisoburn.c Bug fix: xorriso -update_r could lead to SIGSEGV if applied to a data file 19 Feb 2010 [3078] [3079] xorriso/xorriso_eng.html Adjustments with web page of GNU xorriso ------------------------------------ cycle - xorriso-0.4.9 - 2010.02.19.172125 Bug fix on FreeBSD: xorriso could leave the drive tray locked Bug fix on FreeBSD: Piped input was falsely attributed a small fixed size Bug fix: xorriso -update_r could lead to SIGSEGV if applied to a data file New option -scsi_log 22 Feb 2010 [3081] xorriso/README_gnu_xorriso xorriso/xorriso_eng.html Mentioned bug-xorriso@gnu.org as a contact address for GNU xorriso 2010.02.22.195623 [3082] xorriso/make_xorriso_standalone.sh xorriso/xorriso.h xorriso/xorriso.c Changed versioning and tarball name to match unpack directory name 22 Feb 2010 [3083] svn copy -m Branching for libisoburn release 0.5.0 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/ZeroFiveZero 2010.02.22.213001 [3084] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.5.0 22 Feb 2010 [3085] Makefile.am Delivering xorriso/README_gnu_xorriso with libisoburn 22 Feb 2010 [3086] xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-0.5.0 - 2010.02.22.213001 Bug fix: Regression in libisofs introduced with xorriso-0.4.2 in August 2009: -boot_image could lead to SIGSEGV Bug fix on FreeBSD: xorriso could leave the drive tray locked Bug fix on FreeBSD: Piped input was falsely attributed a small fixed size Bug fix: xorriso -update_r could lead to SIGSEGV if applied to a data file New option -scsi_log 2010.02.23.093924 [3087] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.5.1 23 Feb 2010 [3088] Makefile.am Delivering xorriso/README_gnu_xorriso with libisoburn 23 Feb 2010 [3089] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/ZeroFiveZero http://svn.libburnia-project.org/libisoburn/tags/ZeroFiveZero ------------------------------------ cycle - xorriso-0.5.1 - 2010.02.23.093924 28 Feb 2010 [3094] xorriso/make_xorriso_standalone.sh Adjusted patcher of Makefile.in for GNU xorriso 28 Feb 2010 [3095] xorriso/xorriso.1 Corrected spelling errors in xorriso man page 2010.03.09.065117 [3109] libisoburn/libisoburn.h Requiring libburn-0.7.7 now 2010.03.09.065408 [3110] xorriso/xorriso_private.h xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.c Adapted xorriso signal handling to new libburn advise 2010.03.10.183348 [3121] configure.ac libisoburn/libisoburn.h Requiring libburn-0.7.8 now 2010.03.10.183426 [3122] xorriso/configure_ac.txt Adapted GNU xorriso to version leap libburn-0.7.9 2010.03.18.101202 [3125] Makefile.am xorriso/xorriso_makefile_am.txt xorriso/make_xorriso_standalone.sh + xorriso/xorriso.texi + xorriso/xorriso.info + xorriso/make_xorriso_1.c + xorriso/make_docs.sh xorriso/xorriso.1 xorriso/convert_man_to_html.sh Switched xorriso documentation to a hybrid of texinfo and man page ------------------------------------ cycle - xorriso-0.5.1 - 2010.03.18.101202 * xorriso documentation now also available in (tex)info format 2010.03.20.165317 [3126] xorriso/make_docs.sh xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/convert_man_to_html.sh Restructured xorriso documentation and added index 2010.03.21.124435 [3127] Makefile.am xorriso/xorriso_makefile_am.txt xorriso/xorriso.texi xorriso/xorriso.info Distributing and installing xorriso.info 2010.03.21.124517 [3128] libisoburn/burn_wrap.c Silenced a harmless compiler warning 22 Mar 2010 [3129] xorriso/xorriso.texi Changed global info dir entry of xorriso.texi 22 Mar 2010 [3130] xorriso/xorriso.info Changed global info dir entry of xorriso.info 2010.03.29.103419 [3136] libisoburn/burn_wrap.c Avoided to declare empty tray as written media 2010.03.29.103533 [3137] xorriso/xorrisoburn.c Better handling of empty tray when aquiring drive ------------------------------------ cycle - xorriso-0.5.1 - 2010.03.29.103533 29 Mar 2010 [3138] svn copy -m Branching for libisoburn release 0.5.2 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/ZeroFiveTwo 2010.03.29.190001 [3139] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.5.2 30 Mar 2010 [3141] xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-0.5.2 - 2010.03.29.190001 * xorriso documentation now also available in (tex)info format * Prepared FreeBSD system adapter to work with ahci driver 2010.03.30.082405 [3140] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.5.3 30 Mar 2010 [3142] xorriso/changelog.txt Documented changes and release timestamp 30 Mar 2010 [3143] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/ZeroFiveTwo http://svn.libburnia-project.org/libisoburn/tags/ZeroFiveTwo ------------------------------------ cycle - xorriso-0.5.3 - 2010.03.30.082405 2010.04.01.140653 [3144] libisoburn/burn_wrap.c libisoburn refused to recognize ISO images smaller than 64 kB 2010.04.01.140653 [3145] xorriso/xorriso.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Disabled isohybrid MBR production on request of H. Peter Anvin 2010.04.05.192817 [3147] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.29 now 2010.04.06.125013 [3148] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New API call isoburn_igopt_set_system_area() 2010.04.06.151750 [3149] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New -as mkisofs options -G and --protective-msdos-label for GRUB 2010.04.06.192328 [3150] xorriso/xorriso.c xorriso/xorriso_eng.html Polishing of new GRUB supporting features ------------------------------------ cycle - xorriso-0.5.3 - 2010.04.06.192328 * New API call isoburn_igopt_set_system_area() * New -as mkisofs options -G and --protective-msdos-label for GRUB 2010.04.07.073024 [3151] libisoburn/burn_wrap.c Fixed image reading bug introduced with revision 3144 ------------------------------------ cycle - xorriso-0.5.3 - 2010.04.07.073024 2010.04.07.202148 [3152] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New API call isoburn_igopt_set_pvd_times() 2010.04.07.202559 [3153] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New option -volume_date, for grub-mkrescue: -as mkisofs --modification-date= 2010.04.08.185744 [3154] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New find action mkisofs_r and emulation -as mkisofs -r ------------------------------------ cycle - xorriso-0.5.3 - 2010.04.08.185744 * New API call isoburn_igopt_set_pvd_times() * New option -volume_date, for grub-mkrescue: -as mkisofs --modification-date= * New find action mkisofs_r and emulation -as mkisofs -r 2010.04.09.171108 [3164] xorriso/configure_ac.txt Adapted GNU xorriso to version leap libburn-0.8.1 2010.04.10.150747 [3165] configure.ac xorriso/configure_ac.txt Trying to avoid iconv const warning and multiple -liconv options on FreeBSD 2010.04.10.170927 [3166] libisoburn/libisoburn.h libisoburn/isoburn.c New options bit1 of isoburn_igopt_set_system_area() for isohybrid production 2010.04.10.171214 [3167] xorriso/xorriso.c xorriso/xorrisoburn.c New -boot_image isolinux partition_table=on, -as mkisofs -isohybrid-mbr 2010.04.10.180103 [3168] xorriso/xorriso.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Updated help text and documentation ------------------------------------ cycle - xorriso-0.5.3 - 2010.04.10.180103 * New options bit1 of isoburn_igopt_set_system_area() for isohybrid production * New: -boot_image isolinux partition_table=on, -as mkisofs -isohybrid-mbr 2010.04.11.120902 [3169] xorriso/xorriso.c test/compare_file.c Reacted on compiler warnings of cygwin 2010.04.11.121002 [3170] xorriso/xorrisoburn.c Avoided printing of possibly uninitialized integer 2010.04.11.121418 [3171] acinclude.m4 xorriso/configure_ac.txt Realistic iconv() linking test in ./configure with eventual abort 2010.04.11.122253 [3172] xorriso/xorriso.c test/compare_file.c xorriso/xorrisoburn.c acinclude.m4 xorriso/configure_ac.txt (Payload files of revisions 3169, 3170, 3171) ------------------------------------ cycle - xorriso-0.5.3 - 2010.04.11.122253 12 Apr 2010 [3173] xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Mentioned xorriso alias names in chapter FILES of documentation 2010.04.12.111137 [3174] xorriso/xorriso.c test/compare_file.c Decided to put out uid_t and gid_t as unsigned long 2010.04.13.103037 [3175] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New isoburn_igopt_set_relaxed() options: only_iso_versions, no_j_force_dots 2010.04.13.103917 [3176] xorriso/xorrisoburn.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New -compliance options only_iso_version, no_j_force_dots ------------------------------------ cycle - xorriso-0.5.3 - 2010.04.13.103917 * New isoburn_igopt_set_relaxed() options: only_iso_versions, no_j_force_dots * New -compliance options only_iso_version, no_j_force_dots 2010.04.13.154201 [3177] acinclude.m4 configure.ac xorriso/configure_ac.txt More carefully checking for libreadline suitability ------------------------------------ cycle - xorriso-0.5.3 - 2010.04.13.154201 2010.04.16.195349 [3178] libisoburn/isofs_wrap.c libisoburn now always loads the System Area with the ISO image 2010.04.16.195835 [3179] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c Made -boot_image isolinux|grub patch and partition_table=on patch System Area 2010.04.17.171147 [3180] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.30 now 2010.04.17.171232 [3181] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libisofs-0.6.31 ------------------------------------ cycle - xorriso-0.5.3 - 2010.04.17.171232 2010.04.18.095808 [3182] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New -find action sort_weight, new -as mkisofs --sort-weight 2010.04.18.100814 [3183] xorriso/xorriso.c Added --sort-weight to -as mkisofs -help ------------------------------------ cycle - xorriso-0.5.3 - 2010.04.18.100814 * New -find action sort_weight, new -as mkisofs --sort-weight 2010.04.18.141143 [3184] xorriso/xorrisoburn.c Corrected image size computation for comparison with partition table 18 Apr 2010 [3185] xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Updated documentation about MBR 19 Apr 2010 [3186] svn copy -m Branching for libisoburn release 0.5.4 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/ZeroFiveFour 2010.04.19.080001 [3187] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.5.4 19 Apr 2010 [3188] xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-0.5.4 - 2010.04.19.080001 * New API call isoburn_igopt_set_system_area() * New API call isoburn_igopt_set_pvd_times() * New isoburn_igopt_set_relaxed() options: only_iso_versions, no_j_force_dots * New -boot_image any system_area=, -as mkisofs option -G * New -boot_image grub partition_table=on, --protective-msdos-label * New -boot_image isolinux partition_table=on, -as mkisofs -isohybrid-mbr * New option -volume_date, for grub-mkrescue: -as mkisofs --modification-date= * New -find action mkisofs_r and emulation -as mkisofs -r * New -compliance options only_iso_version, no_j_force_dots * New -find action sort_weight, new -as mkisofs --sort-weight 2010.04.19.095104 [3189] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.5.5 19 Apr 2010 [3190] xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-0.5.5 - 2010.04.19.095104 19 Apr 2010 [3191] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/ZeroFiveFour http://svn.libburnia-project.org/libisoburn/tags/ZeroFiveFour 20 Apr 2010 [3192] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.31 now 2010.04.20.091732 [3193] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c New -boot_image any platform_id= 2010.04.20.103448 [3194] xorriso/xorriso.c Determining boot image size only after it was added to the ISO image ------------------------------------ cycle - xorriso-0.5.5 - 2010.04.20.103448 * New -boot_image any platform_id=, -as mkisofs --efi-boot 2010.04.20.140151 [3195] xorriso/xorrisoburn.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Raised boot catalog weight to 1000000000 2010.04.20.142540 [3196] xorriso/xorrisoburn.c Changed iso_image_set_boot_platform_id() to el_torito_set_boot_platform_id() 2010.04.22.143944 [3197] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c Allowing 1 BIOS boot image and 1 EFI boot image: -boot_image grub efi_path= 2010.04.22.160615 [3198] xorriso/xorriso.c xorriso/xorrisoburn.c Bug fixes and improvements of previous revision 3197 ------------------------------------ cycle - xorriso-0.5.5 - 2010.04.22.160615 ------------------------------------ cycle - xorriso-0.5.5 - 2010.04.22.221241 2010.04.26.121051 [3199] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorrisoburn.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Allowing up to 32 boot images, -boot_image any id_string=, sel_crit= 2010.04.26.141229 [3200] xorriso/xorriso.c xorriso/xorrisoburn.c Fixed minor problems with previous revision 3199 2010.04.26.175506 [3201] xorriso/xorriso.c xorriso/xorriso_eng.html xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Some documentation updates 27 Apr 2010 [3202] xorriso/xorriso_eng.html xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Some more documentation updates 2010.04.27.072331 [3203] xorriso/xorriso.c Downgraded message about stdout redirection from NOTE to DEBUG 2010.04.27.074834 [3204] xorriso/xorrisoburn.c Fixed handling of empty current bin_path and already attached boot images 2010.04.29.133234 [3205] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Avoided -boot_image patching for images which obviously have no boot-info-table ------------------------------------ cycle - xorriso-0.5.5 - 2010.04.29.133234 * Allowing up to 32 boot images * New -boot_image bootspecs efi_path=, platform_id=, sel_crit=, id_string=, next * New -as mkisofs options --efi-boot, -eltorito-alt-boot 2010.05.03.123759 [3208] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.32 now 2010.05.03.165446 [3209] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libisofs-0.6.33 04 May 2010 [3210] svn copy -m Branching for libisoburn release 0.5.6 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/ZeroFiveSix 2010.05.04.100001 [3211] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.5.6 04 May 2010 [3212] xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-0.5.6 - 2010.05.04.100001 * Allowing up to 32 boot images * New -boot_image bootspecs efi_path=, platform_id=, sel_crit=, id_string=, next * New -as mkisofs options --efi-boot, -eltorito-alt-boot 2010.05.04.120115 [3213] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorriso.c xorriso/xorrisoburn.h xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.5.7 04 May 2010 [3214] xorriso/changelog.txt Documented changes and release timestamp 04 May 2010 [3215] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/ZeroFiveSix http://svn.libburnia-project.org/libisoburn/tags/ZeroFiveSix ------------------------------------ cycle - xorriso-0.5.7 - 2010.05.04.120115 2010.05.05.194248 [3216] xorriso/xorriso_private.h xorriso/xorriso.c xorriso/xorrisoburn.c Removed development macro Xorriso_multi_booT by making it unconditional 05 May 2010 [3217] xorriso/xorriso_eng.html Avoided to show inappropriate links on www.gnu.org ------------------------------------ cycle - xorriso-0.5.7 - 2010.05.05.194248 2010.05.15.184604 [3218] Makefile.am xorriso/xorriso_makefile_am.txt xorriso/make_xorriso_standalone.sh xorriso/compile_xorriso.sh xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorrisoburn.h - xorriso/xorriso.c - xorriso/xorrisoburn.c + xorriso/xorriso_main.c + xorriso/sfile.h + xorriso/sfile.c + xorriso/aux_objects.h + xorriso/aux_objects.c + xorriso/findjob.h + xorriso/findjob.c + xorriso/check_media.h + xorriso/check_media.c + xorriso/misc_funct.h + xorriso/misc_funct.c + xorriso/text_io.h + xorriso/text_io.c + xorriso/match.h + xorriso/match.c + xorriso/emulators.h + xorriso/emulators.c + xorriso/disk_ops.h + xorriso/disk_ops.c + xorriso/cmp_update.h + xorriso/cmp_update.c + xorriso/parse_exec.h + xorriso/parse_exec.c + xorriso/opts_a_c.c + xorriso/opts_d_h.c + xorriso/opts_i_o.c + xorriso/opts_p_z.c + xorriso/base_obj.h + xorriso/base_obj.c + xorriso/lib_mgt.h + xorriso/lib_mgt.c + xorriso/sort_cmp.h + xorriso/sort_cmp.c + xorriso/drive_mgt.h + xorriso/drive_mgt.c + xorriso/iso_img.h + xorriso/iso_img.c + xorriso/iso_tree.h + xorriso/iso_tree.c + xorriso/iso_manip.h + xorriso/iso_manip.c + xorriso/write_run.h + xorriso/write_run.c + xorriso/read_run.h + xorriso/read_run.c + xorriso/filters.h + xorriso/filters.c Splitted xorriso.c and xorrisoburn.c into smaller source modules 2010.05.16.092546 [3220] libisoburn/burn_wrap.c libisoburn/data_source.c libisoburn/isoburn.c libisoburn/isofs_wrap.c Eventually including ../config.h generated by autotools 2010.05.16.093108 [3221] xorriso/aux_objects.c xorriso/base_obj.c xorriso/check_media.c xorriso/cmp_update.c xorriso/disk_ops.c xorriso/drive_mgt.c xorriso/emulators.c xorriso/filters.c xorriso/findjob.c xorriso/iso_img.c xorriso/iso_manip.c xorriso/iso_tree.c xorriso/lib_mgt.c xorriso/make_xorriso_1.c xorriso/match.c xorriso/misc_funct.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/opts_p_z.c xorriso/parse_exec.c xorriso/read_run.c xorriso/sfile.c xorriso/sort_cmp.c xorriso/text_io.c xorriso/write_run.c xorriso/xorriso_main.c Eventually including ../config.h generated by autotools 2010.05.16.113100 [3222] xorriso/xorriso.h xorriso/xorriso_main.c xorriso/make_xorriso_standalone.sh Made option -version know again whether it is in GNU xorriso 2010.05.16.171056 [3223] xorriso/xorriso_main.c Checking for suitable sizeof(off_t) 2010.05.17.142656 [3224] + xorriso/xorriso_bootstrap.txt xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_makefile_am.txt Made compilation of GNU xorriso less verbous by use of autoheader config.h 2010.05.18.174455 [3225] Makefile.am - xorriso/makefile_libxorriso_am.txt xorriso/xorriso_main.c Moved xorriso implementation into libisoburn 19 May 2010 [3226] test/compare_file.c Eventually including ../config.h generated by autotools 2010.05.19.160540 [3227] configure.ac Makefile.am xorriso/compile_xorriso.sh Moved configuration options from xorriso_xorriso_CFLAGS to CFLAGS 2010.05.21.132725 [3228] libisoburn/libisoburn.h Mentioned both levels of API and their mutual exclusiveness 2010.05.21.133627 [3229] xorriso/xorriso.h xorriso/xorriso_main.c xorriso/base_obj.c xorriso/opts_p_z.c xorriso/write_run.c Adapted version checking to new library situation 2010.05.21.134500 [3230] libisoburn/libisoburn.h Corrected typo in remark 2010.05.23.072450 [3231] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New write extension option isoburn_igopt_no_emul_toc 2010.05.23.072616 [3232] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/write_run.c New -compliance rule no_emul_toc 2010.05.23.072845 [3233] xorriso/emulators.c Implemented -as cdrecord -V, new -as mkisofs option --no-emul-toc 23 May 2010 [3234] xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Documentation for recent enhancements 2010.05.26.123017 [3235] xorriso/emulators.c Implemented -as mkisofs options -U, -N, -l, -d, -allow-lowercase 26 May 2010 [3236] xorriso/xorriso_eng.html Updated GNU xorriso web page ------------------------------------ cycle - xorriso-0.5.7 - 2010.05.26.123017 * xorriso source split into more modules, object code moved into libisoburn * New write extension option isoburn_igopt_no_emul_toc * New -compliance rule no_emul_toc, new -as mkisofs --no-emul-toc * Implemented -as cdrecord -V * Implemented -as mkisofs options -U, -N, -l, -d, -allow-lowercase 2010.05.31.095756 [3238] xorriso/aux_objects.h xorriso/aux_objects.c Corrected a misplaced class description comment 2010.06.07.180414 [3242] xorriso/xorriso_makefile_am.txt Taking care of new Solaris adapter of libburn 07 Jun 2010 [3243] README xorriso/README_gnu_xorriso xorriso/xorriso_eng.html Updated documentation about Solaris adapter ------------------------------------ cycle - xorriso-0.5.7 - 2010.06.07.180414 * New libburn system adapter for Solaris uscsi (tested on snv134, kernel 5.11) 10 Jun 2010 [3249] xorriso/README_gnu_xorriso xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Mentioned Solaris and system dependent drive permission settings 2010.06.11.174804 [3258] configure.ac libisoburn/libisoburn.h Requiring libburn-0.8.2 now 11 Jun 2010 [3259] xorriso/configure_ac.txt Adapted xorriso-standalone to version leap libburn-0.8.3 ------------------------------------ cycle - xorriso-0.5.7 - 2010.06.11.174804 2010.06.13.105645 [3260] xorriso/emulators.c Removed surplus test expression 2010.06.13.110316 [3261] README xorriso/xorriso.h xorriso/xorriso_main.c Updated docs about existence of xorriso API in libisoburn 2010.06.13.133537 [3261] xorriso/opts_d_h.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Untangled messed-up relation between -hardlinks and -compliance 13 Jun 2010 [3263] svn copy -m Branching for libisoburn release 0.5.8 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/ZeroFiveEight 2010.06.13.140001 [3264] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h (forgotten: xorriso/xorriso_main.c) xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.5.8 13 Jun 2010 [3265] xorriso/opts_p_z.c Avoided double printing of xorriso version header line 13 Jun 2010 [3266] xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-0.5.8 - 2010.06.13.140001 * New libburn system adapter for Solaris uscsi (tested on snv134, kernel 5.11) * xorriso source split into more modules, object code moved into libisoburn * New write extension option isoburn_igopt_no_emul_toc * New -compliance rule no_emul_toc, new -as mkisofs --no-emul-toc * Implemented -as cdrecord option -V * Implemented -as mkisofs options -U, -N, -l, -d, -allow-lowercase 2010.06.14.073240 [3268] xorriso/opts_p_z.c Avoided double printing of xorriso version header line 2010.06.14.081834 [3269] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.5.9 14 Jun 2010 [3270] xorriso/changelog.txt Documented changes and release timestamp 14 Jun 2010 [3271] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/ZeroFiveEight http://svn.libburnia-project.org/libisoburn/tags/ZeroFiveEight ------------------------------------ cycle - xorriso-0.5.9 - 2010.06.14.081834 2010.06.15.160133 [3275] configure.ac libisoburn/libisoburn.h Requiring libburn-0.8.3 now (because SIGWINCH handling on Solaris) 2010.06.15.160501 [3276] acinclude.m4 Enabled use of libreadline on Solaris by eventually linking -lcurses 2010.06.16.105449 [3278] libisoburn/libisoburn.h Clarified API description of isoburn_read_iso_head() 2010.06.16.105652 [3279] xorriso/write_run.c Bug fix: check_media patch_lba0= could install wrong image size 2010.06.16.140253 [3280] xorriso/write_run.c Made patch_lba0= more modest with overwriting. 2010.06.18.053105 [3281] xorriso/emulators.c Bug fix: -as mkisofs option -volset was wrongly interpreted like -volid 2010.06.18.113147 [3282] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.33 now 2010.06.19.152046 [3283] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/write_run.c xorriso/opts_a_c.c xorriso/iso_img.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -boot_image bootspec cat_hidden= 2010.06.19.152046 [3284] xorriso/iso_tree.h xorriso/iso_tree.c xorriso/findjob.h xorriso/findjob.c xorriso/iso_manip.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New find test -disk_name 2010.06.20.072130 [3285] xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/iso_manip.c xorriso/findjob.h xorriso/findjob.c xorriso/misc_funct.h xorriso/misc_funct.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New find action -hide, new find test -hidden 2010.06.20.141555 [3286] xorriso/aux_objects.c xorriso/emulators.c xorriso/opts_p_z.c xorriso/read_run.c libisoburn/burn_wrap.c Trying to silence compiler warnings of OpenSuse Build Service 2010.06.20.164738 [3287] xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/iso_manip.c xorriso/disk_ops.c xorriso/iso_tree.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New option -hide 2010.06.22.132641 [3288] xorriso/opts_p_z.c Made -quoted_path_list continue to execute words after error in the same line 2010.06.23.134250 [3289] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/aux_objects.c xorriso/parse_exec.c xorriso/opts_i_o.c xorriso/emulators.c xorriso/disk_ops.c xorriso/misc_funct.h xorriso/misc_funct.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -as mkisofs options -hide, -hide-joliet, -hide-list, -hide-joliet-list 2010.06.23.134250 [3290] xorriso/emulators.c Included a missing header file 2010.06.23.151900 [3291] xorriso/parse_exec.h Updated the missing header file 2010.06.23.152337 [3292] xorriso/emulators.c Revoked unneeded change of revision 3290 2010.06.23.175357 [3293] xorriso/xorriso_private.h xorriso/lib_mgt.c xorriso/drive_mgt.c xorriso/iso_img.c Reset xorriso->boot_count when image gets discarded 2010.06.23.175613 [3294] xorriso/write_run.c Moved call of iso_image_set_boot_catalog_hidden() to Xorriso_write_session() ------------------------------------ cycle - xorriso-0.5.9 - 2010.06.23.175613 Bug fix: -check_media patch_lba0= could install wrong image size Bug fix: -as mkisofs option -volset was wrongly interpreted like -volid Enabled use of libreadline on Solaris New find test -disk_name New option -hide, -find action -hide, -find test -hidden New -boot_image bootspec cat_hidden=on New -as mkisofs options -hide, -hide-joliet, -hide-list, -hide-joliet-list 2010.06.24.084800 [3295] xorriso/emulators.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -as mkisofs option --boot-catalog-hide 2010.06.25.095836 [3296] xorriso/emulators.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -as mkisofs option -dir-mode 2010.06.25.102140 [3297] xorriso/emulators.c New -as mkisofs option -file-mode 2010.06.25.174329 [3298] xorriso/text_io.c Appending eventual strerror() to event message line rather than to new line 2010.06.25.175810 [3299] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/sfile.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New option -read_mkisofsrc interprets .mkisofsrc 2010.06.26.113947 [3300] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/drive_mgt.c xorriso/iso_img.c xorriso/text_io.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New options -copright_file , -biblio_file , -abstract_file 2010.06.26.114315 [3301] xorriso/emulators.c New -as mkisofs options -abstract, -biblio, -copyright ------------------------------------ cycle - xorriso-0.5.9 - 2010.06.26.114315 New -as mkisofs option --boot-catalog-hide New options -copright_file , -biblio_file , -abstract_file New option -read_mkisofsrc interprets .mkisofsrc New -as mkisofs options -dir-mode, -file-mode New -as mkisofs options -abstract, -biblio, -copyright 2010.06.28.100903 [3302] xorriso/text_io.c Supressing "Thank you for being patient" with times smaller than 2 2010.06.28.101019 [3303] xorriso/iso_tree.c Made option -lsl mark files in hidden directories as hidden 27 Jun 2010 [3304] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Removed outdated doc statement about hidden files 2010.06.29.102043 [3305] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.34 now 2010.06.29.102229 [3306] xorriso/configure_ac.txt Adapted GNU xorriso to version leap libisofs-0.6.35 2010.06.30.181822 [3315] configure.ac libisoburn/libisoburn.h Requiring libburn-0.8.4 now 2010.06.30.181908 [3316] xorriso/configure_ac.txt Adapted GNU xorriso to version leap libburn-0.8.5 02 Jul 2010 [3317] svn copy -m Branching for libisoburn release 0.6.0 \ http://svn.libburnia-project.org/libisoburn/trunk \ http://svn.libburnia-project.org/libisoburn/branches/ZeroSixZero 2010.07.02.090001 [3318] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.6.0 02 Jul 2010 [3319] xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-0.6.0 - 2010.07.02.090001 Bug fix: -check_media patch_lba0= could install wrong image size Bug fix: -as mkisofs option -volset was wrongly interpreted like -volid Enabled use of libreadline on Solaris New find test -disk_name New option -hide, -find action -hide, -find test -hidden New -boot_image bootspec cat_hidden=on New options -copright_file , -biblio_file , -abstract_file New option -read_mkisofsrc interprets .mkisofsrc Implemented -as mkisofs options -hide,-hide-joliet,-hide-list,-hide-joliet-list New -as mkisofs option --boot-catalog-hide Implemented -as mkisofs options -dir-mode, -file-mode Implemented -as mkisofs options -abstract, -biblio, -copyright 2010.07.02.195907 [3320] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.6.1 2 Jul 2010 [3321] xorriso/changelog.txt Documented changes and release timestamp 2 Jul 2010 [3322] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/ZeroSixZero http://svn.libburnia-project.org/libisoburn/tags/ZeroSixZero ------------------------------------ cycle - xorriso-0.6.1 - 2010.07.02.195907 4 Jul 2010 [3324] acinclude.m4 Added -L/usr/local/lib to libisoburn LDFLAGS for Solaris 2010.07.05.090409 [3327] xorriso/xorriso.h Removed definition of phantom xorriso options 2010.07.05.122901 [3328] configure.ac Makefile.am README + libisoburn/libisoburn.ver Hiding all non-API symbols from the linker by use of --version-script 2010.07.06.114102 [3331] configure.ac acinclude.m4 Let configure perform linker test with --version-script if enabled 2010.07.06.114503 [3332] libisoburn/libisoburn.h xorriso/xorriso.h Mentioned that public API calls must be in libisofs/libisofs.ver 2010.07.08.155900 [3333] xorriso/emulators.c Made behavior of -as mkisofs with unknown options more similar to original ------------------------------------ cycle - xorriso-0.6.1 - 2010.07.08.155900 * Made behavior of -as mkisofs with unknown options more similar to original 2010.07.29.164843 [3338] Makefile.am Detached make target "doc" from target "all". 29 Jul 2010 [3339] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Corrected manual text about -read_mkisofsrc 2010.07.30.155123 [3340] libisoburn/libisoburn.ver xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/base_obj.c xorriso/lib_mgt.c xorriso/parse_exec.c xorriso/opts_a_c.c xorriso/opts_p_z.c xorriso/emulators.c xorriso/text_io.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New option -preparer_id, -as mkisofs options -p and -preparer 30 Jul 2010 [3342] doc/doxygen.conf.in Removed problematic DETAILS_AT_TOP to silence warning of Debian buildd 30 Jul 2010 [3343] doc/doxygen.conf.in Corrected FILE_PATTERNS 2010.07.31.085437 [3344] xorriso/cmp_update.c Missing device,inode numbers caused -compare_r to report a difference ------------------------------------ cycle - xorriso-0.6.1 - 2010.07.31.085437 * New option -preparer_id, -as mkisofs options -p and -preparer 2010.08.09.092037 [3351] libisoburn/libisoburn.h doc/comments Hopefully silenced warnings of doxygen on Debian buildd 2010.08.18.102709 [3353] xorriso/emulators.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -as mkisofs option -e from Fedora genisoimage 2010.08.18.181640 [3354] xorriso/xorriso_private.h xorriso/opts_a_c.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -boot_image specifier emul_type=none|hard_disk|floppy 2010.08.18.181855 [3355] xorriso/emulators.c New -as mkisofs option -hard-disk-boot, enabled -b without -no-emul-boot 2010.08.21.103003 [3357] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorriso_eng.html Mentioned support for DVD-R DL as single-session media 2010.09.04.100823 [3359] xorriso/iso_manip.c This was obviously forgotten to commit with rev 3289 2010.09.05.113621 [3360] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New API function isoburn_igopt_set_part_offset(), requiring libisofs 0.6.35 2010.09.05.113655 [3361] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_a_c.c xorriso/text_io.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New boot_image boot specs partition_offset, partition_hd_cyl, partition_sec_hd 2010.09.05.113945 [3362] xorriso/emulators.c New -as mkisofs options -partition_offset, -partition_hd_cyl, -partition_sec_hd ------------------------------------ cycle - xorriso-0.6.1 - 2010.09.05.113945 * New API function isoburn_igopt_set_part_offset() * New -boot_image specifier emul_type=none|hard_disk|floppy * New -as mkisofs option -hard-disk-boot, enabled -b without -no-emul-boot * New -as mkisofs option -e from Fedora genisoimage * New boot_image boot specs partition_offset, partition_hd_cyl, partition_sec_hd * New -as mkisofs options -partition_offset, -partition_hd_cyl, -partition_sec_hd 2010.09.06.103347 [3363] libisoburn/isoburn.c Bug fix: Re-enabled use of iso_write_opts_set_rrip_1_10_px_ino() 2010.09.10.170925 [3364] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c libisoburn/burn_wrap.c Enabled multi-session with partition offset 2010.09.10.171223 [3365] xorriso/drive_mgt.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Enabled multi-session with partition offset 2010.09.11.125002 [3366] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c Removed development marks 2010.09.11.125039 [3367] xorriso/xorriso_private.h Removed development marks ------------------------------------ cycle - xorriso-0.6.1 - 2010.09.11.125039 * Bug fix: Regression with -hardlinks and -compliance old_rr, 0.4.2, Aug 2009 2010.09.15.065722 [3370] Makefile.am ChangeLog Meaningful change log file derived by George Danchev from web site 2010.09.15.091546 [3371] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.36 now 2010.09.15.092023 [3372] xorriso/configure_ac.txt Version leap to 0.6.37 17 Sep 2010 [3380] xorriso/configure_ac.txt Version leap to libburn-0.8.7 18 Sep 2010 [3382] svn copy -m Branching for libisoburn release 0.6.0 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/ZeroSixZero 18 Sep 2010 [3383] svn delete http://svn.libburnia-project.org/libisoburn/branches/ZeroSixZero Removed falsely named branch 18 Sep 2010 [3384] svn copy -m Branching for libisoburn release 0.6.2 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/ZeroSixTwo 2010.09.18.120001 [3385] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.6.2 18 Sep 2010 [3386] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 2010.09.18.210001 [3387] libisoburn/isoburn.c Fixed a bug with uninitialized variable introduced by rev 3364 19 Sep 2010 [3388] xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-0.6.2 - 2010.09.18.210001 libisoburn novelties: * New API function isoburn_igopt_set_part_offset() * Hiding all non-API symbols from the linker by use of --version-script * Now with history of release notes in ./ChangeLog file. xorriso novelties: * Bug fix: Regression with -hardlinks and -compliance old_rr, 0.4.2, Aug 2009 * New option -preparer_id, -as mkisofs options -p and -preparer * New -boot_image specifier emul_type=none|hard_disk|floppy * New boot_image boot specs partition_offset, partition_hd_cyl, partition_sec_hd * Made behavior of -as mkisofs with unknown options more similar to original * New -as mkisofs option -hard-disk-boot, enabled -b without -no-emul-boot * New -as mkisofs option -e from Fedora genisoimage * New -as mkisofs options -partition_offset,-partition_hd_cyl,-partition_sec_hd 2010.09.19.134042 [3389] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.6.3 2010.09.19.135354 [3390] libisoburn/isoburn.c Fixed a bug with uninitialized variable introduced by rev 3364 19 Sep 2010 [3391] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-0.6.3 - 2010.09.19.135354 19 Sep 2010 [3392] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/ZeroSixTwo http://svn.libburnia-project.org/libisoburn/tags/ZeroSixTwo 2010.09.21.142424 [3393] acinclude.m4 configure.ac Makefile.am On Linux: Run ldconfig during make install,if not --disable-ldconfig-at-install 2010.09.21.150325 [3394] acinclude.m4 configure.ac Makefile.am On Linux: More tolerance towards failures of ldconfig 22 Sep 2009 [3396] README Mentioned --disable-ldconfig-at-install 2010.09.23.135551 [3400] Makefile.am xorriso/make_xorriso_standalone.sh + doc/partition_offset.wiki Explaining the partition offset feature 2010.09.24.110727 [3406] configure.ac libisoburn/libisoburn.h Requiring libburn-0.8.7 now 2010.09.24.110841 [3407] xorriso/drive_mgt.c Reporting BD spare area info with -list_formats 29 Sep 2010 [3409] doc/partition_offset.wiki Updated partition offset wike about GRUB experiment 2010.09.29.091541 [3410] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/libisoburn.ver ChangeLog New API calls isoburn_igopt_attach_jte() and isoburn_igopt_detach_jte() 2010.09.29.092348 [3411] configure.ac xorriso/xorriso.h libisoburn/libisoburn.ver xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_i_o.c xorriso/emulators.c xorriso/lib_mgt.c xorriso/write_run.c ChangeLog New -as mkisofs options -jigdo-* and -md5-list as of genisoimage 2010.09.29.092537 [3412] xorriso/configure_ac.txt Enabled use of libjte for GNU xorriso 2010.09.29.124423 [3413] xorriso/write_run.c Avoided trailing 64 kB alignment with -compliance no_emul_toc 2010.09.29.152827 [3414] xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/emulators.c xorriso/lib_mgt.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/convert_man_to_html.sh ChangeLog New option -jigdo 2010.09.29.164121 [3415] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/lib_mgt.c xorriso/text_io.c xorriso/aux_objects.h xorriso/aux_objects.c Enabled -status -jigdo 2010.09.30.074208 [3416] xorriso/lib_mgt.c Switched from old libjte API names to new ones 2010.10.01.190235 [3417] xorriso/xorriso_private.h xorriso/base_obj.c Made two non-public parameters independent of Xorriso_with_libjtE ------------------------------------ cycle - xorriso-0.6.3 - 2010.10.01.190235 * New API calls isoburn_igopt_attach_jte() and isoburn_igopt_detach_jte() * New -as mkisofs options -jigdo-* and -md5-list as of genisoimage * New option -jigdo 2010.10.02.121147 [3418] xorriso/emulators.c xorriso/lib_mgt.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -as mkisofs option -jigdo-template-compress 2010.10.02.150240 [3419] xorriso/lib_mgt.c Added a blank to xorriso Preparer Id string 2010.10.02.164306 [3420] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.37 now 2010.10.02.210023 [3421] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/libisoburn.ver ChangeLog New API call isoburn_igopt_set_tail_blocks() 2010.10.02.210305 [3422] xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Letting libisofs do the padding with -jigdo, rather than disabling padding 2010.10.03.082304 [3423] xorriso/opts_d_h.c xorriso/emulators.c xorriso/lib_mgt.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -as mkisofs options -checksum_algorithm_iso, -checksum_algorithm_template 03 Oct 2010 [3424] ChangeLog Forgot to commit ChangeLog 2010.10.03.171305 [3425] xorriso/lib_mgt.c Reacting with FATAL event on failure to create libjte_handle 03 Oct 2010 [3426] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Corrected xorriso docs about meaning of -jigdo-map and .md5 file addresses ------------------------------------ cycle - xorriso-0.6.3 - 2010.10.03.171305 * New API call isoburn_igopt_set_tail_blocks() * New -as mkisofs options -checksum_algorithm_iso, -checksum_algorithm_template 2010.10.04.112234 [3427] xorriso/opts_d_h.c xorriso/emulators.c xorriso/lib_mgt.c xorriso/write_run.c Enabled use of libjte message list 2010.10.04.113140 [3428] xorriso/lib_mgt.c Silenced compiler warning about unused variable 2010.10.04.155110 [3429] libisoburn/libisoburn.h libisoburn/burn_wrap.c libisoburn/libisoburn.ver ChangeLog Tests for version of libjte, new API call isoburn_libjte_req() 2010.10.04.155226 [3430] xorriso/lib_mgt.c Reporting libjte version with option -version 2010.10.05.180016 [3431] xorriso/iso_manip.c Fixed a potential SIGSEGV by pointer offset -1. Detected by valgrind. 2010.10.06.162230 [3432] xorriso/write_run.c Fixed a theoretically possible race condition of burn end and ISO generator end 2010.10.07.114916 [3433] libisoburn/burn_wrap.c xorriso/base_obj.c xorriso/lib_mgt.c xorriso/write_run.c Preparing for GNU xorriso to include libjte source 7 Oct 2010 [3434] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Enhanced xorriso docs about meaning of .md5 file addresses 2010.10.07.180935 [3435] libisoburn/burn_wrap.c xorriso/base_obj.c xorriso/lib_mgt.c xorriso/write_run.c Corrected compile problems introduced with rev 3433 2010.10.08.093338 [3436] libisoburn/burn_wrap.c Fixed inability to compile without enabled libjte. Introduced by rev 3429. 8 Oct 2010 [3437] COPYRIGHT Removed unrelated copyright statements from libisoburn COPYRIGHT 2010.10.12.103027 [3438] libisoburn/libisoburn.h libisoburn/isoburn.c Allowed to set System Area type via isoburn_igopt_set_system_area() 2010.10.12.103157 [3439] xorriso/xorriso_private.h xorriso/opts_a_c.c xorriso/emulators.c Provisorily: -boot_image mips_path= , -as mkisofs -mips-boot. No Eltorito then. 2010.10.12.183125 [3440] xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/opts_a_c.c xorriso/emulators.c xorriso/iso_img.c Lifted the ban to combine MIPS Big Endian boot with El Torito 2010.10.13.170641 [3441] xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/emulators.c xorriso/iso_img.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Polished and documented MIPS booting option 2010.10.15.112050 [3442] xorriso/xorriso_private.h xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/emulators.c xorriso/iso_img.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 -boot_image mipsel_path= , -as mkisofs -mipsel-boot. 2010.10.15.121533 [3443] xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_makefile_am.txt xorriso/COPYRIGHT_gnu_xorriso xorriso/README_gnu_xorriso xorriso/AUTHORS_gnu_xorriso xorriso/xorriso_eng.html Included libjte in GNU xorriso 2010.10.15.125440 [3444] libisoburn/burn_wrap.c xorriso/base_obj.c xorriso/lib_mgt.c xorriso/configure_ac.txt United macro Xorriso_jte_standalonE with macro Xorriso_standalonE ------------------------------------ cycle - xorriso-0.6.3 - 2010.10.15.125440 * New API call isoburn_libjte_req() * New bootspecs mips_path= and mipsel_path= for Debian MIPS releases * New -as mkisofs options -mips-boot and -mipsel-boot 2010.10.18.155353 [3446] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/libisoburn.ver New API calls isoburn_igopt_set_partition_img, isoburn_igopt_get_partition_img 2010.10.18.160132 [3448] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/emulators.c xorriso/iso_img.c xorriso/write_run.c libisoburn/libisoburn.ver xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New option -append_partition, -as mkisofs -append_partition ------------------------------------ cycle - xorriso-0.6.3 - 2010.10.18.160132 * New option -append_partition, -as mkisofs -append_partition 2010.10.19.104814 [3449] xorriso/xorriso.h xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Minor adjustments ------------------------------------ cycle - xorriso-0.6.3 - 2010.10.19.104814 2010.10.19.170704 [3451] ChangeLog xorriso/write_run.c Avoiding potential endless write pacifier loop. Introduced with rev 3432. 2010.10.20.075221 [3452] xorriso/write_run.c Cancelling libisofs write thread in case of early libburn end 2010.10.20.170430 [3461] xorriso/configure_ac.txt Version leap to libburn-0.8.9 2010.10.20.170546 [3462] configure.ac libisoburn/libisoburn.h Requiring libburn-0.8.8 now 2010.10.21.180343 [3463] xorriso/drive_mgt.c Corrected -check_media handling of last track on BD-R resp. BD-ROM 2010.10.23.162213 [3464] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.38 now 2010.10.23.162302 [3465] xorriso/configure_ac.txt Adapted GNU xorriso to version leap libisofs-0.6.39 26 Oct 2010 [3466] svn copy -m Branching for libisoburn release 0.6.4 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/ZeroSixFour 2010.10.26.100001 [3467] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.6.4 26 Oct 2010 [3468] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-0.6.4 - 2010.10.26.100001 * New API call isoburn_libjte_req() * New API calls isoburn_igopt_attach_jte() and isoburn_igopt_detach_jte() * New API call isoburn_igopt_set_tail_blocks() * New API call isoburn_libjte_req() * New option -jigdo * New -as mkisofs options -jigdo-* and -md5-list as of genisoimage * New -as mkisofs options -checksum_algorithm_iso, -checksum_algorithm_template * New bootspecs mips_path= and mipsel_path= for Debian MIPS releases * New -as mkisofs options -mips-boot and -mipsel-boot * New option -append_partition, -as mkisofs -append_partition 2010.10.26.104219 [3469] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.6.5 26 Oct 2010 [3470] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 26 Oct 2010 [3471] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/ZeroSixFour http://svn.libburnia-project.org/libisoburn/tags/ZeroSixFour ------------------------------------ cycle - xorriso-0.6.5 - 2010.10.26.104219 2010.10.27.063628 [3472] xorriso/emulators.c Bug fix: -as mkisofs -print-size printed the size but also produced ISO image 2010.10.27.063705 [3473] xorriso/emulators.c New -as mkisofs option -joliet-long ------------------------------------ cycle - xorriso-0.6.5 - 2010.10.27.063705 * Bug fix: -as mkisofs -print-size printed the size but also produced ISO image * New -as mkisofs option -joliet-long 2010.10.29.164503 [3475] xorriso/write_run.c Added necessary isoburn_cancel_prepared_write() calls ------------------------------------ cycle - xorriso-0.6.5 - 2010.10.29.164503 ------------------------------------ cycle - xorriso-0.6.5 - 2010.11.01.113243 * Build problem fix on Linux 2.4 in GNU xorriso libjte/checksum.c 2010.11.01.191542 [3477] xorriso/iso_manip.c Allowed to perform -rm_r / 2010.11.03.081124 [3478] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/drive_mgt.h xorriso/drive_mgt.c xorriso/findjob.c xorriso/read_run.c Testing for abort file during -check_media 2010.11.05.143916 [3470] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/libisoburn.ver New API calls isoburn_igopt_set_disc_label(), isoburn_igopt_get_disc_label() 2010.11.05.144616 [3480] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/emulators.c xorriso/iso_img.c xorriso/write_run.c New bootspec sparc_label=, new -as mkisofs options -sparc-boot , -sparc-label 05 Nov 2010 [3481] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Documentation changes of rev 3480 ------------------------------------ cycle - xorriso-0.6.5 - 2010.11.05.144616 * New API calls isoburn_igopt_set_disc_label(), isoburn_igopt_get_disc_label() * New bootspec sparc_label=, new -as mkisofs options -sparc-boot , -sparc-label 2010.11.06.133454 [3482] libisoburn/libisoburn.h xorriso/write_run.c ChangeLog Declared that isoburn_cancel_prepared_write() waits until iso write thread ends 2010.11.21.065727 [3484] xorriso/make_xorriso_standalone.sh Included jigdo-gen-md5-list in GNU xorriso ------------------------------------ cycle - xorriso-0.6.5 - 2010.11.21.065727 2010.11.23.193708 [3485] xorriso/iso_img.c Improved behavior with loading multiple boot images of identical content 2010.11.23.200346 [3486] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/lib_mgt.c xorriso/write_run.c Avoided to bother libjte if no output paths are given ------------------------------------ cycle - xorriso-0.6.5 - 2010.11.23.200346 2010.11.24.100845 [3487] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New pseudo extension isoburn_igopt_will_cancel to avoid MISHAP event 2010.11.24.101056 [3488] xorriso/write_run.c Making use of isoburn_igopt_will_cancel with xorriso -print_size ------------------------------------ cycle - xorriso-0.6.5 - 2010.11.24.101056 2010.11.27.134702 [3489] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.39 now 2010.11.30.093929 [3490] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c libisoburn/data_source.c libisoburn/libisoburn.ver New API calls isoburn_ropt_set_displacement(), isoburn_ropt_get_displacement() 2010.11.30.094310 [3491] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/drive_mgt.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 libisoburn/libisoburn.ver ChangeLog New option -displacement 2010.11.30.104719 [3492] xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/disk_ops.h xorriso/disk_ops.c Improved messages at the end of partially failed -extract runs 2010.11.30.112050 [3493] xorriso/opts_p_z.c Processing output of -as mkisofs by -pkt_output if enabled 2010.11.30.170112 [3494] xorriso/parse_exec.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Clarified occasions of -mark message and removed surplus -mark message emitter 2010.12.01.173750 [3495] libisoburn/libisoburn.h Clarified description of isoburn_ropt_set_displacement() 2010.12.02.063209 [3496] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso_main.c xorriso/opts_d_h.c xorriso/emulators.c xorriso/iso_img.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 No -rollback in -as mkisofs -print-size. New flag in Xorriso_change_is_pending. 2010.12.02.111029 [3497] xorriso/xorrisoburn.h xorriso/opts_d_h.c xorriso/disk_ops.c xorriso/iso_manip.c xorriso/findjob.h xorriso/findjob.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New action estimate_size for -find and -findx ------------------------------------ cycle - xorriso-0.6.5 - 2010.12.02.111029 * New API calls isoburn_ropt_set_displacement(), isoburn_ropt_get_displacement() * New option -displacement * New action estimate_size for -find and -findx 2010.12.04.174311 [3498] libisoburn/isofs_wrap.c Fixed a bug about read displacement introduced with rev 3490 2010.12.04.174431 [3499] xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Preliminarily banned writing while read displacement is non-zero 2010.12.06.094347 [3500] xorriso/opts_a_c.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Allowed writing with read displacement if target media is blank 2010.12.07.174921 [3501] xorriso/iso_img.c Made -rom_toc_scan emul_off work with -mount ... sbsector ... 2010.12.08.194225 [3510] xorriso/opts_d_h.c Fixed a potential bug introduced with rev 3497 2010.12.08.194325 [3511] xorriso/iso_img.c Fixed a bug introduced with rev 3501 08 Dec 2010 [3512] xorriso/configure_ac.txt GNU xorriso version leap to libburn-0.9.1 2010.12.10.123534 [3513] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.40 now 2010.12.10.123634 [3514] xorriso/configure_ac.txt Adapted GNU xorriso to version leap libisofs-0.6.41 11 Dec 2010 [3515] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Clarification about -md5, -check_media and -find ... -damaged 12 Dec 2010 [2516] svn copy -m Branching for libisoburn release 0.6.6 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/ZeroSixSix 2010.12.12.090001 [3517] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.6.6 12 Dec 2010 [3518] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-0.6.6 - 2010.12.12.090001 * New API calls isoburn_igopt_set_disc_label(), isoburn_igopt_get_disc_label() * New API calls isoburn_ropt_set_displacement(), isoburn_ropt_get_displacement() * 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 2010.12.12.120823 [3519] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-0.6.7 12 Dec 2010 [3520] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 12 Dec 2010 [3521] svn move -m Promoted branch to tag ttp://svn.libburnia-project.org/libisoburn/branches/ZeroSixSix http://svn.libburnia-project.org/libisoburn/tags/ZeroSixSix ------------------------------------ cycle - xorriso-0.6.7 - 2010.12.12.120823 2010.12.13.123226 [3523] configure.ac xorriso/configure_ac.txt Prepending ./configure generated options to CFLAGS rather than appending them 2010.12.22.133742 [3524] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/libisoburn.ver New API call isoburn_igopt_set_untranslated_name_len() 2010.12.22.133936 [3525] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -compliance options untranslated_names , untranslated_name_len= 2010.12.22.151542 [3526] xorriso/emulators.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -as mkisofs option -untranslated_name_len 23 Dec 2010 [3527] + doc/faq.wiki Took source file of libburnia-project.org/wiki/FAQ into SVN 2010.12.23.190134 [3529] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/emulators.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 ChangeLog New -compliance option iso_9660_1999, -as mkisofs option -iso-level 4 ------------------------------------ cycle - xorriso-0.6.7 - * New API call isoburn_igopt_set_untranslated_name_len() * 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 24 Dec 2010 [3530] doc/faq.wiki New q in faq 2010.12.24.135515 [3531] libisoburn/libisoburn.h Mentioned ISO 9660 level 3 in libisoburn API 2010.12.25.071212 [3532] configure.ac libisoburn/libisoburn.h Requiring libisofs-0.6.41 now 2010.12.25.071522 [3533] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/write_run.c xorriso/emulators.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -compliance option iso_9660_level=number 2010.12.25.091515 [3534] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New isoburn_igopt_set_relaxed() option isoburn_igopt_allow_dir_id_ext 2010.12.25.092828 [3535] xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -compliance option allow_dir_id_ext 2010.12.25.094309 [3536] xorriso/emulators.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -as mkisofs option -disallow_dir_id_ext, allow_dir_id_ext is default ------------------------------------ cycle - xorriso-0.6.7 - 2010.12.25.094309 * New -compliance option iso_9660_level=number * New -compliance option allow_dir_id_ext * New -as mkisofs option -disallow_dir_id_ext 2010.12.28.093144 [3538] xorriso/write_run.c Made -print_size take into account the toc emulation on blank overwriteables 2010.12.28.123348 [3539] xorriso/emulators.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Disabled TOC emulation with -as mkisofs. May be re-enabled by --emul-toc. ------------------------------------ cycle - xorriso-0.6.7 - 2010.12.28.123348 * Disabled TOC emulation with -as mkisofs. May be re-enabled by --emul-toc. 2010.12.29.104047 [3540] xorriso/emulators.c Bug fix: -as mkisofs -print-size did not account for -partition_offset ------------------------------------ cycle - xorriso-0.6.7 - 2010.12.29.104047 * Bug fix: -as mkisofs -print-size did not account for -partition_offset 30 Dec 2010 [3541] doc/partition_offset.wiki Mentioned Debian daily and weekly builds as examples of partiton_offset 2011.01.04.193042 [3543] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_a_c.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Default -abort_on value is now "FAILURE", for dialog it stays "FATAL" 2011.01.06.111034 [3544] xorriso/parse_exec.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Changed dialog default -abort_on value to "NEVER" 6 Jan 2011 [3545] ChangeLog Updated change log ------------------------------------ cycle - xorriso-0.6.7 - 2011.01.06.111034 * Default -abort_on value is now "FAILURE" with batch and "NEVER" with dialog 2011.01.16.182558 [3557] configure.ac libisoburn/libisoburn.h Requiring libisofs-1.0.0 and libburn-1.0.0 now 16 Jan 2011 [3558] xorriso/configure_ac.txt Adapted GNU xorriso to version leap libisofs-1.0.1 , libburn-1.0.1 16 Jan 2011 [3559] doc/partition_offset.wiki Updated partition offset wiki text about --no-emul-toc 16 Jan 2011 [3560] svn copy -m "Branching for libisoburn release 1.0.0" \ http://svn.libburnia-project.org/libisoburn/trunk \ http://svn.libburnia-project.org/libisoburn/branches/1.0.0 2011.01.16.193257 [3562] xorriso/emulators.c xorriso/opts_p_z.c Updated copyright messages to 2011 2011.01.16.200001 [3563] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-1.0.0 16 Jan 2011 [3564] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.0.0 - 2011.01.16.200001 * New API call isoburn_igopt_set_untranslated_name_len() * 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 * New -as mkisofs option -disallow_dir_id_ext * Disabled TOC emulation with -as mkisofs. May be re-enabled by --emul-toc. * Default -abort_on value is now "FAILURE" with batch and "NEVER" with dialog * Bug fix: -as mkisofs -print-size did not account for -partition_offset 2011.01.16.193257 [3561] xorriso/emulators.c xorriso/opts_p_z.c Updated copyright messages to 2011 2011.01.17.092111 [3565] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-1.0.1 17 Jan 2011 [3566] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 17 Jan 2011 [3567] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.0.0 http://svn.libburnia-project.org/libisoburn/tags/1.0.0 ------------------------------------ cycle - xorriso-1.0.1 - 2011.01.17.092111 2011.01.18.154443 [3568] libisoburn/isoburn.h Avoiding if not available. Trying to use in that case. 2011.01.18.154717 [3569] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/lib_mgt.c xorriso/write_run.c Avoiding if not available. Trying to use in that case. ------------------------------------ cycle - xorriso-1.0.1 - 2011.01.18.154717 * Removed compiler obstacles of GNU xorriso on Solaris 9 18 Jan 2011 [3571] doc/faq.wiki Small change in FAQ wiki text 19 Jan 2011 [3572] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Mentioned missing mkisofs -old-root functionality in man page ------------------------------------ cycle - xorriso-1.0.1 - 2011.01.24.141621 * Bug fix: ECMA-119 standards violation with Volume Descriptor Set Terminator 2011.01.26.132843 [3573] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New isoburn_igopt_set_extensions() option isoburn_igopt_old_empty 2011.01.26.133107 [3574] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -compliance option old_empty 26 Jan 2011 [3575] configure.ac Requiring libisofs-1.0.1 now ------------------------------------ cycle - xorriso-1.0.1 - 2011.01.26.133107 * New isoburn_igopt_set_extensions() option isoburn_igopt_old_empty 2011.01.26.184140 [3576] libisoburn/isoburn.c Followed name change in the yet unstable part of libisofs API 2011.01.26.210359 [3577] xorriso/emulators.c New -as mkisofs option --old-empty ------------------------------------ cycle - xorriso-1.0.1 - * New -as mkisofs option --old-empty 2011.01.31.135917 [3578] xorriso/iso_manip.c Bug fix: Option -mkdir yielded SIGSEGV due to a NULL pointer 2011.02.01.185830 [3579] xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/parse_exec.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/iso_manip.c libisoburn/libisoburn.ver xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorriso_eng.html ChangeLog New option -clone 2011.02.02.174154 [3580] xorriso/xorrisoburn.h xorriso/iso_manip.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Disallowed -clone to overwrite existing nodes 2011.02.04.191922 [3581] xorriso/xorriso.h xorriso/parse_exec.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/iso_manip.c xorriso/sfile.c libisoburn/libisoburn.ver xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New option -cp_clone 2011.02.07.182947 [3582] xorriso/cmp_update.c xorriso/sort_cmp.c Do not regard file as changed just because no ino was recorded 2011.02.07.184304 [3583] xorriso/xorrisoburn.h xorriso/opts_p_z.c xorriso/emulators.c xorriso/iso_tree.h xorriso/iso_tree.c xorriso/iso_manip.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -as mkisofs options -root , -old-root, --old-root-no-md5, --old-root-no-ino, --old-root-dev 2011.02.07.202851 [3584] xorriso/emulators.c xorriso/iso_manip.c xorriso/sort_cmp.c xorriso/iso_tree.h xorriso/iso_tree.c Some corrections of the previous commit 2011.02.08.133624 [3585] xorriso/emulators.c -as mkisofs: Enabled reading of xattr and md5 before image loading 2011.02.12.171423 [3587] xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/base_obj.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/emulators.c xorriso/cmp_update.h xorriso/cmp_update.c xorriso/disk_ops.c xorriso/iso_manip.h xorriso/iso_manip.c xorriso/findjob.h xorriso/lib_mgt.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -find actions update_merge, rm_merge, clear_merge. -cp_clone now merges. 2011.02.12.172930 [3588] xorriso/cmp_update.c Reacted on compiler warning about uninitialized variable 2011.02.14.090737 [3590] xorriso/base_obj.c xorriso/parse_exec.c xorriso/filters.c xorriso/write_run.c Closed memory leaks detected by valgrind 14 Feb 2011 [3591] xorriso/xorriso_eng.html ChangeLog Updated change log ------------------------------------ cycle - xorriso-1.0.1 - 2011.02.14.090737 * Bug fix: Option -mkdir yielded SIGSEGV due to a NULL pointer * New options -clone and -cp_clone * New -find actions update_merge, rm_merge, clear_merge * New -as mkisofs options -root , -old-root * New -as mkisofs options --old-root-no-md5, --old-root-no-ino, --old-root-dev 2011.02.19.112243 [3593] xorriso/emulators.c Small adjustments in mkisofs emulation Bug fix: -as mkisofs -l resp. -full-iso9660-filenames did not work 2011.02.19.112439 [3594] xorriso/filters.c Updated copyright 2011.02.19.112541 [3595] xorriso/xorriso.texi Corrections in xorriso man page 19 Feb 2011 [3596] xorriso/xorriso_eng.html ChangeLog Updated change log 19 Feb 2011 [3597] xorriso/xorriso.info xorriso/xorriso.1 info document and man page for recent texi corrections ------------------------------------ cycle - xorriso-1.0.1 - 2011.02.19.112541 * Bug fix in libisofs: 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. 2011.02.21.130729 [3598] xorriso/emulators.c Correction about -as mkisofs --old-root-no-ino 2011.02.22.073504 [3599] xorriso/opts_a_c.c xorriso/iso_manip.c Issueing messages with -clone and -cp_clone 2011.02.22.073641 [3600] xorriso/emulators.c Corrected a bug that prevented -as mkisofs option -output 2011.02.22.123730 [3601] xorriso/emulators.c Made -as mkisofs ignore option -disable-deep-relocation rather than failing 2011.02.22.143131 [3602] xorriso/emulators.c New -as mkisofs option -max-iso9660-filenames 22 Feb 2011 [3603] xorriso/xorriso_eng.html ChangeLog Updated change log ------------------------------------ cycle - xorriso-1.0.1 - 2011.02.22.143131 * New -as mkisofs option -max-iso9660-filenames 23 Feb 2011 [3608] svn copy -m Branching for libisoburn release 1.0.2 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.0.2 2011.02.23.140001 [3609] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-1.0.2 23 Feb 2011 [3610] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.0.2 - 2011.02.23.140001 * 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 * Removed compiler obstacles of GNU xorriso on Solaris 9 * New isoburn_igopt_set_extensions() option isoburn_igopt_old_empty * 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 2011.02.23.202632 [3616] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-1.0.3 23 Feb 2011 [3617] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-1.0.3 - 2011.02.23.202632 23 Feb 2011 [3618] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.0.2 http://svn.libburnia-project.org/libisoburn/tags/1.0.2 2011.02.24.191908 [3620] libisoburn/isofs_wrap.c Corrected a flaw found by George Danchev with cpp 2011.02.24.192029 [3621] xorriso/opts_d_h.c xorriso/text_io.c xorriso/filters.c Corrected flaws found by George Danchev with cpp 2011.02.26.100158 [3622] xorriso/emulators.c Bug fix: -as mkisofs -old-root did not work with -graft-points 2011.02.28.190842 [3623] xorriso/emulators.c Bug fix: -as mkisofs -partition_hd_cyl had no effect 28 Feb 2011 [3624] xorriso/make_xorriso_1.c When producing man page from texi: substitute @minus{} within @item 2011.03.01.145125 [3626] libisoburn/burn_wrap.c Bug fix: -as mkisofs -C attempts to read volume header of blank media 2011.03.01.152159 [3627] libisoburn/burn_wrap.c Installed a test against non-zero msc1 on blank input drives 2011.03.02.093009 [3628] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/emulators.c xorriso/write_run.c Counting padding as part of the image with -as mkisofs 2011.03.02.094049 [3629] xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/text_io.c New -padding modes "included" and "excluded" 02 Mar 2011 [3630] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Updated documentation 02 Mar 2011 [3631] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.0.3 - 2011.03.02.094049 * 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 -C attempted to read volume header of blank media * Bug fix: isohybrid image size was not aligned to cylinder boundary * New -padding modes "included" and "appended" 2011.03.03.181601 [3632] libisoburn/libisoburn.h libisoburn/isoburn.c New bits 8 and 9 with options of isoburn_igopt_set_system_area() 2011.03.03.181850 [3633] xorriso/xorriso_private.h xorriso/opts_a_c.c xorriso/emulators.c xorriso/text_io.c New bootspec partition_cyl_align=, new -as mkisofs option -partition_cyl_align 03 Mar 2011 [3634] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Updated documentation 04 Mar 2011 [3635] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Clarifications about cylinder size and alignment 04 Mar 2011 [3626] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.0.3 - 2011.03.03.181850 * New bootspec partition_cyl_align=, new -as mkisofs option -partition_cyl_align 2011.03.05.090434 [3637] xorriso/parse_exec.c xorriso/emulators.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -as mkisofs and -as cdrecord option --no_rc 2011.03.05.141534 [3638] + xorriso/xorrisofs.texi + xorriso/xorrisofs.info + xorriso/xorrisofs.1 Makefile.am xorriso/make_xorriso_standalone.sh xorriso/xorriso_makefile_am.txt xorriso/make_docs.sh Own man page and info document for xorrisofs 05 Mar 2011 [3639] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Mentioned man xorrisofs in man xorriso 2011.03.06.153741 [3640] xorriso/emulators.c Helptext of -as mkisofs now points to man xorrisofs 06 Mar 2011 [3641] xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Polished xorrisofs documentation 2011.03.07.101547 [3642] xorriso/opts_a_c.c xorriso/emulators.c Bug fix: -as mkisofs did not properly unescape target part of pathspecs 07 Mar 2011 [3643] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.0.3 - 2011.03.07.101547 * New -as mkisofs and -as cdrecord option --no_rc * Own man page and info document for xorrisofs * Bug fix: -as mkisofs did not properly unescape target part of pathspecs 2011.03.09.071325 [3644] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c New isoburn_ropt_set_extensions() option isoburn_ropt_nomd5tag 2011.03.09.071502 [3645] xorriso/xorriso_private.h xorriso/opts_i_o.c xorriso/emulators.c xorriso/text_io.c xorriso/drive_mgt.c New -md5 modes load_check_off and load_check_on 08 Mar 2011 [3646] doc/partition_offset.wiki Updated partition offset wiki 2011.03.09.123847 [3647] xorriso/xorriso.h Marked options introduced since 0.5.8 by the promised @since tags 09 Mar 2011 [3648] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Corrections and updates of documentation 10 Mar 2011 [3649] xorriso/README_gnu_xorriso xorriso/make_xorriso_standalone.sh xorriso/convert_man_to_html.sh + xorriso/man_xorrisofs_to_html.sh + xorriso/man_xorriso_to_html.sh xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 xorriso/xorriso_eng.html HTML version of man xorrisofs 10 Mar 2011 [3654] svn copy -m Branching for libisoburn release 1.0.4 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.0.4 2011.03.10.110001 [3655] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-1.0.4 10 Mar 2011 [3656] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.0.4 - 2011.03.10.110001 * New isoburn_ropt_set_extensions() option isoburn_ropt_nomd5tag * 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 2011.03.10.135207 [3661] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-1.0.5 10 Mar 2011 [3662] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 10 Mar 2011 [3663] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.0.4 http://svn.libburnia-project.org/libisoburn/tags/1.0.4 ------------------------------------ cycle - xorriso-1.0.5 - 2011.03.10.135207 13 Mar 2011 [3668] COPYRIGHT Updated copyright year 2011.03.13.131305 [3669] configure.ac libisoburn/libisoburn.h Requiring libburn-1.0.5 2011.03.13.131557 [3670] libisoburn/burn_wrap.c libisoburn/isofs_wrap.c Prepared libisoburn for drive role 4 2011.03.21.093208 [3679] libisoburn/burn_wrap.c libisoburn/isofs_wrap.c Prepared libisoburn for drive role 5 2011.03.21.093705 [3680] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/write_run.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 libisoburn/libisoburn.ver New option -early_drive_test 2011.03.21.113720 [3681] libisoburn/libisoburn.h libisoburn/burn_wrap.c libisoburn/libisoburn.ver New API call isoburn_set_truncate() 2011.03.21.113858 [3682] xorriso/write_run.c Made use of new API call isoburn_set_truncate 2011.03.21.165533 [3683] xorriso/xorriso_private.h xorriso/opts_d_h.c xorriso/drive_mgt.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -early_stdio_test option appendable_wo 2011.03.22.081408 [3684] libisoburn/burn_wrap.c Fixed use of uninitialized variable when blanking rol5 pseudo drives 24 Mar 2011 [3686] xorriso/README_gnu_xorriso Fixed typos in GNU xorriso readme file 2011.03.24.182518 [3688] libisoburn/burn_wrap.c libisoburn/isofs_wrap.c Better handling of pseudo-drive without read-permission 2011.03.25.191936 [3689] configure.ac libisoburn/libisoburn.h Requiring libisofs-1.0.5 2011.03.26.100519 [3690] xorriso/iso_manip.c Reporting target name if adding of new node fails with ISO_WRONG_ARG_VALUE 2011.03.26.143944 [3691] xorriso/write_run.c Unconditionally reporting iso_level with -status -compliance 2011.03.26.144233 [3692] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New relax option isoburn_igopt_joliet_long_names 2011.03.26.144541 [3693] xorriso/emulators.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -compliance option joliet_long_names 26 Mar 2011 [3694] xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Small adjustments to xorrisofs.texi 26 Mar 2011 [3695] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.0.5 - 2011.03.26.144541 * New API call isoburn_set_truncate() * New relax option isoburn_igopt_joliet_long_names * New option -early_stdio_test * 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 2011.03.26.203042 [3696] xorriso/iso_manip.c Interpreting new libisofs error codes ISO_RR_NAME_TOO_LONG ISO_RR_NAME_RESERVED 2011.03.29.150930 [3697] xorriso/iso_manip.c Interpreting new libisofs error code ISO_RR_PATH_TOO_LONG 2011.03.29.151144 [3698] xorriso/write_run.c Bug fix: -as mkisofs padding did not work (regression in 1.0.4) 30 Mar 2011 [3699] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.0.5 - 2011.03.29.151144 * Bug fix: -as mkisofs padding did not work (regression in 1.0.4) 2011.04.01.133116 [3700] xorriso/emulators.c Allowing double dashes with all long xorrisofs options 3 Apr 2011 [3701] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Clarified relation of startup files, -options_from_file and quoted input. 3 Apr 2011 [3702] xorriso/COPYRIGHT_gnu_xorriso xorriso/README_gnu_xorriso Updated info about GNU xorriso copyright and libjte 2011.04.03.094634 [3703] xorriso/xorriso.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New options -print_info and -print_mark 2011.04.04.064909 [3704] xorriso/write_run.c Bug fix: Options -gid and -uid had no effect 2011.04.04.071443 [3705] xorriso/drive_mgt.c Avoided to report Volume Id when aquiring drive with blank media 4 Apr 2011 [3706] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.0.5 - 2011.04.04.071443 * Bug fix: Options -gid and -uid had no effect * New options -print_info and -print_mark 2011.04.04.140752 [3707] Makefile.am xorriso/xorriso_makefile_am.txt xorriso/make_xorriso_standalone.sh + doc/startup_file.txt Added an example of a startup file 2011.04.05.072141 [3708] xorriso/xorriso_main.c xorriso/write_run.c Fixed a typo in messages and goto label 07 Apr 2011 [3709] xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Clarification about -as mkisofs pathspecs 07 Apr 2011 [3710] doc/partition_offset.wiki Updated partition offset wiki about cylinder alignment 08 Apr 2011 [3711] doc/faq.wiki FAQ about release version numbers 08 Apr 2011 [3716] svn copy -m Branching for libisoburn release 1.0.6 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.0.6 2011.04.08.193001 [3717] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-1.0.6 08 Apr 2011 [3718] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.0.6 - 2011.04.08.193001 * 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 2011.04.09.105219 [3723] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-1.0.7 09 Apr 2011 [3724] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 09 Apr 2011 [3725] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.0.6 http://svn.libburnia-project.org/libisoburn/tags/1.0.6 ------------------------------------ cycle - xorriso-1.0.7 - 2011.04.09.105219 2011.04.13.204236 [3726] xorriso/emulators.c Bug fix: mkisofs emulation could ignore options (regression in 0.1.6) 14 Apr 2011 [3727] svn copy -m Branching for libisoburn release 1.0.8 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.0.8 2011.04.15.073001 [3278] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-1.0.8 14 Apr 2011 [3729] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 2011.04.14.073001 [3730] xorriso/xorriso_timestamp.h ChangeLog xorriso/changelog.txt Corrected release date ----------------------------------- release - xorriso-1.0.8 - 2011.04.13.073001 * Bug fix: mkisofs emulation could ignore options (regression in 0.1.6) 2011.04.14.081721 [3731] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h Version leap to libisoburn-1.0.9 14 Apr 2011 [3732] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 14 Apr 2011 [3733] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.0.8 http://svn.libburnia-project.org/libisoburn/tags/1.0.8 ------------------------------------ cycle - xorriso-1.0.9 - 2011.04.14.081721 15 Apr 2011 [3734] doc/doxygen.conf.in Disabled HAVE_DOT in doxygen.conf 18 Apr 2011 [3736] doc/partition_offset.wiki doc/faq.wiki Mentioned success and failure reports of partition offset 2011.04.22.081847 [3737] libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/burn_wrap.c libisoburn/isofs_wrap.c Avoiding repeated PVD read attempts if first reading of PVD yielded error 2011.04.23.152348 [3738] xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/base_obj.c xorriso/lib_mgt.h xorriso/lib_mgt.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/write_run.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 libisoburn/libisoburn.ver New option -signal_handling 23 Apr 2011 [3739] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.0.9 - 2011.04.23.152348 * New option -signal_handling 2011.04.27.143713 [3740] xorriso/iso_manip.c Saved some CPU cycles when adding wide directory trees 2011.04.27.150829 [3741] xorriso/read_run.c Downgraded extraction error from FAILURE to SORRY (for new -abort_on default) 2011.04.30.121138 [3742] xorriso/iso_manip.c Saved more CPU cycles by optimistic adding of file objects 2011.05.02.090908 [3744] xorriso/aux_objects.c Replaced some large local variables by other means which save stack space 2011.05.02.091632 [3745] xorriso/base_obj.c Replaced some large local variables by other means which save stack space 2011.05.02.100332 [3746] xorriso/check_media.c Replaced some large local variables by other means which save stack space 2011.05.02.121907 [3747] xorriso/cmp_update.c Replaced some large local variables by other means which save stack space 2011.05.02.191704 [3748] xorriso/disk_ops.c Replaced some large local variables by other means in xorriso/disk_ops.c 2011.05.02.191905 [3749] xorriso/cmp_update.c Better reporting of memory shortage with rev 3747 2011.05.02.211310 [3750] xorriso/drive_mgt.c Replaced some large local variables by other means in xorriso/drive_mgt.c 2011.05.02.211401 [3751] xorriso/xorriso.h Clarified and updated API documentation of Xorriso_prescan_args() 2011.05.03.063012 [3752] xorriso/drive_mgt.c Closed a memory leak found by valgrind 2011.05.03.085459 [3753] xorriso/write_run.c Closed memory leaks found by valgrind 2011.05.03.091059 [3754] xorriso/emulators.c Replaced some large local variables by other means in xorriso/emulators.c 2011.05.03.095849 [3755] xorriso/filters.c Replaced some large local variables by other means in xorriso/filters.c 2011.05.03.100744 [3756] xorriso/findjob.c Replaced some large local variables by other means in xorriso/findjob.c 2011.05.03.115103 [3757] xorriso/iso_img.c Replaced some large local variables by other means in xorriso/iso_img.c 2011.05.03.115146 [3758] libisoburn/burn_wrap.c Closed a memory leak found by valgrind 2011.05.03.115226 [3759] xorriso/findjob.c Closed a memory leak found by valgrind 2011.05.04.151605 [3760] xorriso/iso_manip.c Replaced some large local variables by other means in xorriso/iso_manip.c 2011.05.04.151721 [3761] xorriso/cmp_update.c Replaced some large local variables by other means in xorriso/cmp_update.c 2011.05.04.151820 [3762] xorriso/findjob.c Closed a memory leak found by valgrind 2011.05.04.152314 [3763] xorriso/drive_mgt.c xorriso/emulators.c Reacted on compiler warning about rev 3750 and 3754 2011.05.04.165840 [3764] xorriso/iso_tree.c Replaced some large local variables by other means in xorriso/iso_tree.c 2011.05.04.171628 [3765] xorriso/lib_mgt.c Replaced some large local variables by other means in xorriso/lib_mgt.c 2011.05.05.075233 [3766] xorriso/match.c Replaced some large local variables by other means in xorriso/match.c 2011.05.05.081436 [3767] xorriso/misc_funct.c Replaced some large local variables by other means in xorriso/misc_funct.c 2011.05.05.105152 [3768] xorriso/opts_a_c.c Replaced some large local variables by other means in xorriso/opts_a_c.c 2011.05.05.105310 [3769] xorriso/iso_img.c Closed a memory leak found by valgrind 2011.05.05.121640 [3770] xorriso/opts_d_h.c Replaced some large local variables by other means in xorriso/opts_d_h.c 2011.05.05.121957 [3771] xorriso/opts_d_h.c Reacted on compiler warning about rev 3770 2011.05.05.122855 [3772] xorriso/text_io.c Added newline character to output of -errfile_log plain -I 2011.05.05.163832 [3773] xorriso/opts_i_o.c Replaced some large local variables by other means in xorriso/opts_i_o.c 2011.05.05.163926 [3774] xorriso/opts_a_c.c Corrected a mistake introduced with rev 3768 2011.05.06.120600 [3775] xorriso/misc_funct.c Introduced flag bit1 with Text_shellsafe() for double sized target string 2011.05.06.120655 [3776] xorriso/opts_p_z.c Replaced some large local variables by other means in xorriso/opts_p_z.c 2011.05.06.120834 [3777] xorriso/disk_ops.c Corrected use of unitialized variables found by valgrind 2011.05.06.121218 [3778] xorriso/sfile.h Commited definition of Xorriso_alloc_meM which is needed since 30 revisions 2011.05.06.132058 [3779] xorriso/disk_ops.c xorriso/iso_tree.c xorriso/iso_manip.c xorriso/opts_i_o.c Made use of Text_shellsafe bit1 for messages with two file names 2011.05.06.151905 [3780] xorriso/parse_exec.c Replaced some large local variables by other means in xorriso/parse_exec.c 2011.05.07.104932 [3781] [3782] xorriso/iso_img.c Bug fix: -mount_opts "shared" worked only with -osirrox "o_excl_off" 2011.05.07.105142 [3783] xorriso/iso_img.c Enabled drive addresses of form mmc:/dev/srX with option -mount 2011.05.07.165758 [3784] xorriso/read_run.c Replaced some large local variables by other means in xorriso/read_run.c 2011.05.07.184625 [3785] xorriso/text_io.c Replaced some large local variables by other means in xorriso/text_io.c 2011.05.08.083929 [3786] xorriso/write_run.c Replaced some large local variables by other means in xorriso/write_run.c 2011.05.08.174805 [3787] xorriso/opts_a_c.c xorriso/cmp_update.c xorriso/drive_mgt.c xorriso/iso_img.c xorriso/sort_cmp.c xorriso/text_io.c xorriso/write_run.c Replaced some large local variables by other means 2011.05.09.155010 [3788] libisoburn/isoburn.c libisoburn/burn_wrap.c libisoburn/isofs_wrap.c Replaced some large local variables by other means in 2011.05.09.181239 [3789] xorriso/parse_exec.c xorriso/opts_p_z.c xorriso/drive_mgt.c xorriso/iso_img.c xorriso/iso_tree.c xorriso/iso_manip.c xorriso/sort_cmp.c xorriso/filters.c xorriso/write_run.c xorriso/match.c xorriso/text_io.c xorriso/findjob.c xorriso/misc_funct.c xorriso/sfile.c Reacted on -Wsign-compare warnings of gcc 2011.05.09.181449 [3790] libisoburn/isoburn.c libisoburn/isofs_wrap.c Reacted on -Wsign-compare warnings of gcc 2011.05.12.175155 [3797] configure.ac libisoburn/libisoburn.h Requiring libisofs-1.0.8 now 2011.05.12.175423 [3798] xorriso/configure_ac.txt GNU xorriso now contains libisofs-1.0.9 13 May 2011 [3799] xorriso/xorrisofs.texi Corrected a typo in man page of xorrisofs 13 May 2011 [3800] xorriso/make_xorriso_1.c xorriso/xorriso.texi xorriso/xorriso.1 Added a rule to the conversion prescription for man pages 13 May 2011 [3801] xorriso/xorrisofs.texi xorriso/xorrisofs.1 Added a rule to the conversion prescription for man pages 14 May 2011 [3802] xorriso/make_xorriso_1.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Patch by Mats Erik Anderson: wrap @command{} around the word xorriso 2011.05.16.132939 [3809] xorriso/parse_exec.c Bug fix: xorriso command -add_plainly "any" did not add all file sto the image 2011.05.16.133231 [3810] xorriso/sfile.h Replaced german macro parameter name by an english one 2011.05.16.134341 [3811] xorriso/xorriso.h xorriso/parse_exec.c Checking for unknown xorriso commands already in Xorriso_prescan_args() 16 May 2011 [3812] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Made xorriso version number visible in manuals 16 May 2011 [3813] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Adjusted line lengths to less than 80 chars in source of xorriso manual 17 May 2011 [3814] xorriso/make_xorriso_1.c Implemented texi-to-man translation rule about {...} recursion 17 May 2011 [3815] xorriso/xorriso.texi xorriso/xorrisofs.texi Added to the manual instructions for bug reporting 17 May 2011 [3816] xorriso/xorrisofs.texi Wrapped @command{} around the word xorrisofs in its manual 17 May 2011 [3817] xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.info xorriso/xorrisofs.1 Updated generated manuals 2011.05.17.115159 [3818] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.0.9 - 2011.05.17.115159 * Bug fix: -mount_opts shared worked only with -osirrox o_excl_off * Bug fix (libisofs): Production of MIPS bootable images caused SIGSEGV * Bug fix: xorriso command -add_plainly "any" did not add all files to the image 2011.05.17.151719 [3819] xorriso/xorriso.h xorriso/parse_exec.c xorriso/xorriso_main.c New flag bit1 of API call Xorriso_prescan_args() reports unknown commands 17 May 2011 [3820] xorriso/make_xorriso_1.c xorriso/xorriso.texi xorriso/xorrisofs.texi New rules for translating several texi @-commands to man page ------------------------------------ cycle - xorriso-1.0.9 - 2011.05.17.151719 2011.05.18.063511 [3821] xorriso/parse_exec.c Fixed refusal to run with command -as introduced by rev 3819 18 May 2011 [3822] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Polished node "Bugreport" in manuals ------------------------------------ cycle - xorriso-1.0.9 - 2011.05.18.063511 2011.05.19.111229 [3823] libisoburn/libisoburn.h Mentioned the need to define uint32_t when including libisoburn.h 2011.05.19.133735 [3824] xorriso/write_run.c Bug fix: The attempt to blank already blanked DVD-RW was not gracefully blocked 2011.05.19.133840 [3825] xorriso/check_media.c Replaced some large local variables by other means in xorriso/check_media.c 2011.05.19.133940 [3826] xorriso/opts_p_z.c Reacted on -Wsign-compare warnings of gcc 2011.05.19.134432 [3827] libisoburn/isofs_wrap.c Revoked experimental change which sneaked into SVN by rev 3737 20 May 2011 [3828] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.0.9 - 2011.05.19.134432 * Bug fix: The attempt to blank already blank DVD-RW was not gracefully blocked 2011.05.20.175842 [3829] xorriso/iso_img.c Reacted on compiler warning about inactivated if statement 2011.05.22.143652 [3832] configure.ac xorriso/configure_ac.txt Added options -Wextra -Wno-unused-parameter for gcc 2011.05.22.181525 [3833] xorriso/opts_a_c.c xorriso/opts_i_o.c xorriso/findjob.c Reacted on static code checker warning reported by George Danchev 2011.05.26.151635 [3841] configure.ac libisoburn/libisoburn.h Requiring libburn-1.0.7 now 2011.05.26.151744 [3842] xorriso/drive_mgt.c Report damaged track with "Media status :" 2011.05.29.095524 [3843] xorriso/drive_mgt.c Removed quotation marks in message introduced by rev3842 2011.05.29.100055 [3844] xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Improved error messages if DVD-RW media can only be written with -close on 2011.05.31.092902 [3845] xorriso/text_io.c With -status : always display setting of -abort_on 2011.06.01.165129 [3847] xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/parse_exec.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 libisoburn/libisoburn.ver New option -close_damaged 2011.06.07.144548 [3857] xorriso/write_run.c Fixed a typo in a hint about fast blanked DVD-RW 8 Jun 2011 [3862] configure.ac Makefile.am xorriso/configure_ac.txt xorriso/xorriso_makefile_am.txt Introduced AC_CONFIG_MACRO_DIR() and ACLOCAL_AMFLAGS on advise of George Danchev 9 Jun 2011 [3865] bootstrap xorriso/xorriso_bootstrap.txt Added option -I . to aclocal in bootstrap script on advise of George Danchev ------------------------------------ cycle - xorriso-1.0.9 - 2011.06.15.153630 * New option -close_damaged * Bug fix (libisofs) : -as mkisofs -isohybrid-mbr without -no-pad was not cylinder aligned 2011.06.17.143813 [3867] xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info README doc/faq.wiki doc/partition_offset.wiki xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorriso_eng.html ChangeLog Avoided the use of the term 'eventual' for the meaning 'if applicable'. 18 Jun 2011 [3872] svn copy -m Branching for libisoburn release 1.1.0 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.1.0 2011.06.18.123001 [3973] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info Version leap to libisoburn-1.1.0 18 Jun 2011 [3874] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.1.0 - 2011.06.18.123001 * 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 * Bug fix: Production of MIPS bootable images caused SIGSEGV * New option -signal_handling * New option -close_damaged 2011.06.18.173208 [3879] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info Version leap to libisoburn-1.1.1 18 Jun 2011 [3880] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 18 Jun 2011 [3881] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.1.0 http://svn.libburnia-project.org/libisoburn/tags/1.1.0 ------------------------------------ cycle - xorriso-1.1.1 - 2011.06.18.173208 ------------------------------------ cycle - xorriso-1.1.1 - 2011.06.19.210656 * Bug fix: GNU xorriso-1.1.0 compiled only on Linux, FreeBSD, and Solaris ------------------------------ release - xorriso-1.1.0.pl01 - 2011.06.20.110001 * Bug fix: GNU xorriso-1.1.0 compiled only on Linux, FreeBSD, and Solaris 22 Jun 2011 [3887] releng/releng_build_jigdo releng/README.releng Beginning to create a test suite for libisoburn and xorriso 27 Jun 2011 [3943] + releng/test_hardlinks New test test_hardlinks 27 Jun 2011 [3944] releng/TODO Added rules to releng/TODO, new options -keep, -clean_up, deprecated -clean 27 Jun 2011 [3945] [3948] [3952] [3957] releng/test_hardlinks Polished hardlink test 2011.06.27.160728 [3956] xorriso/opts_p_z.c Bug fix: -update_r scheduled non-existing files for hardlink update 2011.06.27.172423 [3958] xorriso/parse_exec.c Reporting commands and their arguments as DEBUG messages before execution 28 Jun 2011 [3964] releng/test_hardlinks + tmp Adapted test_hardlinks to newly defined general test rules 28 Jun 2011 [3965] releng/test_hardlinks Adjusted names of config variables in test_hardlinks 28 Jun 2011 [3968] releng/test_hardlinks - tmp + releng/tmp Option -fail for test_hardlinks to simulate failure, moved tmp to releng/tmp 28 Jun 2011 [3969] releng/test_hardlinks Removed suffix .result from tmp/test_hardlinks 2011.06.28.084751 [3970] A test with non-added file releng/tmp/test 28 Jun 2011 [3973] + releng/releng_generated_data - releng/tmp Renamed releng/tmp to releng/releng_generated_data 28 Jun 2011 [3974] releng/test_hardlinks Adapted test_hardlinks to newest agreements with George 28 Jun 2011 [3975] + releng/releng_hardlinks - releng/test_hardlinks Renamed test_hardlinks to releng_hardlinks 2011.07.02.153320 [3991] libisoburn/burn_wrap.c Reacted on warnings of -Wunused-but-set-variable 2011.07.03.085629 [4003] xorriso/aux_objects.c Reacted on warnings of -Wunused-but-set-variable 2011.07.03.091220 [4006] xorriso/misc_funct.c Reacted on warnings of -Wunused-but-set-variable 2011.07.03.091706 [4007] xorriso/misc_funct.c Reacted on warnings of -Wunused-but-set-variable 2011.07.03.092353 [4008] xorriso/disk_ops.c Reacted on warnings of -Wunused-but-set-variable 2011.07.03.093500 [4010] xorriso/parse_exec.c Reacted on warnings of -Wunused-but-set-variable 2011.07.03.093500 [4015] xorriso/sfile.c Reacted on warnings of -Wtype-limits 2011.07.03.181840 [4020] configure.ac libisoburn/libisoburn.h Requiring libsofs-1.1.1 now 2011.07.03.193627 [4029] xorriso/iso_tree.c xorriso/read_run.c Enabled extraction of the boot catalog file to disk filesystem 2011.07.03.194138 [4030] xorriso/opts_a_c.c xorriso/opts_i_o.c xorriso/opts_p_z.c Reacted on warnings of -Wunused-but-set-variable 2011.07.03.194723 [4031] xorriso/drive_mgt.c Reacted on warnings of -Wunused-but-set-variable 2011.07.03.203013 [4033] xorriso/opts_i_o.c Removed a premature reference to upcomming function 2011.07.04.092828 [4034] xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/drive_mgt.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 libisoburn/libisoburn.ver New option -list_speeds 4 Jul 2011 [4035] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.1.1 - 2011.07.04.092828 * Bug fix: -update_r scheduled non-existing files for hardlink update * New option -list_speeds * Enabled extraction of the boot catalog file to disk filesystem 2011.07.04.105800 [4036] xorriso/iso_manip.c Reacted on warnings of -Wunused-but-set-variable 2011.07.04.105854 [4037] xorriso/write_run.c Reacted on warnings of -Wunused-but-set-variable 2011.07.04.121342 [4038] xorriso/read_run.c Reacted on warnings of -Wunused-but-set-variable 2011.07.04.121501 [4039] xorriso/filters.c Reacted on warnings of -Wunused-but-set-variable 2011.07.05.145103 [4062] libisoburn/libisoburn.h Made libisoburn.h ready for use with C++ without importing namespace "burn" 2011.07.06.190111 [4078] libisoburn/isofs_wrap.c Hopefully fixed Debian bug 632865: blank ISO images with drive role 5 2011.07.07.113930 [4082] libisoburn/isoburn.c libisoburn/isofs_wrap.c libisoburn/burn_wrap.c Bug fix: Since 1.0.6: Unreadable image produced by: xorrisofs ... >image.iso ------------------------------------ cycle - xorriso-1.1.1 - 2011.07.07.113930 * Bug fix: Since 1.0.6: Unreadable image produced by: xorrisofs ... >image.iso 7 Jul 2011 [4086] xorriso/xorriso_eng.html ChangeLog Updated change log and web page 8 Jul 2011 [4092] svn copy -m Branching for libisoburn release 1.1.2 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.1.2 2011.07.08.100001 [4094] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info Version leap to libisoburn-1.1.2 8 Jul 2011 [4095] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.1.2 - 2011.07.08.100001 * Bug fix: -update_r scheduled non-existing files for hardlink update * New option -list_speeds * Enabled extraction of the boot catalog file to disk filesystem * Bug fix: Since 1.0.6: Unreadable image produced by: xorrisofs ... >image.iso 2011.07.08.131032 [4099] [4100] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info Version leap to libisoburn-1.1.3 8 Jul 2011 [4101] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 8 Jul 2011 [4102] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.1.2 http://svn.libburnia-project.org/libisoburn/tags/1.1.2 ------------------------------------ cycle - xorriso-1.1.3 - 2011.07.08.131032 2011.07.10.112539 [4126] libisoburn/isofs_wrap.c Recognizing overwritable media, blanked by cdrskin --grow_overwriteable_iso 2011.07.11.175609 [4134] xorriso/drive_mgt.c Reacted on warnings of cppcheck 2011.07.12.092010 [4137] xorriso/drive_mgt.c Improved output of -list_speeds with CD drives. Empty list now cause SORRY. 2011.07.12.135452 [4146] xorriso/drive_mgt.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Improved output of -list_speeds with ROM media and ROM drives. 13 Jul 2011 [4158] [4159] [4160] + releng/manual_devices_ts Proposal for test ./manual_devices 14 Jul 2011 [4161] [4162] releng/manual_devices_ts + releng/inc/releng_getopts_ts.inc Proposal for test ./manual_devices and inc/releng_getopts_ts.inc 14 Jul 2011 [4163] releng/manual_devices_ts releng/inc/releng_getopts_ts.inc Prepared test proposal for option -f and for incomplete option -x 14 Jul 2011 [4165] releng/manual_devices_ts Issueing failure message and non-zero exit value if manual_devices_ts fails 14 Jul 2011 [4166] releng/inc/releng_getopts_ts.inc Corrected a misunderstanding about meaning of code piece 2011.07.15.083052 [4171] libisoburn/burn_wrap.c Reacted on warnings of cppcheck about libisoburn/burn_wrap.c 15 Jul 2011 [4172] releng/manual_devices Removed remnant reference to releng_getopts_ts.inc 15 Jul 2011 [4173] releng/inc/releng_getopts.inc Removed usage of getopts in releng_getopts.inc 15 Jul 2011 [4174] releng/inc/releng_getopts.inc Removed obsolete input checks from releng_getopts.inc 15 Jul 2011 [4175] releng/inc/releng_getopts.inc releng/manual_devices New function check_for_xorriso in releng_getopts.inc 15 Jul 2011 [4176] releng/inc/releng_getopts.inc Removed call to print_specific_help from releng_getopts.inc 15 Jul 2011 [4177] releng/inc/releng_getopts.inc Changed general option -k -c -f in releng_getopts.inc 17 Jul 2011 [4185] releng/run_all_releng Issueing pacifier messages in run_all_releng about logged line 17 Jul 2011 [4186] releng/run_all_releng Making run_all_releng recognize exit values again (fixing rev 4185) 17 Jul 2011 [4187] releng_printsize Issueing pacifier messages during tree generation of releng_printsize 17 Jul 2011 [4186] releng/run_all_releng Using a more elegant way to obtain pipe component exit value 17 Jul 2011 [4192] releng/run_all_releng Switched error message away from stderr, only pacifier remains on stderr 17 Jul 2011 [4194] releng/run_all_releng Added my copyright to run_all_releng 23 Jul 2011 [4208] [4209] svn mv releng/README releng/README.old releng/README Began to sketch an releng/README file 2011.07.24.193433 [4213] xorriso/drive_mgt.c Improved media summary with overwritable media and unknown content 2011.07.24.203919 [4214] xorriso/drive_mgt.c Improved -check_media with overwritable media and unknown content 2011.07.25.095843 [4215] xorriso/check_media.h xorriso/check_media.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -check_media option what=image 2011.07.25.103809 [4216] xorriso/drive_mgt.c Issueing a warning messages if BD-R with more than 299 sessions is loaded 27 Jul 2011 [4217] releng/auto_printsize Reduced runtime of auto_printsize and balanced xorriso versus genisoimage 2011.07.27.211423 [4218] xorriso/xorriso.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/drive_mgt.c xorriso/aux_objects.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New option -device_links 27 Jul 2011 [4219] releng/manual_devices Switched releng/manual_devices from -devices to -device_links 2011.07.28.111814 [4220] xorriso/drive_mgt.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Prefering dvd over cd with -device_links 28 Jul 2011 [4221] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.1.3 - 2011.07.28.111814 * New option -device_links 2011.07.28.192110 [4224] configure.ac libisoburn/libisoburn.h Requiring libburn 1.1.1 2011.07.28.195103 [4225] xorriso/drive_mgt.c Using libburn call burn_lookup_device_link() 30 Jul 2011 [4226] xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Small correction in xorrisofs man page 2011.07.31.091836 [4229] libisoburn/burn_wrap.c Bug fix: xorriso native mode on some drives wrote unreadble ISO images to CD 2011.07.31.094422 [4230] xorriso/xorrisoburn.h xorriso/opts_a_c.c xorriso/opts_p_z.c Allowed lower case severity names with -abort_on, -return_with, -report_about 2011.07.31.145832 [4231] xorriso/misc_funct.c Bug fix: -assert_volid did not work. Regression since version 1.1.0, rev 3767. 2011.08.01.130400 [4233] xorriso/drive_mgt.c xorriso/misc_funct.c New report line "Media blocks :" with option -toc 1 Aug 2011 [4234] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.1.3 - 2011.08.01.130400 * 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. 2011.08.01.152915 [4236] xorriso/misc_funct.h Forgot to upload the header which defines Xorriso__to_upper 1 Aug 2011 [4238] releng/auto_isocontent Checking -assert_volid in auto_isocontent 3 Aug 2011 [4240] releng/README releng/template_new Added more text pieces to releng/README, updated template for new tests 3 Aug 2011 [4241] releng/inc/releng_getopts.inc Added option -h to general helptext of releng 4 Aug 2011 [4242] releng/template_new Further improvements to releng test template 4 Aug 2011 [4243] + releng/manual_burn New test releng/manual_burn 4 Aug 2011 [4244] releng/README releng/manual_burn Improvements about releng/manual_burn 5 Aug 2011 [4245] releng/auto_cxx releng/auto_isocontent releng/manual_burn releng/manual_isojigdo Made existing tests comply to upcomming prescriptions for failure messages 5 Aug 2011 [4246] releng/inc/releng_getopts.inc Made existing tests comply to upcomming prescriptions for failure messages 7 Aug 2011 [4248] releng/README More work on releng/README 07 Aug 2011 [4252] svn copy -m Branching for libisoburn release 1.1.4 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.1.4 2011.08.07.120001 [4253] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info Version leap to libisoburn-1.1.4 07 Aug 2011 [4254] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 2011.08.08.071649 [4256] xorriso/read_run.c Improved error reporting with problems when extracting xattr or ACL 2011.08.08.070301 [4257] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/configure_ac.txt xorriso/xorriso_eng.html xorriso/xorriso_timestamp.h Requiring libisofs-1.1.4 (because of ACL extraction problem in 1.1.2) 08 Aug 2011 [4258] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.1.4 - 2011.08.08.070301 * New option -device_links * 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 2011.08.08.124228 [4263] xorriso/read_run.c Improved error reporting with problems when extracting xattr or ACL 2011.08.08.124914 [4264] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info Version leap to libisoburn-1.1.5 08 Aug 2011 [4265] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 08 Aug 2011 [4266] svn move -m 'Promoted branch to tag' http://svn.libburnia-project.org/libisoburn/branches/1.1.4 http://svn.libburnia-project.org/libisoburn/tags/1.1.4 ------------------------------------ cycle - xorriso-1.1.5 - 2011.08.08.124914 09 Aug 2011 [4267] releng/auto_isocontent Made releng/auto_isocontent ready for Solaris (with bash) 09 Aug 2011 [4268] releng/inc/releng_getopts.inc Made releng/manual_burn and releng/manual_devices work on FreeBSD 09 Aug 2011 [4269] releng/auto_cxx Made releng/auto_cxx ready for FreeBSD (with bash or "bash" linked to /bin/sh) 09 Aug 2011 [4270] releng/auto_printsize Made releng/auto_printsize ready for FreeBSD ("bash" linked to /bin/sh) 10 Aug 2010 [4271] releng/manual_isojigdo Made releng/manual_isojigdo ready for FreeBSD ("bash" linked to /bin/sh) 10 Aug 2010 [4272] releng/run_all_auto Made releng/run_all_auto ready for FreeBSD ("bash" linked to /bin/sh) 10 Aug 2010 [4273] releng/run_all_auto Added some newlines to output of releng/run_all_auto 11 Aug 2011 [4274] releng/manual_burn releng/manual_devices releng/README Option --priv_cmd for releng/manual_burn and releng/manual_devices 14 Aug 2011 [4275] releng/run_all_auto Avoided use of "let" in releng/run_all_auto in favor of "expr" 14 Aug 2011 [4276] releng/README releng/change_shell_to_use Opportunity to choose the shell that runs the releng test scripts 14 Aug 2011 [4277] releng/change_shell_to_use Changed a comment 2011.08.15.132616 [4278] xorriso/disk_ops.c Bug fix: -extract_single extracted directory content 2011.08.15.171835 [4279] xorriso/opts_i_o.c xorriso/read_run.c xorriso/disk_ops.c Bug fix: -extract was not immediately aborted if -abort_on was triggered 17 Aug 2011 [4282] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.1.5 - 2011.08.17.163150 * 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 18 Aug 2011 [4283] releng/inc/releng_getopts.inc Made cleanup message of releng less loud 2011.08.18.132218 [4284] configure.ac libisoburn/libisoburn.h Requiring libsofs-1.1.5 now 2011.08.18.151913 [4285] xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/lib_mgt.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_i_o.c libisoburn/libisoburn.ver xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New option -list_extras 18 Aug 2011 [4286] releng/auto_isocontent Testing recording and extraction of ACLs and xattr if available 19 Aug 2011 [4288] releng/README releng/TODO Moved todo items from releng/README to releng/TODO 19 Aug 2011 [4290] releng/TODO Some "pro" arguments for the disputed items in releng/TODO 2011.08.19.110340 [4291] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.1.5 - 2011.08.19.110340 * 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 * New option -list_extras 2011.08.23.104121 [4292] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/text_io.c xorriso/read_run.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info New -osirrox option strict_acl 23 Aug 2011 [4293] releng/auto_isocontent Made releng/auto_isocontent ready to test FreeBSD extattr 23 Aug 2011 [4294] releng/auto_isocontent Made releng/auto_isocontent work on filesystems with no xattr and ACL 23 Aug 2011 [4295] releng/auto_isocontent Made releng/auto_isocontent work with disabled xorriso ACL adapter 2011.08.24.072854 [4296] xorriso/iso_manip.c Reporting specific libisofs error if setting of ACL fails 2011.08.25.185950 [4297] xorriso/xorrisoburn.h xorriso/findjob.h xorriso/opts_d_h.c xorriso/iso_tree.c xorriso/iso_manip.c xorriso/disk_ops.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New -find and -findx action list_extattr 29 Aug 2011 [4298] releng/auto_isocontent Small change about Linux getfattr usage in releng/auto_isocontent 29 Aug 2011 [4299] releng/manual_isojigdo Made releng/manual_isojigdo remove .iso file after failed download 29 Aug 2011 [4300] + releng/jigdo-gen-md5-list + releng/jigdo-gen-md5-list.1 xorriso/make_xorriso_standalone.sh Moved jigdo-gen-md5-list of GNU xorriso into libisoburn/releng 29 Aug 2011 [4301] releng/manual_isojigdo Using own jigdo-gen-md5-list to avoid restriction to Linux and FreeBSD 30 Aug 2011 [4303] releng/inc/releng_getopts.inc releng/auto_isocontent releng/README Reacting on xorriso failure in pipe test of releng/auto_isocontent 02 Sep 2011 [4304] configure.ac PKG_CHECK_MODULES test of ./configure now only with --enable-pkg-check-modules 2011.09.03.194744 [4305] configure.ac xorriso/configure_ac.txt Made PKG_CHECK_MODULES with --enable-libcdio conditional 2011.09.20.133438 [4309] xorriso/xorriso_eng.html ChangeLog xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.1.5 - 2011.09.20.133438 * New -osirrox option strict_acl * libisofs: Enabled recording and restoring of extattr on FreeBSD. * New -find and -findx action list_extattr * Worked around a collision with Linux udev which lets device links vanish 21 Sep 2011 [4312] xorriso/README_gnu_xorriso Mentioned configure-time options for udev anti-collision waiting time 2011.09.22.142118 [4313] xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/base_obj.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/drive_mgt.c Re-aquiring drives by their burn_drive_convert_fs_adr() names 23 Sep 2011 [4314] README xorriso/README_gnu_xorriso Mentioned my sysadmin workarounds to cope with udisks on Debian 6.0.2 amd64 23 Sep 2011 [4315] Makefile.am releng/README releng/template_new Added releng test suite to release tarball 2011.09.23.131734 [4316] xorriso/drive_mgt.c Improved error message if xorriso shall open a vanished udev link 2011.09.23.135519 [4317] releng/manual_burn Let releng burn test tolerate vanished udev link and wait for its re-appearance 24 Sep 2011 [4318] releng/README Fixed typos in releng/README 25 Sep 2011 [4320] releng/README Small corrections in releng/README 27 Sep 2011 [4325] svn copy -m Branching for libisoburn release 1.1.6 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.1.6 2011.09.27.080001 [4326] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info Version leap to libisoburn-1.1.6 27 Sep 2011 [4327] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.1.6 - 2011.09.27.080001 * 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 * New option -list_extras * New -osirrox option strict_acl * libisofs: Enabled recording and restoring of extattr on FreeBSD. * New -find and -findx action list_extattr * Workaround for collision with Linux udev which lets device links vanish 2011.09.27.133025 [4333] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info Version leap to libisoburn-1.1.7 27 Sep 2011 [4334] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 27 Sep 2011 [4335] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.1.6 http://svn.libburnia-project.org/libisoburn/tags/1.1.6 ------------------------------------ cycle - xorriso-1.1.7 - 2011.09.27.133025 2011.10.05.075024 [4338] configure.ac libisoburn/libisoburn.h Requiring libburn 1.1.7 2011.10.05.085704 [4340] libisoburn/libisoburn.h libisoburn/burn_wrap.c New flag bit of API call isoburn_drive_aquire() to cause burn_drive_re_assess() 2011.10.05.172142 [4341] xorriso/drive_mgt.c Avoiding open-close cycles on MMC drives after blanking or burning 2011.10.05.173150 [4342] xorriso/opts_a_c.c xorriso/lib_mgt.c Allowed lowercase severity names for all occasions 06 Oct 2011 [4343] README Pointed readers of README to releng/README 08 Oct 2011 [4393] xorriso/man_xorriso_to_html.sh xorriso/man_xorrisofs_to_html.sh Replaced HTML minus by a flat ASCII minus in HTML man page generator 2011.10.09.162439 [4396] xorriso/drive_mgt.c Reacted on nitpicking of cppcheck 2011.10.13.105921 [4404] xorriso/drive_mgt.c Improved plausibility of xorriso media summary in case of unreliable readbility 13 Oct 2011 [4405] releng/manual_burn Removed potentially dangerous hint from releng/manual_burn 2011.10.14.094257 [4406] xorriso/xorriso.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_p_z.c libisoburn/libisoburn.ver xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New option -sleep 2011.10.18.162119 [4407] xorriso/parse_exec.c xorriso/emulators.h xorriso/emulators.c Enabled xorrecord dev=- 2011.10.25.103839 [4408] README Makefile.am xorriso/README_gnu_xorriso xorriso/make_xorriso_standalone.sh xorriso/xorriso_makefile_am.txt xorriso/emulators.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 + xorriso/xorrecord.texi + xorriso/xorrecord.info + xorriso/xorrecord.1 xorriso/make_docs.sh xorriso/make_xorriso_1.c xorriso/convert_man_to_html.sh + xorriso/man_xorrecord_to_html.sh Info document and man page for xorrecord 25 Oct 2011 [4409] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.1.7 - * New option -sleep * Info document and man page for xorrecord 2011.10.25.160042 [4410] xorriso/drive_mgt.c Avoided to report "Supported modes: SAO TAO" with xorrecord -atip on ROM drives 2011.10.26.085213 [4411] xorriso/drive_mgt.c Let xorrecord -atip throw SORRY on empty tray, but report profile list of drive 26 Oct 2011 [4412] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Replaced several occurences of the word "media" by "medium" 2011.11.02.140829 [4420] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/burn_wrap.c libisoburn/isofs_wrap.c Replaced several occurences of the word "media" by "medium" 2011.11.02.142105 [4421] xorriso/xorrisoburn.h xorriso/check_media.h xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/drive_mgt.c xorriso/emulators.c xorriso/write_run.c Replaced several occurences of the word "media" by "medium" ------------------------------------ cycle - xorriso-1.1.7 - 2011.11.02.142105 2011.11.04.102805 [4423] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.1.7 - 2011.11.04.102805 * Bug fix: libburn misinterpreted mode page 2A 2011.11.09.131243 [4425] + doc/qemu_xorriso.wiki Added a wiki page about xorriso on qemu. Online: wiki/QemuXorriso ------------------------------------ cycle - xorriso-1.1.7 - 2011.11.09.131243 * Enabled out-of the box use of xorriso on Linux guest on qemu virtio-blk-pci 09 Nov 2011 [4426] xorriso/make_xorriso_standalone.sh Added wiki page about xorriso on qemu to the GNU xorriso tarball generator 09 Nov 2011 [4427] doc/qemu_xorriso.wiki Small corrections in wiki/QemuXorriso 2011.11.09.145155 [4428] Makefile.am Added wiki/QemuXorriso to libisoburn tarball generator 09 Nov 2011 [4429] doc/qemu_xorriso.wiki Mentioned how to use /dev/vda without /dev/sr1 link 10 Nov 2011 [4432] doc/qemu_xorriso.wiki Some clarifications in wiki/QemuXorriso 11 Nov 2011 [4433] doc/qemu_xorriso.wiki Some clarifications in wiki/QemuXorriso 13 Nov 2011 [4434] doc/qemu_xorriso.wiki Some clarifications in wiki/QemuXorriso 16 Nov 2011 [4438] doc/qemu_xorriso.wiki Some clarifications in wiki/QemuXorriso 16 Nov 2011 [4439] doc/qemu_xorriso.wiki Corrected a wrong statement in wiki/QemuXorriso 20 Nov 2011 [4445] svn copy -m Branching for libisoburn release 1.1.8 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.1.8 2011.11.20.173001 [4446] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.1.8 20 Nov 2011 [4447] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.1.8 - 2011.11.20.173001 * 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 2011.11.21.081802 [4452] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.1.9 21 Nov 2011 [4453] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 21 Nov 2011 [4454] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.1.8 http://svn.libburnia-project.org/libisoburn/tags/1.1.8 ------------------------------------ cycle - xorriso-1.1.9 - 2011.11.21.081802 22 Nov 2011 [4456] doc/qemu_xorriso.wiki Updated QemuXorriso wiki about xorriso version requirements 23 Nov 2011 [4457] doc/qemu_xorriso.wiki Mentioned GNU Hurd qemu page as source of qemu knowledge 2011.11.24.093151 [4459] xorriso/iso_tree.c Worked around inconsistency of stat.st_rdev and dev_t on Debian mips, mipsel 2011.11.29.130622 [4461] libisoburn/libisoburn.ver Bug fix: libisoburn.ver had a duplicate function entry 2011.12.01.152236 [4464] xorriso/emulators.c xorriso/write_run.c xorriso/xorrecord.texi xorriso/xorrecord.info xorriso/xorrecord.1 Made verbosity and exit value of xorrecord more similar to cdrecord resp. wodim 03 Dec 2011 [4472] Makefile.am Removing test/.libs with make clean 03 Dec 2011 [4473] Makefile.am Added ./bootstrap script to release tarball 03 Dec 2011 [4474] xorriso/xorriso_makefile_am.txt Removing xorriso/.libs test/.libs with make clean 2011.12.07.080625 [4480] Makefile.am xorriso/xorriso_makefile_am.txt Removed version.h from list of source files because generated by configure 2011.12.25.121944 [4513] xorriso/xorriso_makefile_am.txt Integrated new source file libburn/cdtext.c 28 Dec 2011 [4520] xorriso/compile_xorriso.sh Integrated new source file libburn/cdtext.c 2012.01.14.144233 [4565] configure.ac libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New relaxations isoburn_igopt_joliet_rec_mtime, isoburn_igopt_iso1999_rec_mtime 2012.01.14.144535 [4566] xorriso/xorriso.h xorriso/opts_p_z.c xorriso/emulators.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Using new libisoburn relaxations with "rec_mtime", enabling it with -as mkisofs 14 Jan 2012 [4567] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.1.9 - 2012.01.14.144535 * 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 2012.01.15.104012 [4569] xorriso/write_run.h xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Made -compliance "rec_mtime" default for xorriso 2012.01.18.093532 [4572] xorriso/drive_mgt.c Improved interpretation of -check_media min_lba= 2012.01.21.114233 [4586] delayed_commit/B20121.114249 xorriso/xorriso_private.h xorriso/base_obj.c xorriso/drive_mgt.c xorriso/read_run.c xorriso/text_io.c Reporting speed with -check_media 2012.01.21.173229 [4587] delayed_commit/B20121.173233 xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/opts_p_z.c xorriso/drive_mgt.c xorriso/read_run.c Reporting speed with -check_md5, -compare, -find, -compare_l, -update 2012.01.21.190312 [4587] delayed_commit/B20121.190324 xorriso/drive_mgt.c Curbed -check_media chunk_size= to 64 kB 2012.01.23.104642 [4588] xorriso/cmp_update.c xorriso/iso_tree.c Two files forgotten with rev 4587 24 Jan 2012 [4594] xorriso/make_xorriso_standalone.sh Added libisoburn ChangeLog to GNU xorriso tarball 25 Jan 2012 [4596] ChangeLog Updated ChangeLog 2012.01.25.153732 [4597] xorriso/text_io.c Made rev 4586 safe against division by 0 27 Jan 2012 [4602] svn copy -m Branching for libisoburn release 1.2.0 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.2.0 2012.01.27.120001 [4603] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.2.0 27 Jan 2012 [4604] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.2.0 - 2012.01.27.120001 * 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 2012.01.27.155323 [4609] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.2.1 27 Jan 2012 [4610] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 27 Jan 2012 [4611] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.2.0 http://svn.libburnia-project.org/libisoburn/tags/1.2.0 ------------------------------------ cycle - xorriso-1.2.1 - 2012.01.27.155323 2012.01.31.130405 [4616] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_i_o.c libisoburn/libisoburn.ver xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New commands -x, -list_arg_sorting 2012.02.01.122709 [4617] xorriso/drive_mgt.c Avoided lots of error messages when checking media in empty drive 2012.02.01.162935 [4618] xorriso/drive_mgt.c xorriso/text_io.c Reporting correct speed unit with -check_media use=outdev 2012.02.01.163200 [4619] xorriso/drive_mgt.c Allowed chunk_size= values up to 1024s 02 Feb 2012 [4620] xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Polished man page about option -x 02 Feb 2012 [4621] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.1 - 2012.02.01.163200 * New commands -x, -list_arg_sorting 02 Feb 2012 [4622] xorriso/xorriso_eng.html Fixed a HTML bug in xorriso web page 02 Feb 2012 [4623] xorriso/man_xorriso_to_html.sh Updated generator script for HTML man page 2012.02.14.103107 [4629] libisoburn/libisoburn.h libisoburn/libisoburn.ver libisoburn/isoburn.h libisoburn/isofs_wrap.c libisoburn/isoburn.c New API calls isoburn_get_attached_start_lba(), isoburn_attach_start_lba() 2012.02.14.103256 [4630] xorriso/drive_mgt.c More accurate determination of size with check_media what=image 24 Feb 2012 [4633] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Some adjustments in xorriso man page 2012.02.25.154938 [4634] xorriso/opts_d_h.c xorriso/read_run.c xorriso/text_io.c Enabled speed display with command -extract 2012.02.25.194514 [4635] xorriso/disk_ops.c Bug fix: -osirrox on:sort_lba_on -extract from / restored nearly nothing 27 Feb 2012 [4636] xorriso/disk_ops.c Fixed a problem with directing an -extract to the / directory of disk 2012.02.27.150241 [4637] libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c New default permission on / directory: rwxr-xr-x 27 Feb 2012 [4638] xorriso/man_xorriso_to_html.sh Equipped chapters of xorriso HTML man page with link targets 27 Feb 2012 [4639] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.1 - 2012.02.27.150241 * New API calls isoburn_get_attached_start_lba(), isoburn_attach_start_lba() * Bug fix: -osirrox on:sort_lba_on -extract from / restored nearly nothing 2012.02.29.135454 [4640] xorriso/drive_mgt.c Fixed a problem after blanking, which was introduced by rev 4630. ------------------------------------ cycle - xorriso-1.2.1 - 2012.02.29.135454 2012.03.03.104637 [4641] xorriso/filters.c Bug fix: Setting file content filters did not mark image as changed for commit 2012.03.03.134008 [4642] xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/opts_p_z.c xorriso/emulators.c xorriso/drive_mgt.c xorriso/read_run.c xorriso/write_run.c Centralized the inquiry whether an image change is pending 2012.03.03.182917 [4643] xorriso/xorriso.h xorriso/parse_exec.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 libisoburn/libisoburn.ver New command -changes_pending 2012.03.03.185100 [4644] xorriso/filters.c Revoked rev 4641. It is not a bug but a feature. E.g. for reading. 03 Mar 2012 [4645] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Mentioned peculiar -changes_pending behavior of filter attaching 2012.03.03.211636 [4646] xorriso/opts_d_h.c Corrected texts about "command", "argument", "parameter" 2012.03.04.094824 [4647] xorriso/iso_img.c Added a comment 2012.03.04.095952 [4648] xorriso/xorriso.h Added a comment 05 Mar 2012 [4649] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/man_xorriso_to_html.sh Changed xorriso.texi according to proposals by Tony Mancill 05 Mar 2012 [4650] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/man_xorriso_to_html.sh Revised the use of "option" and "ASCII" in xorriso.texi 05 Mar 2012 [4651] xorriso/README_gnu_xorriso Corrected orthographical error in GNU xorriso readme file 2012.03.05.145209 [4652] libisoburn/libisoburn.h Corrected orthographical errors in libisoburn.h 2012.03.05.145346 [4653] xorriso/xorriso.h Replaced many occurences of "option" by "command" in comments of xorriso.h ------------------------------------ cycle - xorriso-1.2.1 - 2012.03.05.145346 2012.03.05.204946 [4654] xorriso/emulators.c Added -hide-rr-moved to the list of ignored -as mkisofs options 2012.03.09.190043 [4655] xorriso/iso_manip.c Corrected missing linefeed in message of command -mkdir 2012.03.10.145124 [4657] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/libisoburn.ver New API calls isoburn_igopt_set_rr_reloc(), isoburn_igopt_get_rr_reloc() 2012.03.10.150003 [4658] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/write_run.c xorriso/text_io.c libisoburn/libisoburn.ver xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New command -rr_reloc_dir 2012.03.10.153518 [4659] xorriso/parse_exec.c Changed a degugging text about command parameters 2012.03.11.162050 [4660] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c libisoburn/data_source.c libisoburn/libisoburn.ver New API calls isoburn_ropt_set_data_cache(), isoburn_ropt_get_data_cache() 2012.03.11.164130 [4661] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/lib_mgt.c xorriso/drive_mgt.c xorriso/iso_img.c xorriso/text_io.c libisoburn/libisoburn.ver xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New command -data_cache_size 2012.03.12.180937 [4662] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs option -rr_reloc, implemented option -hide-rr-moved 2012.03.13.102621 [4663] xorriso/emulators.c Now ignoring -as mkisofs -no-split-symlink-components -no-split-symlink-fields 2012.03.14.152414 [4664] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Adjusted behavior of -as mkisofs option -D 14 Mar 2012 [4665] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Clarified xorriso documentation about deep directories 2012.03.14.195147 [4666] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Adjusted behavior of -as mkisofs option -l 14 Mar 2012 [4667] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.1 - 2012.03.14.195147 * 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 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 2012.03.21.141040 [4668] libisoburn/libisoburn.h Bug fix: Relaxation option joliet_rec_mtime and iso1999_rec_mtime had wrong values 2012.03.21.193055 [4669] libisoburn/data_source.c libisoburn/isofs_wrap.c Reacted on warnings of cppcheck 2012.03.21.193153 [4670] xorriso/parse_exec.c Reacted on warning of cppcheck 2012.03.21.193557 [4672] xorriso/text_io.c Reacted on warning of cppcheck 2012.03.22.084956 [4673] xorriso/emulators.c xorriso/misc_funct.h xorriso/misc_funct.c Bug fix: -as mkisofs without -graft-points could noy handle names with "=" 2012.03.22.102053 [4674] libisoburn/libisoburn.h libisoburn/isoburn.c New relaxation option allow_7bit_ascii 2012.03.22.102402 [4675] libisoburn/isoburn.h File which was omitted when committing rev. 4674 2012.03.22.103201 [4676] xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -compliance option 7bit_ascii 2012.03.22.103349 [4677] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Implemented -as mkisofs option -relaxed-filenames 22 Mar 2012 [4678] xorriso/make_xorriso_1.c Updated help text of texi-to-man converter 27 Mar 2012 [4679] configure.ac Demanding libisofs-1.2.1 with ./configure --enable-pkg-check-modules 28 Mar 2012 [4680] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.1 - 2012.03.22.103349 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 2 Apr 2012 [4688] svn copy -m Branching for libisoburn release 1.2.2 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.2.2 2012.04.02.133001 [4689] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.2.0 02 Apr 2012 [4690] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.2.2 - 2012.04.02.133001 * 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 2012.04.02.192028 [4695] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.2.3 02 Apr 2012 [4696] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 02 Apr 2012 [4697] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.2.2 http://svn.libburnia-project.org/libisoburn/tags/1.2.2 ------------------------------------ cycle - xorriso-1.2.3 - 2012.04.02.192028 2012.04.06.173904 [4700] xorriso/write_run.c Avoided to mention autoformatting in message about missing -outdev at -commit 2012.04.10.071539 [4703] xorriso/emulators.c Now recognizing long -as cdrecord options with double dash 2012.04.11.163237 [4705] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/emulators.c xorriso/text_io.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs option -log-file 2012.04.19.073152 [4710] libisoburn/isofs_wrap.c Fixed a small memory leak in case of failed ISO image reading 2012.04.19.074422 [4711] configure.ac libisoburn/libisoburn.h Requiring libisofs 1.2.3 now 19 Apr 2012 [4712] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.3 - 2012.04.19.073152 * New -as mkisofs option -log-file * Bug fix: Memory corruption when reading bootable image that was truncated 2012.04.21.193504 [4723] xorriso/make_xorriso_standalone.sh releng/README releng/TODO Now copying libisoburn/releng into GNU xorriso 2012.04.22.100352 [4724] xorriso/make_xorriso_standalone.sh releng/README Removing old data from releng/releng_generated_data in GNU xorriso 2012.04.25.191110 [4727] xorriso/emulators.c Now recognizing fused single character -as mkisofs options without parameters 2012.04.28.161532 [4728] xorriso/emulators.c Now producing a FAILURE event with unknown mkisofs arguments which begin by dash 2012.05.01.075022 [4729] xorriso/drive_mgt.c xorriso/check_media.h xorriso/check_media.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New -check_media option async_chunks= 2012.05.02.111016 [4730] xorriso/drive_mgt.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Made chunksize=32s default with -check_media 2012.05.22.121401 [4732] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 libisoburn/libisoburn.ver New command -rockridge 2012.05.22.121743 [4733] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs option --norock 2012.05.24.070718 [4734] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c Preparations for ISO/HFS+ hybrid images by Vladimir Serbinenko 2012.05.24.071402 [4735] xorriso/xorriso_makefile_am.txt xorriso/compile_xorriso.sh xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/emulators.c xorriso/iso_img.c xorriso/iso_tree.c xorriso/iso_manip.c xorriso/disk_ops.c xorriso/write_run.c xorriso/text_io.c xorriso/misc_funct.c libisoburn/libisoburn.ver Preparations for ISO/HFS+ hybrid images by Vladimir Serbinenko 2012.05.24.093552 [4736] xorriso/xorriso_makefile_am.txt xorriso/compile_xorriso.sh Welcomimg three new libisofs source files by Vladimir Serbinenko 2012.05.25.084641 [4737] xorriso/xorrisoburn.h xorriso/iso_manip.c xorriso/emulators.c New (yet inofficial) -as mkisofs option -hfsplus-file-creator-type 2012.05.25.190220 [4738] xorriso/xorrisoburn.h xorriso/iso_manip.c xorriso/emulators.c New (yet inofficial) -as mkisofs options -hfs-bless and -hfs-bless-by 2012.05.26.212559 [4739] libisoburn/isoburn.c Closed a memory leak about system area buffer. Found by valgrind. 2012.05.27.165658 [4740] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/libisoburn.ver New API call isoburn_igopt_set_hfsp_serial_number() 2012.05.27.165938 [4741] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/emulators.c xorriso/write_run.c New (yet inofficial) -as mkisofs option -hfsplus-serial-no 2012.05.28.133310 [4742] xorriso/opts_a_c.c xorriso/emulators.c xorriso/text_io.c New (yet inofficial) -boot_image bootspec hfsplus_serial= 2012.05.30.153449 [4743] xorriso/opts_d_h.c xorriso/findjob.h xorriso/iso_manip.h xorriso/iso_manip.c New (yet inofficial) -find actions set/get_hfs_crtp, set/get_hfs_bless 2012.05.31.070528 [4745] xorriso/opts_d_h.c xorriso/iso_manip.c xorriso/findjob.h xorriso/findjob.c New (yet inofficial) -find tests -has_hfs_crtp, has_hfs_bless 2012.05.31.071033 [4746] xorriso/opts_d_h.c Corrected a mistake in previous revision 2012.06.05.103058 [4747] xorriso/write_run.c Closed a memory leak about -print_size, found by valgrind 2012.06.05.145849 [4748] xorriso/iso_manip.c Silenced harmless compiler warnings 2012.06.06.184910 [4749] xorriso/opts_d_h.c xorriso/emulators.c xorriso/iso_manip.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Updated documentation of xorriso and xorrisofs about HFS+ 2012.06.08.071018 [4750] xorriso/emulators.c xorriso/iso_manip.c xorriso/findjob.h xorriso/drive_mgt.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Made HFS creator, type, blessing persistent in AAIP isofs.hx isofs.hb 2012.06.10.083050 [4751] xorriso/emulators.c Fixed false error with -as mkisofs option -hfsplus. Introduced by rev 4750. 2012.06.10.184039 [4752] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c Provisory new image generation extension isoburn_igopt_fat 2012.06.10.184210 [4753] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/write_run.c xorriso/emulators.c Provisory new -as mkisofs option -fat 2012.06.12.113220 [4754] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/libisoburn.ver Provisory new API calls isoburn_igopt_set_prep_partition, isoburn_igopt_set_efi_bootp 2012.06.12.113552 [4755] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/write_run.c xorriso/emulators.c Provisory new -as mkisofs options -prep-boot-part, -efi-boot-part 2012.06.12.192702 [4756] libisoburn/libisoburn.h libisoburn/isoburn.c New system area sub type CHRP with isoburn_igopt_set_system_area() 2012.06.12.192817 [4757] xorriso/xorriso_private.h xorriso/emulators.c Provisory new -as mkisofs option -chrp-boot-part 2012.06.14.142958 [4758] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.3 - 2012.06.14.142958 * New API call isoburn_igopt_set_hfsp_serial_number() * New -check_media option async_chunks= * New 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 -boot_image bootspec hfsplus_serial= * Command -hide allows hiding in HFS+ filesystem * 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 option -hide-hfsplus, -hide-hfsplus-list >>> Provisory new image generation extension isoburn_igopt_fat >>> Provisory new -as mkisofs option -fat 14 Jun 2012 [4759] xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Correction in xorrisofs manual 14 Jun 2012 [4760] doc/faq.wiki Gave some hints about SCSI errors in faq.wiki 2012.06.15.085732 [4761] xorriso/write_run.c Provisorily banned the combination of -hfsplus and ISO image growing 2012.06.18.082701 [4763] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Documented -as mkisofs options *-boot-part 2012.06.18.112125 [4764] xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/emulators.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New bootspecs efi_boot_part, prep_boot_part, chrp_boot_part 18 Jun 2012 [4765] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.3 - 2012.06.18.112125 New API calls isoburn_igopt_set_prep_partition, isoburn_igopt_set_efi_bootp New -as mkisofs options -prep-boot-part, -efi-boot-part, -chrp-boot-part New -boot_image bootspecs efi_boot_part, prep_boot_part, chrp_boot_part 2012.06.18.181204 [4766] xorriso/iso_manip.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Pseudo blessing "none" to revoke any HFS+ blessing of a node ------------------------------------ cycle - xorriso-1.2.3 - 2012.06.19.093921 2012.06.20.190651 [4767] xorriso/xorriso_private.h xorriso/opts_a_c.c xorriso/emulators.c xorriso/iso_img.c xorriso/write_run.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs options -isohybrid-gpt-basdat, -isohybrid-gpt-hfsplus, -isohybrid-apm-hfsplus 20 Jun 2012 [4768] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.3 - 2012.06.20.190651 * New -as mkisofs options -isohybrid-gpt-basdat, -isohybrid-gpt-hfsplus, -isohybrid-apm-hfsplus 2012.06.21.203531 [4769] xorriso/opts_d_h.c xorriso/iso_manip.c xorriso/iso_tree.c xorriso/findjob.h xorriso/findjob.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -find test -disk_path 2012.06.21.204359 [4770] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Now expecting disk_path with -as mkisofs -hfs-bless 22 Jun 2012 [4771] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.3 - 2012.06.21.204359 * New -find test -disk_path 2012.06.25.125438 [4772] xorriso/drive_mgt.c Loaded images with HFS+ attributes were marked as having changes pending 2012.06.27.184552 [4773] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New API calls isoburn_igopt_set_hfsp_block_size() and isoburn_igopt_get_hfsp_block_size() 2012.06.27.184915 [4774] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_a_c.c orriso/opts_d_h.c xorriso/write_run.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -boot_image bootspecs hfsplus_block_size= and apm_block_size= 2012.06.27.192151 [4775] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs options -hfsplus-block-size and -apm-block-size 28 Jun 2012 [4776] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.3 - 2012.06.27.192151 * New API calls isoburn_igopt_set_hfsp_block_size() and isoburn_igopt_get_hfsp_block_size() * New -boot_image bootspecs hfsplus_block_size= and apm_block_size= * New -as mkisofs options -hfsplus-block-size and -apm-block-size 03 Jul 2012 [4777] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Mentioned HFS+ name mangling in man pages 2012.07.08.134305 [4779] libisoburn/burn_wrap.c Delegated write_type selection to caller of libisoburn 2012.07.08.134840 [4780] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/write_run.c xorriso/text_io.c libisoburn/libisoburn.ver xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New xorriso command -write_type 2012.07.08.135555 [4781] libisoburn/burn_wrap.c Reacted on compiler complaint about rev 4779 2012.07.08.171526 [4782] xorriso/emulators.c xorriso/xorrecord.texi xorriso/xorrecord.info xorriso/xorrecord.1 New -as cdrecord options -tao -sao -dao 08 Jul 2012 [4783] xorriso/xorriso_eng.html ChangeLog Updated change log and web page 2012.07.08.200735 [4784] xorriso/write_run.c Re-introduced capability of multi-session on overwritables. Spoiled by rev 4780. 2012.07.10.082919 [4785] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/burn_wrap.c libisoburn/libisoburn.ver New API calls isoburn_igopt_set_write_type() , isoburn_igopt_get_write_type() 2012.07.10.083040 [4786] xorriso/write_run.c Write type selection via libisoburn API to avoid redundant decisions ------------------------------------ cycle - xorriso-1.2.3 - 2012.07.10.083040 * New xorriso command -write_type * New -as cdrecord options -tao -sao -dao * New API calls isoburn_igopt_set_write_type() , isoburn_igopt_get_write_type() 2012.07.12.163117 [4787] xorriso/iso_manip.c Bug fix: -update deleted MD5 of files of which only attributes changed 14 Jul 2012 [4788] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.3 - 2012.07.12.163117 * Bug fix: -update deleted MD5 of files of which only attributes had changed 20 Jul 2012 [4798] svn copy -m Branching for libisoburn release 1.2.4 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.2.4 2012.07.20.130001 [4799] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.2.4 20 Jul 2012 [4800] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.2.4 - 2012.07.20.130001 * 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 2012.07.20.184237 [4804] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.2.5 20 Jul 2012 [4805] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 20 Jul 2012 [4807] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.2.4 http://svn.libburnia-project.org/libisoburn/tags/1.2.4 ------------------------------------ cycle - xorriso-1.2.5 - 2012.07.20.184237 2012.07.25.181415 [4808] libisoburn/libisoburn.h libisoburn/burn_wrap.c Clarified role of drive when parsing already loaded ISO 9660 superblock 2012.07.25.182507 [4809] xorriso/write_run.c Bug fix: SIGSEGV by uninitialized local variable with -check_media patch_lba0="on". Regression by version 1.0.6 2012.07.25.184207 [4810] xorriso/write_run.c Small beautification of previous commit. 26 Jul 2012 [4812] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Corrected description of check_media patch_lba0="on" 14 Aug 2012 [4815] xorriso/man_xorrisofs_to_html.sh Corrected conversion from man xorrisofs to man_1_xorrisofs.html 2012.08.14.102632 [4816] libisoburn/libisoburn.h libisoburn/burn_wrap.c New flag bit 9 with isoburn_drive_aquire() 2012.08.14.103138 [4817] xorriso/xorriso_private.h xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/drive_mgt.c xorriso/iso_img.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -rom_toc_scan option "emul_wide" 15 Aug 2012 [4818] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Shortened oversized line in man page 2012.08.20.084354 [4819] xorriso/text_io.c Enhanced command -status to recognize -cdi 2012.09.08.082759 [4821] xorriso/text_io.c Fixed SIGSEGV introduced by rev 4819 2012.09.08.173754 [4822] xorriso/xorriso.h xorriso/parse_exec.c xorriso/sfile.h xorriso/sfile.c libisoburn/libisoburn.ver New API calls Xorriso_parse_line() and Xorriso__dispose_words() 2012.09.08.181144 [4823] xorriso/parse_exec.c libisoburn/libisoburn.ver Reacted on compiler warning about rev 4822 ------------------------------------ cycle - xorriso-1.2.5 - 2012.09.08.181144 * Bug fix: SIGSEGV by uninitialized local variable with -check_media patch_lba0="on". Regression by version 1.0.6 * New API calls Xorriso_parse_line() and Xorriso__dispose_words() 2012.09.09.181723 [4824] Makefile.am xorriso/make_xorriso_standalone.sh xorriso/xorriso_makefile_am.txt test/frontend_pipes_xorriso.c Demonstration program of xorriso at two pipes: test/frontend_pipes_xorriso.c 2012.09.11.092703 [4825] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/lib_mgt.c xorriso/text_io.c libisoburn/libisoburn.ver New API call Xorriso_fetch_outlists() 2012.09.11.122559 [4826] xorriso/text_io.c Disabled a not yet thread-safe part of the new API call 11 Sep 2012 [4827] test/frontend_pipes_xorriso.c Added copyright and licensing to demonstration program 2012.09.13.130910 [4830] xorriso/xorriso_private.h xorriso/parse_exec.c xorriso/base_obj.c xorriso/text_io.c xorriso/lib_mgt.c Made Xorriso_process_msg_queues() thread-safe 2012.09.14.175104 [4831] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorriso_main.c xorriso/base_obj.c xorriso/parse_exec.c xorriso/text_io.c xorriso/aux_objects.h xorriso/aux_objects.c libisoburn/libisoburn.ver New API call Xorriso_start_msg_watcher() 2012.09.15.095146 [4832] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/text_io.c Changed prototype of new API call Xorriso_start_msg_watcher() 2012.09.15.170346 [4833] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/text_io.c libisoburn/libisoburn.ver New API call Xorriso_peek_outlists() 2012.09.16.141845 [4834] xorriso/xorriso.h xorriso/text_io.c Made -pkt_output combinable with message output lists 2012.09.21.115522 [4835] xorriso/xorriso.h Small enhancement of API description 2012.09.21.120245 [4836] xorriso/opts_a_c.c xorriso/emulators.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -boot_image partition_cyl_align mode "all" 22 Sep 2012 [4837] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.5 - 2012.09.21.120245 * New API call Xorriso_fetch_outlists() * New API call Xorriso_peek_outlists() * New API call Xorriso_start_msg_watcher() * New -boot_image partition_cyl_align mode "all" 2012.09.29.173546 [4838] xorriso/parse_exec.c Corrected interpretation of flag in Xorriso_parse_line() 30 Sep 2012 [4389] test/frontend_pipes_xorriso.c Equipped frontend_pipes_xorriso.c with word parser code 2012.10.02.134601 [4840] configure.ac xorriso/configure_ac.txt Configuration for use of libcdio on cygwin. Thanks Rocky Bernstein. 03 Oct 2012 [4842] xorriso/README_gnu_xorriso Mentioned releng tests in README of GNU xorriso. 2012.10.03.124152 [4843] xorriso/xorriso.h xorriso/parse_exec.c Enabled use of Xorriso_parse_line() with xorriso==NULL 07 Oct 2012 [4844] xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Clarified documentation of -as mkisofs -isohybrid-gpt-basdat 07 Oct 2012 [4845] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.5 - 2012.10.07.110444 * Bug fix: -partition_offset 16 kept -isohybrid-gpt-basdat from writing MBR entries 0xef 12 Oct 2012 [4846] xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 man xorrisofs falsely described -p as option for publisher id. Must be -P. 2012.10.14.190352 [4847] xorriso/xorriso.h xorriso/parse_exec.c xorriso/lib_mgt.c libisoburn/libisoburn.ver New API call Xorriso__severity_cmp() 2012.10.19.081758 [4848] xorriso/xorriso.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/iso_manip.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 libisoburn/libisoburn.ver New command -lns for creating symbolic links 19 Oct 2012 [4849] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.5 - 2012.10.19.081758 * New command -lns for creating symbolic links 2012.10.24.095235 [4851] xorriso/xorrisoburn.h xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/drive_mgt.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -blank mode prefix "force:" 2012.10.25.125559 [4853] xorriso/drive_mgt.c Improved -check_media handling of last two blocks in initial CD TAO session 2012.10.25.172830 [4855] xorriso/drive_mgt.c Ceased to count track gaps as read blocks with -check_media 05 Nov 2012 [4856] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Corrections in xorriso manual. Proposed by Paul Menzel. 05 Nov 2012 [4857] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Corrections in xorriso manual. Proposed by Paul Menzel. 2012.11.26.070047 [4861] xorriso/iso_manip.c Command -mv did not mark the emerging image as haveing pending changes 2012.11.26.070128 [4862] xorriso/drive_mgt.c Corrected a typo in a message text 2012.11.26.070212 [4863] xorriso/parse_exec.c Added help text for inofficial command -test 2012.11.26.154951 [4864] xorriso/parse_exec.c Avoided surplus warning messages with -iso_rr_pattern off -mv [wildcards] 2 Dec 2012 [4870] xorriso/README_gnu_xorriso Fixed a typo in GNU xorriso README. Thanks to Omega Weapon. 2012.12.06.132118 [4871] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_p_z.c xorriso/text_io.c libisoburn/libisoburn.ver New API calls Xorriso_sieve_add_filter, Xorriso_sieve_get_result, Xorriso_sieve_clear_results, Xorriso_sieve_dispose, Xorriso_sieve_big 2012.12.07.193658 [4872] xorriso/xorriso.h xorriso/text_io.c Some more filter rules for Xorriso_sieve_big 2012.12.08.175205 [4873] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/text_io.c xorriso/sfile.h xorriso/sfile.c libisoburn/libisoburn.ver xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New command -msg_op 11 Dec 2012 [4874] xorriso/xorriso_eng.html ChangeLog Updated change log and web page 11 Dec 2012 [4875] test/frontend_pipes_xorriso.c Demonstrated use of message sieve by piped frontend program 11 Dec 2012 [4876] test/frontend_pipes_xorriso.c Improved help text of piped frontend demo ------------------------------------ cycle - xorriso-1.2.5 - 2012.12.08.175205 * New -blank mode prefix "force:" * New API calls Xorriso_sieve_add_filter, Xorriso_sieve_get_result, Xorriso_sieve_clear_results, Xorriso_sieve_dispose, Xorriso_sieve_big * New command -msg_op 2012.12.13.193255 [4877] xorriso/xorriso.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_p_z.c libisoburn/libisoburn.ver xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New command -toc_of 2012.12.15.092821 [4880] xorriso/xorriso.h libisoburn/libisoburn.h xorriso/lib_mgt.c libisoburn/libisoburn.ver New API call Xorriso__severity_list() 2012.12.15.093055 [4881] xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -msg_op opcodes "compare_sev" and "list_sev" 2012.12.16.131128 [4882] xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/text_io.h xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -msg_op opcode "parse_bulk" 2012.12.18.081434 [4883] xorriso/xorriso.h xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Command -toc_of modifier ":short" 2012.12.18.154505 [4884] xorriso/opts_p_z.c Bug fix: -rollback did not work if indev and outdev were empty 2012.12.18.185121 [4885] xorriso/text_io.c Corrected sieve filter rules for -tell_media_space 2012.12.19.210641 [4886] xorriso/opts_d_h.c Bug fix: -dialog "single_line" behaved like -dialog "on" 2012.12.20.202145 [4887] configure.ac xorriso/configure_ac.txt xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_i_o.c xorriso/opts_d_h.c xorriso/text_io.h xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 libisoburn/libisoburn.ver xorriso/compile_xorriso.sh New command -launch_frontend 2012.12.25.175536 [4888] xorriso/xorriso.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/text_io.h xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Changed the parameter rules for new command -launch_frontend 2012.12.25.180844 [4889] xorriso/text_io.c Xorriso_sieve_clear_results() dereferenced NULL if message sieve never started 27 Dec 2012 [4890] README Makefile.am xorriso/README_gnu_xorriso xorriso/xorriso_makefile_am.txt xorriso/make_xorriso_standalone.sh + frontend/ + frontend/xorriso-tcltk + frontend/README-tcltk + frontend/frontend_pipes_xorriso.c Proof-of-concept of a GUI frontend program. Written in Tcl/Tk. 27 Dec 2012 [4891] - test/frontend_pipes_xorriso.c Moved frontend_pipes_xorriso.c 27 Dec 2012 [4892] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.5 - 2012.12.27.100106 * New command -toc_of * New API call Xorriso__severity_list() * Bug fix: -rollback did not work if indev and outdev were empty * New command -launch_frontend * Proof-of-concept of a GUI frontend program: xorriso-tcltk written in Tcl/Tk. 28 Dec 2012 [4893] frontend/xorriso-tcltk frontend/README-tcltk Equiped xorriso-tcltk with help texts and enabled it to start xorriso by itself 28 Dec 2012 [4894] README xorriso/README_gnu_xorriso Updated general README files about xorriso-tcltk 2012.12.30.100913 [4895] xorriso/emulators.c xorriso/xorrecord.texi xorriso/xorrecord.info xorriso/xorrecord.1 Corrected a typo in man page of xorrecord, tolerating--grow_over[w]rit[e]able_iso 2012.12.30.115258 [4896] frontend/README-tcltk frontend/xorriso-tcltk Primitive file tree browser for xorriso-tcltk (if package BWidget is available) 2012.12.30.195312 [4897] frontend/xorriso-tcltk Improved xorriso-tcltk file browser 2012.12.30.203203 [4898] frontend/xorriso-tcltk Improved xorriso-tcltk file browser ------------------------------------ cycle - xorriso-1.2.5 - 2012.12.30.203203 2012.12.31.100509 [4899] frontend/xorriso-tcltk Made main Help window independent of help window for GUI elements 2012.12.31.120152 [4900] frontend/xorriso-tcltk Changed layout of drive list and drive buttons 2012.12.31.173306 [4901] frontend/xorriso-tcltk Avoided an error message if xorriso and xorriso-tcltk had differing device addresses 2013.01.01.130149 [4902] frontend/xorriso-tcltk Added a menu for global access permission policy, improved pop-up window positioning 2013.01.01.135853 [4903] frontend/README-tcltk frontend/xorriso-tcltk Changed copyright year and switched xorriso-tcltk to BSD license 2013.01.01.152241 [4904] frontend/xorriso-tcltk Reduced horizontal size of xorriso-tcltk to fit into 1024 pixels 2013.01.02.183011 [4905] xorriso/parse_exec.c Removed obsolete test code and disabled other tests 2013.01.03.101633 [4906] frontend/README-tcltk frontend/xorriso-tcltk Improved xorriso-tcltk dialog about overwriting of existing files 2013.01.03.102627 [4907] frontend/xorriso-tcltk Changed xorriso-tcltk default to --click_to_focus 2013.01.03.125535 [4908] frontend/xorriso-tcltk Blocked GUI activities until yes/no window resp. error window are closed 2013.01.03.134011 [4909] frontend/xorriso-tcltk Consolidated overwrite switches in a single menu burron 2013.01.03.160118 [4910] frontend/xorriso-tcltk Removed surplus quotes around variable evaluation 2013.01.03.182504 [4911] frontend/xorriso-tcltk Equipped file browser with a second vertical scrollbar 2013.01.03.185545 [4912] frontend/xorriso-tcltk Moved and renamed the "Refresh avail:" button 2013.01.03.190805 [4913] frontend/xorriso-tcltk Gave the "Move to:" field a Return key binding 2013.01.04.094503 [4914] frontend/xorriso-tcltk Added start option --script_log_file. Gave file tree browser a fallback mode. 2013.01.04.140336 [4915] frontend/xorriso-tcltk Made script logging and log target addresses controllable from GUI 2013.01.04.143459 [4916] frontend/xorriso-tcltk Avoided redundant logging of -cd commands 2013.01.04.185925 [4917] xorriso/xorriso_private.h xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -osirrox settings "blocked" and "unblock" 2013.01.04.192238 [4918] frontend/xorriso-tcltk Gave xorriso-tcltk an opportunity to execute files with xorriso commands 2013.01.04.204305 [4919] frontend/xorriso-tcltk Small adjustments and bug fixes in xorriso-tcltk 2013.01.04.221013 [4920] frontend/xorriso-tcltk Small adjustments and bug fixes in xorriso-tcltk 2013.01.05.105029 [4921] frontend/xorriso-tcltk Small adjustments and bug fixes in xorriso-tcltk ------------------------------------ cycle - xorriso-1.2.5 - 2013.01.05.105029 * New -osirrox settings "blocked" and "unblock" 2013.01.05.214951 [4922] xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Made -msg_op "parse" obey -backslash_codes. 2013.01.05.220937 [4923] frontend/README-tcltk frontend/xorriso-tcltk Hardened xorriso-tcltk against filenames with newlines 2013.01.06.093550 [4924] frontend/xorriso-tcltk Avoided unnecessary rebuilding of file browser tree with Up and Down buttons 2013.01.06.095957 [4925] frontend/README-tcltk frontend/xorriso-tcltk New xorriso-tcltk start option --no_extract 2013.01.06.100954 [4926] frontend/xorriso-tcltk Decided for xorriso as info source about loal filesystem 2013.01.06.102339 [4927] frontend/xorriso-tcltk Disabled "Extract to disk" button if extraction is banned 2013.01.06.154027 [4928] frontend/xorriso-tcltk Small adjustments in xorriso-tcltk 2013.01.06.171902 [4929] xorriso/match.c Corrected an error message which has undesired effects with fronetnds 2013.01.06.174508 [4930] frontend/xorriso-tcltk Removed the ""File browser text field" switch 2013.01.06.194655 [4931] frontend/xorriso-tcltk Worked around the 4 reserved characters of Bwidget Tree 2013.01.06.205810 [4932] frontend/xorriso-tcltk Promoted drive line labels to buttons 2013.01.07.190934 [4933] frontend/xorriso-tcltk Some polishing of xorriso-tcltk 2013.01.07.215658 [4934] xorriso/text_io.c xorriso/disk_ops.c Closed memory leaks found by valgrind 08 Jan 2013 [4940] svn copy -m Branching for libisoburn release 1.2.6 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.2.6 2013.01.08.103001 [4941] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.2.6 08 Jan 2012 [4942] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 2013.01.08.103001 [4943] libisoburn/libisoburn.h libisoburn.h was missing in commit 4941 2013.01.08.103001 [4944] Makefile.am Had to add xorriso-tcltk to EXTRA_DIST although it is in bin_SCRIPTS 2013.01.08.103001 [4945] xorriso/xorriso_makefile_am.txt Had to add xorriso-tcltk to EXTRA_DIST although it is in bin_SCRIPTS ----------------------------------- release - xorriso-1.2.6 - 2013.01.08.103001 =============================================================================== * 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. 2013.01.08.151611 [4950] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.2.7 08 Jan 2013 [4951] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 08 Jan 2013 [4952] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.2.6 http://svn.libburnia-project.org/libisoburn/tags/1.2.6 ------------------------------------ cycle - xorriso-1.2.7 - 2013.01.08.151611 09 Jan 2013 [4953] frontend/xorriso-tcltk For now only demanding xorriso >= 1.2.6 for xorriso-tcltk-1.2.7 11 Jan 2013 [4954] xorriso/xorriso_eng.html Presenting xorriso-tcltk on the GNU xorriso web page 2013.01.13.093116 [4957] xorriso/match.c Curbed the number of wildcard warnings to 3 for iso and 3 for disk 2013.01.13.102527 [4958] configure.ac libisoburn/libisoburn.h Requiring libburn-1.2.7 2013.01.13.200742 [4959] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/burn_wrap.c libisoburn/libisoburn.ver New API call isoburn_toc_disc_get_incmpl_sess() 2013.01.14.094419 [4960] xorriso/drive_mgt.c Making use of new libisoburn API call to show incomplete sessions 2013.01.15.104804 [4962] frontend/xorriso-tcltk frontend/README-tcltk New feature "Log non-essential commands" and --script_log_all_commands 15 Jan 2013 [4963] xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Clarified meaning of "After commit" prediction of -tell_media_space 16 Jan 2013 [4964] xorriso/xorriso_eng.html ChangeLog Updated change log and web page 2013.01.16.181831 [4967] xorriso/emulators.c xorriso/opts_p_z.c Updated copyright message of xorriso ------------------------------------ cycle - xorriso-1.2.7 - 2013.01.16.181831 * Bug fix: -print_size and -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. 12 Feb 2013 [4968] doc/faq.wiki Mentioned xorriso-tcltk in the online FAQ 12 Feb 2013 [4969] doc/faq.wiki Improved mentioning of xorriso-tcltk in the online FAQ 2013.02.18.104738 [4970] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs options -eltorito-id , -eltorito-selcrit 18 Feb 2012 [4971] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.7 - 2013.02.18.104738 * New -as mkisofs options -eltorito-id , -eltorito-selcrit 2013.02.26.082331 [4973] xorriso/check_media.c Corrected wrong use of sizeof 2013.02.26.103233 [4974] xorriso/drive_mgt.c Bug fix: -check_media use=outdev sector_map= stored TOC of input drive 2013.03.06.164347 [4983] xorriso/iso_manip.c Bug fix: -hide hfsplus and -as mkisofs -hide-hfsplus had no effect. Thanks to Davy Ho. 2013.03.06.164906 [4984] xorriso/drive_mgt.c With -list_speeds : reporting the effective speed 0 if it deviates from speed H 2013.03.10.193344 [4985] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_a_c.c xorriso/emulators.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Improved interaction of -as mkisofs command with other commands 10 Mar 2013 [4986] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.7 - 2013.03.10.193344 * 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. 2013.03.12.124913 [4988] configure.ac libisoburn/libisoburn.h Requiring libisofs-1.2.7 2013.03.12.194637 [4989] xorriso/write_run.c Prevented rollover of El Torito Sector Count of large EFI boot images 2013.03.12.194842 [4990] configure.ac xorriso/misc_funct.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Corrected the interpretation of user supplied ECMA-119 timestamp strings 2013.03.12.195052 [4991] xorriso/xorriso.h xorriso/iso_img.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Reporting volume timestamps with -pvd_info 2013.03.13.195851 [4992] xorriso/xorriso.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 libisoburn/libisoburn.ver New command -move 2013.03.17.110559 [4993] configure.ac Bug fix: ./configure did not abort if libburn.h or libisofs.h were missing 18 Mar 2013 [5000] svn copy -m Branching for libisoburn release 1.2.8 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.2.8 18 Mar 2013 [5001] frontend/xorriso-tcltk frontend/README-tcltk Making use of command -move in xorriso-tcltk 2013.03.18.093001 [5002] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.2.8 18 Mar 2013 [5004] Makefile.am Had to add xorriso-tcltk to EXTRA_DIST although it is in bin_SCRIPTS 18 Mar 2013 [5003] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.2.8 - 2013.03.18.093001 * 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 18 Mar 2013 [5005] frontend/xorriso-tcltk frontend/README-tcltk Making use of command -move in xorriso-tcltk 18 Mar 2013 [5006] Makefile.am Had to add xorriso-tcltk to EXTRA_DIST although it is in bin_SCRIPTS 2013.03.18.204322 [5010] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.2.9 19 Mar 2013 [5011] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 20 Mar 2013 [5012] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.2.8 http://svn.libburnia-project.org/libisoburn/tags/1.2.8 ------------------------------------ cycle - xorriso-1.2.9 - 2013.03.18.204322 2013.04.13.064738 [5017] libisoburn/libisoburn.h libisoburn/isoburn.c New options bit with isoburn_igopt_set_system_area() for GRUB2 MBR patching 2013.04.13.074117 [5018] xorriso/xorriso_private.h xorriso/opts_a_c.c xorriso/iso_img.c xorriso/write_run.c New -boot_image bootspecs grub2_mbr= and grub2_boot_info= 2013.04.13.074309 [5019] xorriso/emulators.c New -as mkisofs options --grub2-mbr and --grub2-boot-info ------------------------------------ cycle - xorriso-1.2.9 - 2013.04.13.074309 * New options bit with isoburn_igopt_set_system_area() for GRUB2 MBR patching * New -boot_image bootspecs grub2_mbr= and grub2_boot_info= * New -as mkisofs options --grub2-mbr and --grub2-boot-info 2013.04.13.144946 [5020] xorriso/iso_tree.c Bug fix: Disk paths with components '.' or '..' could be mistaken for directories 2013.04.13.205230 [5021] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_a_c.c xorriso/iso_img.c xorriso/write_run.c New -boot_image bootspec grub2_sparc_core= 2013.04.13.205450 [5022] xorriso/emulators.c New -as mkisofs option --grub2-sparc-core ------------------------------------ cycle - xorriso-1.2.9 - 2013.04.13.205450 2013.04.14.174539 [5023] xorriso/iso_img.c xorriso/text_io.c Reporting grub2_mbr= with -status -boot_image 2013.04.14.174902 [5024] xorriso/opts_d_h.c xorriso/emulators.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Updated man page and help texts about new features 2013.04.16.124331 [5025] xorriso/iso_img.c Recognizing grub2_mbr= on image load 17 Apr 2013 [5026] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.9 - 2013.04.16.124331 * 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 * Bug fix: Disk paths with components '.' or '..' could be mistaken for directories 2013.05.03.135424 [5027] xorriso/emulators.c Letting -as cdrecord -help point to man xorrecord rather than to man xorriso 2013.05.06.161651 [5028] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/text_io.c New -hardlinks mode "lsl_count" / "no_lsl_count" 06 May 2013 [5029] frontend/xorriso-tcltk Starting up xorriso-tcltk with -hardlinks "on" if xorriso version >= 1.3.0 07 May 2013 [5030] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Documented new -hardlinks mode 07 May 2013 [5031] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrecord.texi xorriso/xorrecord.info xorriso/xorrecord.1 Clarification that xorriso does neither audio CD nor official video DVD 07 May 2013 [5032] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.9 - 2013.05.07.185653 * New -hardlinks mode "lsl_count" / "no_lsl_count" 07 May 2013 [5033] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Small improvement in layout of xorriso info page 10 May 2013 [5037] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Corrected two examples in man xorriso 10 May 2013 [5038] xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Corrected bold printing of three options in man xorrisofs 2013.05.13.123951 [5039] xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Bug fix: -as mkisofs -print-size failed with -isohybrid-mbr and a single boot image 13 May 2013 [5040] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.9 - 2013.05.13.123951 * Bug fix: -as mkisofs -print-size failed with -isohybrid-mbr and a single boot image 2013.05.16.070643 [5041] xorriso/emulators.c Ignoring -as mkisofs options -gui and -sort 2013.05.16.070643 [5042] xorriso/emulators.c Bug fix: -as mkisofs -path-list did not switch to --no-emul-toc by default 16 May 2013 [5043] xorriso/xorriso_eng.html ChangeLog Updated change log and web page ------------------------------------ cycle - xorriso-1.2.9 - 2013.05.16.070643 * Bug fix: -as mkisofs -path-list did not switch to --no-emul-toc by default 2013.05.17.140001 [5049] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.3.0 17 May [5050] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.3.0 - 2013.05.17.140001 * 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 * Bug fix: Disk paths with components '.' or '..' could be mistaken for directories * New -hardlinks mode "lsl_count" / "no_lsl_count" * Bug fix: -as mkisofs -print-size failed with -isohybrid-mbr and a single boot image * Bug fix: -as mkisofs -path-list did not switch to --no-emul-toc by default 2013.05.17.193457 [5055] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.3.1 17 May 2013 [5056] ChangeLog xorriso/changelog.txt Updated change log and web page 17 May 2013 [5057] xorriso/make_xorriso_standalone.sh Corrected release number in make_xorriso_standalone.sh 17 May 2013 [5058] svn move -m 'Promoted branch to tag' ------------------------------------ cycle - xorriso-1.3.1 - 2013.05.17.193457 2013.05.24.111243 [5072] xorriso/iso_manip.c Bug fix: -find -exec "sort_weight" did not mark the image as having pending changes 24 May 2013 [5073] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Corrected statement about sort weight of files which are loaded from ISO image 2013.05.28.175212 [5075] xorriso/xorrisoburn.h xorriso/emulators.c xorriso/iso_manip.c xorriso/disk_ops.c xorriso/iso_tree.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs options --sort-weight-list and --sort-weight-patterns 2013.05.30.192537 [5078] xorriso/xorriso.h xorriso/parse_exec.c xorriso/sfile.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Bug fix: -backslash_codes "with_program_arguments" was interpreted too late 2013.06.02.112441 [5079] xorriso/opts_p_z.c xorriso/write_run.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -pacifier behavior code "interval=" 2013.06.02.112720 [5085] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Letting -as mkisofs -gui cause a higher frequency of pacifier messages 02 Jun 2013 [5086] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.3.1 - 2013.06.02.112720 * 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 * New -pacifier behavior code "interval=" * New -as mkisofs options --sort-weight-list and --sort-weight-patterns ------------------------------------ cycle - xorriso-1.3.1 - 2013.06.10.083720 (Improved granularity of SCSI log time measurement, SCSI log timestamps) 2013.06.27.125407 [5092] xorriso/opts_a_c.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -format mode "without_spare" (for BD-RE) 30 Jun 2013 [5095] frontend/xorriso-tcltk Small fix in xorriso-tcltk help text 2013.06.30.160008 [5096] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/text_io.h xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 libisoburn/libisoburn.ver New command -named_pipe_loop 2013.07.01.180608 [5098] xorriso/xorriso.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/disk_ops.c xorriso/iso_tree.c xorriso/iso_manip.c xorriso/text_io.h xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 libisoburn/libisoburn.ver New command -sh_style_result 2013.07.01.180652 [5099] xorriso/lib_mgt.c Making use of new libburn option to ignore SIGPIPE 01 Jul 2013 [5100] configure.ac libisoburn/libisoburn.h Requiring libburn-1.3.1 2013.07.02.092827 [5101] xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -msg_op opcdoes "parse_silently" and "parse_bulk_silently" 2013.07.02.123642 [5102] xorriso/text_io.c Comitting file that was missing in rev 5101 2013.07.04.094640 [5103] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/text_io.c xorriso/aux_objects.h xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Extended new command -named_pipe_loop by mode parameter 04 Jul 2013 [5104] frontend/sh_on_named_pipes.sh New frontend demo skript frontend/sh_on_named_pipes.sh 04 Jul 2013 [5105] README Makefile.am xorriso/README_gnu_xorriso xorriso/make_xorriso_standalone.sh xorriso/xorriso_makefile_am.txt Integrating frontend/sh_on_named_pipes.sh into docs and delivery system 2013.07.05.072400 [5106] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page 05 Jul 2013 [5107] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Corrected a typo in change logs ------------------------------------ cycle - xorriso-1.3.1 - 2013.07.05.072400 * New -format mode "without_spare" (for BD-RE) * New command -named_pipe_loop * New -msg_op opcodes "parse_silently" and "parse_bulk_silently" 2013.07.05.164001 [5108] xorriso/xorriso.h xorriso/opts_i_o.c Bug fix: Missing or empty parameter with -dus was interpreted as "*" rather than "." 2013.07.06.110101 [5109] xorriso/opts_d_h.c xorriso/text_io.c Bug fix: readline history was spammed by -msg_op parsing and pipe loops 22 Jul 2013 [5113] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.3.1 - 2013.07.22.202742 * 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: (libburn) xorriso aborted on SIGCONT, SIGTSTP, SIGTTIN, SIGTTOU 01 Aug 2013 [5115] xorriso/xorrisofs.texi xorriso/xorrisofs.1 Corrected line breaks in man xorrisofs example about isohybrid 2013.08.04.101212 [5117] configure.ac xorriso/configure_ac.txt Adapted text output of configure option --enable-dvd-obs-64k 2013.08.04.102038 [5118] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/write_run.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 libisoburn/libisoburn.ver New command -application_use 2013.08.04.102243 [5119] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs option --application_use 2013.08.04.102418 [5120] xorriso/emulators.c Bug fix: -as mkisofs -help in dialog mode with pager did not end on request 04 Aug 2013 [5121] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.3.1 - 2013.08.04.102418 * New command -application_use and new -as mkisofs option --application_use 07 Aug 2013 [5129] copy -m Branching for libisoburn release 1.3.2 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.3.2 2013.08.04.172325 [5123] xorriso/base_obj.c xorriso/text_io.c Changed default setting of -application_use from 0x00 to 0x20 2013.08.07.110001 [5130] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.3.2 07 Aug 2013 [5131] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.3.2 - 2013.08.07.110001 * 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 2013.08.07.141130 [5136] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.3.3 07 Aug 2013 [5137] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 07 Aug 2013 [5138] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.3.2 http://svn.libburnia-project.org/libisoburn/tags/1.3.2 ------------------------------------ cycle - xorriso-1.3.3 - 2013.08.07.141130 2013.08.16.153701 [5139] libisoburn/libisoburn.h Clarified the comments about isoburn_prepare_*() calls 2013.08.16.153743 [5140] xorriso/write_run.c Bug fix: Command -blank "as_needed" formatted blank BD-R. 2013.08.19.152714 [5141] xorriso/write_run.c Downgraded severity of media overflow with -print_size 2013.08.20.144306 [5142] xorriso/emulators.c Closed a small memory leak with -as mkisofs emulation 2013.08.27.095314 [5143] xorriso/xorriso_private.h xorriso/write_run.c Avoiding a futile re-try when ending after a failed session write attempt 27 Aug 2013 [5144] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.3.3 - 2013.08.27.095314 * Bug fix: Command -blank "as_needed" formatted blank BD-R. 2013.09.05.080255 [5149] xorriso/drive_mgt.c Keeping -check_media from reading outside of medium readable area 2013.09.05.081703 [5150] xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Reacted on warnings of PLD Linux build log 2013.09.05.082833 [5151] xorriso/emulators.c Bug fix: -as mkisofs option -log-file added the log file to the image 2013.09.07.193824 [5153] xorriso/iso_manip.c Reacted on warning of valgrind 07 Sep 2013 [5154] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Mentioned the change of default weight for boot image files 10 Sep 2013 [5155] xorriso/xorriso_eng.html Removed false promise from web page example about -osirrox 2013.09.16.164820 [5156] libisoburn/burn_wrap.c xorriso/iso_manip.c Reacted on warnings of Debian buildd with clang 2013.10.05.073918 [5159] xorriso/iso_manip.c Bug fix: -cut_out did not add x-permission to r-permission of directory 2013.10.08.175702 [5160] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/text_io.c xorriso/drive_mgt.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New command -read_speed 09 Oct 2013 [5162] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.3.3 - 2013.10.08.175702 * 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 * New command -read_speed * libisofs: Default sort weight of El Torito boot images is now 2. 2013.10.14.140028 [5165] xorriso/opts_p_z.c Bug fix: Command -zisofs did not accept all options emitted by -status -zisofs 2013.10.20.125455 [5166] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/emulators.c xorriso/text_io.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -close mode "as_needed" 2013.10.27.115427 [5167] libisoburn/libisoburn.h Now requiring libburn-1.3.3 2013.10.28.150924 [5169] xorriso/xorrisoburn.h xorriso/parse_exec.c xorriso/opts_a_c.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Automatic re-try with -close "as_needed" and unannounced fast-blanked DVD-RW 2013.10.28.151434 [5170] xorriso/emulators.c xorriso/xorrecord.texi xorriso/xorrecord.info xorriso/xorrecord.1 New -as cdrecord option --multi_if_possible 2013.10.29.123448 [5171] xorriso/drive_mgt.c Avoiding to list pairs of the same speed with -list_speeds 2013.11.10.163500 [5176] xorriso/drive_mgt.c Bug fix: -blank force:... failed on appendable or closed media 11 Nov 2013 [5178] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.3.3 - 2013.11.10.163500 * Bug fix: Command -zisofs did not accept all options emitted by -status -zisofs * Bug fix: libburn: Drive error reports were ignored during blanking and formatting * Bug fix: -blank force:... failed on appendable or closed media * Bug fix: libburn: Drive LG BH16NS40 stalled on inspection of unformatted DVD+RW * New -close mode "as_needed", new -as cdrecord option --multi_if_possible 2013.11.15.095611 [5181] xorriso/opts_a_c.c Removed an obsolete variable 15 Nov 2013 [5183] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Mentioned built-in limits for minimum and maximum speed 2013.11.17.120422 [5186] libisoburn/burn_wrap.c Releasing loaded ISO image data when no longer needed ------------------------------------ cycle - xorriso-1.3.3 - 2013.11.17.120422 2013.11.18.140456 [5188] xorriso/text_io.c Reacted on warning about unused variable if no readline is enabled ------------------------------------ cycle - xorriso-1.3.3 - 2013.11.26.123204 * libisofs: Encoding HFS+ names in UTF-16 rather than UCS-2. 2013.11.27.094951 [5190] xorriso/parse_exec.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -alter_date types: a-c , m-c , b-c , c 01 Dec 2013 [5191] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Defined the term LBA in man xorriso 12 Dec 2013 [5196] svn copy -m Branching for libisoburn release 1.3.4 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.3.4 2013.12.12.103001 [5197] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.3.4 12 Dec 2013 [5198] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.3.4 - 2013.12.12.103001 * 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 2013.12.12.154238 [5203] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.3.5 12 Dec 2013 [5204] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.3.4 http://svn.libburnia-project.org/libisoburn/tags/1.3.4 12 Dec 2013 [5205] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-1.3.5 - 2013.12.12.154238 2013.12.18.074049 [5206] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New isoburn_igopt_set_relaxed() relaxation isoburn_igopt_joliet_utf16 2013.12.18.074219 [5207] xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New -compliance rule joliet_utf16 2013.12.18.074401 [5208] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info New -as mkisofs option -joliet-utf16 2013.12.28.194725 [5209] libisoburn/libisoburn.h libisoburn/isoburn.c libisoburn/libisoburn.ver New API call isoburn_conv_name_chars() 2013.12.29.120027 [5210] xorriso/opts_d_h.c xorriso/findjob.h xorriso/findjob.c xorriso/iso_manip.c xorriso/write_run.h xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -find test -bad_outname, new -find action print_outname 2013.12.30.101707 [5211] xorriso/iso_tree.c Bug fix: -compare reported false differences with directories which have non-trivial ACL but no default ACL 02 Jan 2014 [5212] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Clarified in man xorriso the roles of character sets 2014.01.05.072818 [5212] [5213] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.3.5 - 2014.01.05.072818 * Bug fix: libisofs: Division by zero if HFS+ was combined with TOC emulation for overwritable media. * New isoburn_igopt_set_relaxed() relaxation isoburn_igopt_joliet_utf16 * New -compliance rule joliet_utf16, new -as mkisofs option -joliet-utf16 * New API call isoburn_conv_name_chars() * New -find test -bad_outname, new -find action print_outname 2014.01.09.154437 [5217] xorriso/drive_mgt.c Bug fix: -list_speeds did not work any more with old CD drives 2014.01.09.215206 [5219] xorriso/drive_mgt.c Improved display of -list_speeds 09 Jan 2014 [5220] ChangeLog xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.3.5 - 2014.01.09.215206 * libburn: Adapted Linux SG_IO adapter to scsi/sg.h of git.kernel.org 2014.01.14.084808 [5221] libisoburn/libisoburn.h Mentioned system area type 4 for HP-PA 2014.01.14.090320 [5222] xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/iso_img.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -boot_image settings hppa_cmdline=, hppa_bootloader=, hppa_kernel_32=, hppa_kernel_64=, hppa_ramdisk= 2014.01.14.091348 [5223] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs options -hppa-cmdline, -hppa-bootloader, -hppa-kernel-32, -hppa-kernel-64, -hppa-ramdisk 14 Jan 2014 [5224] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.3.5 - 2014.01.14.091348 * New -boot_image settings hppa_cmdline=, hppa_bootloader=, hppa_kernel_32=, hppa_kernel_64=, hppa_ramdisk= * New -as mkisofs options -hppa-cmdline, -hppa-bootloader, -hppa-kernel-32, -hppa-kernel-64, -hppa-ramdisk 2014.01.16.112242 [5227] libisoburn/libisoburn.h Mentioned system area type 5 for HP-PA version 5 2014.01.16.113247 [5228] xorriso/xorriso_private.h xorriso/opts_a_c.c xorriso/iso_img.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -boot_image setting hppa_hdrversion= 2014.01.16.113503 [5229] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs option -hppa-hdrversion 20 Jan 2014 [5230] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Corrected a wrong statement in man xorriso about -check_media bad_limit= 2014.01.23.200641 [5231] xorriso/drive_mgt.c xorriso/check_media.h xorriso/check_media.c Bug fix: -check_media marked untested sectors in sector map as valid 24 Jan 2014 [5232] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.3.5 - 2014.01.23.200641 * Bug fix: -check_media marked untested sectors in sector map as valid * New -boot_image setting hppa_hdrversion= * New -as mkisofs option -hppa-hdrversion ------------------------------------ cycle - xorriso-1.3.5 - 2014.02.05.121822 (Experimental upload for NetBSD support) 2014.02.05.191021 [5236] configure.ac xorriso/configure_ac.txt xorriso/compile_xorriso.sh Added -Wno-char-subscripts to CFLAGS 2014.02.08.111505 [5239] xorriso/write_run.c Silenced a MISHAP message of libisofs with -tell_media_space caused by rev 5210 2014.02.09.141412 [5240] xorriso/iso_img.c Improved output of -pvd_info with timestamps with non-zero time zone 2014.02.10.104827 [5241] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/disk_ops.c xorriso/iso_tree.c Bug fix: Paths with symbolic links preceding ".." were not interpreted properly 10 Feb 2014 [5242] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.3.5 - 2014.02.10.104827 Bug fix: Paths with symbolic links preceding ".." were not interpreted properly 10 Feb 2014 [5243] configure.ac libisoburn/libisoburn.h Requiring libisofs-1.3.5 and libburn-1.3.5 11 Feb 2014 [5248] acinclude.m4 Added /usr/local for NetBSD 12 Feb 2014 [5250] doc/comments xorriso/README_gnu_xorriso Mentioned support for NetBSD 2014.02.13.154003 [5251] xorriso/iso_img.c Corrected a bug introduced with rev 5240 27 Feb 2014 [5256] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.3.5 - 2014.02.27.091053 * libburn: New system adapter for NetBSD 2014.03.02.102010 [5258] xorriso/iso_img.c Made -status -boot_image more verbous about the pending boot image definition 2014.03.03.202815 [5299] xorriso/opts_d_h.c xorriso/emulators.c xorriso/iso_img.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Temporarily disabled the unfinished HP-PA PALO bootability preparations 04 Mar 2014 [5264] svn copy -m Branching for libisoburn release 1.3.6 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.3.6 2014.03.04.113001 [5265] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.3.6 04 Mar 2014 [5266] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 2014.03.04.120001 [5267] xorriso/drive_mgt.c Last minute regression fix: -list_speeds on non-BD drives used CD speed factor 04 Mar 2014 [5268] xorriso/changelog.txt Documented release timestamp ----------------------------------- release - xorriso-1.3.6 - 2014.03.04.120001 * 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 2014.03.04.164038 [5273] xorriso/drive_mgt.c Last minute regression fix: -list_speeds on non-BD drives used CD speed factor 2014.03.04.165750 [5274] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.3.7 04 Mar 2014 [5275] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.3.6 http://svn.libburnia-project.org/libisoburn/tags/1.3.6 05 Mar 2014 [5276] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-1.3.7 - 2014.03.04.165750 05 Mar 2014 [5277] releng/run_all_auto Gave up use of PIPESTATUS in releng/run_all_auto because of NetBSD /bin/sh 2014.03.06.075858 [5278] xorriso/drive_mgt.c Changed severity of missing -list_format data from FAILURE to SORRY 2014.03.06.164332 [5279] xorriso/iso_img.c Bug fix: Command -status produced FAILURE event if no drive was acquired 06 Mar 2014 [5280] ChangeLog xorriso/xorriso_eng.html Updated change log and web page ------------------------------------ cycle - xorriso-1.3.7 - 2014.03.06.164332 * Bug fix: Command -status produced FAILURE event if no drive was acquired 2014.03.14.134138 [5283] libisoburn/libisoburn.h Corrected outdated description of GRUB2 MBR patching 18 Mar 2014 [5288] svn copy -m Patching libisoburn to pl01 http://svn.libburnia-project.org/libisoburn/tags/1.3.6 http://svn.libburnia-project.org/libisoburn/branches/1.3.6.pl01 2014.03.18.083001 [5289 1.3.6.pl01] README xorriso/README_gnu_xorriso xorriso/iso_img.c xorriso/xorriso_eng.html xorriso/xorriso_timestamp.h Bug fix: Command -status produced FAILURE event if no drive was acquired 18 Mar 2014 [5290] svn move -m Patched libisoburn to 1.3.6.pl01 http://svn.libburnia-project.org/libisoburn/branches/1.3.6.pl01 http://svn.libburnia-project.org/libisoburn/tags/1.3.6.pl01 ------------------------------ release - xorriso-1.3.6.pl01 - 2014.03.18.083001 25 Mar 2014 [5292] ChangeLog xorriso/xorriso_eng.html Mentioned patch level release 1.3.6.pl01 2014.03.25.195908 [5293] xorriso/xorriso_private.h xorriso/iso_img.c Bug fix: -boot_image any partition_cyl_align=on prevented further settings 2014.04.03.194751 [5294] xorriso/iso_img.c Reacted on compiler warning of gcc on AIX. Thanks Richard Nolde. 2014.04.04.142016 [5295] xorriso/opts_a_c.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Bug fix: -boot_image grub grub2_mbr= did not work (but -as mkisofs --grub2-mbr did work) 2014.04.04.153505 [5296] xorriso/opts_a_c.c xorriso/iso_img.c Bug fix: -boot_image grub2_mbr= prevented -boot_image partition_table=on 2014.04.08.091745 [5298] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/emulators.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info New -stdio_sync option "end", -as mkisofs default is now --stdio_sync "off" 2014.04.08.094441 [5299] configure.ac libisoburn/libisoburn.h Requiring libburn-1.3.7 and libisofs-1.3.7 2014.04.09.073038 [5300] xorriso/emulators.c xorriso/iso_img.c xorriso/opts_d_h.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info Re-enabled HP-PA PALO boot preparations 09 Apr 2014 [5301] ChangeLog xorriso/xorriso_eng.html Updated change log and web page ------------------------------------ cycle - xorriso-1.3.7 - 2014.04.09.073038 * Bug fix: libburn : Compilation warning for unsupported systems mutated into an error * 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". * New bootspecs hppa_*, new -as mkisofs options -hppa-* for HP-PA via PALO 2014.04.10.072212 [5303] xorriso/opts_d_h.c Mentioned bootspec hppa_discard in xorriso -help 2014.04.11.161139 [5304] xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/iso_img.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info libisoburn/libisoburn.ver New command -report_system_area 2014.04.12.130150 [5305] xorriso/iso_img.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New -report_system_area form "gpt_crc_of:" 2014.04.13.071908 [5306] xorriso/iso_img.c Adapted -report_system_area to changed output format of libisofs 2014.04.13.120421 [5307] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c libisoburn/libisoburn.ver New API calls isoburn_igopt_set_stdio_endsync(), isoburn_igopt_get_stdio_endsync() 2014.04.13.120743 [5308] xorriso/write_run.c Making use of new libisoburn API call 2014.04.14.190506 [5311] xorriso/opts_p_z.c Updated copyright date in output of xorriso -version 2014.04.16.144146 [5312] xorriso/opts_d_h.c xorriso/findjob.h xorriso/findjob.c xorriso/iso_manip.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New -find pseudo tests -use_pattern , -or_use_pattern 2014.04.16.144623 [5313] xorriso/opts_d_h.c Removed a surplus code snippet that was committed by rev 5312 2014.04.16.145517 [5314] xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Corrected a statement in the man page. 2014.04.19.115057 [5316] xorriso/drive_mgt.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Adapted -check_media to peculiarities of DVD and BD 2014.04.21.131802 [5317] xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/parse_exec.h xorriso/parse_exec.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/iso_img.c xorriso/disk_ops.c xorriso/read_run.c xorriso/filters.c xorriso/sfile.h xorriso/sfile.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info libisoburn/libisoburn.ver New command -concat 2014.04.21.165612 [5318] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_d_h.c xorriso/disk_ops.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New -follow occasion "concat" 22 Apr 2014 [5319] xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Polished man page about -concat 22 Apr 2014 [5320] ChangeLog xorriso/xorriso_eng.html Updated change log and web page ------------------------------------ cycle - xorriso-1.3.7 - 2014.04.21.165612 * New command -report_system_area * New -find pseudo tests -use_pattern , -or_use_pattern * New command -concat 2014.04.24.084041 [5321] xorriso/opts_d_h.c xorriso/iso_img.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New -report_system_area form "el_torito" 2014.04.24.084540 [5322] xorriso/write_run.c Clarified potentially negative el_torito_set_load_size() parameter in xorriso 2014.04.25.064456 [5323] xorriso/iso_img.c Using libisofs system area summary in -toc line "Boot record" 2014.04.29.174832 [5325] xorriso/xorriso.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/iso_img.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info libisoburn/libisoburn.ver New command -report_el_torito (former -report_system_area "el_torito") 2014.05.02.090851 [5326] acinclude.m4 releng/auto_cxx Added -I/usr/pkg/include und -L/usr/pkg/lib for NetBSD 2014.05.03.080034 [5327] xorriso/opts_d_h.c Fixed a bug with recognition of -find test -or_use_pattern 2014.05.03.114648 [5329] libisoburn/libisoburn.h libisoburn/burn_wrap.c libisoburn/libisoburn.ver New API call isoburn_disc_pretend_full_uncond() 2014.05.03.114930 [5330] xorriso/drive_mgt.c Making use of new API call 2014.05.03.115011 [5331] libisoburn/burn_wrap.c Bug fix: -blank force:all on DVD+RW had no effect 2014.05.18.144453 [5332] xorriso/sort_cmp.c Added a few comments about ino_t compatibility 2014.05.28.125704 [5333] xorriso/iso_img.c xorriso/disk_ops.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info Anticipating NetBSD mount option -s 2014.06.03.190644 [5334] xorriso/parse_exec.c Fixed a bug introduced by rev 5317, which prevented use of execution paths 2014.06.13.084712 [5337] xorriso/write_run.c Precautions for large stdio filesystems 2014.06.13.090244 [5338] xorriso/opts_d_h.c xorriso/iso_tree.h xorriso/iso_tree.c xorriso/iso_manip.c xorriso/findjob.h xorriso/read_run.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New -find action report_sections 2014.06.14.185146 [5339] xorriso/disk_ops.h Commiting a header file that was forgotten with rev 5317 2014.06.14.192149 [5340] configure.ac acinclude.m4 xorriso/configure_ac.txt xorriso/base_obj.c xorriso/opts_d_h.c xorriso/lib_mgt.c xorriso/text_io.c Enabled use of libedit as alternative to libreadline 2014.06.15.090324 [5341] xorriso/lib_mgt.c xorriso/text_io.h xorriso/text_io.c Shutdown of libedit 2014.06.15.094311 [5342] xorriso/opts_p_z.c xorriso/text_io.h xorriso/text_io.c Stating license GPLv3+ if header of libreadline >= 6.x is included 2014.06.15.125555 [5343] README xorriso/README_gnu_xorriso configure.ac xorriso/configure_ac.txt Clarified configuration and license aspects of libreadline and libedit 2014.06.15.183236 [5344] Makefile.am Keeping releng/releng_generated_data/.svn out of libisoburn tarball 15 Jun 2014 [5345] ChangeLog xorriso/xorriso_eng.html Updated change log and web page ------------------------------------ cycle - xorriso-1.3.7 - 2014.06.15.183236 * New command -report_el_torito * New -find action report_sections * Bug fix: -blank force:all on DVD+RW had no effect * Enabled use of libedit as alternative to libreadline ------------------------------------ cycle - xorriso-1.3.7 - 2014.06.20.065402 * Enabled recording and restoring of extattr on NetBSD 27 Jun 2014 [5347] xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Corrected information about -isohybrid-gpt-basdat MBR partition type 27 Jun 2014 [5352] svn copy -m Branching for libisoburn release 1.3.8 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.3.8 2014.06.28.070001 [5353] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.3.8 28 Jun 2014 [5354] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 2014.06.28.071001 [5355] xorriso/parse_exec.h xorriso/xorriso_timestamp.h Corrected a type in declaration ----------------------------------- release - xorriso-1.3.8 - 2014.06.28.071001 * 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 bootspecs hppa_*, new -as mkisofs options -hppa-* for HP-PA via PALO * New -find pseudo tests -use_pattern , -or_use_pattern * New command -concat * New -find action report_sections * New commands -report_system_area and -report_el_torito 2014.06.28.071104 [5360] xorriso/parse_exec.h xorriso/xorriso_timestamp.h Corrected a type in declaration 2014.06.28.071234 [5361] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.3.9 28 Jun 2014 [5362] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-1.3.9 - 2014.06.28.071234 28 Jun 2014 [5363] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.3.8 http://svn.libburnia-project.org/libisoburn/tags/1.3.8 06 Jul 2014 [5365] COPYRIGHT Updated copyright date 20 Aug 2014 [5372] ChangeLog xorriso/xorriso_eng.html Updated change log and web page ------------------------------------ cycle - xorriso-1.3.9 - 2014.08.20.093534 * Bug fix: -dev or -indev of medium with non-ISO data caused SIGSEGV by NULL 2014.09.23.064407 [5377] xorriso/emulators.c Corrected xorrisofs help text about -chrp-boot-part and -prep-boot-part 2014.09.23.064554 [5378] libisoburn/burn_wrap.c libisoburn/isofs_wrap.c Reporting with severity DEBUG about read error messages during image loading 26 Sep 2014 [5379] xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info Corrected description of -as mkisofs option -boot-load-size 2014.09.28.085819 [5380] xorriso/emulators.c Officially supporting combination -isohybrid-gpt-basdat -isohybrid-apm-hfsplus 2014.09.30.181738 [5381] xorriso/opts_a_c.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New -boot_image bootspecs partition_table=gpt_basdat, gpt_hfsplus, apm_hfsplus 01 Oct 2014 [5382] doc/faq.wiki Added three popular google search texts to FAQ 02 Oct 2014 [5383] doc/faq.wiki Small correction of rev 5382 2014.10.03.180649 [5384] xorriso/emulators.c Supporting -as mkisofs -chrp-boot as alias of -chrp-boot-part 2014.10.28.140220 [5385] xorriso/iso_img.c Preparing for -report_system_area formats "cmd" and "as_mkisofs" 2014.10.28.140313 [5386] xorriso/write_run.c Improved processing of system area in multi-session situations 2014.10.28.140609 [5387] xorriso/opts_a_c.c xorriso/emulators.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info Argument "." for system area import commands 2014.10.28.140709 [5388] xorriso/misc_funct.c Interpreting number suffix "d" (disk block) as factor of 512 2014.10.28.141130 [5389] xorriso/xorriso_private.h Added a clarifying comment about XorrisO.patch_system_area 2014.10.28.141959 [5390] xorriso/write_run.c Reacted on compiler warning about rev 5386 2014.11.04.121733 [5391] xorriso/opts_d_h.c xorriso/findjob.h xorriso/iso_manip.c xorriso/iso_tree.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New -find action "show_stream_id" 2014.11.11.112623 [5392] xorriso/write_run.c Sort weight 1000000000 for El Torito boot catalog with -boot_image patch 2014.11.13.180252 [5393] xorriso/iso_img.c With -report_system_area as_mkisofs: Adding option -B if --grub2-sparc-core 2014.11.13.180427 [5394] xorriso/emulators.c Letting -as mkisofs -sparc-label perform command -boot_image any sparc_label= 2014.11.26.134709 [5396] acinclude.m4 configure.ac xorriso/configure_ac.txt xorriso/misc_funct.c Checking at configure time for timezone integer variable 2014.11.26.164605 [5398] xorriso/check_media.c xorriso/cmp_update.c xorriso/disk_ops.c xorriso/read_run.c xorriso/text_io.c xorriso/write_run.c test/compare_file.c Equipped all non-system-dependent open(2) calls with O_BINARY ------------------------------------ cycle - xorriso-1.3.9 - 2014.11.28.110954 * New -find action "show_stream_id" ------------------------------------ cycle - xorriso-1.3.9 - 2014.12.06.183523 2014.12.21.222445 [5401] acinclude.m4 xorriso/README_gnu_xorriso xorriso/xorriso_eng.html Using libvolmgt on older Solaris ------------------------------------ cycle - xorriso-1.3.9 - 2014.12.21.222445 2014.12.29.105732 [5402] Makefile.am Fixed a typo in message of make install. Thanks to Jakub Wilk. 2014.12.29.142036 [5404] xorriso/write_run.c Clarified meaning of xorriso->patch_isolinux_image in Xorriso_make_iso_write_opts() 29 Jan 2015 [5405] xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Mentioned -report_el_torito parameters cmd and as_mkisofs 2015.02.04.113526 [5406] xorriso/write_run.c Fixed memory error when overwriting boot image of loaded ISO. Caused by rev5386 2015.02.06.114605 [5407] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/libisoburn.ver New API calls isoburn_igopt_set_appended_as_gpt(), isoburn_igopt_get_appended_as_gpt() 2015.02.06.115405 [5408] xorriso/xorriso_private.h xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/base_obj.c xorriso/emulators.c xorriso/iso_img.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info New -boot_image bootspec "appended_part_as=", new -as mkisofs option -appended_part_as_gpt 2015.02.07.114834 [5409] xorriso/iso_img.c Corrected representation of isohybrid MBR with -report_system_area "cmd" 2015.02.28.142843 [5410] xorriso/xorrisoburn.h xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/emulators.c xorriso/iso_img.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info New bootspec alpha_boot=, new -as mkisofs option -alpha-boot 2015.03.03.201723 [5411] xorriso/drive_mgt.c Corrected error message about drive class "caution" ------------------------------------ cycle - xorriso-1.3.9 - 2015.03.05.144703 * New API calls isoburn_igopt_set_appended_as_gpt(), isoburn_igopt_get_appended_as_gpt() * New -boot_image bootspec "appended_part_as=", new -as mkisofs option -appended_part_as_gpt ------------------------------------ cycle - xorriso-1.3.9 - 2015.04.13.172501 (with libisofs rev 1194 for -appended_part_as_gpt without isohybrid) 2015.04.23.135054 [5413] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c libisoburn/libisoburn.ver New API call isoburn_igopt_set_part_flag() and libisofs interval reader flags 2015.04.23.142257 [5414] xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Enabled use of libisofs interval reader in xorriso 2015.04.23.142407 [5415] xorriso/iso_img.c Counting -volid as pending change only if the text really changed 29 Apr 2015 [5416] doc/grub-mkrescue_reserved_commands.txt New file with list of argument names which are reserved for grub-mkrescue 29 Apr 2015 [5417] doc/grub-mkrescue_reserved_commands.txt Small correction in new doc file 2015.05.07.075329 [5418] xorriso/iso_img.c Emitting interval reader strings with -report_system_area cmd or as_mkisofs 2015.05.07.151926 [5419] xorriso/iso_img.c Emitting sparse zeroizers for system area and SORRY events for some insufficiencies 2015.05.10.093325 [5420] xorriso/iso_img.c Some corrections about -report_system_area cmd and as_mkisofs 2015.05.11.160333 [5421] xorriso/iso_img.c Some corrections about -report_system_area cmd and as_mkisofs 2015.05.14.100737 [5422] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/findjob.h xorriso/iso_img.h xorriso/iso_img.c xorriso/iso_manip.c Enabled output of HFS+ proposal with report_system_area cmd and as_mkisofs 2015.05.14.113925 [5423] xorriso/findjob.h xorriso/iso_img.h xorriso/iso_manip.c Updated some copyright marks 2015.05.14.131152 [5424] xorriso/iso_img.c Enabled output of volume id und modification date with -report_system_area cmd 16 May 2015 [5425] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Updated man xorriso about -report_system_area cmd 17 May 2015 [5432] svn copy -m Branching for libisoburn release 1.4.0 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.4.0 2015.05.17.112001 [5433] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.4.0 17 May 2017 [5434] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 2015.05.17.112001 [5436] xorriso/iso_img.c Reacted on a warning of NetBSD compiler ----------------------------------- release - xorriso-1.4.0 - 2015.05.17.112001 * 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" 2015.05.17.204035 [5442] xorriso/iso_img.c Reacted on a warning of NetBSD compiler 2015.05.17.204220 [5443] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.4.1 17 May 2017 [5444] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-1.4.1 - 2015.05.17.204220 18 May 2015 [5445] svn move -m 'Promoted branch to tag' \ http://svn.libburnia-project.org/libisoburn/branches/1.4.0 \ http://svn.libburnia-project.org/libisoburn/tags/1.4.0 18 May 2015 [5447] xorriso/xorriso_eng.html Corrected a faulty tag in web page of GNU xorriso 2015.06.24.155902 [5450] xorriso/sfile.c Bug fix: -backslash_codes "on" did not work outside quotes and with showing "\r" 24 Jun 2015 [5451] xorriso/configure_ac.txt Silenced libjte compiler warnings by -Wno-strict-aliasing 30 Jun 2015 [5454] xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Added EFI information to manual page example of bootable ISO 2015.06.30.144252 [5455] xorriso/opts_p_z.c Updated copyright year of xorriso command -version 2015.07.04.084911 [5456] xorriso/parse_exec.c Closed memory leaks on lack of memory reported by cppcheck 2015.07.04.085116 [5457] xorriso/read_run.c Reacted on cppcheck warning about uninitialized variable 2015.07.04.094815 [5458] xorriso/text_io.c Silenced a semi-correct error message of cppcheck 2015.07.04.094919 [5459] xorriso/iso_img.c Silenced false positive of cppcheck 2015.07.31.162206 [5460] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/emulators.c xorriso/text_io.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrecord.texi xorriso/xorrecord.info xorriso/xorrecord.1 New command -modesty_on_drive, new -as cdrecord -immed, minbuf=, modesty_on_drive= 2015.07.31.165816 [5461] xorriso/man_xorriso_to_html.sh xorriso/man_xorrisofs_to_html.sh xorriso/man_xorrecord_to_html.sh + xorriso/unite_html_b_line.c Reacting on changes in the output of my local man -H 2015.07.31.171227 [5462] libisoburn/libisoburn.h xorriso/xorriso_main.c xorriso/make_xorriso_1.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 README xorriso/README_gnu_xorriso releng/README doc/partition_offset.wiki doc/comments frontend/xorriso-tcltk Changed wrong use of "resp." in docs 12 Aug 2015 [5465] xorriso/compile_xorriso.sh Added automatic compilation of unite_html_b_line.c to developer compile script 2015.08.12.091220 [5466] xorriso/iso_img.c Avoiding to hand out indigestible --modification-date with -report_el_torito 2015.08.17.200155 [5467] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c New options with isoburn_ropt_set_extensions(): isoburn_ropt_map_* 2015.08.17.200910 [5468] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/text_io.c xorriso/drive_mgt.c libisoburn/libisoburn.ver xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New command -ecma119_map 2015.08.19.122832 [5469] Makefile.am Linking libpthread to libisoburn, not only to xorriso 2015.08.30.184740 [5470] xorriso/base_obj.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrecord.texi xorriso/xorrecord.info xorriso/xorrecord.1 Changed defaults of new command -modesty_on_drive to suit concurrent SG_IO 2015.09.06.194259 [5476] xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/iso_img.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -boot_image action "replay" 2015.09.15.182031 [5477] xorriso/iso_tree.c Hopefully finally enabled correct compilation on Debian mips and mipsel 2015.09.17.120554 [5478] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c libisoburn/libisoburn.ver New API calls isoburn_ropt_set_truncate_mode() isoburn_ropt_get_truncate_mode() 2015.09.17.121258 [5479] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/drive_mgt.c xorriso/iso_img.c xorriso/iso_tree.c xorriso/iso_manip.c xorriso/filters.c xorriso/text_io.c xorriso/emulators.c libisoburn/libisoburn.ver xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New command -file_name_limit, -as mkisofs -file_name_limit 2015.09.17.161956 [5481] acinclude.m4 Recognizing Debian GNU/kFreeBSD (seems to never have worked) 2015.09.20.124012 [5482] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/burn_wrap.c libisoburn/data_source.c Reacted on complaints of lintian spelling check 2015.09.20.125159 [5483] xorriso/xorriso_private.h xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/drive_mgt.c xorriso/iso_img.c xorriso/sfile.c xorriso/sfile.h frontend/frontend_pipes_xorriso.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 xorriso/xorrecord.texi xorriso/xorrecord.info xorriso/xorrecord.1 Reacted on complaints of lintian spelling check 2015.09.22.155937 [5484] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/drive_mgt.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 libisoburn/libisoburn.ver New command -read_fs 2015.09.22.204735 [5485] xorriso/xorriso.h xorriso/opts_i_o.c xorriso/opts_d_h.c Marked introduction dates of xorriso commands in API description 2015.09.25.171620 [5488] xorriso/opts_d_h.c xorriso/drive_mgt.c xorriso/iso_manip.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Took into respect possible truncate mode change by AAIP variable isofs.nt 2015.09.28.141723 [5489] xorriso/xorriso_private.h xorriso/opts_d_h.c xorriso/iso_manip.h xorriso/iso_manip.c xorriso/findjob.h xorriso/sfile.h xorriso/sfile.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -find test -name_limit_blocker. Made -file_name_limit ready for loaded ISOs 07 Oct 2015 [5490] doc/faq.wiki Mentioned USB 3 problems in FAQ 2015.10.15.170642 [5491] xorriso/drive_mgt.c Closed memory leak with acquiration of drive 2015.10.16.155137 [5492] xorriso/drive_mgt.c xorriso/cmp_update.c Closed memory leak with 2015.10.18.130151 [5494] xorriso/drive_mgt.c xorriso/text_io.c New -toc report lines "Drive id :" and "Media id :". 2015.10.23.085903 [5497] xorriso/write_run.c Record size 0 with oversized EFI boot images to span them up to end of medium 2015.10.25.123601 [5517] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.1 - 2015.10.25.123601 * 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. 2015.11.03.125130 [5549] xorriso/text_io.c Closed a memory leak with message sieve. Coverity CID 28738. 2015.11.03.125655 [5550] xorriso/text_io.c Closed a memory leak with message sieve. Coverity CID 28739. 2015.11.03.130551 [5551] xorriso/findjob.c Closed a memory leak with -find. Coverity CID 28740. 2015.11.03.140546 [5552] xorriso/iso_manip.c Closed memory leak in case of error with file hiding. Coverity CID 28746 to 28750. 2015.11.03.145540 [5553] xorriso/check_media.c Closed memory leak with error about -check_media sector bitmapCoverity CID 28751. 2015.11.03.145920 [5554] xorriso/opts_i_o.c Closed memory leak with error about -ls. Coverity CID 28752. 2015.11.03.150839 [5555] xorriso/read_run.c Clarified handling of file descriptor. Coverity CID 28753. 2015.11.03.154102 [5556] libisoburn/burn_wrap.c Made clear that a drive needs an isoburn object for writing. Coverity CID 28758. 2015.11.03.155015 [5557] xorriso/findjob.c Prevented potential NULL pointer dereference. Coverity CID 28759. 2015.11.04.084711 [5558] xorriso/read_run.c Removed a surplus test for NULL. Coverity CID 28760. 2015.11.04.094803 [5559] xorriso/iso_tree.c Removed a wrong and obsolete test. Coverity CID 28762. 2015.11.04.100839 [5560] xorriso/write_run.c Prevented bug when interpreting MBR partition entry > 1 TB. Coverity CID 28764. 2015.11.04.105349 [5561] xorriso/match.c Prevented a potentially severe memory error with disk file pattern expansion. Coverity CID 28765. 2015.11.04.110102 [5562] xorriso/iso_tree.c Same as rev 5561. Here for iso_rr file names. Coverity CID 28766. 2015.11.04.114353 [5563] xorriso/parse_exec.c Prevented a string overflow in case of program error. Coverity CID 28767. 2015.11.04.123926 [5564] xorriso/text_io.c Prevented a possible program error in Xorriso_dialog_input() 2015.11.04.155640 [5565] xorriso/opts_p_z.c Prevented possible buffer overflow inside xorriso object. Coverity CID 28775. 2015.11.04.155640 [5566] xorriso/parse_exec.h xorriso/parse_exec.c xorriso/opts_a_c.c Prevented a possible buffer overrun with -concat. Coverity CID 28782. 05 Nov 2015 [5567] xorriso/make_xorriso_1.c Closed a gap for line buffer overflow with man page production. Coverity CID 28784. 05 Nov 2015 [5568] test/compare_file.c Checking argument length of test/compare_file. Coverity CID 28785, 28786. 2015.11.06.092940 [5569] xorriso/iso_manip.c Prevented a potential corruption in case of memory shortage. Coverity CID 28800. 2015.11.06.123344 [5570] xorriso/iso_tree.c Prevented use of uninitialized variable in case of memory shortage. Coverity CID 28801. 2015.11.06.124252 [5571] xorriso/read_run.c Prevented use of uninitialized variable in case of memory shortage. Coverity CID 28805. 2015.11.06.124702 [5571] xorriso/text_io.c Prevented use of uninitialized variable in case of memory shortage. Coverity CID 28806. 2015.11.06.125101 [5573] xorriso/disk_ops.c Prevented use of uninitialized variable in case of memory shortage. Coverity CID 28808. 2015.11.06.125705 [5574] xorriso/disk_ops.c Prevented use of uninitialized variable in case of memory shortage. Coverity CID 28809. 2015.11.06.130635 [5575] xorriso/drive_mgt.c Removed unneccessary variables which were used uninitialized. Coverity CID 28810. 2015.11.06.181047 [5576] xorriso/parse_exec.c Reacting on failure while reading mkisofsrc. Coverity CID 28817. 2015.11.06.194638 [5577] xorriso/text_io.c Corrected improper reaction on memory shortage. Coverity CID 28825. 2015.11.06.200320 [5578] xorriso/opts_a_c.c Reacting properly on failure to set hppa or alpha boot image. Coverity CID 28828, 28829. 2015.11.07.105529 [5579] xorriso/check_media.c Prevented use of already freed memory. Coverity CID 28830. 2015.11.07.110421 [5580] xorriso/base_obj.c Closed a memory leak wiyh -check_media_defaults 2015.11.07.111034 [5581] xorriso/opts_i_o.c Changed a suspiciously looking but correct code gesture. Coverity CID 28831. 2015.11.08.110314 [5582] xorriso/drive_mgt.c Clarified handling of missing drives when it shall be given up. Coverity CID 28697. 2015.11.08.140544 [5583] xorriso/text_io.c Removed duplicate check for memory shortage. Coverity CID 28701. 2015.11.08.143244 [5584] xorriso/text_io.c Moved variable definition into its proper ifdef case. Coverity CID 28702. 2015.11.08.161658 [5585] xorriso/lib_mgt.c Clarified code path ifndef Xorriso_with_libjtE. Coverity CID 28703. 2015.11.08.163431 [5586] xorriso/iso_tree.c Corrected interpretation of some return values during -find -exec list_extattr. Coverity CID 28704. 2015.11.08.164013 [5587] xorriso/read_run.c Checking the return value of Xorriso_open_job_data_to(). Coverity CID 28705. 2015.11.08.194028 [5588] xorriso/emulators.c Removed a duplicate test statement. Coverity CID 28709. 2015.11.08.194419 [5589] xorriso/disk_ops.c Removed a duplicate test statement. Coverity CID 28710. 2015.11.08.200543 [5590] xorriso/drive_mgt.c Preserved return value of iso_util_decode_md5_tag() until it is tested. Coverity CID 28711. 2015.11.08.202957 [5591] xorriso/iso_img.c With -mount: Checking Xorriso_give_up_drive return value for error. Coverity CID 28712. 2015.11.09.095505 [5592] Removed a surplus test statement with -boot_image any show_status. Coverity CID 28713. 2015.11.09.105122 [5593] xorriso/write_run.c Removed an effectively unused variable. Coverity CID 28715. 2015.11.09.121421 [5594] xorriso/lib_mgt.c Clarified handling of NULL name with Xorriso_set_local_charset(). Coverity CID 28719. 2015.11.09.133135 [5595] libisoburn/isofs_wrap.c Prevented a SIGSEGV with isoburn_read_image() feature to submit NULL parameter. Coverity CID 28721. 2015.11.10.084903 [5596] xorriso/text_io.c Improved handling of potential program error with -msg_op read_sieve. Coverity CID 28723. 2015.11.10.090901 [5597] xorriso/drive_mgt.c Prevented possible NULL pointer dereference. Coverity CID 28724. 2015.11.10.094015 [5598] xorriso/misc_funct.c Corrected an error with conversion from bourne shell patterns to regular expressions. Coverity CID 28727. 2015.11.10.104918 [5599] xorriso/iso_img.c Corrected an error with recognition of APM partitions. Coverity CID 28728. 2015.11.11.192609 [5600] xorriso/text_io.c Corrected reporting of -logfile in -status "short". Coverity CID 28729. 2015.11.12.123345 [5601] xorriso/iso_tree.c Protected output -find -exec list_extattr from potential overflow. Coverity CID 28780. 2015.11.12.142649 [5602] xorriso/iso_tree.c Reacted on compiler warnings about rev 5601 2015.11.12.160620 [5603] xorriso/text_io.c Prevented possible overlapping memory copying 2015.11.13.152751 [5604] xorriso/iso_tree.c Prevented possible buffer overflow with -getfacl. Coverity CID 28695. 2015.11.13.202241 [5605] xorriso/drive_mgt.c Handled failure to release a mutex lock. Coverity CID 28698. 2015.11.15.153822 [5606] xorriso/text_io.c Avoiding to use message system while result_msglists_lock is acquired. Coverity CID 28726. 2015.11.16.100618 [5607] xorriso/lib_mgt.c Rev 5594 was not complete. Coverity CID 28719. 2015.11.16.102246 [5608] xorriso/write_run.c Rev 5560 was not complete. Coverity CID 28764. 16 Nov 2015 [5609] test/compare_file.c Trying to finally silence Coverity CID 28785. 21 Nov 2015 [5610] README xorriso/README_gnu_xorriso + frontend/xorriso_broker.sh New demo script frontend/xorriso_broker.sh (see Debian bug 805495) 22 Nov 2015 [5611] Makefile.am xorriso/make_xorriso_standalone.sh xorriso/xorriso_makefile_am.txt Putting xorriso_broker.sh into release tarballs 22 Nov 2015 [5612] frontend/xorriso_broker.sh Small improvements with xorriso_broker.sh 28 Nov 2015 [5618] svn copy -m Branching for libisoburn release 1.4.2 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.4.2 2015.11.28.140001 [5619] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.4.2 28 Nov 2015 [5620] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.4.2 - 2015.11.28.140001 * 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 2015.11.29.082702 [5625] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.4.3 29 Nov 2015 [5626] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-1.4.3 - 2015.11.29.082702 29 Nov 2015 [5627] svn move -m 'Promoted branch to tag' \ http://svn.libburnia-project.org/libisoburn/branches/1.4.2 \ http://svn.libburnia-project.org/libisoburn/tags/1.4.2 29 Nov 2015 [5628] xorriso/xorrecord.texi xorriso/xorrecord.info xorriso/xorrecord.1 Fixed typos in manual of xorrecord 02 Dec 2015 [5629] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrecord.texi xorriso/xorrecord.info xorriso/xorrecord.1 Reacted on lintian complaint about oversized lines in man pages 05 Dec 2015 [5630] Makefile.am xorriso/xorriso_makefile_am.txt Letting "make" target "check" run xorriso/xorriso -no_rc -version -list_extras 2015.12.09.132636 [5631] xorriso/xorriso_private.h xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/emulators.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Bug fix: -as mkisofs did not unescape "\=" in the source part of pathspecs 2015.12.09.162402 [5632] xorriso/xorriso_private.h xorriso/opts_a_c.c xorriso/misc_funct.c Bug fix: -pathspecs "on" did not properly handle "\\=" 09 Dec 2015 [5633] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.3 - 2015.12.09.162402 * Bug fix: -as mkisofs did not unescape "\=" in the source part of pathspecs * Bug fix: -pathspecs "on" did not properly handle "\\=" * New -pathspecs mode "as_mkisofs" 10 Dec 2015 [5635] configure.ac xorriso/configure_ac.txt acinclude.m4 Checking for availability of LIBBURN_ARCH_LIBS 2015.12.11.120319 [5636] xorriso/xorrisoburn.h Forgot to commit declaration of Xorriso_graftable_pathspec() in rev 5631 15 Dec 2015 [5637] configure.ac xorriso/configure_ac.txt acinclude.m4 Following build system changes in libisofs about ACL and xattr 2015.12.22.133736 [5638] xorriso/xorriso_timestamp.h Setting timestamp of experimental xorriso-1.4.3 tarball ------------------------------------ cycle - xorriso-1.4.3 - 2015.12.22.133736 2015.12.23.112013 [5639] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_a_c.c xorriso/drive_mgt.c xorriso/iso_img.c xorriso/write_run.c Bug fix: -boot_image "any" "system_area=/dev/zero" did not zeroize loaded data 2015.12.24.080343 [5640] xorriso/iso_img.c El Torito load size 0 what not shown with -report_el_torito as_mkisofs or cmd 2015.12.26.090812 [5641] xorriso/iso_img.c Silencing a false warning of gcc on Sid about uninitialized "image" variable 26 Dec 2015 [5642] xorriso/make_xorriso_standalone.sh Updated the production script for GNU xorriso to work with plain repo checkouts 26 Dec 2015 [5643] xorriso/make_xorriso_standalone.sh Letting production of GNU xorriso ignore failure of command "man -H" 27 Dec 2015 [5644] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.3 - 2015.12.27.150821 * Bug fix: -boot_image "any" "system_area=/dev/zero" did not zeroize loaded data 27 Dec 2015 [5645] Makefile.am xorriso/make_xorriso_standalone.sh xorriso/xorriso_makefile_am.txt + frontend/grub-mkrescue-sed.sh Man-in-the-middle script to manipulate the xorriso run of grub-mkrescue 28 Dec 2015 [5646] frontend/grub-mkrescue-sed.sh Added modes "mbr_only", "original" and parameter variables MKRESCUE_SED_* 2015.12.30.175951 [5647] xorriso/emulators.c xorriso/write_run.c frontend/grub-mkrescue-sed.sh Provisory new -e pseudo path --interval:appened_partition_N:all:: 2016.01.01.172059 [5648] libisoburn/isoburn.c Letting bit15 of system_area_options pass to libisofs 2016.01.01.172817 [5649] xorriso/xorriso_private.h xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/emulators.c xorriso/iso_img.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -boot_image setting mbr_force_bootable=, -as mkisofs --mbr-force-bootable ------------------------------------ cycle - xorriso-1.4.3 - 2016.01.01.172817 * New -boot_image setting mbr_force_bootable=, -as mkisofs --mbr-force-bootable 02 Jan 2016 [5650] frontend/grub-mkrescue-sed.sh Fixed a copy+paste bug of rev 5647. Thanks to Alexander E. Patrakov. 2016.01.20.104201 [5651] xorriso/opts_a_c.c Let -boot_image bin_path= , efi_path= recognize --interval:appended_partition 2016.01.20.104342 [5652] xorriso/iso_img.c Changed report format of --interval:appended_partition_X_start_Y_size_Z 2016.02.05.095140 [5660] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c New API calls isoburn_igopt_set_appended_as_apm, isoburn_igopt_set_part_like_isohybrid 2016.02.05.100719 [5661] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/write_run.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -boot_image bootspec appended_part_as=apm, part_like_isohybrid=on 2016.02.05.101337 [5662] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs options -appended_part_as_apm, -part_like_isohybrid 2016.02.05.145901 [5665] libisoburn/isoburn.h xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/opts_d_h.c xorriso/drive_mgt.c xorriso/disk_ops.c xorriso/sort_cmp.c xorriso/text_io.c frontend/xorriso-tcltk xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 xorriso/xorrecord.texi xorriso/xorrecord.info xorriso/xorrecord.1 Fixed typos reported by lintian 2016.02.07.194339 [5666] libisoburn/libisoburn.h Reacted on doxygen warnings of Fedora s390x build log 2016.02.27.170008 [5668] xorriso/iso_img.c Image size tolerance of 300 kB when recognizing genisoimage -B "..." 2016.03.01.141456 [5669] xorriso/opts_i_o.c Bug fix: -modesty_on_drive properties timeout_sec, min_usec, max_usec read wrong numbers from the parameter text 01 Mar 2016 [5670] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.3 - 2016.03.01.141456 * New -boot_image bootspec appended_part_as=apm, part_like_isohybrid=on * New -as mkisofs options -appended_part_as_apm, -part_like_isohybrid * Bug fix: -modesty_on_drive properties timeout_sec, min_usec, max_usec read wrong numbers from the parameter text 05 Mar 2016 [5671] doc/faq.wiki Added answer to "Why is simultaneous burning with multiple drives so slow ?" 2016.03.08.075457 [5673] xorriso/drive_mgt.c Improved handling of TAO CD tracks by -check_media 2016.03.09.205708 [5674] xorriso/sfile.c Removed an unused function 2016.03.10.200551 [5676] xorriso/parse_exec.c xorriso/sfile.c xorriso/text_io.c Replaced unused timezone parameter of gettimeofday() by NULL 2016.03.15.203403 [5677] libisoburn/libisoburn.h Added to libisoburn.h "extern C" for C++, and protection against double include 2016.03.15.203626 [5678] xorriso/xorriso.h Added "extern C" to xorriso.h 15 Mar 2016 [5679] doc/qemu_xorriso.wiki Updated QemuXorriso wiki article for qemu-2.1.2 2016.03.18.135548 [5681] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/drive_mgt.c xorriso/iso_img.c xorriso/text_io.c xorriso/emulators.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrecord.texi xorriso/xorrecord.info xorriso/xorrecord.1 libisoburn/libisoburn.ver New command -scsi_dev_family, new -as cdrecord option drive_scsi_dev_family= 18 Mar 2016 [5683] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.3 - 2016.03.18.135548 * New command -scsi_dev_family, new -as cdrecord option drive_scsi_dev_family= 20 Mar 2016 [5684] doc/faq.wiki Updated answer to "Why is simultaneous burning with multiple drives so slow ?" 2016.03.22.125444 [5685] xorriso/text_io.c Silenced a warning of gcc on Fedora rawhide s390 8 Apr 2016 [5691] frontend/grub-mkrescue-sed.sh Optional use of gdb in grub-mkrescue-sed.sh 19 Apr 2016 [5692] acinclude.m4 Makefile.am Prevented option --version-script with linker run of xorriso. By Matthias Klose. 2016.04.25.100906 [5694] xorriso/iso_img.c xorriso/findjob.h xorriso/findjob.c xorriso/iso_tree.h xorriso/iso_tree.c xorriso/iso_manip.c Improved assessment of appended partitions 2016.04.27.092902 [5695] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Letting -as mkisofs --norock revoke the special effect of -r 27 Apr 2016 [5696] configure.ac xorriso/configure_ac.txt Removed option --silent from libtool runs 2016.05.03.075722 [5698] libisoburn/isofs_wrap.c Letting isoburn_disc_erase() invalidate UDF extended descriptors if present 03 May 2016 [5699] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.3 - 2016.05.03.075722 * Letting -as mkisofs --norock revoke the special effect of -r * Letting -blank on overwritable media invalidate UDF extended descriptors 01 Jul 2016 [5704] svn copy -m Branching for libisoburn release 1.4.4 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.4.4 2016.07.01.140001 [5705] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.4.4 01 Jul 2016 [5706] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.4.4 - 2016.07.01.140001 * 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= 2016.07.02.142514 [5711] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.4.5 2016.07.02.144635 [5712] xorriso/opts_p_z.c Updated copyright year of xorriso -version 02 Jul 2016 [5713] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-1.4.5 - 2016.07.02.144635 02 Jul 2016 [5714] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.4.4 http://svn.libburnia-project.org/libisoburn/tags/1.4.4 03 Jul 2016 [5715] Makefile.am xorriso/xorriso_makefile_am.txt Added missing parameter "all" to "make check" run of xorriso 2016.07.03.204237 [5717] xorriso/lib_mgt.c xorriso/iso_manip.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info Corrected spelling errors found by lintian 2016.07.16.111233 [5718] xorriso/iso_manip.c xorriso/text_io.c Corrected spelling errors found by lintian.debian.org 2016.07.20.083654 [5719] libisoburn/isoburn.h libisoburn/burn_wrap.c xorriso/xorriso.h xorriso/xorriso_private.h xorriso/lib_mgt.c xorriso/parse_exec.c xorriso/opts_a_c.c xorriso/iso_manip.c xorriso/findjob.h frontend/sh_on_named_pipes.sh frontend/xorriso-tcltk frontend/grub-mkrescue-sed.sh xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info releng/README Reacted on some of the complaints of codespell 2016.07.21.103607 [5721] xorriso/xorriso_private.h Including pthread.h in xorriso_private.h to define pthread_mutex_t on OpenBSD 31 Jul 2016 [5729] libisoburn/libisoburn.h Requiring libburn-1.4.5 2016.07.31.073903 [5730] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/emulators.c xorriso/drive_mgt.c xorriso/write_run.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrecord.texi xorriso/xorrecord.info xorriso/xorrecord.1 libisoburn/libisoburn.ver New command -use_immed_bit, new -as cdrecord option use_immed_bit= 31 Jul 2016 [5731] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.5 - 2016.07.31.073903 * New command -use_immed_bit, new -as cdrecord option use_immed_bit= 2016.08.04.073312 [5733] xorriso/misc_funct.c Corrected weekday name in debug message of --modification-date. Thanks to Chris Lamb. 2016.08.05.112045 [5734] libisoburn/libisoburn.h Mentioned that an empty name with isoburn_igopt_set_scdbackup_tag disables it 05 Aug 2016 [5735] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Mentioned that empty record_name disables scdbackup tagging 2016.08.06.111650 [5736] xorriso/write_run.h xorriso/xorriso_eng.html 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. 2016.08.06.132358 [5737] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs option --set_all_file_dates 07 Aug 2016 [5738] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Documented new timestamp behavior of El Torito catalog file 2016.08.07.193333 [5739] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.5 - 2016.08.07.193333 * Bug fix: The default setting of -compliance did not apply rec_mtime to Joliet and ISO:1999. mkisofs emulation was not affected by this bug. * New -as mkisofs option --set_all_file_dates 12 Aug 2016 [5740] configure.ac Eased re-enabling of libtool --silent at bootstrap time 2016.08.12.184736 [5741] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/libisoburn.ver New API calls isoburn_igopt_set_gpt_guid(), isoburn_igopt_get_gpt_guid() 2016.08.12.185822 [5742] xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/base_obj.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/emulators.c xorriso/lib_mgt.c xorriso/iso_img.c xorriso/write_run.c xorriso/text_io.c xorriso/misc_funct.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New bootspec "gpt_disk_guid=", new -as mkisofs option --gpt_disk_guid, new -report_system_area mode "make_guid" 12 Aug 2016 [5743] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.5 - 2016.08.12.185822 * New bootspec "gpt_disk_guid=", new -as mkisofs option --gpt_disk_guid * New -report_system_area mode "make_guid" 2016.08.15.102443 [5744] xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Corrected interpretation of RFC 4122 UUID strings for GPT. Thanks Andrei Borzenkov. 2016.08.15.175002 [5745] xorriso/xorrisoburn.h xorriso/lib_mgt.c xorriso/iso_img.c New -report_system_area mode "gpt_disk_guid" 2016.08.16.131434 [5746] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_p_z.c xorriso/emulators.c xorriso/write_run.c xorriso/text_io.c New -volume_date mode "all_file_dates" 2016.08.16.131907 [5747] xorriso/parse_exec.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New environment variable SOURCE_DATE_EPOCH 16 Aug 2016 [5748] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.5 - 2016.08.16.131907 * New -report_system_area mode "gpt_disk_guid" * New -volume_date mode "all_file_dates" * New environment variable SOURCE_DATE_EPOCH 2016.08.20.085236 [5749] xorriso/opts_d_h.c xorriso/findjob.h xorriso/iso_manip.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New -find action "set_to_mtime" 2016.08.20.102601 [5750] xorriso/xorriso_private.h xorriso/opts_p_z.c xorriso/emulators.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -volume_date "all_file_dates" pseudo-timestamp "set_to_mtime" 20 Aug 2016 [5751] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.5 - 2016.08.20.102601 * New -find action "set_to_mtime" 2016.08.25.205059 [5753] xorriso/drive_mgt.c Corrected block count messages with -check_media sector_map= 28 Aug 2016 [5755] doc/doxygen.conf.in Removed obsoleted doxygen.conf tags XML_SCHEMA, XML_DTD, SHOW_DIRECTORIES, HTML_ALIGN_MEMBERS 2016.09.12.091506 [5757] xorriso/parse_exec.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Changed SOURCE_DATE_EPOCH effect to --set_all_file_dates "set_to_mtime" 12 Sep 2016 [5758] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Mentioned --interval:appended_partition_NNN in man pages 2016.09.12.163816 [5759] xorriso/opts_d_h.c Bug fix: -file_size_limit did not increase ISO level if necessary. Thanks Mattias Schlenker. 16 Sep 2016 [5764] svn copy -m Branching for libisoburn release 1.4.6 http://svn.libburnia-project.org/libisoburn/trunk http://svn.libburnia-project.org/libisoburn/branches/1.4.6 2016.09.16.133001 [5765] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.4.6 16 Sep 2016 [5766] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 16 Sep 2016 [5767] configure.ac Corrected secondary .so number to 103 ----------------------------------- release - xorriso-1.4.6 - 2016.09.16.133001 * 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 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" 2016.09.16.193454 [5772] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.4.7 16 Sep 2016 [5773] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ------------------------------------ cycle - xorriso-1.4.7 - 2016.09.16.193454 17 Sep 2016 [5774] svn move -m Promoted branch to tag http://svn.libburnia-project.org/libisoburn/branches/1.4.6 http://svn.libburnia-project.org/libisoburn/tags/1.4.6 07 Oct 2016 [5775] libisoburn/libisoburn.ver Corrected sorting in libisoburn.ver 2016.10.23.095558 [76ac0d8] xorriso/changelog.txt A first try to commit to git 2016.11.13.101258 [8adbb1d] [5776] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_a_c.c xorriso/emulators.c xorriso/iso_img.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Bug fix: -as mkisofs -no-emul-boot without -boot-load-size defaulted to size 4 13 Nov 2016 [fb7da95] [5777] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.7 - 2016.11.10.134753 * Bug fix: -as mkisofs -no-emul-boot without -boot-load-size defaulted to size 4 * Bug fix: -read_fs "norock" did not prevent reading of root Rock Ridge 2016.11.18.173658 [3da2ac2] [5780] libisoburn/libisoburn.h xorriso/write_run.c Applying -dummy mode explicitely to superblock relocation 2016.11.19.172243 [7371115] [5761] xorriso/opts_d_h.c xorriso/iso_manip.c xorriso/disk_ops.c xorriso/findjob.h xorriso/findjob.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -find tests -maxdepth and -mindepth 27 Nov 2016 [b48c54c] [5782] xorriso/xorriso_eng.html Adapted in web page xorriso-tcltk links and changed SVN/bzr references to git 2016.12.05.101546 [9b75d21] [5783] xorriso/match.c Bug fix: Mix of absolute and relative disk paths could cause SIGSEGV with pattern expansion 2016.12.05.132927 [7b12dd0] [5784] xorriso/xorriso.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/iso_tree.c xorriso/match.c xorriso/misc_funct.h xorriso/misc_funct.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New command -update_lxi 2016.12.14.091711 [85aa000] [5785] xorriso/xorriso.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New command -update_li 2016.12.14.093149 [8a0d936] [5786] xorriso/xorriso_main.c Changed in usage text "option" to "command" 19 Dec 2016 [85c51db] [5787] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.7 - 2016.12.19.195610 * Bug fix: Mix of absolute and relative disk paths could cause SIGSEGV with pattern expansion * New -find tests -maxdepth and -mindepth * New commands -update_lxi and -update_li 23 Dec 2016 [fa3ee61] [5788] frontend/grub-mkrescue-sed.sh New grub-mkrescue-sed.sh mode "gpt_appended" 23 Dec 2016 [08b316d] [5789] frontend/grub-mkrescue-sed.sh Changed default mode of grub-mkrescue-sed.sh to "mbr_only" 23 Dec 2016 [783e706] [5790] frontend/grub-mkrescue-sed.sh Changed in grub-mkrescue-sed.sh default of MKRESCUE_SED_PROTECTIVE to "no" 27 Jan 2017 [aa34637] [5793] acinclude.m4 xorriso/configure_ac.txt COPYRIGHT Detecting Linux systems without generic SCSI support by scsi/scsi.h 27 Jan 2017 [3cac9fe] [5794] acinclude.m4 Small adjustement for previous commit 27 Jan 2017 [db36ca5] [5796] xorriso/configure_ac.txt Disable multi-threading in libjte of GNU xorriso if pthread_cancel() is missing 29 Jan 2017 [9d912df] [5799] xorriso/man_xorriso_to_html.sh Corrected in HTML man page a flaw with headline about Blind Growing 2017.02.13.145207 [0ec0ba8] [5803] xorriso/drive_mgt.c xorriso/write_run.c Properly refusing on Pseudo Overwritable formatted BD-R 22 Feb 2017 [caedaa8] [5804] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Clarified effect of -overwite mode "off" 2017.02.27.091402 [0d07bd1] [5805] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/libisoburn.ver New API calls isoburn_igopt_set_iso_mbr_part_type(), isoburn_igopt_get_iso_mbr_part_type() 2017.02.27.092840 [f3b8515] [5806] libisoburn/libisoburn.h Corrected an error in description of isoburn_igopt_get_iso_mbr_part_type() 2017.02.27.093756 [3a41524] [5807] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_a_c.c xorriso/opts_d_h.c xorriso/text_io.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -boot_image bootspec iso_mbr_part_type= 2017.02.27.094332 [274715a] [5808] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs option -iso_mbr_part_type ------------------------------------ cycle - xorriso-1.4.7 - 2017.02.27.094332 * Properly refusing on Pseudo Overwritable formatted BD-R * 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 2017.04.09.175231 [2f24d82] [] xorriso/iso_img.c Avoiding to recognize real GPT as -part_like_isohybrid 2017.04.09.175347 [4c45684] [] xorriso/iso_img.c With -report_system_area as_mkisofs ignore GPT if same start as MBR partition 10 Apr 2017 [e30507d] [] frontend/grub-mkrescue-sed.sh Made -iso_mbr_part_type 0x00 default of grub-mkrescue-sed.sh mode "mbr_only" 2017.04.25.135002 [d812835] [] xorriso/configure_ac.txt Bug fix: Variable LDFLAGS was emptied during ./configure test for jtethreads 05 May 2017 [22d552a] [] xorriso/configure_ac.txt Preliminary blocking --enable-libcdio if CFLAGS, LDFLAGS contain option -static 2017.05.05.123120 [e72d702] [] libisoburn/isofs_wrap.c When pseudo-blanking: Invalidate all ECMA-119 volume descriptors, not only PVD 09 May 2017 [5865cef] README Replaced link to vanished svn repository by link to git repository 2017.05.09.081543 [43c37e3] xorriso/xorriso.h xorriso/xorriso_main.c xorriso/opts_p_z.c xorriso/emulators.c Changed copyright date to 2017 09 May 2017 [3e3fddd] xorriso/README_gnu_xorriso Replaced link to vanished svn repository by link to git repository 2017.06.03.132429 [2126dce] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs option -eltorito-platform 2017.06.03.163742 [92ae870] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Made small adjustment to new -as mkisofs option -eltorito-platform 03 Jun 2017 [c9df1a1] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.7 - 2017.06.03.163742 * New -as mkisofs option -eltorito-platform 2017.06.03.193458 [3d66432] xorriso/iso_img.c Making use of -eltorito-platform with -report_el_torito as_mkisofs 2017.06.29.211523 [3972c72] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Mentioned -append_partition in manual about --mbr-force-bootable 29 Jun 2017 [a2b52b4] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.7 - 2017.06.29.211523 * Bug fix: --mbr-force-bootable did not get into effect with -append_partition 2017.07.21.105310 [4bb3dbf] xorriso/iso_img.c Bug fix: Exit value of failed -mount command was reported as 0 2017.08.07.134036 [2cab210] xorriso/iso_manip.c Fixed a code typo which luckily had no negative effect with existing use cases 08 Aug 2017 [d9c93a6] releng/run_all_auto releng/inc/releng_getopts.inc Bug fix: ./run_all_auto aborted on kojipkgs.fedoraproject.org on tput attempt. Thanks Robert Scheck. 14 Aug 2017 [e8b387c] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.7 - 2017.08.14.160231 * 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. 2017.08.24.102256 [e74b04a] xorriso/iso_img.c Issue iso_mbr_part_type info with -report_system_area "cmd" and "as_mkisofs" 2017.08.24.102427 [047b8db] xorriso/write_run.c Accept partition interval strings of type "imported_iso" for multi-session 06 Sep 2017 [650c015] doc/faq.wiki doc/partition_offset.wiki doc/qemu_xorriso.wiki Updated libisoburn doc/*.wiki files by current publicly shown files 2017.09.09.142818 [ea8a759] xorriso/iso_img.c Made sure only legal ECMA-119 timestrings come from -report_system_area as_mkisofs 2017.09.10.164942 [3813a74] xorriso/iso_img.c Prevented in -report_system_area "as_mkisofs" a confusion about -appended_part_as_gpt and -part_like_isohybrid 2017.09.12.143001 [19e1303] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.4.8 12 Sep 2017 [0e85c8c] ChangeLog xorriso/changelog.txt Documented changes and release timestamp 12 Sep 2017 [5d5e7be] libisoburn/libisoburn.h Making a forgotten version leap change in libisoburn.h 12 Sep 2017 [8c4f8da] releng/releng_generated_data/placeholder Making a directory which was not copied from SVN to git ----------------------------------- release - xorriso-1.4.8 - 2017.09.12.143001 * Bug fix: -as mkisofs -no-emul-boot without -boot-load-size defaulted to size 4 * Bug fix: -read_fs "norock" did not prevent reading of root Rock Ridge * 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 * Properly refusing on Pseudo Overwritable formatted BD-R * 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 2017.09.13.094536 [bc544e0] configure.ac libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Version leap to libisoburn-1.4.9 13 Sep 2017 [187d796] ChangeLog xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.9 - 2017.09.13.094536 17 Sep 2017 [2e560d1] xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info Corrected spelling errors found by lintian 2017.09.23.074650 [f61d818] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Publishing a libisofs bug fix as GNU xorriso development snapshot tarball ------------------------------------ cycle - xorriso-1.4.9 - 2017.09.23.074650 libisofs: * Bug fix: Reading beyond array end for HFS+ production caused SIGSEGV with FreeBSD 11 CLANG -O2. Thanks ASX of GhostBSD. 29 Sep 2017 [c3d302e] Makefile.am xorriso/xorriso_makefile_am.txt xorriso/make_xorriso_standalone.sh frontend/xorriso-tcltk xorriso/make_xorriso_1.c xorriso/make_docs.sh + xorriso/xorriso-tcltk.texi + xorriso/xorriso-tcltk.info + xorriso/xorriso-tcltk.1 Created manual page and info document for xorriso-tcltk 2017.10.23.095252 [25e2491] libisoburn/libisoburn.h libisoburn/isofs_wrap.c libisoburn/burn_wrap.c New bit10 of isoburn_drive_aquire() to accept all xattr namespaces 2017.10.23.100749 [cbc5dbf] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/drive_mgt.c xorriso/iso_img.c xorriso/write_run.c xorriso/read_run.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -xattr mode "any" to process all xattr namespaces of local filesystem 2017.10.23.101135 [761ff8f] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs option --xattr-any 2017.10.30.122625 [3eee060] xorriso/emulators.c Code change which was forgotten with previous commit 2017.11.15.100856 [3794753] xorriso/iso_manip.c xorriso/iso_tree.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Enabling non-user xattr namespaces with -getfattr and -setfattr 2017.11.15.101228 [d574a69] xorriso/opts_p_z.c Fixing bug from rev cbc5dbf: unknown -xattr mode caused mode "off" 2017.11.16.114215 [143f60f] xorriso/text_io.c Adapted field size of small pacifier numbers to size of large numbers 2017.11.17.143122 [d965b81] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs options -uid and -gid 17 Nov 2017 [dd6042a] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.9 - 2017.11.17.143122 * 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 2017.11.25.095955 [2d35076] xorriso/iso_img.c Recognizing appended partitions with partition offset 16 12 Feb 2018 [447b427] xorriso/xorrecord.texi xorriso/xorrecord.info xorriso/xorrecord.1 Corrected typo "sdc" <> "scd" in xorrecord documentation 22 Mar 2018 [e72ab34] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Small corrections and enhancements in man xorriso 2018.05.08.092636 [198ecef] libisoburn/isofs_wrap.c Bug fix: Multi-session emulation was not recognized with non-zero partition offset 2018.05.18.152119 [b1a47ed] xorriso/configure_ac.txt Preferring Linux include file sys/xattr.h over attr/attr.h Aug 08 2018 [675f9fe] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.4.9 - 2018.08.08.155040 * Bug fix: Multi-session emulation was not recognized with non-zero partition offset libburn: * Bug fix: SIGSEGV could happen if a track ended by reaching its fixed size while the track source still was willing to deliver bytes 2018.09.01.191851 [92665c8] xorriso/drive_mgt.c xorriso/check_media.h xorriso/check_media.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Corrected rank of -checkmedia quality "md5_mismatch" 2018.09.09.125911 [7add413] xorriso/iso_img.c Adapted -report_system_area perception of appended partitions to changes in libisofs 2018.09.09.130316 [8765230] xorriso/iso_img.c Letting -report_system_area propose --mbr-force-bootable more often 2018.09.12.113255 [c30c89d] xorriso/iso_img.c Improved in -report_system_area recognition of appended GPT partitions 2018.09.15.133001 [f0b6ea7] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info xorriso/xorriso-tcltk.texi (should have been done) xorriso/xorriso-tcltk.1 (should have been done) xorriso/xorriso-tcltk.info (should have been done) Version leap to libisoburn-1.5.0 15 Sep 2018 [cb4ac1c] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.5.0 - 2018.09.15.133001 2018.09.16.145527 [08355f7] configure.ac libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info xorriso/xorriso-tcltk.texi xorriso/xorriso-tcltk.1 xorriso/xorriso-tcltk.info Made number transition to 1.5.1 2018.09.16.150917 [c2b33f4] xorriso/opts_p_z.c xorriso/emulators.c Updated copyright messages 16 Sep 2018 [c338597] ChangeLog xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.5.1 - 2018.09.16.150917 24 Sep 2018 [1efe7aa] xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info Corrected typo in documentation (found by lintian) 10 Oct 2018 [05732a2] xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Corrected typo in documentation (found by younger lintian) 2018.10.10.114818 [1002df9] xorriso/cmp_update.c Displaying data file sizes with -update and -update_r 2018.10.12.104229 [22aa52b] xorriso/parse_exec.c xorriso/emulators.c Silenced gcc warnings about printf target buffer 21 Oct 2018 [9cfd466] test/compare_file.c Silenced gcc warning about printf target buffer 2018.11.01.100352 [ff68bda] xorriso/drive_mgt.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Re-enabled unconditional reporting of MD5 tags with -check_media 11 Nov 2018 [b8ee16a] xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Changed prescription for safe loading of tray before xorrisofs add-on session 10 Jan 2019 [c56842e] acinclude.m4 Makefile.am Improved recognizability of copyright and license statements in various files 2019.01.10.194009 [122e43d] xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.5.1 - 2019.01.10.194009 * Bug fix in libisofs: Appended GPT partitions were not covered by the protective MBR partition * Bug fix in libisofs: Multi-session emulation spoiled GPT production "GPT partitions ... overlap". Regression towards 1.4.8 18 Feb 2019 [caf38e8] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/libisoburn.ver 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() 18 Feb 2019 [fc71cec] xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/base_obj.c xorriso/opts_a_c.c xorriso/iso_img.c xorriso/write_run.c xorriso/emulators.c xorriso/text_io.c xorriso/lib_mgt.c xorriso/misc_funct.h xorriso/misc_funct.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Enabled GPT type GUIDs with -append_partition, -boot_image any iso_mbr_part_type=, and -as mkisofs -iso_mbr_part_type 2019.02.18.121941 [7a1cac3] xorriso/xorriso_timestamp.h Updated xorriso timestamp 05 Apr 2019 [0722502] acinclude.m4 Made libisoburn ready for building out-of-source. Thanks Ross Burton. 05 Apr 2019 [720d289] xorriso/xorriso_makefile_am.txt Made GNU xorriso ready for building out-of-source. Thanks Ross Burton. 07 Apr 2019 [1ff0913] configure.ac xorriso/configure_ac.txt Disabled autotools macro AM_MAINTAINER_MODE on advise of Ross Burton 2019.04.08.115541 [e9a424a] xorriso/xorrisoburn.h xorriso/cmp_update.c xorriso/iso_tree.c xorriso/disk_ops.h xorriso/disk_ops.c Displaying directory tree sizes with -update and -update_r 2019.04.18.092737 [1f8d9c7] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/xorrisoburn.h xorriso/base_obj.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/lib_mgt.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 libisoburn/libisoburn.ver New command -iso_nowtime to set fixed timestamp for synthetic files 2019.04.18.092941 [5b62c55] xorriso/parse_exec.c Bug fix: Environment variable SOURCE_DATE_EPOCH did not affect synthetic files 22 Apr 2019 [3a2a3ba] frontend/grub-mkrescue-sed.sh New control variable for grub-mkrescue-sed.sh: MKRESCUE_SED_IN_EFI_NO_PT 2019.04.22.082211 [95c2e7c] xorriso/text_io.c Correction of default output of command -status about -iso_nowtime 22 Apr 2019 [1eb51f4] frontend/grub-mkrescue-sed.sh grub-mkrescue-sed.sh: MKRESCUE_SED_IN_EFI_NO_PT="extra" to erase MBR signature 2019.05.02.175412 [aa50f5c] xorriso/write_run.c Re-assessing drive status after automatic formatting by a write run 2019.05.02.175539 [31450dc] xorriso/opts_p_z.c xorriso/emulators.c Updated year in copyright message texts 2019.07.06.130540 [c0ad17b] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.5.1 - 2019.07.06.130540 * 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. 2019.07.13.153027 [3b0abc1] xorriso/drive_mgt.c Improved -toc summary of sessions with multiple tracks or non-data sessions 2019.07.22.181418 [397551f] xorriso/iso_img.c With report_system_area of iso_mbr_part_type: give MBR precedence over GPT 2019.07.24.073750 [321a047] xorriso/opts_p_z.c xorriso/text_io.h xorriso/text_io.c Bug fix: Very large ACL texts led to SIGSEGV with -setfacl* commands. Thanks Eliska Svobodova. 2019.07.24.141555 [e3ff5a9] xorriso/iso_manip.c Enabled verbous error reporting of iso_node_set_acl_text() 2019.08.12.152719 [fb61be0] xorriso/cmp_update.c test/compare_file.c Fixed a comparation report text problem with files of 4 GiB or larger. Thanks Eliska Svobodova. 2019.08.12.190808 [56a5962] xorriso/cmp_update.c xorriso/disk_ops.c xorriso/drive_mgt.c xorriso/emulators.c xorriso/iso_manip.c xorriso/opts_p_z.c xorriso/read_run.c Changed all occurences of (1<<31) to (1u<<31). Thanks Eliska Svobodova. 2019.08.13.160439 [e17db6a] xorriso/opts_d_h.c xorriso/parse_exec.c Avoided potential dereference of NULL. Thanks Eliska Svobodova. 2019.08.13.161913 [b356291] xorriso/iso_manip.c Added a missing pointer initialization. Thanks Eliska Svobodova. 2019.08.14.094038 [3eba8cc] xorriso/opts_p_z.c xorriso/emulators.c xorriso/text_io.c Closed potential memory leaks. Thanks Eliska Svobodova. 2019.08.14.141748 [06346c1] xorriso/opts_a_c.c Prevented potential string overruns. Thanks Eliska Svobodova. 2019.08.14.144754 [fe5fd8e] libisoburn/isofs_wrap.c Changed strncpy() to memcpy() in order to please static analyzers 2019.09.01.071701 [4db0aab] xorriso/match.c Bug fix: -disk_pattern on -add ./ -- mistook "./" for the root directory 2019.09.01.071948 [7066fd4] xorriso/iso_manip.c Improved rejection message in case case of local root directory as input file 2019.09.01.072438 [8828d6f] xorriso/parse_exec.c Bug fix: -disk_pattern on -add "" -- yielded SIGSEGV 2019.09.08.102946 [9019399] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/base_obj.c xorriso/text_io.c xorriso/emulators.c xorriso/drive_mgt.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrecord.texi xorriso/xorrecord.info xorriso/xorrecord.1 New command -drive_access, new -as cdrecord option --drive_not_exclusive 2019.09.29.205332 [a6328e8] xorriso/iso_img.c Prevented -report_system_area as_mkisofs from combining -efi-boot-part with -e --interval:appended_partition 2019.09.29.205504 [cb597ec] xorriso/text_io.c Clarified the message for file paths which are much too long 2019.10.11.104334 [e2c71a3] xorriso/opts_a_c.c xorriso/iso_tree.c xorriso/read_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Bug fix: -osirrox "concat_split_on" worked only together with -split_size larger than 0. Thanks William Willems. 2019.10.26.180001 [3c8f270] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info xorriso/xorriso-tcltk.texi xorriso/xorriso-tcltk.1 xorriso/xorriso-tcltk.info Version leap to libisoburn-1.5.2 26 Oct 2019 [74d9160] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.5.2 - 2019.10.26.180001 * Bug fix in libisofs: Appended GPT partitions were not covered by the protective MBR partition * Bug fix in libisofs: Multi-session emulation spoiled GPT production "GPT partitions ... overlap". Regression towards 1.4.8 * Bug fix: -disk_pattern on -add ./ -- mistook "./" for the root directory * 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 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() * New command -drive_access, new -as cdrecord option --drive_not_exclusive * 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. 2019.10.27.154326 [614e36f] configure.ac libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info xorriso/xorriso-tcltk.texi xorriso/xorriso-tcltk.1 xorriso/xorriso-tcltk.info Made number transition to 1.5.3 27 Oct 2019 [5903885] ChangeLog xorriso/changelog.txt Updated change log ------------------------------------ cycle - xorriso-1.5.3 - 2019.10.27.154326 2019.10.28.143339 [c8b9c9a] xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_private.h xorriso/xorriso_main.c xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/emulators.c xorriso/text_io.h xorriso/text_io.c xorriso/sort_cmp.c xorriso/iso_manip.c xorriso/lib_mgt.h xorriso/lib_mgt.c xorriso/drive_mgt.c xorriso/iso_img.c xorriso/findjob.c xorriso/cmp_update.c xorriso/iso_tree.c xorriso/write_run.c xorriso/aux_objects.h xorriso/misc_funct.c xorriso/misc_funct.h xorriso/sfile.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorriso_eng.html xorriso/README_gnu_xorriso libisoburn/libisoburn.h libisoburn/isoburn.c libisoburn/isoburn.h libisoburn/burn_wrap.c releng/jigdo-gen-md5-list.1 releng/jigdo-gen-md5-list releng/README frontend/frontend_pipes_xorriso.c frontend/xorriso-tcltk frontend/sh_on_named_pipes.sh Fixed spelling errors found by fossies.org with codespell ------------------------------------ cycle - xorriso-1.5.3 - 2019.10.28.143339 (upload for spelling check by fossies.org) 30 Oct 2019 [78a2a37] xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info Fixed another spelling error found by fossies.org with codespell 2019.11.23.132942 [c4894d8] xorriso/misc_funct.c xorriso/opts_d_h.c xorriso/make_xorriso_1.c Reacted on compiler warnings of Debian Sid 2019.11.24.123339 [1557304] configure.ac xorriso/xorriso_private.h xorriso/opts_d_h.c xorriso/emulators.c xorriso/lib_mgt.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info Switched to usage of libjte-2.0.0. New -jigdo parameters "checksum_algorithm", "demand_checksum", "checksum_path". New -as mkisofs options-jigdo-checksum-algorithm, "-checksum-list", "-jigdo-force-checksum". 24 Nov 2019 [b35e119] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.5.3 - 2019.11.24.123339 * 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" 2019.11.26.192814 [9028117] xorriso/emulators.c Removed some surplus blanks 2019.11.26.193722 [ea86330] releng/README releng/manual_isojigdo releng/jigdo-gen-md5-list releng/jigdo-gen-md5-list.1 Added options --md5 and --sha256 to Jigdo releng test 29 Nov 2019 [fe46a2d] + xorriso-dd-target/xorriso-dd-target Beginning public development of xorriso-dd-target 30 Nov 2019 [e36596b] xorriso-dd-target/xorriso-dd-target Assessing which partitions are really mounted. Made sure that a bus related reason is shown if bus was inquired. Improved hint and usage text. 30 Nov 2019 [81272c8] xorriso-dd-target/xorriso-dd-target Introduced option -dummy and enabled real unmounting 30 Nov 2019 [b8f7767] xorriso-dd-target/xorriso-dd-target Introduced option -plug_test 30 Nov 2019 [b0db123] xorriso-dd-target/xorriso-dd-target Added pacifier dots to the waiting loop of -plug_test 30 Nov 2019 [69ce40b] xorriso-dd-target/xorriso-dd-target Added a confirmation prompt to -plug_test controlled write runs 30 Nov 2019 [099d24f] xorriso-dd-target/xorriso-dd-target Added option -dummy_force 30 Nov 2019 [9ffb3ff] xorriso-dd-target/xorriso-dd-target Running sudo early in order to get the possible password prompt 02 Dec 2019 [a6ab055] xorriso-dd-target/xorriso-dd-target Small fixes of problems found while writing documentation 02 Dec 2019 [23bce9c] + xorriso-dd-target/xorriso-dd-target.texi + xorriso-dd-target/xorriso-dd-target.1 + xorriso-dd-target/xorriso-dd-target.info xorriso/make_xorriso_1.c xorriso/make_docs.sh Added info and man page for xorriso-dd-target 02 Dec 2019 [9b711f2] xorriso-dd-target/xorriso-dd-target xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/xorriso-dd-target.1 xorriso-dd-target/xorriso-dd-target.info Reassured success of unmount 02 Dec 2019 [74f05d3] xorriso-dd-target/xorriso-dd-target xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/xorriso-dd-target.1 xorriso-dd-target/xorriso-dd-target.info Made changes to -plug_test step 3 03 Dec 2019 [6de23e9] xorriso-dd-target/xorriso-dd-target Avoided to show mount lines again after -dummy umount 03 Dec 2019 [02e55a9] xorriso-dd-target/xorriso-dd-target Enabled real writing in xorriso-dd-target 03 Dec 2019 [f7f484d] xorriso-dd-target/xorriso-dd-target Wrapped command path variables in double quotes 03 Dec 2019 [3bf01c1] xorriso-dd-target/xorriso-dd-target Replaced fgrep by grep -F 03 Dec 2019 [7fa1f82] xorriso-dd-target/xorriso-dd-target Removed unused variable 03 Dec 2019 [f419f51] xorriso-dd-target/xorriso-dd-target Rejecting device names which are not a single word 04 Dec 2019 [2451020] xorriso-dd-target/xorriso-dd-target Unwrapped the three usages of variable sudo_cmd, because it can be empty 04 Dec 2019 [e226486] xorriso-dd-target/xorriso-dd-target Taking inability to determine -image_file size as reason to abort 04 Dec 2019 [c0b650b] xorriso-dd-target/xorriso-dd-target Simplified the pipeline which obtains the partition device files 05 Dec 2019 [5e727b4] xorriso-dd-target/xorriso-dd-target xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/xorriso-dd-target.1 xorriso-dd-target/xorriso-dd-target.info Rejecting zram[0-9] as candidate device 05 Dec 2019 [a09ed16] xorriso-dd-target/xorriso-dd-target Tell no_bus_info- rather than not_usb- if lsblkd -o TRAN fails 05 Dec 2019 [a28ad87] xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/xorriso-dd-target.1 xorriso-dd-target/xorriso-dd-target.info Clarified in man page the use of option -with_vendor_model 05 Dec 2019 [98c301e] xorriso-dd-target/xorriso-dd-target Letting round_down_div_million() convert small numbers to 0 06 Dec 2019 [3ac5dba] xorriso-dd-target/xorriso-dd-target Excluding loop devices from being considered 06 Dec 2019 [fd04b11] xorriso-dd-target/xorriso-dd-target xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/xorriso-dd-target.1 xorriso-dd-target/xorriso-dd-target.info New reason looks_like_loopdev- 07 Dec 2019 [51994a7] xorriso-dd-target/xorriso-dd-target Experimental options -list_long_inline -list_long_after 07 Dec 2019 [ba505e8] xorriso-dd-target/xorriso-dd-target Imposing stricter checks on option parameters 07 Dec 2019 [d315b65] xorriso/README_gnu_xorriso xorriso/configure_ac.txt xorriso/xorriso_makefile_am.txt xorriso/make_xorriso_standalone.sh Brought xorriso-dd-target into GNU xorriso 07 Dec 2019 [1b22aa5] xorriso-dd-target/xorriso-dd-target xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/xorriso-dd-target.1 xorriso-dd-target/xorriso-dd-target.info Removed option -list_long_after, changed -list_long_inline to -list_long 2019.12.07.203142 [1f6504f] xorriso/README_gnu_xorriso xorriso/AUTHORS_gnu_xorriso ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated authorship, change log and web page ------------------------------------ cycle - xorriso-1.5.3 - 2019.12.07.203142 * New helper script xorriso-dd-target 08 Dec 2019 [2a8894a] xorriso-dd-target/xorriso-dd-target Added forgotten initialization of variable umount_cmd 08 Dec 2019 [03ae735] README AUTHORS configure.ac Makefile.am Brought xorriso-dd-target into libisoburn 08 Dec 2019 [157cb19] xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/xorriso-dd-target.1 xorriso-dd-target/xorriso-dd-target.info Equipped xorriso-dd-target -dummy_force example with -list_long 08 Dec 2019 [697c8cc] xorriso-dd-target/xorriso-dd-target Forcing locale "C" to avoid grep ambiguities and locale bugs 08 Dec 2019 [e5d86b3] xorriso-dd-target/xorriso-dd-target Giving device detected by -plug_test an extra second to settle 09 Dec 2019 [27bc463] xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/xorriso-dd-target.1 xorriso-dd-target/xorriso-dd-target.info Exchanged two-byte UTF-8 characters by ASCII lookalikes 09 Dec 2019 [6bfdd2f] xorriso-dd-target/xorriso-dd-target Disabled -list_long before giving device overview after rejected -DO_WRITE 09 Dec 2019 [1efa98a] xorriso-dd-target/xorriso-dd-target Small fixes with help text and program message 10 Dec 2019 [ac01884] xorriso-dd-target/xorriso-dd-target xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/xorriso-dd-target.1 xorriso-dd-target/xorriso-dd-target.info Trying to avoid race conditions with automounters during and after -plug_test 12 Dec 2019 [ab2af1d] + xorriso-dd-target/xorriso-dd-target.xdt A version of xorriso-dd-target with xdt_-prefixed symbols and return instead of exit 12 Dec 2019 [f6c56fe] xorriso-dd-target/xorriso-dd-target.xdt Some corrections of the previous commit 12 Dec 2019 [a3a351b] xorriso-dd-target/xorriso-dd-target xorriso-dd-target/xorriso-dd-target.xdt Improved handling of dd failure 14 Dec 2019 [b8a2a0b] xorriso-dd-target/xorriso-dd-target.xdt Created function xdt_predict_su_power from end of xdt_arg_interpreter 14 Dec 2019 [8fee0fc] xorriso-dd-target/xorriso-dd-target.xdt Created function xdt_unmount from xdt_write_image 15 Dec 2019 [39163b6] xorriso-dd-target/xorriso-dd-target Replaced xorriso-dd-target by xorriso-dd-target.xdt 15 Dec 2019 [93ebe30] - xorriso-dd-target/xorriso-dd-target.xdt Removed the work copy xorriso-dd-target.xdt 16 Dec 2019 [42df8f9] xorriso-dd-target/xorriso-dd-target Fixed the test for mounted devices after umount. Regression by 8fee0fc. 21 Dec 2019 [b97841b] xorriso-dd-target/xorriso-dd-target Shielded processing of user arguments against leading dashes 22 Dec 2019 [2392441] xorriso-dd-target/xorriso-dd-target Followed advice of Open Group about shell command "test" 23 Dec 2019 [80e3228] xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info Corrected description of command -preparer_id 01 Jan 2020 [71b6133] xorriso-dd-target/xorriso-dd-target xorriso-dd-target returned exit value 1 if no device name is given and one of the listed devices is not advisable 02 Jan 2020 [3466f23] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/read_run.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info New -osirrox option check_md5_on|_off|_force 2020.01.02.220502 [56238c3] Timestamp for 3466f23 06 Jan 2020 [557e69a] xorriso-dd-target/xorriso-dd-target xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/xorriso-dd-target.1 xorriso-dd-target/xorriso-dd-target.info Using dd option status=progress if available 2020.01.06.204949 [43d5804] xorriso-dd-target/xorriso-dd-target xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/xorriso-dd-target.1 xorriso-dd-target/xorriso-dd-target.info New xorriso-dd-target option -version 2020.01.07.123808 [5a335e5] xorriso-dd-target/xorriso-dd-target xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/xorriso-dd-target.1 xorriso-dd-target/xorriso-dd-target.info Erasing GPT backup header block, if expr is good enough 2020.01.08.204757 [086a9a6] xorriso-dd-target/xorriso-dd-target Corrected computation of end block for GPT erasure 2020.01.19.095527 [bf0a3f0] xorriso/opts_d_h.c xorriso/emulators.c Added contact information to help texts 2020.01.20.132834 [49690fc] xorriso/opts_d_h.c xorriso/emulators.c Added GNU Coding Style compliant versions of contact information to help texts 2020.02.12.145929 [1170a9b] xorriso-dd-target/xorriso-dd-target xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/xorriso-dd-target.1 xorriso-dd-target/xorriso-dd-target.info New xorriso-dd-target option -trust_lsblk_udev 2020.02.12.195952 [89fe871] xorriso-dd-target/xorriso-dd-target Corrected a functionality spoiling typo in commit 1170a9b 13 Jun 2020 [c51f381] xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Mentioned in man xorrisofs the directory tree limitation of HFS+ 13 Jun 2020 [af0dd13] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Corrected typo in man xorriso. Thanks Jakub Wilk. 2020.07.01.103946 [1667035] libisoburn/libisoburn.h Corrected a few typos and swapped words in API description 01 Jul 2020 [25b445f] + xorriso-dd-target/xorriso-dd-target.sig Offering GPG signature file for repo downloads of xorriso-dd-target 03 Jul 2020 [gitea: 8f872ba] [gitlab: 5d27645] README Updated copyright year in README 08 Jul 2020 [2fda271] doc/faq.wiki Adapted faq.wiki to Gitea 06 Aug 2020 [3f6195d] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Mentioned in man xorriso the directory tree limitation of HFS+ 2020.08.06.101015 [ec49c62] xorriso/write_run.c Silenced an inappropriate note message with -check_media patch_lba0 2020.08.06.153930 [04a82ce] xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New command -truncate_overwritable 20 Aug 2020 [f23b23f] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.5.3 - 2020.08.06.153930 * New command -truncate_overwritable 2020.08.26.142853 [ffb7fe6] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/drive_mgt.c xorriso/text_io.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -read_speed prefixes "soft_force:" and "soft_corr:" 11 Sep 2020 [56b2d88] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Mentioned that partition_entry=gpt_basdat and -isohybrid-gpt-basdat create invalid GPT but also a valid MBR partition table 2020.09.30.190728 [588578f] xorriso/opts_a_c.c xorriso/check_media.c xorriso/drive_mgt.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -check_media option data_to="-" for standard output 30 Sep 2020 [bbded29] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.5.3 - 2020.09.30.190728 * New -read_speed prefixes "soft_force:" and "soft_corr:" * New -check_media option data_to="-" for standard output 2020.10.14.182119 [9a7dfd7] libisoburn/libisoburn.h Requiring libisofs 1.5.3 2020.10.14.205904 [dcb1395] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/iso_tree.c xorriso/lib_mgt.c xorriso/filters.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -zisofs parameters version_2=, block_size_v2=, max_bpt=, max_bpt_f= 2020.10.14.210148 [8286468] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs option --zisofs-version-2 14 Oct 2020 [fb0d617] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.5.3 - 2020.10.14.210148 * New -zisofs parameters version_2=, block_size_v2=, max_bpt=, max_bpt_f= * New -as mkisofs option --zisofs-version-2 2020.10.16.091750 [2f44446] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Let -as mkisofs --zisofs-version-2 imply -z 2020.10.17.133001 [3f390f2] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/iso_tree.c xorriso/lib_mgt.c xorriso/filters.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -zisofs parameters bpt_target= 17 Oct 2020 [5a6aa8a] xorriso/make_docs.sh Added makeinfo option --no-split in make_docs.sh 2020.10.22.114038 [c4d66ec] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/lib_mgt.c xorriso/filters.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -zisofs parameter bpt_free_ratio= 2020.10.24.121839 [396d099] xorriso/iso_img.c Bug fix: -report_system_areas as_mkisofs misrepresented GPT with appended partition and forced boot flag 2020.10.25.160005 [c1e6d34] xorriso/base_obj.c xorriso/filters.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 In case of ISO_ZISOFS_TOO_MANY_PTR remove all dispensable block pointers 27 Oct 2020 [c24ffed] xorriso/configure_ac.txt Let ./configure --disable-zlib issue a message 2020.10.27.113831 [1ddb676] xorriso/opts_p_z.c xorriso/emulators.c xorriso/filters.c xorriso/write_run.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 Enabled recognition of zisofs by magic without zlib support. New by_magic=v2 2020.10.29.082836 [a9d8102] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_d_h.c xorriso/opts_p_z.c xorriso/lib_mgt.c xorriso/filters.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -zisofs parameter susp_z2= 2020.10.29.083347 [5316687] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 New -as mkisofs option --zisofs-susp-z2 29 Oct 2020 [d2f10a1] xorriso/xorriso_makefile_am.txt xorriso/make_xorriso_standalone.sh Added libisofs/doc/zisofs2_format.txt to GNU xorriso 2020.10.29.191346 [80b4d29] xorriso/emulators.c xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Changed --zisofs-susp-z2 to --zisofs2-susp-z2, added --zisofs2-susp-zf 2020.10.31.195038 [66fe150] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.5.3 - 2020.10.31.195038 * New -zisofs parameters bpt_target=, bpt_free_ratio=, by_magic=v2, susp_z2= * New -as mkisofs options --zisofs2-susp-z2, --zisofs2-susp-zf * Enabled recognition of zisofs by magic without zlib support * Bug fix: -report_system_area as_mkisofs misrepresented GPT with appended partition and forced boot flag as -part_like_isohybrid 2020.11.03.082729 [05de7ec] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/opts_d_h.c xorriso/opts_i_o.c xorriso/opts_p_z.c xorriso/read_run.c xorriso/text_io.c xorriso/misc_funct.h xorriso/misc_funct.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 New -osirrox option sparse= controls extraction into sparse files 2020.11.07.113931 [6fa5f97] xorriso/xorrisoburn.h xorriso/iso_manip.c xorriso/write_run.c Bug fix: Boot catalog could get a wrong name if cat_path= is explicitely given but not containing a slash character 13 Nov 2020 [fc2a2d4] + NEWS Added a NEWS file to please automake without --foreign. Thanks Felipe Franciosi. 13 Nov 2020 [d9176df] xorriso/make_xorriso_standalone.sh Added NEWS to GNU xorriso 2020.11.14.083425 [266a6f4] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.5.3 - 2020.11.14.083425 * New -osirrox option sparse= controls extraction into sparse files * Bug fix: Boot catalog could get a wrong name if cat_path= is explicitely given but not containing a slash character 15 Nov 2020 [abd65a7] xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 xorriso/xorrisofs.texi xorriso/xorrisofs.info xorriso/xorrisofs.1 Documented new opportunity to use with -append_partition the HFS+ type GUID to get APM type "Apple_HFS" 2020.11.18.200311 [9f5a6ea] xorriso/emulators.c Added -translation-table to the list of ignroed -as mkisofs options 2020.11.22.131521 [cf176ee] libisoburn/libisoburn.h libisoburn/isofs_wrap.c libisoburn/isoburn.h libisoburn/isoburn.c New libisoburn extension option isoburn_ropt_map_joliet_stripped 2020.11.22.134545 [8f89ad0] libisoburn/libisoburn.h libisoburn/isofs_wrap.c libisoburn/isoburn.h libisoburn/isoburn.c New libisoburn extension option isoburn_ropt_map_joliet_unmapped 2020.11.22.135052 [2fbb3cf] xorriso/xorriso.h xorriso/xorriso_private.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/base_obj.c xorriso/text_io.c xorriso/drive_mgt.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 libisoburn/libisoburn.ver New command -joliet_map 2020.12.04.103410 [e97cd48] xorriso/opts_i_o.c Added the source code of Xorriso_option_joliet_map which was omitted with commit 2fbb3cf 2020.12.05.085329 [47be075] xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/parse_exec.c xorriso/opts_d_h.c xorriso/drive_mgt.c xorriso/iso_img.c xorriso/read_run.c xorriso/check_media.h xorriso/check_media.c xorriso/sfile.h xorriso/sfile.c xorriso/xorriso.texi xorriso/xorriso.info xorriso/xorriso.1 libisoburn/libisoburn.ver New command -extract_boot_images 2020.12.07.183710 [b3adff1] libisoburn/libisoburn.h libisoburn/isoburn.h libisoburn/isoburn.c libisoburn/isofs_wrap.c libisoburn/libisoburn.ver New API call isoburn_ropt_get_tree_loaded() 2020.12.07.184159 [3542e8a] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/drive_mgt.c New -toc lines "ISO offers :" and "ISO loaded :" 2020.12.08.122752 [5bc1d99] xorriso/xorriso_private.h xorriso/base_obj.c xorriso/drive_mgt.c Omitting "ISO offers :" and "ISO loaded :" if no ISO was loaded at all 2021.01.30.150001 [f81eade] configure.ac README libisoburn/libisoburn.h xorriso/README_gnu_xorriso xorriso/xorriso.h xorriso/xorrisoburn.h xorriso/xorriso_main.c xorriso/xorriso_eng.html xorriso/make_xorriso_standalone.sh xorriso/configure_ac.txt frontend/xorriso-tcltk xorriso-dd-target/xorriso-dd-target xorriso/xorriso_timestamp.h xorriso/xorriso.texi xorriso/xorriso.1 xorriso/xorriso.info xorriso/xorrisofs.texi xorriso/xorrisofs.1 xorriso/xorrisofs.info xorriso/xorrecord.texi xorriso/xorrecord.1 xorriso/xorrecord.info xorriso/xorriso-tcltk.texi xorriso/xorriso-tcltk.1 xorriso/xorriso-tcltk.info xorriso-dd-target/xorriso-dd-target.texi xorriso-dd-target/xorriso-dd-target.1 xorriso-dd-target/xorriso-dd-target.info Version leap to libisoburn-1.5.4 30 Jan 2021 [] ChangeLog xorriso/changelog.txt Documented changes and release timestamp ----------------------------------- release - xorriso-1.5.4 - 2021.01.30.150001 * 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 helper script xorriso-dd-target * New command -truncate_overwritable * 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= * New -as mkisofs option --zisofs-version-2 * New -zisofs parameters bpt_target=, bpt_free_ratio=, by_magic=v2, susp_z2= * New -as mkisofs options --zisofs2-susp-z2, --zisofs2-susp-zf * Enabled recognition of zisofs by magic without zlib support * Bug fix: -report_system_area as_mkisofs misrepresented GPT with appended partition and forced boot flag as -part_like_isohybrid * New -osirrox option sparse= controls extraction into sparse files * Bug fix: Boot catalog could get a wrong name if cat_path= is explicitely given but not containing a slash character * New libisoburn extension options isoburn_ropt_map_joliet_stripped and isoburn_ropt_map_joliet_unmapped * New API call isoburn_ropt_get_tree_loaded() * New command -joliet_map * New command -extract_boot_images [] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.5.3 - [] ChangeLog xorriso/xorriso_eng.html xorriso/changelog.txt Updated change log and web page ------------------------------------ cycle - xorriso-1.5.3 - ********************************************************************** Important: When adding a public API function then add its name to file libisoburn/libisoburn.ver When adding a new xorriso command or xorrisofs option, check the list in file doc/grub-mkrescue_reserved_commands.txt ********************************************************************** =============================================================================== TODO =============================================================================== Current pending changes: >>> check whether the flat assumption of GPT block size 512 can do harm >>> Issue warning if -hfsplus is "off" and -report_system_area as_mkisofs does not find any blessings. >>> Report HFS+ blessings with -report_system_area "plain" ? >>> SuSE does EFI -boot-load-size 1. Shall xorriso do so with oversized EFI partition ? >>> HFS+ problems on coverty VM # mount /dev/sdb3 /mnt/hfs # ls /mnt/hfs ls: reading directory /mnt/hfs: Input/output error System boot empty-file.txt mach_kernel [ 359.020970] hfsplus: walked past end of dir # mount -o loop /dev/sdb /mnt/iso # ls /mnt/iso System boot boot.catalog efi.img empty-file.txt mach_kernel --------- >>> compare old and new boot equipment after modifying with -report_system_area cmd resp. -report_system_area as_mkisofs xorriso=/home/thomas/projekte/cdrskin_dir/libisoburn-develop/xorriso/xorriso # (set empty to start from scratch) start=/dvdbuffer/FreeBSD-8.2-RELEASE-amd64-livefs.iso for i in /dvdbuffer/*.iso do test "$start" = "$i" && start="" test -n "$start" && continue test "$i" = /dvdbuffer/test.iso && continue $xorriso -indev "$i" -toc -report_el_torito cmd \ -report_el_torito plain -report_system_area plain done 2>&1 | less /home/thomas/projekte/cdrskin_dir/libisoburn-develop/test/repack_cmd_and_diff.sh \ 2>&1 | less >>> compare with result of -report_system_area as_mkisofs for i in /dvdbuffer/*.iso do test "$start" = "$i" && start="" test -n "$start" && continue test "$i" = /dvdbuffer/test.iso && continue $xorriso -indev "$i" -toc -report_el_torito as_mkisofs \ -report_el_torito plain -report_system_area plain done 2>&1 | less ~/projekte/cdrskin_dir/libisoburn-develop/test/repack_as_mkisofs_and_diff.sh \ 2>&1 | less # As superuser from mounted ISOs rather than -indev /root/xorriso_repack_loop 2>&1 | less ------------------------------------------------------------------------- 2015: >>> xorriso : SORRY : Cannot make proposal to mark PReP partition by data file: '/CD_GET_V' Drive current: -indev '/dvdbuffer/mkisofs-prep-boot.iso' --- Old: System area options: 0x00000200 System area summary: PReP ISO image size/512 : 3712 Partition offset : 0 MBR heads per cyl : 0 MBR secs per head : 0 MBR partition table: N Status Type Start Blocks MBR partition : 1 0x80 0x41 140 26 MBR partition path : 1 /CD_GET_V PReP boot partition: 35 7 --- New: System area options: 0x00000200 System area summary: PReP ISO image size/512 : 3152 Partition offset : 0 MBR heads per cyl : 64 MBR secs per head : 32 MBR partition table: N Status Type Start Blocks MBR partition : 1 0x00 0xcd 0 148 MBR partition : 2 0x00 0x41 148 28 MBR partition : 3 0x00 0xcd 176 2976 PReP boot partition: 37 7 >>> Unusual MBR partition layout. isohybrid plus head transplant. >>> xorriso : SORRY : Cannot make proposal to mark data file as MBR partition without being in GPT : '/boot/x86_64/efi' Drive current: -indev '/dvdbuffer/openSUSE-13.1-NET-x86_64.iso' --- Old: El Torito catalog : 20 1 El Torito images : N Pltf B Emul Ld_seg Hdpt Ldsiz LBA El Torito boot img : 1 BIOS y none 0x0000 0x00 4 4238 El Torito boot img : 2 UEFI y none 0x0000 0x00 1 70 El Torito img path : 1 /boot/x86_64/loader/isolinux.bin El Torito img opts : 1 boot-info-table isohybrid-suitable El Torito img path : 2 /boot/x86_64/efi System area options: 0x00000202 System area summary: MBR isohybrid cyl-align-off ISO image size/512 : 581424 Partition offset : 0 MBR heads per cyl : 64 MBR secs per head : 32 MBR partition table: N Status Type Start Blocks MBR partition : 1 0x00 0xef 280 8192 MBR partition : 2 0x80 0x17 8472 573160 MBR partition path : 1 /boot/x86_64/efi --- New: El Torito catalog : 46 1 El Torito images : N Pltf B Emul Ld_seg Hdpt Ldsiz LBA El Torito boot img : 1 BIOS y none 0x0000 0x00 4 2095 El Torito boot img : 2 UEFI y none 0x0000 0x00 8192 47 El Torito img path : 1 /boot/x86_64/loader/isolinux.bin El Torito img opts : 1 boot-info-table isohybrid-suitable El Torito img path : 2 /boot/x86_64/efi System area options: 0x00000202 System area summary: MBR isohybrid cyl-align-off GPT ISO image size/512 : 572292 Partition offset : 0 MBR heads per cyl : 64 MBR secs per head : 32 MBR partition table: N Status Type Start Blocks MBR partition : 1 0x80 0x00 0 572292 MBR partition : 2 0x00 0xef 188 8192 MBR partition path : 2 /boot/x86_64/efi GPT : N Info GPT disk GUID : 552ab653be9e044caf952a521d48596c GPT entry array : 2 248 overlapping GPT lba range : 64 572228 572291 GPT partition name : 1 490053004f00480079006200720069006400 GPT partname local : 1 ISOHybrid GPT partition GUID : 1 552ab653be9e044caf972a521d48596c GPT type GUID : 1 a2a0d0ebe5b9334487c068b6b72699c7 GPT partition flags: 1 0x1000000000000001 GPT start and size : 1 0 572228 GPT partition name : 2 490053004f004800790062007200690064003100 GPT partname local : 2 ISOHybrid1 GPT partition GUID : 2 552ab653be9e044caf962a521d48596c GPT type GUID : 2 a2a0d0ebe5b9334487c068b6b72699c7 GPT partition flags: 2 0x1000000000000001 GPT start and size : 2 188 8192 GPT partition path : 2 /boot/x86_64/efi >>> Hidden El Torito boot images /dvdbuffer/netbsd_69944_boot.iso /dvdbuffer/FreeBSD-8.4-BETA1-amd64-livefs.iso /dvdbuffer/NetBSD-6.1.3-i386.iso /dvdbuffer/NetBSD-6.1.4-i386.iso xorriso : SORRY : Cannot enable EL Torito boot image #1 because it is not a data file in the ISO filesystem >>> Hidden El Torito catalog with default name /dvdbuffer/Vicibox_v.6.0.x86_64-6.0.3.preload.iso has a data file /boot.catalog which is not the boot catalog. xorriso proposes --boot-catalog-hide and no -c which causes the data file to be overwritten by the boot catalog which then gets hidden. >>> /dvdbuffer/debian-7.4.0-amd64-netinst.iso grows by 25 MB (/dvdbuffer/debian-testing-amd64-netinst.iso does not) - identical files initrd.gz and vmlinuz do not get unified as is done with newly imported ones. Caused by the fact that the debian ISO was made with hardlinks off and thus with PX entries of length 36. >>> Need a command to unify the inode numbers of files with same LBA and nonzero length >>> Maintain GPT individual GUIDs ? >>> ??? should giving up of both drives cause dropping of boot images ? >>> coordinate libisofs/image.h : iso_write_opts.system_area_options and iso_write_opts.imported_sa_info->system_area_options possibly by new API call: /* >>> Activates all System Area and El Torito features from the loaded ISO (see iso_image_report_system_area() and iso_image_report_el_torito()) for the upcomming ISO. */ int iso_image_set_boot_as_loaded(IsoImage *img, int flag); >>> Why does -boot_image "grub" "patch", -boot_image "grub" "boot_info_table=on" set bit1 of patch_isolinux_image/el_torito_set_isolinux_options ? - This causes iso_align_isohybrid() to align to full MB - } else if (sa_type == 0 && t->catalog != NULL && (t->catalog->bootimages[0]->isolinux_options & 0x0a) == 0x02) { /* Check for isolinux image with magic number of 3.72 and produce an MBR from our built-in template. (Deprecated since 31 Mar 2010) */ ------------------------------------------------------------------- DVD 95 home_backup_update_zisofs B41104 - load sbsector 2193824 indev /dev/sr3 ... libburn : DEBUG : SCSI error on read_10(0,32): [3 11 05] Medium error. L-EC uncorrectable error. ... Why does it read sector 0 ? indev /dev/sr2 ... libburn : DEBUG : SCSI error condition on command 28h READ(10): [4 3E 02] Drive error. Timeout on logical unit. libburn : DEBUG : SCSI error on read_10(0,32): [4 3E 02] Drive error. Timeout on logical unit. libburn : DEBUG : SCSI error condition on command 28h READ(10): [3 11 05] Medium error. L-EC uncorrectable error. libburn : DEBUG : SCSI error on read_10(0,16): [3 11 05] Medium error. L-EC uncorrectable error. ... dev indev /dev/sr2 ... libburn : SORRY : Drive is already registered resp. scanned Why does libburn have the drive registered while xorriso is not aware of it ? ------------------------------------------------------------------- xorriso -indev /dev/sr0 \ -as mkisofs -r -J -iso-level 3 \ -C 0,1486688 -o /dvdbuffer/ms.iso \ --md5 test_dir xorriso -as cdrecord -v dev=/dev/sr0 --grow_overwritable_iso \ -multi /dvdbuffer/ms.iso xorriso -md5 on -indev /dev/sr0 -check_md5_r sorry / -- libisofs: WARNING : Found copied superblock checksum tag probably ISO loading does not checkread MD5 Surely this does not use MD5s: xorriso -md5 on -indev /dev/sr0 -check_media -- ------------------------------------------------------------------- - One should try to determine the relaxation in the imported image. iso_add_dir_src_rec() would proabably be the place to do so. ------------------------------------------------------------------- >>> Does libisofs need an assertion that sizeof(ino_t) >= 4 ? Where to state that libisofs produced ino may not surpass 32 bit. >>> Does libisofs have an assertion for sizeof(off_t) >= 8 ? >>> even libburn lacks it ------------------------------------------------------------------- Ponder this: Date: Sat, 3 May 2014 01:32:15 +0200 From: G.raud reply: B40503_cdwrite_g_raud > $ xorriso -indev img.iso -find \ > -fexec sh -c 'test "$1" = "$2" || test $ISO_MODE = 755' s "$name" '{}' \; \ > -exec lsdl I understand that "$1" and "$2" shall become the value of environment variable "name" (evaluated by the shell that starts xorriso) and the path of the currently examined ISO file object. The parameter range of -fexec shall end at "\;". "s" is a dummy sacrifice to the -c interpreter of sh, so that "$name" does not become "$0". I am not happy with the semicolon. Probably a user-defined separator word is preferrable. It would be the first parameter of -fexec and its next occurence would mark the end of -fexec. Like -fexec + sh -c ... + Similarly i'm not happy with '{}', because it would be a reserved word among the parameters of fexec. The solution could be user-defined word given as second parameter. Like -fexec + +path sh -c ... s "$name" +path ... + I am not happy with the potential to perform arbitrary actions on the computer system. One can easily shoot one's foot. ------------------------------------------------------------------- Try to forward a DVD burner to NetBSD by virtio. >>> appears as /dev/[r]ld0d >>> libburn insists in /dev/rcd*d address. Why ? >>> /dev/rld0d as softlink target of /dev/rcd9c refuses on ioctl(SCIOCCOMMAND) ------------------------------------------------------------------- >>> NetBSD: Why does wip/libisoburn linking fail without proper -R options and upstream libisoburn work without any -R but only -L ? >>> verify the suspicion that a single -R invalidates all -L at runtime ------------------------------------------------------------------- Expand GPT, MBR and APM end partitions on multi-session. Option to put backup GPT to end of storage device ? ??? xorrisofs option -isohybrid-mbr-efi for MBR partition 0xef but no GPT ? ------------------------------------------------------------------- Option to avoid removal of extraction target file. (for stdout, pipes, devices, fifos, (UNIX sockets) ?) Date: Wed, 16 Apr 2014 06:39:29 +0200 From: G.raud B40416_cdwrite_g_raud B40416_cdwrite_g_raud_3 B40417_cdwrite_g_raud: - Follow symbolic links to replace or overwrite its target rather than replacing the link itself. - Do not unlink special files but rather overwrite their content while keeping all their POSIX file attributes. (What about ACL and getfattr attributes ?) - Do not unlink regular files but handle them like the special file in the previous option. In case of no-unlink: If the existing target file cannot take content because of file type or permissions, then this is a failure event. The target will not be replaced. Special files from the ISO, which do not deliver content, will not replace target files on disk but rather cause a failure event. ------------------------------------------------------------------- >>> NetBSD >>> Explore mounting with arbitrary offset >>> not possible : (B402XX_netbsd_kernel_mount_offset) >>> 007_*.diff to 009*.diff. kern/48808 >>> test + compile with old and new /usr/include + run new binary on old and new kernel + mount(2) with MNT_GETARGS + -s with wd partitions (acts like a real partition) (+) mount(2) with MNT_UPDATE or MNT_RELOAD MNT_UPDATE does nothing, MNT_RELOAD gets censored away by mount(2) >>> wait for acceptance >>> Large file support >>> patch 011 +++ being tested ------------------------------------------------------- >>> Review output sequence of -status for compliance with -list_arg_sorting >>> ??? Adjust partition tables after add-on session with -boot_image any keep ? ------------- >>> Have an AAIP pointer from any type of file to a (hidden ?) directory which represents Solaris openat(O_XATTR) >>> -map and -extract O_XATTR attributes on Solaris man 2 openat: O_XATTR If set in openat(), a relative path argument is inter- preted as a reference to an extended attribute of the file associated with the supplied file descriptor. This flag therefore requires the presence of a legal fildes argument. If set in open(), the implied file descriptor is that for the current working directory. Extended attributes must be referenced with a relative path; pro- viding an absolute path results in a normal file refer- ence. man 5 fsattr: The set of existing attributes can be browsed by calling openat() with "." as the file name and the O_XATTR flag set, resulting in a file descriptor for the attribute directory. The list of attributes is obtained by calls to getdents(2) on the returned file descriptor. >>> create O_XATTR attributes in ISO from normal directory >>> extract O_XATTR attributes in ISO to normal directory ----------------- - GRUB2 patching -as mkisofs \ -hfsplus \ -no-pad \ -o /u/test/test.iso \ --protective-msdos-label \ --grub2-mbr /u/test/grub2/zero_mbr \ -c /BOOT.cat \ -b /img1 \ -boot-info-table -no-emul-boot -boot-load-size 4 \ --grub2-boot-info \ -eltorito-alt-boot \ -b /img2 \ -boot-info-table -no-emul-boot -boot-load-size 4 \ /u/test/grub2/ --grub2-sparc-core /boot/grub/sparc64-ieee1275/core.img -as mkisofs \ -no-pad \ -o /u/test/test.iso \ -sparc-boot "" \ -G /u/test/grub2/zero_mbr \ --grub2-sparc-core /img1 \ /u/test/grub2/ >>> make optional use of ttk::treeview instead of BWidget (needs Tk 8.5) consider to let -x choose a drive automatically at the sequence position of -dev, if there are commands which would need a drive. >>> needs a scan mode that inspects no other drives after the first one ----------------------------------------------------- ISOHYBRID >>> mjg PC-BIOS, Mac : + New -as mkisofs options -isoybrid-gpt-basdat, -isoybrid-gpt-hfsplus, -isoybrid-apm-hfsplus ? shall isohybrid-*-hfsplus prevent writing into EL Torito ? ? shall a further option -no-eltorito prevent writing into EL Torito ? Test: dd if=/dvdbuffer/Fedora-LiveCD.iso bs=512 count=1 \ of=/dvdbuffer/Fedora-LiveCD.mbr valgrind --leak-check=full \ xorriso/xorriso -abort_on never -report_about all -for_backup \ -as mkisofs -o /dvdbuffer/test.iso -no-pad \ -isohybrid-mbr /dvdbuffer/Fedora-LiveCD.mbr \ -b /doc/README -no-emul-boot -boot-load-size 4 -boot-info-table \ -eltorito-alt-boot \ -e dvd_get_variables -no-emul-boot \ -isohybrid-gpt-basdat -isohybrid-apm-hfsplus \ -eltorito-alt-boot \ -e /inst/CONFIGURE_DVD -no-emul-boot \ -isohybrid-gpt-hfsplus -isohybrid-apm-hfsplus \ /u/test/diet/scdbackup-0.9.2 mount -o loop /dvdbuffer/Fedora-LiveCD.iso /mnt valgrind --leak-check=full \ xorriso/xorriso -abort_on never -report_about all \ -as mkisofs -o /dvdbuffer/FedoraRepack.iso -no-pad \ -isohybrid-mbr /dvdbuffer/Fedora-LiveCD.mbr -c /isolinux/boot.cat \ -b /isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 \ -boot-info-table \ -eltorito-alt-boot \ -e /isolinux/efiboot.img -no-emul-boot \ -isohybrid-gpt-basdat -isohybrid-apm-hfsplus \ -eltorito-alt-boot \ -e /isolinux/macboot.img -no-emul-boot \ -isohybrid-gpt-hfsplus -isohybrid-apm-hfsplus \ -V Fedora-LiveCD \ /mnt ----------------------------------------------------- Vladimir - Multi-Session >>> hfsplus.c has no protection against 32 bit rollover due to block addresses that are lower than the HFS+ partition start. + Provisorily banned in xorriso the combination of -hfsplus and growing to appendables >>> install a similar ban in libisofs ? Is HFS+ usable if added to a session ? + The system area gets copied to block 0-15 ? Can HFS+ partitions be added ? (we have few) >>> How to let HFS+ access blocks outside the new session ? ? A patchable HFS superblock in the first session ? >>> for image modifying: - Find out at image load time whether it has APM with HFS+ - Have -hfsplus mode "auto" to enable HFS+ writing in that case. + -as mkisofs for HFS+. Rough sketch. Some options will change. genisoimage -hfs -part -no-desktop -r -J -o ${output_image} \ -map ${map_file} -hfs-bless ${boot_dir} -chrp-boot -sysid PPC \ ${iso_dir} ${source} + -hfs -part -> -hfsplus + -map -> -hfsplus-file-creator-type + -hfs-bless + -chrp-boot -> -chrp-boot-part - Prep and ChrP Vladimir: "-chrp-boot produce an MBR entry spanning the whole ISO and of type 0x96. PreP boot may be preferable." "PreP and CHRP refers mainly to IBM hardware. HFS+ is for Apple only. PreP boot is a partition contating only raw ELF and having type 0x41." + -as mkisofs -chrp-boot-part + -as mkisofs -prep-boot-part DISKFILE + xorriso -boot_image any chrp_boot_part=on|off + xorriso -boot_image any prep_boot_part=disk_path ??? Let writer grab Ecma119Node rather than disk file >>> make combinable with isohybrid - FAT for mounting by running systems which do not expect ISO 9660 on USB stick. --- Da Windows AFAIR nur fuer FAT und NTFS auf USB sticks anschaut, braucht man, eine FAT Dateisystem in der Partition und nicht noch eine Kopie von ISO. Andere Desktopsysteme haben manchmal aehnliches Problem. Man kann HFS+ ins kombinierte HFS+/FAT umwandeln aber dazu braucht man die Groesse zwischen erster und zweiter Zone im Voraus. + This is meanwhile available as Ecma119Image.filesrc_blocks --- + -as mkisofs -fat >>> FAT not implemented yet >>> document >>> xorriso -fat on|off , status -fat , -hide-fat* - EFI boot via GPT >>> Get a positive test result from Vladimir Vladimir: > I'm happy to continue to use > mtools for this, xorriso will have just to embed the image as a GPT > parition. + -as mkisofs -efi-boot-part DISKFILE + Let writer grab Ecma119Node rather than disk file + --efi-boot-image as DISKFILE + xorriso -boot_image efi_boot_part= - Vladimir: Was meinst du zur Möglichkeit es zu einer HFS+/FAT/ISO hyvrid machen? "Wir können es in die gleiche Partition machen. im FAT es kann bis 2^16 512B Sektoren = 32M zwischen BPB und FAT geben. Wir können in diesen Platz volumedescr2 reinschleppen." >>> Currently Ecma119.partition_offset is needed before compute_data_blocks. Several components expect the twin sets of Volume Descriptors and of filesystem trees to be stored as one interval per set. Vladimir's proposal would separate the second Volume Descriptors and trees from the first ones. - Overall goals: Date: Thu, 24 May 2012 16:22:44 +0200 ---------------------------------------------------------------------------- Let's look on the goals side and what is achieved and what isn't. My goals: Already achieved with xorriso: + i386_pc (HD and CD) + *_efi (CD) + (i386_qemu, i386_coreboot, i386_multiboot, mips_loongson, mips-qemu_mips) + Accessible by major OS on CD Would be achieved by your work (I suppose) + *_efi (HD) + -efi-boot-part DISKFILE|--efi-boot-image Achieved by HFS+: + Apple EFI (HD and CD) >>> Vladimir: GPT HFS+ entry still missing from hfsplus.c. Is it needed for booting ? + Apple PPC, New world (HD and CD) Other: + IBM (PreP) PPC (HD and CD). We need PreP partition for HD, + -prep-boot-part DISKFILE >>> who can tell ?: Idk what we need for CD. -Ability to have eltorito.img over 32K and free system area from it: the patching like in the patch, I've showed you in the beginning. - B20521_from_grub_proposal >>> Ask Vladimir for refreshing this info -Accessible by major OS on HD. >>> Vladimir: We probably need FAT for this. "but it creates drawbacks like that its allocation table grows with disk size and unlike on HFS+ there is no way to put it at the end of the disk." + solved by early size computation of filesrc area Ecma119Image.filesrc_blocks ---------------------------------------------------------------------------- - make -check_media chunk_size=32s default for DVD ? - Can UTF-8 or other charsets confuse xorriso or libisofs by byte 47 '/' in multi-byte characters ? > UTF-8 cannot. All multi-bytes are >= 129. - Can character sets map "/" to a byte sequence different from {47,0} ? Would this confuse xorriso or libisofs ? > UTF-8 does not. ---------------------------------------------------------------------------- - -check_media option which aborts the check run on the first error ? Such an option for -check_md5_r ? ??? make -early_stdio_test on by default ? man page for osirrox ? -------------------------- - libisofs: Dynamic hand-out of filesystem id number for user streams and registration of a type string. Deprecate global variable serial_id. demo/custom_stream.c ------------------------------------------------------------------------- - Get rid of ((size_t) -1) in libisofs/util.c - Make Debian test machine ready for cppcheck and add it to release procedure - ? Allow to adjust maximum path length - Is it possible to allow longer Rock Ridge names ? - need a loop to calc and to call rrip_add_NM() ------------------------------------------------- For Debian: - Need specs for the exotic boot options -chrp-boot - needs HFS ------------------------------------------------- For Solaris (The mount command needs to be adapted to Solaris. But currently there is no sector address option with mount.) ------------------------------------------------- For GRUB - multi-boot management libisofs: - replace memory buffered boot images by filtered streams - in eltorito_writer_compute_data_blocks(): from iso_memory_stream_new() to some filter contraption with memorized first block and reading the rest from stream. - let patch_boot_image() read directly from stream (filtered or unfiltered should make no difference for the checksum) - warn that multiple boot images work only if they stem from distinct disk files ------------------------------------------------- FreeBSD - Examine and replay: http://wiki.freebsd.org/AvgLiveCD - looks ok now: mkisofs -R -l -ldots -allow-lowercase -allow-multidot \ -V 'My FreeBSD' -volset 'My FreeBSDs' \ -hide boot.catalog -o ../R.iso -no-emul-boot \ -b boot/cdboot . - try qemu -m 256 -cdrom /tmp/R.iso -boot d >>> does not do anything recognizable. Not even fails. ------------------------------------------------- bugs - xorriso_eng.html on www.gnu.org it should rather be xorriso.html - DVD-ROM drives report CD tracks with size up to the next track start. Why ? -> libburn Eventually restrict -check_media to ISO image size ? - make iso_init() and iso_finish() safe against multiple calls from multiple threads. - what about split files and hard links ? - xorriso -as cdrecord in rare cases reports intermediate "X of X MB" xorriso : UPDATE : 3671 MB written (fifo 94%) [buf 100%] 2.3x. xorriso : UPDATE : 3680 of 3680 MB written (fifo 87%) [buf 100%] 2.3x. xorriso : UPDATE : 3691 MB written (fifo 78%) [buf 100%] 2.3x. Direct reason: burn_drive_get_status(drive, &progress); if(progress.sector<=progress.sectors) sprintf(xorriso->info_text, "%4d of %4d MB written", So this has to be examined in libburn. ------------------------------------------------- important - introduce a read offset for displaced ISO images - coordinate -displacement with image growing - improve find action estimate_size. - take into account indispensible RR and eventual Joliet stuff - take into account the eventual file checksums. - Mark data blocks of -check_md5 matching files as valid in sector map ? - tree of name nodes to represent the cached paths of hardlink candidates. - register hard link disk path for files with link count 1 and allow in Xorriso_restore_target_hl() to use the own hln_target of a node when that node is copied to disk a second time. - libisofs call to create a hard link ? - during -update* - what about differently filtered streams ? It is not wrong but a waste to update them as siblings. - one-time delimiter which overrides -list_delimiter for only the next command. E.g. for --back_to_xorriso in emulations - sudo and setuid chapter in man page ? option -sudo_aware ??? move suffix processing into libisofs ? (currently the suffice are already stored in the filter chain) Can only be done if renaming is made safe with any open IsoDirIter. ------------------------------------------------- development - Special pseudo ACL: "--remove-default" - libisofs , libburn , own system adapter ? : Needed is a system dependend facility: dev_t <-> major, minor - ??? -getfaclx , -getfattrx - -load option to ignore existing images - random access read and write option - option to patch the mount image size and location on overwriteables - change -check_media what=disc to libburn disc rather than libisoburn (seems to need new API capabilities of libburn) ??? Clarify handling of links in ISO and on disk during restore > Relative addressing and pattern matching : iso_rr_pattern on cd /u/FERTIG lsd nonexist/.. - perform any long lasting operation in separate threads while the main thread cares for user and message queues. - Introduce an interrupt key for dialog >>> but how without disturbing readline ? - regularly do valgrind check for memory leaks - ??? http://scan.coverity.com/faq.html - ??? curb depth of tree traversal recursion - eject a not yet aquired device (e.g. after modifying commit) - -cd[ix] and pattern - memory curb for image model > Make transactional the tree deletions meant for replacing ------------------------------------------------- libisofs wishes ------ problem fixes : - the error handling system should be comprehensively documented and eventually rectified where needed. - the iterators are still not safe with node renamings: iso_dir_get_children(...); while(...) { iso_dir_iter_next(...); ... iso_node_get_name() returns "xyz" ... iso_node_set_name("xyz.gz"); ... iso_file_add_external_filter() returns 2 ... iso_node_set_name("xyz"); } ------ feature enhancements : - With 100,000 files in a single directory, adding new nodes becomes very slow with high workload. Some hash accelerator would be nice. - Re-use unchanged sub trees in the previous image in order to reduce the session overhead. -------------------------------------------------------------------------- License statement by the author of the HFS+ enhancements in libisofs and libisoburn: Date: Wed, 23 May 2012 18:26:15 +0200 Message-ID: <4FBD0FA7.8040105@gmail.com> From: Vladimir '?-coder/phcoder' Serbinenko To: Thomas Schmitt Subject: Re: HFS+ writer I'm ok with LGPL but I'd like a mention in documentation that HFS+ writer is of my coding. -- Regards Vladimir '?-coder/phcoder' Serbinenko -------------------------------------------------------------------------- =============================================================================== This is the dirty end of the todo list. The recent changelog entries are above the headline "TODO". =============================================================================== libisoburn-1.5.4/xorriso/xorrecord.texi0000644000175700017510000013461714005266103015242 00000000000000\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename xorrecord.info @settitle GNU xorrecord 1.5.4 @c %**end of header @c @c man-ignore-lines begin @dircategory Archiving @direntry * Xorrecord: (xorrecord). Emulates CD/DVD/BD program cdrecord @end direntry @c man-ignore-lines end @c @c Notes about embedded man page: @c This texinfo code contains the necessary info to produce a man page @c which resembles much the version of xorriso.1 from which this code @c was originally derived in march 2010. @c One can produce the man page by applying the following rules: @c The first line gets discarded. @c Line start "@c man " will become "", the remainder is put out unaltered. @c Lines "@*" will be converted to ".br" @c "@c man-ignore-lines N" will discard N following lines. @c "@c man-ignore-lines begin" discards all following lines @c up to "@c man-ignore-lines end". @c Line blocks of "@menu" "@end menu" will be discarded. @c "@item word words" becomes "\fBword\fR words". @c @b{...}, @command{...}, @dfn{...}, @emph{...}, @strong{...} @c get mapped to \fB...\fR . @c @abbr{...}, @code{...}, @file{...}, @i{...}, @option{...}, @r{...}, @c @ref{...}, @samp{...},@var{...}, get mapped to ... . @c @ref{...}, @xref{...} get mapped to empty text. @c @email{...} gets mapped to <...> . @c Mapped {...} content is subject to the rules except {...} mapping. @c @minus{} will become "-". @c @@ , @{, @} will get stripped of their first @. @c Other lines which begin by "@" will be discarded. @c In lines not stemming from "@c man", "\" becomes "\\" @c "-" which are not preceded by an uneven number of "\" will get @c prepended one "\". @c @c @c man .\" Hey, EMACS: -*- nroff -*- @c man .\" @c man .\" IMPORTANT NOTE: @c man .\" @c man .\" The original of this file is kept in xorriso/xorrecord.texi @c man .\" This here was generated by program xorriso/make_xorriso_1 @c man .\" @c man .\" @c man .\" First parameter, NAME, should be all caps @c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection @c man .\" other parameters are allowed: see man(7), man(1) @c man .TH XORRECORD 1 "Version 1.5.4, Jan 30, 2021" @c man .\" Please adjust this date whenever revising the manpage. @c man .\" @c man .\" Some roff macros, for reference: @c man .\" .nh disable hyphenation @c man .\" .hy enable hyphenation @c man .\" .ad l left justify @c man .\" .ad b justify to both left and right margins @c man .\" .nf disable filling @c man .\" .fi enable filling @c man .\" .br insert line break @c man .\" .sp insert n+1 empty lines @c man .\" for manpage-specific macros, see man(7) @c man .nh @c man-ignore-lines begin @copying xorrecord - Emulation of CD/DVD/BD program cdrecord by program xorriso Copyright @copyright{} 2011 - 2021 Thomas Schmitt @quotation Permission is granted to distribute this text freely. @end quotation @end copying @c man-ignore-lines end @titlepage @title Manual of GNU xorriso personality xorrecord 1.5.4 @author Thomas Schmitt @page @vskip 0pt plus 1filll @insertcopying @end titlepage @contents @ifnottex @node Top @top xorrecord 1.5.4 @c man-ignore-lines 1 @c man .SH NAME xorrecord - Emulation of CD/DVD/BD program cdrecord by program xorriso @end ifnottex @menu * Overview:: Overview * Standards:: MMC, Session, Track, Media types * Drive:: Drive preparation and addressing * Xorriso:: Relation to program xorriso * Options:: Options * Examples:: Examples * Files:: Files * Seealso:: See also * Bugreport:: Reporting bugs * Legal:: Author, Copyright, Credits * CommandIdx:: Alphabetic Command List * ConceptIdx:: Alphabetic List of Concepts and Objects @end menu @node Overview, Standards, Top, Top @chapter Overview @c man .SH SYNOPSIS @c man .B xorrecord @c man [ options ] dev=device [track_source] @c man .br @c man .SH DESCRIPTION @c man .PP @command{xorrecord} writes preformatted data to CD, DVD, and BD media. @* @sp 1 @c man .PP It understands some options of program cdrecord from cdrtools by Joerg Schilling. Its implementation is part of program xorriso which shares no source code with cdrtools, but rather makes use of libburn for communicating with the drive. @* @sp 1 Another, more complete cdrecord emulator is program @strong{cdrskin} which uses the same burn functions as @strong{xorrecord}, but is able to burn audio CDs and to handle CD-TEXT. @c man .SS @node Standards, Drive, Overview, Top @chapter MMC, Session, Track, Media types @c man \fBMMC, Session, Track, Media types:\fR @c man .br @cindex MMC, _definiton @strong{MMC} is a standard out of the SCSI family which defines the interaction between computers and optical drives. Since more than a decade all CD, DVD, or BD recorders obey this standard regardless by what bus cabling they are attached to the computer. libburn relies on this standard compliance and on the capability of the operating system to perform SCSI transactions over the particular bus cabling. @* @cindex Session, _definiton A @strong{Session} is a data region on an optical disc which usually gets written in a single sweep. It contains at least one @cindex Track, _definiton @strong{Track} which is a contiguous string of readable blocks. @command{xorrecord} produces a single session with a single data track which consists of blocks with 2048 bytes each. It chooses the write mode automatically according to media type, medium state, and option -multi. @* On CD media there are other track types, like audio, and particular write modes like TAO and SAO. CD and DVD- media can put more than one track into a session. Some of these features can be addressed by program @strong{cdrskin}. @* @sp 1 @cindex Media types, _definiton MMC describes several recordable @strong{media types} which roughly form two families. @* @cindex Sequentially recordable media, _definiton @strong{Sequentially recordable media} are CD-R, CD-RW, DVD-R, DVD-R DL, DVD-RW, DVD+R, DVD+R DL, BD-R. Except DVD-R DL they can store more than one session if there is still unwritten space and if the previous session was written with option @strong{-multi}. CD-RW and DVD-RW can be blanked in order to be re-usable from scratch. @* @cindex Overwritable media, _definiton @strong{Overwritable media} are DVD-RAM, DVD+RW, formatted DVD-RW, BD-RE. They offer a single session with a single track for random access writing. There is no need to blank overwritable media before re-use. @* DVD-RW media are sold in sequentially recordable state but can be formatted once to become overwritable. See options @strong{blank=format_overwrite} and @strong{blank=deformat}. @* If ISO 9660 filesystems are to be stored on overwritable media, then it is possible to emulate multiple sessions, by using option @strong{--grow_overwriteable_iso}. In this case, the need for blanking before re-use is emulated too. @c man .SS @sp 1 @c man .B Drive preparation and addressing: @node Drive, Xorriso, Standards, Top @chapter Drive preparation and addressing @c man .PP The drives, CD, DVD, or BD burners, are accessed via file addresses which are specific to libburn and the operating system. Those addresses get listed by a run of @command{xorrecord --devices} or @command{xorriso -device_links}. @* On GNU/Linux, FreeBSD, and NetBSD, the user needs rw-permission for the device file. On Solaris, the user needs r-permission and privilege "sys_devices", which is usually gained by running @command{xorrecord} via command pfexec. @* These permissions or privileges are needed already for listing a drive. So it might be necessary to get the overview as superuser or via pfexec. @* @command{xorrecord} does not perform cdrecord option -scanbus and does not accept the addresses of form Bus,Target,Lun which are told by -scanbus. If support for these addresses is necessary, consider to use program cdrskin. @* @sp 1 It is possible to let @command{xorrecord} work on emulated drives. Their addresses begin by prefix "stdio:" followed by a file address. The emulated media behavior depends on the file type. See man xorriso for details. @* If standard output is chosen as emulated drive, then all program result texts, which usually appear on standard output, will get redirected to standard error. @c man .SS @node Xorriso, Options, Drive, Top @chapter Relation to program xorriso @c man \fBRelation to program xorriso:\fR @c man .br @cindex xorriso, mkisofs emulation @command{xorrecord} is actually a command mode of program @strong{xorriso}, which gets entered either by xorriso command "-as cdrecord" or by starting the program by one of the names "xorrecord", "cdrecord", "wodim", or "cdrskin". @* This command mode can be left by argument "@minus{}@minus{}" which leads to generic xorriso command mode. See @strong{man xorriso} for its description. Other than in xorriso command mode, the sequence of the cdrecord emulation options does not matter. All pending actions get performed in a fixed sequence before the program run ends or before cdrecord emulation ends. @c man .SS @node Options, Examples, Xorriso, Top @chapter Options @cindex xorriso, options @c man .br @c man .SH OPTIONS @c man .br @menu * DriveAddr:: Drive addressing * Inquire:: Inquiring drive and media * SetBurn:: Settings for the burn run * Verbose:: Program version and verbosity * NonCdrecord:: Options not compatible to cdrecord @end menu @c man .PP @c man .TP @c man .B Addressing the drive: @node DriveAddr, Inquire, Options, Options @section Addressing the drive @table @asis @sp 1 @c man .TP @item @minus{}@minus{}devices @kindex @minus{}@minus{}devices get list of drives @cindex Drive, get list of, @minus{}@minus{}devices Print the list of accessible CD, DVD, or BD drives to standard output. Drives might be inaccessible if the user lacks of permissions to use them or if the drive is in use by another program. @* Each accessible drive is shown by a line like: @* 0 -dev '/dev/sr0' rwrw-- : 'TSSTcorp' 'CDDVDW SH-S203B' @* The libburn address of this drive is '/dev/sr0'. 'TSSTcorp' is the name of the vendor (in this case: Toshiba Samsung Storage Technologies Corporation), 'CDDVDW SH-S203B' is the model name (in this case: a DVD burner). @* Afterwards end emulation without performing any further drive operation. @c man .TP @item dev=drive_address @kindex dev= address the drive to be used @cindex Drive, address, dev= Set the libburn address of the drive to be used. @* E.g. on GNU/Linux: dev=/dev/sr0 @* E.g. on FreeBSD: dev=/dev/cd0 @* E.g. on NetBSD: dev=/dev/rcd0d @* E.g. on Solaris: dev=/dev/rdsk/c2t2d0s2 @* See also above "Drive preparation and addressing". @* The medium in the drive should not be mounted or be otherwise in use. @* This option will only get into effect if a track source, a blank= option, or a drive inquiry option is given. Else it will lead to a SORRY event and normally cause a non-zero exit value. @end table @c man .TP @c man .B Inquiring drive and media: @node Inquire, SetBurn, DriveAddr, Options @section Inquiring drive and media @table @asis @sp 1 @c man .TP @item -inq @kindex -inq inquire drive identifiers @cindex Drive, inquire identifiers, -inq Print to standard output: vendor, model name, and firmware revision of the drive. @c man .TP @item -checkdrive @kindex -checkdrive inquire drive CD capabilities @cindex Drive, inquire CD capabilities, -checkdrive Print unconditionally that the drive supports burnfree, SAO, and TAO. Also print the output of option -inq. @c man .TP @item -atip @kindex -atip inquire medium state @cindex medium state, inquire, -atip Print the output of -checkdrive, the most capable profile of the medium in the drive, the list of profiles which are supported by the drive, whether it is erasable (i.e. can be blanked), the media manufacturer, and the medium product name. @* Profiles are usage models, which are often tied to a particular media type (e.g. CD-RW), but may also apply to a family of media. E.g. profile CD-ROM applies to all CD media which contain data. @c man .TP @item -toc @kindex -toc inquire medium content @cindex medium content, inquire, -toc Print a table of content of the medium in the drive. The output is not compatible to cdrecord option -toc, but rather the one of @command{xorriso} command -toc. It lists the address, vendor, model name, and firmware revision of the drive. @* About the medium it tells product name and manufacturer, whether there is already content written, and if so, whether the medium is closed or appendable. Appendable media can take another session. The amount of readable and writable data is told. If there are sessions, then their start block address and size is reported. If a session contains an ISO 9660 filesystem, then its Volume Id is reported. If the medium is writable, then the next writable block address is reported. @* If not option @strong{--grow_overwriteable_iso} is given or no ISO 9660 file system is present on the medium, then overwritable media are reported as being blank. This is due to the fact that they can be written from scratch without further preparation, and that MMC does not distinguish between data written by the most previous burn run and older data which have not been overwritten by that burn run. Consequently, these media are reported with 0 readable blocks, although all their writable blocks normally are readable, too. @c man .TP @item -msinfo @kindex -msinfo retrieve multi-session info @cindex multi-session info, retrieve, -msinfo Print the argument text for option -C of programs mkisofs, genisoimage, or xorrisofs. It consists of two numbers separated by a comma. @* The first number tells the first block of the first track of the last recorded session. This is also the address used by default when operating systems mount a medium with e.g. ISO 9660 filesystem. @* The second number tells the next writable address, where @command{xorrecord} will begin to write the next session. @* This option is only valid for written, appendable media. In all other cases it will yield no output text but will abort the program with non-zero exit value. @end table @c man .TP @c man .B Settings for the burn run: @node SetBurn, Verbose, Inquire, Options @section Settings for the burn run @table @asis @c man .PP A burn run requires exactly one track source address argument, which tells from where to read the data which shall be put into the upcoming session. The medium state must be either blank or appendable. @* Track source may be "-" for standard input or the address of a readable file of any type except directories. Nearly all media types accept a track source with unpredictable byte count, like standard input or named pipes. Nevertheless, DVD-R DL and DVD-RW blanked by mode deformat_quickest demand exact in-advance reservation of the track size, so that they either need to be read from a source of predictable length, or need to be accompanied by option @strong{tsize=} or by option @strong{-isosize}. @* Several options expect a size value as argument. A number with a trailing letter "b" or without a trailing letter is a plain byte count. Other trailing letters cause multiplication of the given number by a scaling factor: @* "k" or "K" = 1024 , "m" or "M" = 1024k , "g" or "G" = 1024m , "s" or "S" = 2048 @* E.g. tsize=234567s means a size of 234567 * 2048 = 480393216 bytes. @sp 1 @c man .TP @item blank=mode @kindex blank= make media re-usabable or format media @cindex Media, blank, blank= @cindex Media, make re-usable, blank= @cindex Media, format, blank= Blank a CD-RW or DVD-RW to make it re-usable from scratch. Format a DVD-RW, DVD+RW, DVD-RAM, BD-R, or BD-RE if not yet formatted. @* This operation normally makes any recorded data on the medium unreadable. It is combinable with burning in the same run of @command{xorrecord}, or it may be performed without a track source, leaving the medium empty. @* The mode given with blank= selects the particular behavior: @c man .RS @c man .TP @* @sp 1 as_needed @* Try to make the media ready for writing from scratch. If it needs formatting, then format it. If it is not blank, then try to apply blank=fast. It is a reason to abort if the medium cannot assume thoroughly writeable state, e.g. if it is a non-blank write-once. @* This leaves unformatted DVD-RW in unformatted blank state. To format DVD-RW use blank=format_overwrite. Blank unformatted BD-R stay unformatted. @* (Note: blank=as_needed is not an original cdrecord option.) @c man .TP @* @sp 1 all @* Blank an entire CD-RW or an unformatted DVD-RW. @c man .TP @sp 1 @* fast @* Minimally blank an entire CD-RW or blank an unformatted DVD-RW. @c man .TP @sp 1 @* deformat @* Like blank=all but with the additional ability to blank overwritable DVD-RW. This will destroy their formatting and make them sequentially recordable. @* (Note: blank=deformat is not an original cdrecord options) @c man .TP @sp 1 @* deformat_quickest @* Like blank=deformat but blanking DVD-RW only minimally. This is faster than full blanking but yields media incapable of writing tracks of unpredictable size. Multi-session will not be possible either. @* (Note: blank=deformat_quickest is not an original cdrecord option.) @c man .TP @sp 1 @* format_overwrite @* Format a DVD-RW to "Restricted Overwrite". The user should bring some patience. @* Format unformatted DVD+RW, BD-RE or blank BD-R to their default size. It is not mandatory to do this with DVD+RW and BD-RE media, because they will get formatted automatically on the first write attempt. @* BD-R media may be written in unformatted state. This keeps disabled the replacement of bad blocks and enables full nominal write speed. Once BD-R media are written, they cannot be formatted any more. @* For re-formatting already formatted media or for formatting with non-default size, use program @strong{xorriso} with command @strong{-format}. @* (Note: blank=format_overwrite is not an original cdrecord options) @c man .TP @sp 1 @* help @* Print a short overview of blank modes to standard error output. @* Afterwards end emulation without performing any drive operation. @c man .RE @c man .TP @item -multi @kindex -multi keep media appendable after burn run @cindex Media, keep appendable, -multi This option keeps CD, unformatted DVD-R[W], DVD+R, or BD-R appendable after the current session has been written. Without it the disc gets closed and may not be written any more - unless it is a -RW and gets blanked, which causes loss of its content. @* This option cannot be applied to DVD-R DL or to DVD-RW which were blanked by mode "deformat_quickest". Option --multi_if_possible may automatically recognize and handle this situation. @* In order to have all filesystem content accessible, the eventual ISO-9660 filesystem of a follow-up session needs to be prepared in a special way by the filesystem formatter program. mkisofs, genisoimage, and xorrisofs expect particular info about the situation which can be retrieved by @command{xorrecord} option -msinfo. @* With overwritable DVD or BD media, -multi cannot mark the end of the session. So when adding a new session, this end has to be determined from the payload. Currently only ISO-9660 filesystems can be used that way. See option @strong{--grow_overwriteable_iso}. @c man .TP @item -dummy @kindex -dummy control write simulation @cindex Write simulation , control, -dummy Try to perform the drive operations without actually affecting the inserted media. There is no warranty that this will work with a particular combination of drive and media. Blanking is prevented reliably, though. To avoid inadverted real burning, -dummy refuses burn runs on anything but CD-R[W], DVD-R[W], or emulated stdio-drives. @c man .TP @item -waiti @kindex -waiti access drive only after stdin delivers data @cindex Accessing drive, wait for stdin, -waiti Wait until input data is available at stdin or EOF occurs at stdin. Only then begin to access any drives. @* One should use this if xorrisofs is working at the end of a pipe where the feeder process reads from the drive before it starts writing its output into xorrisofs. Example: @* xorrisofs ... -C 0,12800 -M /dev/sr0 ... | \ @* xorrecord dev=/dev/sr0 ... -waiti - @* This option works even if standard input is not the track source. If no process is piping in, then the Enter key of your terminal will act as trigger for @command{xorrecord}. Note that this input line will not be consumed by cdrskin if standard input is not the track source. It will end up as shell command, usually. @c man .TP @item tsize=size @kindex tsize= set a fixed track size @cindex Track size, set fixed, tsize= Announce the exact size of the track source. This is necessary with DVD-R DL media and with quickest blanked DVD-RW, if the size cannot be determined in advance from the track source. E.g. if it is standard input or a named pipe. @* If the track source does not deliver the predicted amount of bytes, the remainder of the track is padded with zeros. This is not considered an error. If on the other hand the track source delivers more than the announced bytes then the track on media gets truncated to the predicted size and xorrecord exits with non-zero value. @c man .TP @item -isosize @kindex -isosize obtain track size from ISO 9660 superblock @cindex Track size, obtain from ISO 9660, -isosize Try to obtain the track size from the content of the track source. This works only if the track source bears an ISO 9660 filesystem. Any other track source content will cause the burn run to abort. @* If the track source is not a regular file or block device, then this option will work only if the program's fifo size is at least 64k. See option fs=. @c man .TP @item padsize=size @kindex padsize= add bytes to end of track @cindex Padding, at end of track, padsize= Add the given amount of trailing zeros to the upcoming track. This feature can be disabled by size 0. Default is 300 kB in order to work around a problem with GNU/Linux which often fails to read the last few blocks of a CD track which was written in write mode TAO. TAO is used by @command{xorrecord} if the track size cannot be predicted or if the CD medium is not blank but appendable. @c man .TP @item -nopad @kindex -nopad disable adding of bytes to end of track @cindex Padding, disable, -nopad The same as padsize=0. @c man .TP @item -pad @kindex -pad add 15 blocks to end of track @cindex Padding, insufficient old, -pad The same as padsize=15s. This was once sufficient with older GNU/Linux kernels. Meanwhile one should at least use padsize=128k, if not padsize=300k. @c man .TP @item -data @kindex -data explicitly announce a data track @cindex Data track, announce, -data Explicitly announce that the track source shall be recorded as data track, and not as audio track. This option has no effect with @command{xorrecord}, because there is no support for other track formats anyway. @c man .TP @item -tao @kindex -tao explicitly set write type TAO @cindex Write type, TAO, -tao Explicitly demand that write type TAO shall be used for CD, or Incremental for DVD-R. Normally the program will choose the write type according to the given medium state, option -multi, and track source. Demanding it explicitly prevents the start of a write run, if it is not appropriate to the situation. @c man .TP @item -sao @kindex -sao explicitly set write type SAO/DAO @cindex Write type, SAO/DAO, -sao Explicitly demand that write type SAO shall be used for CD, or DAO for DVD-R. This might prevent the write run, if it is not appropriate to the situation. @c man .TP @item -dao @kindex -dao explicitly set write type SAO/DAO @cindex Write type, SAO/DAO, -dao Alias of -sao. @c man .TP @item fs=size @kindex fs= set program fifo size @cindex Fifo, set size, fs= Set the size of the program fifo buffer to the given value rather than the default of 4m. @* The fifo buffers a temporary surplus of track source data in order to provide the drive with a steady stream during times of temporary lack of track source supply. @* Other than cdrecord, xorrecord enables drive buffer underrun protection by default and does not wait with writing until the fifo is full for a first time. On very old CD drives and slow computers, this might cause aborted burn runs. In this case, consider to use program @strong{cdrskin} for CD burning. DVD and BD drives tolerate buffer underrun without problems. @* The larger the fifo, the longer periods of poor source supply can be compensated. But a large fifo can deprive the operating system of read cache for better filesystem performance. @c man .TP @item speed=value @kindex speed= set write speed @cindex Speed, set for writing, speed= Set the write speed. Default is 0 = maximum speed. Speed can be given in media type dependent x-speed numbers or as a desired throughput per second in MMC compliant kB (= 1000) or MB (= 1000 kB). Media x-speed factor can be set explicitly by appending "c" for CD, "d" for DVD, "b" for BD. "x" is optional. @* Example speeds: @* 706k = 706kB/s = 4c = 4xCD @* 5540k = 5540kB/s = 4d = 4xDVD @* If there is no hint about the speed unit attached, then the medium in the drive will decide. Default unit is CD, 1x = 176,400 raw bytes/second. With DVD, 1x = 1,385,000 bytes/second. With BD, 1x = 4,495,625 bytes/second. @* MMC drives usually activate their own idea of speed and take the speed value given by the burn program only as a hint for their own decision. @c man .TP @item minbuf=percentage @kindex minbuf= keep drive buffer hungry @cindex Write, drive buffer, minbuf= Equivalent to: @* modesty_on_drive= @c man .TP @item -immed @kindex -immed keep drive buffer hungry @cindex Write, drive buffer, -immed Equivalent to: @* modesty_on_drive=75 @* In cdrecord, this also controls use of the Immed bit. But xorriso uses Immed where possible and appropriate, unless it is disabled by option use_immed_bit=off . @c man .TP @item -eject @kindex -eject finally eject drive tray @cindex Eject, the tray, -eject @cindex Tray, eject, -eject Eject the drive tray after alll other work is done. @end table @c man .TP @c man .B Program version and verbosity: @node Verbose, NonCdrecord, SetBurn, Options @section Program version and verbosity @table @asis @sp 1 @c man .TP @item -version @kindex -version report emulation and xorriso version @cindex Version, report, -version Print to standard output a line beginning by @* "Cdrecord 2.01-Emulation Copyright" @* and further lines which report the version of xorriso and its supporting libraries. They also state the license under which the program is provided, and disclaim any warranty, to the extent permitted by law. @* Afterwards end emulation without performing any drive operation. @c man .TP @item -v @kindex -v increase program verbosity @cindex Verbosity, increase, -v Increase program verbosity by one level. There are four verbosity levels from nearly silent to debugging verbosity. The both highest levels can be enabled by repeated -v or by -vv or by -vvv. @c man .TP @item -V @kindex -V log SCSI command transactions to stderr @cindex Verbosity, SCSI commands, -V @cindex SCSI commands, log, -V Log SCSI commands and drive replies to standard error. This might be of interest if @strong{xorrecord} and a particular drive or medium do not cooperate as expected, or if you just want to know how libburn interacts with the drive. To understand this extremely verbose log, one needs to read SCSI specs SPC, SBC, and MMC. @* Please do not add such a log to a bug report on the first hand, unless you want to point out a particular deviation from said specs, or if you get asked for this log by a maintainer of @command{xorrecord} who feels in charge for your bug report. @c man .TP @item -help @kindex -help print sparse overview of options @cindex Options, overview, -help Print a sparse list of program options to standard error and declare not to be cdrecord. @* Afterwards end emulation without performing any drive operation. @end table @c man .TP @c man .B Options not compatible to cdrecord: @node NonCdrecord, ExDevices, Verbose, Options @section Options not compatible to cdrecord @table @asis @sp 1 @c man .TP @item @minus{}@minus{}no_rc @kindex @minus{}@minus{}no_rc do not execute xorriso startup files @cindex Startup files, do not execute, @minus{}@minus{}no_rc Only if used as first command line argument this option prevents reading and interpretation of startup files. See section FILES below. @c man .TP @item @minus{}@minus{}drive_not_exclusive @kindex @minus{}@minus{}drive_not_exclusive use drive even if busy @cindex Drive, use even if busy, @minus{}@minus{}drive_not_exclusive This option disables the use of device file locking mechanisms when acquiring the drive. On GNU/Linux the locking is done by open(O_EXCL), on FreeBSD by flock(LOCK_EX). @* Be aware that it can cause problems if you use a drive which is mounted, or opened by some other process, or guarded by /dev/pktcdvd*. Make sure that other users of the drive do not cause drive activities while a xorrecord burn run is going on. @c man .TP @item drive_scsi_dev_family=sr|scd|sg|default @kindex drive_scsi_dev_family= Linux device type to be used @cindex Drive, Linux device type, drive_scsi_dev_family GNU/Linux specific: @* By default, cdrskin tries to map Linux drive addresses to /dev/sr* before they get opened for operating the drive. This coordinates well with other use cases of optical drives, like mount(8). But since year 2010 all /dev/sr* share a global lock which allows only one drive to process an SCSI command while all others have to wait for its completion. This yields awful throughput if more than one drive is writing or reading simultaneously. @* The global lock is not applied to device files /dev/sg* and also not with the system calls read(2), write(2). But ioctl(SG_IO) is affected, which is needed to perform the SCSI commands for optical burning. @* So for simultaneous burn runs on modern GNU/Linux it is advisable to use drive_scsi_dev_family="sg". The drive addresses may then well be given as /dev/sr* but will nevertheless get used as /dev/sg*. @c man .TP @item @minus{}@minus{}grow_overwriteable_iso @kindex @minus{}@minus{}grow_overwriteable_iso emulate ISO 9660 multi-session @cindex Multi-session, emulate ISO 9660, @minus{}@minus{}grow_overwriteable_iso Enable emulation of multi-session writing on overwritable media which contain an ISO 9660 filesystem. This emulation is learned from growisofs -M but adapted to the usage model of @* xorrecord -msinfo @* xorrisofs -C -M | xorrecord -waiti -multi - @* for sequential media. @* --grow_overwriteable_iso does not hamper the use of true multi-session media. I.e. it is possible to use the same @command{xorrecord} options with both kinds of media and to achieve similar results if ISO 9660 filesystem images are to be written. This option implies option -isosize and therefore demands that the track source is a ISO 9660 filesystem image. @* With overwritable media and no option blank=fast|all present it expands an eventual ISO 9660 filesystem on media. It is assumed that this image's inner size description points to the end of the valuable data. Overwritable media with a recognizable ISO 9660 size will be regarded as appendable rather than as blank. I.e. options -msinfo and -toc will work. -toc will always show a single session with its size increasing with every added ISO 9660 image. @c man .TP @item @minus{}@minus{}multi_if_possible @kindex @minus{}@minus{}multi_if_possible apply -multi if medium is suitable @cindex Media, keep appendable, @minus{}@minus{}multi_if_possible Apply option -multi if the medium is suitable. Not suitable are DVD-R DL and DVD-RW, which were blanked with mode "deformat_quickest". @* Not all drives correctly recognize such fast-blanked DVD-RW which need "on". If there is well founded suspicion that a burn run failed due to -multi, then this causes a re-try without -multi. @c man .TP @item stream_recording="on"|"off"|number @kindex stream_recording= try to get full speed on DVD-RAM, BD @cindex Full speed, on DVD-RAM and BD, stream_recording= @cindex Defect management, control, stream_recording= Mode "on" requests that compliance to the desired speed setting is preferred over management of write errors. With DVD-RAM and BD this can bring effective write speed near to the nominal write speed of the media. But it will also disable the automatic use of replacement blocks if write errors occur. It might as well be disliked or ignored by the drive. @* If a number is given, then error management stays enabled for all byte addresses below that number. Any number below 16s is the same as "off". @c man .TP @item dvd_obs="default"|"32k"|"64k" @kindex dvd_obs= set write transaction payload size @cindex Transaction size, set, dvd_obs= Linux specific: Set the number of bytes to be transmitted with each write operation to DVD or BD media. Tracks get padded up to the next multiple of this write size. A number of 64 KB may improve throughput with bus systems which show latency problems. The default depends on media type, option stream_recording=, and on compile time options. @c man .TP @item modesty_on_drive=parameter[:parameters] @kindex -modesty_on_drive keep drive buffer hungry @cindex Write, drive buffer, modesty_on_drive= Control whether the drive buffer shall be kept from getting completely filled. Parameter "on" (or "1") keeps the program from trying to write to the burner drive while its buffer is in danger to be filled over a given limit. If this filling is exceeded then the program will wait until the filling reaches a given low percentage value. @* This can ease the load on operating system and drive controller and thus help with achieving better input bandwidth if disk and burner are not on independent controllers (like hda and hdb). It may also help with simultaneous burns on different burners with Linux kernels like 3.16, if one has reason not to fix the problem by drive_scsi_dev_family="sg". On the other hand it increases the risk of buffer underflow and thus reduced write speed. @* Some burners are not suitable because they report buffer fill with granularity too coarse in size or time, or expect their buffer to be filled to the top before they go to full speed. @* Parameters "off" or "0" disable this feature. @* The threshold for beginning to wait is given by parameter "max_percent=". Parameter "min_percent=" defines the threshold for resuming transmission. Percentages are permissible in the range of 25 to 100. Numbers in this range without a prepended name are interpreted as "on:min_percent=". @* E.g.: modesty_on_drive=75 @* The optimal values depend on the buffer behavior of the drive. @* Parameter "timeout_sec=" defines after which time of unsuccessful waiting the modesty shall be disabled because it does not work. @* Parameter "min_usec=" defines the initial sleeping period in microseconds. If the drive buffer appears to be too full for sending more data, the program will wait the given time and inquire the buffer fill state again. If repeated inquiry shows not enough free space, the sleep time will slowly be increased to what parameter "max_usec=" defines. @* Parameters, which are not mentioned with a modesty_on_drive= option, stay unchanged. Default is: @* modesty_on_drive=off:min_percent=90:max_percent=95: timeout_sec=120:min_usec=5000:max_usec=25000 @c man .TP @item use_immed_bit="on"|"off"|"default" @kindex use_immed_bit= control use of Immed bit @cindex Blank, format, Immed bit, use_immed_bit= Control whether several long lasting SCSI commands shall be executed with the Immed bit, which makes the commands end early while the drive operation is still going on. xorriso then inquires progress indication until the drive reports to be ready again. If this feature is turned off, then blanking and formatting will show no progress indication. @* It may depend on the operating system whether -use_immed_bit is set to "off" by default. @c man .TP @item write_start_address=value @kindex write_start_address= set block address for write start @cindex Write start address, set, write_start_address= Set the block address on overwritable media where to start writing the track. With DVD+RW, DVD-RAM or BD-RE, byte_offset must be aligned to 2 kiB blocks, but better is 32 kiB on DVD and 64 kiB on BD. With formatted DVD-RW 32 kiB alignment is mandatory. @* Other media are not suitable for this option. @c man .TP @item stdio_sync="on"|"off"|number @kindex stdio_sync= control stdio buffer @cindex Write, buffer syncing, stdio_sync= Set the number of bytes after which to force output to emulated stdio: drives. This forcing keeps the memory from being clogged with lots of pending data for slow devices. Default "on" is the same as "16m". Forced output can be disabled by "off". @end table @node Examples, Files, Options, Top @chapter Examples @c man .SH EXAMPLES @c man .SS @c man .B Overview of examples: @c man Get an overview of drives and their addresses @c man .br @c man Get info about a particular drive or loaded media @c man .br @c man Prepare CD-RW or DVD-RW for re-use, BD-R for bad block handling @c man .br @c man Format DVD-RW to avoid need for blanking before re-use @c man .br @c man De-format DVD-RW to make it capable of multi-session again @c man .br @c man Write a single ISO 9660 filesystem image @c man .br @c man Write multiple ISO 9660 sessions @c man .br @c man Write ISO 9660 session on-the-fly @c man .br @c man Write compressed afio archive on-the-fly @c man .br @cindex Examples @menu * ExDevices:: Get an overview of drives and their addresses * ExMedium:: Get info about a particular drive or loaded media * ExBlank:: Prepare CD-RW or DVD-RW for re-use * ExFormat:: Format DVD-RW to avoid need for blanking before re-use * ExDeformat:: De-format DVD-RW to make it capable of multi-session again * ExIsoSingle:: Write a single ISO 9660 filesystem image * ExIsoMulti:: Write multiple ISO 9660 sessions * ExIsoFly:: Write ISO 9660 session on-the-fly * ExAfio:: Write compressed afio archive on-the-fly @end menu @c man .SS @c man .B Get an overview of drives and their addresses: @node ExDevices, ExMedium, NonCdrecord, Examples @section Get an overview of drives and their addresses @sp 1 $ xorrecord --devices @c man .SS @c man .B Get info about a particular drive and loaded media: @node ExMedium, ExBlank, ExDevices, Examples @section Get info about a particular drive and loaded media @sp 1 $ xorrecord dev=/dev/sr0 -atip -toc --grow_overwriteable_iso @c man .SS @c man .B Prepare CD-RW or DVD-RW for re-use: @node ExBlank, ExFormat, ExMedium, Examples @section Prepare CD-RW or DVD-RW for re-use @sp 1 $ xorrecord -v dev=/dev/sr0 blank=as_needed -eject @c man .SS @c man .B Format DVD-RW to avoid need for blanking before re-use: @node ExFormat, ExDeformat, ExBlank, Examples @section Format DVD-RW to avoid need for blanking before re-use @sp 1 $ xorrecord -v dev=/dev/sr0 blank=format_overwrite -eject @* @sp 1 This command may also be used to format BD-R media before first use, in order to enable handling of write errors. Several hundred MB of spare blocks will be reserved and write runs on such media will perform with less than half nominal speed. @c man .SS @c man .B De-format DVD-RW to make it capable of multi-session again: @node ExDeformat, ExIsoSingle, ExFormat, Examples @section De-format DVD-RW to make it capable of multi-session again @sp 1 $ xorrecord -v dev=/dev/sr0 blank=deformat @c man .SS @c man .B Write a single ISO 9660 filesystem image: @node ExIsoSingle, ExIsoMulti, ExDeformat, Examples @section Write a single ISO 9660 filesystem image @sp 1 $ xorrecord -v dev=/dev/sr0 speed=12 fs=8m \ blank=as_needed -eject padsize=300k my_image.iso @c man .SS @c man .B Write multiple ISO 9660 sessions: @node ExIsoMulti, ExIsoFly, ExIsoSingle, Examples @section Write multiple ISO 9660 sessions This is possible with all media except minimally blanked DVD-RW and DVD-R DL, which cannot do multi-session. @* The first session is written like in the previous example, except that option -multi is used. It will contain the files of hard disk directory ./tree1 under the ISO 9660 directory /dir1: @* @sp 1 $ xorrisofs -o image_1.iso -J -graft-points /dir1=./tree1 @* $ xorrecord -v dev=/dev/sr0 speed=12 fs=8m \ @* -multi --grow_overwriteable_iso \ @* blank=as_needed -eject padsize=300k image_1.iso @* @sp 1 For the second session xorrisofs needs to know the -msinfo numbers of the medium. Further it will read data from the medium by using the system's read-only CD-ROM driver. @* Many systems do not take notice of xorrecord's write activities. It is necessary to force their attention by ejecting and reloading the drive tray. Therefore above run uses option -eject. @* Get the -msinfo numbers (and properly reload the tray if it has a motor) by: @* $ m=$(xorrecord dev=/dev/sr0 -msinfo) @* @sp 1 Offer a victim to any problem caused by obtrusive demons after tray loading: @* $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 @* @sp 1 Use the numbers with xorrisofs to add ./tree2 to the image as /dir2: @* @sp 1 $ xorrisofs -M /dev/sr0 -C $m -o image_2.iso \ @* -J -graft-points /dir2=./tree2 @* @sp 1 Now burn the new session onto the same medium. This time without blanking: @* @sp 1 $ xorrecord -v dev=/dev/sr0 speed=12 fs=8m \ @* -multi --grow_overwriteable_iso \ @* -eject padsize=300k image_2.iso @* @sp 1 Operating systems which mount this medium will read the superblock of the second session and show both directories /dir1 and /dir2. @c man .SS @c man .B Write ISO 9660 session on-the-fly: @node ExIsoFly, ExAfio, ExIsoMulti, Examples @section Write ISO 9660 session on-the-fly It is possible to combine the run of @strong{xorrisofs} and @command{xorrecord} in a pipeline without storing the ISO 9660 image as file on hard disk. @* The piped run is more vulnerable to the problem that some systems have not enough patience with automatic tray loading and that demons may interfere with a first CD-ROM driver read attempt from a freshly loaded medium. It is advised to load the tray manually or via a separate run of xorriso with a subsequent run of dd. @* Again, xorriso has the patience and dd is a dispensable victim for demons. @* @sp 1 $ m=$(xorrecord dev=/dev/sr0 -msinfo) @* @sp 1 $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 @* @sp 1 $ xorrisofs -M /dev/sr0 -C $m \ @* -J -graft-points /dir2=./tree2 \ @* | xorrecord -v dev=/dev/sr0 speed=12 fs=8m \ @* -waiti -multi --grow_overwriteable_iso \ @* -eject padsize=300k - @* @sp 1 This is also the main use case of program @strong{xorriso} itself, where the run would need no system workarounds and simply look like: @* @sp 1 $ xorriso -dev /dev/sr0 -joliet on -speed 12 -fs 8m \ @* -map ./tree2 /dir2 -commit_eject all @c man .SS @c man .B Write compressed afio archive on-the-fly: @node ExAfio, , ExIsoFly, Examples @section Write compressed afio archive on-the-fly This is possible with all media except minimally blanked DVD-RW and DVD-R DL. Since the compressed output stream is of very variable speed, a larger fifo is advised. Nevertheless, this example is not suitable for very old CD drives which have no underrun protection and thus would abort the burn run on temporary data shortage. @* @sp 1 $ find . | afio -oZ - | \ @* xorrecord -v dev=/dev/sr0 speed=12 fs=64m \ @* -multi padsize=300k - @* @sp 1 afio archives do not contain references to absolute data block addresses. So they need no special precautions for multi-session. One may get the session start addresses by option -toc, and then use dd option skip= to begin reading at one of those addresses. E.g. for listing its content: @* @sp 1 $ dd if=/dev/sr0 bs=2048 skip=64046 | afio -tvZ - @* @sp 1 afio will know when the end of the archive is reached. @c man .SH FILES @node Files, Seealso, Examples, Top @chapter Files @c man .SS @c man .B Startup files: @section Startup Files @* If not --no_rc is given as the first argument then @command{xorrecord} attempts on startup to read and execute lines from the following files: @* @sp 1 /etc/default/xorriso @* /etc/opt/xorriso/rc @* /etc/xorriso/xorriso.conf @* $HOME/.xorrisorc @* @sp 1 The files are read in the sequence given here, but none of them is required to exist. The lines are not interpreted as @command{xorrecord} options but as generic @strong{xorriso} commands. See man xorriso. @c man .SH SEE ALSO @c man .TP @c man For generic xorriso command mode @c man .BR xorriso(1) @c man .TP @c man Formatting track sources for xorrecord: @c man .BR xorrisofs(1), @c man .BR mkisofs(8), @c man .BR genisoimage(8), @c man .BR afio(1), @c man .BR star(1) @c man .TP @c man Other programs which burn sessions to optical media @c man .BR growisofs(1), @c man .BR cdrecord(1), @c man .BR wodim(1), @c man .BR cdrskin(1) @c man-ignore-lines begin @node Seealso, Bugreport, Files, Top @chapter See also @table @asis @item For generic xorriso command mode xorriso(1) @item Formatting track sources for xorrecord xorrisofs(1), mkisofs(8), genisoimage(1), afio(1), star(1) @item Other programs which burn sessions to optical media growisofs(1), cdrecord(1), wodim(1), cdrskin(1) @end table @c man-ignore-lines end @c man .SH BUGS @node Bugreport, Legal, Seealso, Top @chapter Reporting bugs @cindex Bugs, reporting @cindex Problems, reporting To report bugs, request help, or suggest enhancements for @command{xorriso}, please send electronic mail to the public list @email{bug-xorriso@@gnu.org}. If more privacy is desired, mail to @email{scdbackup@@gmx.net}. @* @sp 1 Please describe what you expect @command{xorriso} to do, the program arguments or dialog commands by which you tried to achieve it, the messages of @command{xorriso}, and the undesirable outcome of your program run. @* @sp 1 Expect to get asked more questions before solutions can be proposed. @c man .SH AUTHOR @node Legal, CommandIdx, Bugreport, Top @chapter Author, Copyright, Credits @section Author Thomas Schmitt @* for libburnia-project.org @c man .SH COPYRIGHT @section Copyright Copyright (c) 2011 - 2021 Thomas Schmitt @* Permission is granted to distribute this text freely. It shall only be modified in sync with the technical properties of xorriso. If you make use of the license to derive modified versions of xorriso then you are entitled to modify this text under that same license. @c man .SH CREDITS @section Credits @command{xorriso} is in part based on work by Vreixo Formoso who provides libisofs together with Mario Danic who also leads the libburnia team. Thanks to Andy Polyakov who invented emulated growing, to Derek Foreman and Ben Jansens who once founded libburn. @* Compliments towards Joerg Schilling whose cdrtools served me for ten years. @c man-ignore-lines begin @node CommandIdx, ConceptIdx, Legal, Top @chapter Alphabetic Command List @printindex ky @node ConceptIdx,, CommandIdx, Top @chapter Alphabetic List of Concepts and Objects @printindex cp @c man-ignore-lines end @bye libisoburn-1.5.4/xorriso/aux_objects.h0000644000175700017510000001472013701321754015015 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2010 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of classes: - SplitparT which represents byte intervals of data files. - DirseQ which crawls along a directory's content list. - ExclusionS which manages the list of excluded file paths and leaf patterns. - Xorriso_lsT which provides a generic double-linked list. - LinkiteM, PermiteM which temporarily record relations and states. */ #ifndef Xorriso_pvt_auxobj_includeD #define Xorriso_pvt_auxobj_includeD yes struct SplitparT; int Splitparts_new(struct SplitparT **o, int count, int flag); int Splitparts_destroy(struct SplitparT **o, int count, int flag); int Splitparts_set(struct SplitparT *o, int idx, char *name, int partno, int total_parts, off_t offset, off_t bytes, off_t total_bytes, int flag); int Splitparts_get(struct SplitparT *o, int idx, char **name, int *partno, int *total_parts, off_t *offset, off_t *bytes, off_t *total_bytes, int flag); int Splitpart__parse(char *name, int *partno, int *total_parts, off_t *offset, off_t *bytes, off_t *total_bytes, int flag); int Splitpart__is_part_path(char *path, int flag); int Splitpart__compose(char *adr, int partno, int total_parts, off_t offset, off_t bytes, off_t total_bytes, int flag); int Splitpart__read_next_num(char *base_pt, char **next_pt, off_t *num, int flag); int Splitparts_sort(struct SplitparT *o, int count, int flag); struct DirseQ; int Dirseq_new(struct DirseQ **o, char *adr, int flag); int Dirseq_destroy(struct DirseQ **o, int flag); int Dirseq_next_adr(struct DirseQ *o, char reply[SfileadrL], int flag); int Dirseq_rewind(struct DirseQ *o, int flag); struct Xorriso_lsT { char *text; struct Xorriso_lsT *prev,*next; }; /** Create a new list item with arbitrary byte content. @param lstring The newly created object or NULL on failure @param data An array of bytes to be copied into the new object @param data_len Number of bytes to be copied @param link Xorriso_lsT object to which the new object shall be linked @param flag Bitfield for control purposes bit0= insert before link rather than after it bit1= do not copy data (e.g. because *data is invalid) bit2= attach data directly by pointer rather than by copying @return <=0 error, 1 ok */ int Xorriso_lst_new_binary(struct Xorriso_lsT **lstring, char *data, int data_len, struct Xorriso_lsT *link, int flag); /** Create a new list item with a 0-terminated text as content. @param lstring The newly created object or NULL on failure @param text A 0-terminated array of bytes @param link Xorriso_lsT object to which the new object shall be linked @param flag see Xorriso_lst_new_binary @return <=0 error, 1 ok */ int Xorriso_lst_new(struct Xorriso_lsT **lstring, char *text, struct Xorriso_lsT *link, int flag); /** Create a new list item at the end of a given list. @param entry Contains as input a pointer to a pointer to any existing list item. As output this list item pointer may be changed to the address of the new list item: if ((*entry == 0) || (flag & 1)) @param data An array of bytes to be copied into the new object @param data_len Number of bytes to be copied @param flag Bitfield for control purposes bit0= Return new object address in *entry bit1= do not copy data (e.g. because *data is invalid) bit2= attach data directly by pointer rather than by copying @return <=0 error, 1 ok */ int Xorriso_lst_append_binary(struct Xorriso_lsT **entry, char *data, int data_len, int flag); /** Destroy a single list item and connect its eventual list neighbors. @param lstring pointer to the pointer to be freed and set to NULL @param flag unused yet, submit 0 @return 0= *lstring was already NULL, 1= ok */ int Xorriso_lst_destroy(struct Xorriso_lsT **lstring, int flag); struct Xorriso_lsT *Xorriso_lst_get_next(struct Xorriso_lsT *entry, int flag); struct Xorriso_lsT *Xorriso_lst_get_prev(struct Xorriso_lsT *entry, int flag); char *Xorriso_lst_get_text(struct Xorriso_lsT *entry, int flag); int Xorriso_lst_detach_text(struct Xorriso_lsT *entry, int flag); int Xorriso_lst_get_last(struct Xorriso_lsT *entry, struct Xorriso_lsT **last, int flag); int Xorriso_lst_concat(struct Xorriso_lsT *first, struct Xorriso_lsT *second, int flag); int Exclusions_new(struct ExclusionS **o, int flag); int Exclusions_destroy(struct ExclusionS **o, int flag); int Exclusions_get_descrs(struct ExclusionS *o, struct Xorriso_lsT **not_paths_descr, struct Xorriso_lsT **not_leafs_descr, int flag); /* @param flag bit0= whole subtree is banned with -not_paths @return 0=no match , 1=not_paths , 2=not_leafs, <0=error */ int Exclusions_match(struct ExclusionS *o, char *abs_path, int flag); int Exclusions_add_not_leafs(struct ExclusionS *o, char *not_leafs_descr, regex_t *re, int flag); int Exclusions_add_not_paths(struct ExclusionS *o, int descrc, char **descrs, int pathc, char **paths, int flag); struct LinkiteM; /* Trace of hops during symbolic link resolution */ int Linkitem_new(struct LinkiteM **o, char *link_path, dev_t target_dev, ino_t target_ino, struct LinkiteM *next, int flag); int Linkitem_destroy(struct LinkiteM **o, int flag); int Linkitem_reset_stack(struct LinkiteM **o, struct LinkiteM *to, int flag); int Linkitem_find(struct LinkiteM *stack, dev_t target_dev, ino_t target_ino, struct LinkiteM **result, int flag); int Linkitem_get_link_count(struct LinkiteM *item, int flag); struct PermiteM; /* Stack of temporarily altered access permissions */ int Permstack_push(struct PermiteM **o, char *disk_path, struct stat *stbuf, int flag); int Permstack_pop(struct PermiteM **o, struct PermiteM *stopper, struct XorrisO *xorriso, int flag); #endif /* ! Xorriso_pvt_auxobj_includeD */ libisoburn-1.5.4/xorriso/xorriso.texi0000644000175700017510000114267714005265731014754 00000000000000\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename xorriso.info @settitle GNU xorriso 1.5.4 @c %**end of header @c @c man-ignore-lines begin @dircategory Archiving @direntry * Xorriso: (xorriso). Burns ISO 9660 on CD, DVD, BD. @end direntry @c man-ignore-lines end @c @c Notes about embedded man page: @c This texinfo code contains the necessary info to produce a man page @c which resembles much the version of xorriso.1 from which this code @c was originally derived in march 2010. @c One can produce the man page by applying the following rules: @c The first line gets discarded. @c Line start "@c man " will become "", the remainder is put out unaltered. @c Lines "@*" will be converted to ".br" @c "@c man-ignore-lines N" will discard N following lines. @c "@c man-ignore-lines begin" discards all following lines @c up to "@c man-ignore-lines end". @c Line blocks of "@menu" "@end menu" will be discarded. @c "@item word words" becomes "\fBword\fR words". @c @b{...}, @command{...}, @dfn{...}, @emph{...}, @strong{...} @c get mapped to \fB...\fR . @c @abbr{...}, @code{...}, @file{...}, @i{...}, @option{...}, @r{...}, @c @ref{...}, @samp{...},@var{...}, get mapped to ... . @c @ref{...}, @xref{...} get mapped to empty text. @c @email{...} gets mapped to <...> . @c Mapped {...} content is subject to the rules except {...} mapping. @c @minus{} will become "-". @c @@ , @{, @} will get stripped of their first @. @c Other lines which begin by "@" will be discarded. @c In lines not stemming from "@c man", "\" becomes "\\" @c "-" which are not preceded by an uneven number of "\" will get @c prepended one "\". @c @c @c man .\" Hey, EMACS: -*- nroff -*- @c man .\" @c man .\" IMPORTANT NOTE: @c man .\" @c man .\" The original of this file is kept in xorriso/xorriso.texi @c man .\" This here was generated by program xorriso/make_xorriso_1 @c man .\" @c man .\" @c man .\" First parameter, NAME, should be all caps @c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection @c man .\" other parameters are allowed: see man(7), man(1) @c man .TH XORRISO 1 "Version 1.5.4, Jan 30, 2021" @c man .\" Please adjust this date whenever revising the manpage. @c man .\" @c man .\" Some roff macros, for reference: @c man .\" .nh disable hyphenation @c man .\" .hy enable hyphenation @c man .\" .ad l left justify @c man .\" .ad b justify to both left and right margins @c man .\" .nf disable filling @c man .\" .fi enable filling @c man .\" .br insert line break @c man .\" .sp insert n+1 empty lines @c man .\" for manpage-specific macros, see man(7) @c man .nh @c man-ignore-lines begin @copying xorriso - creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. Copyright @copyright{} 2007 - 2021 Thomas Schmitt @quotation Permission is granted to distribute this text freely. @end quotation @end copying @c man-ignore-lines end @titlepage @title Manual of GNU xorriso 1.5.4 @author Thomas Schmitt @page @vskip 0pt plus 1filll @insertcopying @end titlepage @contents @ifnottex @node Top @top GNU xorriso 1.5.4 @c man-ignore-lines 1 @c man .SH NAME xorriso - creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. @end ifnottex @menu * Overview:: Overview * Model:: Session model * Media:: Media types and states * Methods:: Creating, Growing, Modifying, Blind Growing * Drives:: Libburn drives * Extras:: Rock Ridge, POSIX, X/Open, El Torito, ACL, xattr * Processing:: Command processing * Dialog:: Dialog, Readline, Result pager * Commands:: Reference of commands * Examples:: Examples * Files:: Files * Environ:: Environment * Seealso:: See also * Bugreport:: Reporting bugs * Legal:: Author, Copyright, Credits * CommandIdx:: Alphabetic Command List * ConceptIdx:: Alphabetic List of Concepts and Objects @end menu @node Overview, Model, Top, Top @chapter Overview @c man .SH SYNOPSIS @c man .B xorriso @c man .RI [ settings | actions ] @c man .br @c man .SH DESCRIPTION @c man .PP @command{xorriso} is a program which copies file objects from POSIX compliant filesystems into Rock Ridge enhanced ISO 9660 filesystems and performs session-wise manipulation of such filesystems. It can load the management information of existing ISO images and it writes the session results to optical media or to filesystem objects. @* Vice versa @command{xorriso} is able to copy file objects out of ISO 9660 filesystems. @c man .PP @sp 1 A special property of @command{xorriso} is that it needs neither an external ISO 9660 formatter program nor an external burn program for CD, DVD or BD but rather incorporates the libraries of libburnia-project.org . @c man .SS @section Features @c man .B Overview of features: @* Operates on an existing ISO image or creates a new one. @* Copies files from disk filesystem into the ISO image. @* Copies files from ISO image to disk filesystem (see osirrox). @* Renames or deletes file objects in the ISO image. @* Changes file properties in the ISO image. @* Updates ISO subtrees incrementally to match given disk subtrees. @* Writes result either as completely new image or as add-on session to optical media or filesystem objects. @* Can activate ISOLINUX and GRUB boot images via El Torito and MBR. @* Can perform multi-session tasks as emulation of mkisofs and cdrecord. @* Can record and restore hard links and ACL. @* Content may get zisofs compressed or filtered by external processes. @* Can issue commands to mount older sessions on GNU/Linux or FreeBSD. @* Can check media for damages and copy readable blocks to disk. @* Can attach MD5 checksums to each data file and the whole session. @* Scans for optical drives, blanks re-usable optical media. @* Reads its instructions from command line arguments, dialog, and files. @* Provides navigation commands for interactive ISO image manipulation. @* Adjustable thresholds for abort, exit value, and problem reporting. @* @sp 1 @c man .sp 1 Note that @command{xorriso} does not write audio CDs and that it does not produce UDF filesystems which are specified for official video DVD or BD. @c man .SS @c man .B General information paragraphs: @c man .br @c man Session model @c man .br @c man Media types and states @c man .br @c man Creating, Growing, Modifying, Blind Growing @c man .br @c man Libburn drives @c man .br @c man Rock Ridge, POSIX, X/Open, El Torito, ACL, xattr @c man .br @c man Command processing @c man .br @c man Dialog, Readline, Result pager @c man .sp 1 @c man Maybe you first want to have a look at section EXAMPLES near the end of @c man this text before reading the next few hundred lines of background information. @c man .SS @node Model, Media, Overview, Top @chapter Session model @c man \fBSession model:\fR @c man .br @cindex Session, _definition @cindex ISO 9660, _definition @cindex ECMA-119, _definition Unlike other filesystems, @strong{ISO 9660} (aka @strong{ECMA-119}) is not intended for read-write operation but rather for being generated in a single sweep and being written to media as a @strong{session}. @* @cindex Image, _definition The data content of the session is called filesystem @strong{image}. @c man .PP @sp 1 The written image in its session can then be mounted by the operating system for being used read-only. GNU/Linux is able to mount ISO images from block devices, which may represent optical media, other media or via a loop device even from regular disk files. FreeBSD mounts ISO images from devices that represent arbitrary media or from regular disk files. @c man .PP @sp 1 @cindex Multi-session, _definition This session usage model has been extended on CD media by the concept of @strong{multi-session} , which adds information to the CD and gives the mount programs of the operating systems the addresses of the entry points of each session. The mount programs recognize block devices which represent CD media and will by default mount the image in the last session. @* This session usually contains an updated directory tree for the whole medium which governs the data contents in all recorded sessions. So in the view of the mount program all sessions of a particular medium together form a single filesystem image. @* Adding a session to an existing ISO image is in this text referred as @strong{growing}. @* The multi-session model of the MMC standard does not apply to all media types. But program growisofs by Andy Polyakov showed how to extend this functionality to overwritable media or disk files which carry valid ISO 9660 filesystems. @c man .PP @sp 1 @command{xorriso} provides growing as well as an own method named @strong{modifying} which produces a completely new ISO image from the old one and the modifications. See paragraph Creating, Growing, Modifying, Blind Growing below. @c man .PP @sp 1 @command{xorriso} adopts the concept of multi-session by loading an image directory tree if present, by offering to manipulate it by several actions, and by writing the new image to the target medium. @c man .br The first session of a @command{xorriso} run begins by the definition of the input drive with the ISO image or by the definition of an output drive. The session ends by command -commit which triggers writing. A -commit is done automatically when the program ends regularly. @c man .PP @sp 1 After -commit a new session begins with the freshly written one as input. A new input drive can only be chosen as long as the loaded ISO image was not altered. Pending alteration can be revoked by command -rollback. @c man .PP @sp 1 Writing a session to the target is supposed to be very expensive in terms of time and of consumed space on appendable or write-once media. Therefore all intended manipulations of a particular ISO image should be done in a single session. But in principle it is possible to store intermediate states and to continue with image manipulations. @c man .SS @node Media, Methods, Model, Top @chapter Media types and states @c man .B Media types and states: There are two families of media in the MMC standard: @* @cindex Multi-session media, _definition @strong{Multi-session media} are CD-R, CD-RW, DVD-R, DVD+R, DVD+R/DL, BD-R, and unformatted DVD-RW. These media provide a table of content which describes their existing sessions. See command @strong{-toc}. @* Similar to multi-session media are DVD-R DL and minimally blanked DVD-RW. They record only a single session of which the size must be known in advance. @command{xorriso} will write onto them only if command -close is set to "on". @* @cindex Overwritable media, _definition @strong{Overwritable media} are DVD-RAM, DVD+RW, BD-RE, and formatted DVD-RW. They offer random write access but do not provide information about their session history. If they contain one or more ISO 9660 sessions and if the first session was written by @command{xorriso}, then a table of content can be emulated. Else only a single overall session will be visible. @* DVD-RW media can be formatted by -format "full". They can be made unformatted by -blank "deformat". @* Regular files and block devices are handled as overwritable media. Pipes and other writeable file types are handled as blank multi-session media. @c man .PP @sp 1 These media can assume several states in which they offer different capabilities. @* @sp 1 @cindex Blank media, _definition @strong{Blank} media can be written from scratch. They contain no ISO image suitable for @command{xorriso}. @* Blank is the state of newly purchased optical media. With used CD-RW and DVD-RW it can be achieved by action -blank "as_needed". Overwritable media are considered blank if they are new or if they have been marked as blank by @command{xorriso}. Action -blank "as_needed" can be used to do this marking on overwritable media, or to apply mandatory formatting to new media if necessary. @* @sp 1 @cindex Appendable media, _definition @strong{Appendable} media accept further sessions. Either they are MMC multi-session media in appendable state, or they are overwritable media which contain an ISO image suitable for @command{xorriso}. @* Appendable is the state after writing a session with command -close off. @* @sp 1 @cindex Closed media, _definition @strong{Closed} media cannot be written. They may contain an ISO image suitable for @command{xorriso}. @* Closed is the state of DVD-ROM media and of multi-session media which were written with command -close on. If the drive is read-only hardware then it will probably show any media as closed CD-ROM or DVD-ROM. @* Overwritable media assume this state in such read-only drives or if they contain unrecognizable data in the first 32 data blocks. @* Read-only drives may or may not show session histories of multi-session media. Often only the first and the last session are visible. Sometimes not even that. Command -rom_toc_scan might or might not help in such cases. @c man .SS @node Methods, Drives, Media, Top @chapter Creating, Growing, Modifying, Blind Growing: @c man .B Creating, Growing, Modifying, Blind Growing: @* @cindex Create, new ISO image, _definition A new empty ISO image gets @strong{created} if there is no input drive with a valid ISO 9660 image when the first time an output drive is defined. This is achieved by command -dev on blank media or by command -outdev on media in any state. @* The new empty image can be populated with directories and files. Before it can be written, the medium in the output drive must get into blank state if it was not blank already. @c man .PP @sp 1 If there is a input drive with a valid ISO image, then this image gets loaded as foundation for manipulations and extension. The constellation of input and output drive determines which write method will be used. They have quite different capabilities and constraints. @c man .PP @sp 1 @cindex Growing, _definition The method of @strong{growing} adds new data to the existing data on the medium. These data comprise of new file content and they override the existing ISO 9660 + Rock Ridge directory tree. It is possible to hide files from previous sessions but they still exist on the medium and with many types of optical media it is quite easy to recover them by mounting older sessions. @* Growing is achieved by command -dev. @c man .PP @sp 1 @cindex Modifying, _definition The write method of @strong{modifying} produces compact filesystem images with no outdated files or directory trees. Modifying can write its images to target media which are completely unsuitable for multi-session operations. E.g. DVD-RW which were treated with -blank deformat_quickest, DVD-R DL, named pipes, character devices, sockets. On the other hand modified sessions cannot be written to appendable media but to blank media only. @* So for this method one needs either two optical drives or has to work with filesystem objects as source and/or target medium. @* Modifying takes place if input drive and output drive are not the same and if command -grow_blindly is set to its default "off". This is achieved by commands -indev and -outdev. @c man .PP @sp 1 @cindex Blind growing, _definition If command -grow_blindly is set to a non-negative number and if -indev and -outdev are both set to different drives, then @strong{blind growing} is performed. It produces an add-on session which is ready for being written to the given block address. This is the usage model of @* mkisofs -M $indev -C $msc1,$msc2 -o $outdev @* which gives much room for wrong parameter combinations and should thus only be employed if a strict distinction between ISO formatter @command{xorriso} and the burn program is desired. -C $msc1,$msc2 is equivalent to: @* -load sbsector $msc1 -grow_blindly $msc2 @c man .SS @node Drives, Extras, Methods, Top @chapter Libburn drives @c man .B Libburn drives: @c man .br @cindex Drive, _definition Input drive, i.e. source of an existing or empty ISO image, can be any random access readable libburn drive: optical media with readable data, blank optical media, regular files, block devices. @* Output drive, i.e. target for writing, can be any libburn drive. Some drive types do not support the method of growing but only the methods of modifying and blind growing. They all are suitable for newly created images. @c man .PP @sp 1 All drive file objects have to offer rw-permission to the user of @command{xorriso}. Even those which will not be usable for reading an ISO image. @* @cindex LBA, _definition With any type of drive object, the data are considered to be organized in blocks of 2 KiB. Access happens in terms of Logical Block Address (@strong{LBA}) which gives the number of a particular data block. @c man .PP @sp 1 MMC compliant (i.e. optical) drives on GNU/Linux usually get addressed by the path of their block device or of their generic character device. E.g. @* -dev /dev/sr0 @* -dev /dev/hdc @* -dev /dev/sg2 @* By default xorriso will try to map the given address to /dev/hd* and /dev/sr*. The command -scsi_dev_family can redirect the mapping from sr to scd or sg. The latter does not suffer from the concurrency problems which plague /dev/sr of Linux kernels since version 3. But it does not yield the same addresses which are used by mount(8) or by open(2) for read(2). @* On FreeBSD the device files have names like @* -dev /dev/cd0 @* On NetBSD: @* -dev /dev/rcd0d @* On OpenSolaris: @* -dev /dev/rdsk/c4t0d0s2 @* Get a list of accessible drives by command @* -device_links @* It might be necessary to do this as @strong{superuser} in order to see all drives and to then allow rw-access for the intended users. Consider to bundle the authorized users in a group like old "floppy". @c man .PP @sp 1 Filesystem objects of nearly any type can be addressed by prefix "stdio:" and their path in the filesystem. E.g.: @* -dev stdio:/dev/sdc @* The default setting of -drive_class allows the user to address files outside the /dev tree without that prefix. E.g.: @* -dev /tmp/pseudo_drive @* If path leads to a regular file or to a block device then the emulated drive is random access readable and can be used for the method of growing if it already contains a valid ISO 9660 image. Any other file type is not readable via "stdio:" and can only be used as target for the method of modifying or blind growing. Non-existing paths in existing directories are handled as empty regular files. @c man .PP @sp 1 A very special kind of pseudo drive are open file descriptors. They are depicted by "stdio:/dev/fd/" and descriptor number (see man 2 open). @* Addresses "-" or "stdio:/dev/fd/1" depict standard output, which normally is the output channel for result texts. To prevent a fatal intermingling of ISO image and text messages, all result texts get redirected to stderr if -*dev "-" or "stdio:/dev/fd/1" is among the start arguments of the program. @* Standard output is currently suitable for creating one session per program run without dialog. Use in other situations is discouraged and several restrictions apply: @* It is not allowed to use standard output as pseudo drive if it was not among the start arguments. Do not try to fool this ban via backdoor addresses to stdout. @* If stdout is used as drive, then -use_readline is permanently disabled. Use of backdoors can cause severe memory and/or tty corruption. @c man .PP @sp 1 Be aware that especially the superuser can write into any accessible file or device by using its path with the "stdio:" prefix. By default any address in the /dev tree without prefix "stdio:" will work only if it leads to a MMC drive. @* One may use command @strong{-ban_stdio_write} to surely prevent this risk and to restrict drive usage to MMC drives. @* One may prepend "mmc:" to a path to surely disallow any automatic "stdio:". @c man .br By command -drive_class one may ban certain paths or allow access without prefix "stdio:" to other paths. @c man .SS @node Extras, Processing, Drives, Top @chapter Rock Ridge, POSIX, X/Open, El Torito, ACL, xattr @c man .B Rock Ridge, POSIX, X/Open, El Torito, ACL, xattr: @c man .br @cindex Rock Ridge, _definition @strong{Rock Ridge} is the name of a set of additional information which enhance an ISO 9660 filesystem so that it can represent a POSIX compliant filesystem with ownership, access permissions, symbolic links, and other attributes. @* This is what @command{xorriso} uses for a decent representation of the disk files within the ISO image. @command{xorriso} produces Rock Ridge information by default. It is strongly discouraged to disable this feature. @c man .PP @sp 1 @command{xorriso} is not named "porriso" because POSIX only guarantees 14 characters of filename length. It is the X/Open System Interface standard XSI which demands a file name length of up to 255 characters and paths of up to 1024 characters. Rock Ridge fulfills this demand. @c man .PP @sp 1 @cindex El Torito, _definition An @strong{El Torito} boot record points the BIOS bootstrapping facility to one or more boot images, which are binary program files stored in the ISO image. The content of the boot image files is not in the scope of El Torito. @* Most bootable GNU/Linux CDs are equipped with ISOLINUX or GRUB boot images. @command{xorriso} is able to create or maintain an El Torito object which makes such an image bootable. For details see command -boot_image. @* @cindex MBR, _definition It is possible to make ISO images bootable from USB stick or other hard-disk-like media. Several options install a @strong{MBR} (Master Boot Record), It may get adjusted according to the needs of the intended boot firmware and the involved boot loaders, e.g. GRUB2 or ISOLINUX. A MBR contains boot code and a partition table. The new MBR of a follow-up session can get in effect only on overwritable media. @* MBR is read by PC-BIOS when booting from USB stick or hard disk, and by PowerPC CHRP or PReP when booting. An MBR partition with type 0xee indicates the presence of GPT. @* Emulation -as mkisofs supports the example options out of the ISOLINUX wiki, the options used in GRUB script grub-mkrescue, and the example in the FreeBSD AvgLiveCD wiki. @* @cindex GPT, _definition A @strong{GPT} (GUID Partition Table) marks partitions in a more modern way. It is read by EFI when booting from USB stick or hard disk, and may be used for finding and mounting a HFS+ partition inside the ISO image. @* @cindex APM, _definition An @strong{APM} (Apple Partition Map) marks the HFS+ partition. It is read by Macs for booting and for mounting. @* MBR, GPT and APM are combinable. APM occupies the first 8 bytes of MBR boot code. All three do not hamper El Torito booting from CDROM. @* There is support for further facilities: MIPS Big Endian (SGI), MIPS Little Endian (DEC), SUN SPARC, HP-PA. Those are mutually not combinable and also not combinable with MBR, GPT, or APM. @* @c man .PP @sp 1 @cindex ACL, _definition @strong{ACL} are an advanced way of controlling access permissions to file objects. Neither ISO 9660 nor Rock Ridge specify a way to record ACLs. So libisofs has introduced a standard conformant extension named AAIP for that purpose. It uses this extension if enabled by command @strong{-acl}. @* AAIP enhanced images are supposed to be mountable normally, but one cannot expect that the mounted filesystem will show and respect the ACLs. For now, only @command{xorriso} is able to retrieve those ACLs. It can bring them into effect when files get restored to an ACL enabled file system or it can print them in a format suitable for tool setfacl. @* Files with ACL show as group permissions the setting of entry "mask::" if that entry exists. Nevertheless the non-listed group members get handled according to entry "group::". When removing ACL from a file, @command{xorriso} brings "group::" into effect. @* Recording and restoring of ACLs from and to local files works currently only on GNU/Linux and FreeBSD. @c man .PP @sp 1 @cindex xattr, _definition @cindex EA, _definition @cindex extattr, _definition @strong{xattr} (aka EA, or extattr) are pairs of name and value which can be attached to file objects. AAIP is able to represent them and @command{xorriso} can record and restore them. @* But be aware that pairs with names of non-user namespaces are not necessarily portable between operating systems and not even between filesystems. Only those which begin with "user.", like "user.x" or "user.whatever", can unconditionally be expected to be appropriate on other machines and disks. Processing of other xattr may need administrator privileges. @* Name has to be a 0 terminated string. Value may be any array of bytes which does not exceed the size of 4095 bytes. xattr processing happens only if it is enabled by command @strong{-xattr}. @* As with ACL, currently only @command{xorriso} is able to retrieve xattr from AAIP enhanced images, to restore them to xattr capable file systems, or to print them. @* Recording and restoring of xattr from and to local files works currently only on GNU/Linux and FreeBSD, where they are known as extattr. @c man .SS @node Processing, Dialog, Extras, Top @chapter Command processing @c man .B Command processing: @c man .br Commands are either actions which happen immediately or settings which influence following actions. So their sequence does matter, unless they are given as program arguments and command @strong{-x} is among them. @* @cindex List delimiter, _definition Commands consist of a command word, followed by zero or more parameter words. If the list of parameter words is of variable length (indicated by "[...]" or "[***]") then it must be terminated by either the @strong{list delimiter}, occur at the end of the argument list, or occur at the end of an input line. @c man .PP @sp 1 At program start the list delimiter is the string "@minus{}@minus{}". This may be changed with the -list_delimiter command in order to allow "@minus{}@minus{}" as parameter in a variable length list. However, it is advised to reset the delimiter to "@minus{}@minus{}" immediately afterwards. @* For brevity the list delimiter is referred as "@minus{}@minus{}" throughout this text. @* The list delimiter is silently ignored if it appears after the parameters of a command with a fixed list length. It is handled as normal text if it appears among the parameters of such a command. @c man .PP @sp 1 @cindex Pattern expansion, _definition @strong{Pattern expansion} converts a list of pattern words into a list of existing file addresses. Unmatched pattern words will appear unaltered in that result list. @* Pattern matching supports the usual shell parser wildcards '*' '?' '[xyz]' and respects '/' as the path separator, which may only be matched literally. @* Pattern expansion is a property of some particular commands and not a general feature. It is controlled by commands -iso_rr_pattern and -disk_pattern. Commands which use pattern expansion all have variable parameter lists which are specified in this text by "[***]" rather than "[...]". @* Some other commands perform pattern matching unconditionally. @c man .PP @sp 1 Command and parameter words are either read from the program arguments, where one argument is one word, or from quoted input lines where words are recognized similar to the quotation rules of a shell parser. @* @command{xorriso} is not a shell, although it might appear so at first glimpse. Be aware that the interaction of quotation marks and pattern symbols like "*" differs from the usual shell parsers. In @command{xorriso}, a quotation mark does not make a pattern symbol literal. @c man .PP @sp 1 @cindex Quoted input, _definition @strong{Quoted input} converts whitespace-separated text into words. The double quotation mark " and the single quotation mark ' can be used to enclose whitespace and make it part of words (e.g. of file names). Each mark type can enclose the marks of the other type. A trailing backslash \ outside quotations or an open quotation cause the next input line to be appended. @* @cindex Backslash Interpretation, _definition Quoted input accepts any 8-bit character except NUL (0) as the content of the quotes. Nevertheless it can be cumbersome for the user to produce those characters directly. Therefore quoted input and program arguments offer optional @strong{Backslash Interpretation} which can represent all 8-bit characters except NUL (0) via backslash codes as in $'...' of bash. @* This is not enabled by default. See command -backslash_codes. @c man .PP @sp 1 When the program starts then it first looks for argument -no_rc. If this is not present then it looks for its startup files and reads their content as command input lines. Then it interprets the program arguments as commands and parameters. Finally it enters dialog mode if command -dialog "on" has been executed by this point. @c man .PP @sp 1 The program ends either by command -end, or by the end of program arguments if dialog mode has not been enabled at that point, or by a problem event which triggers the threshold of command -abort_on. @c man .SS @node Dialog, Commands, Processing, Top @chapter Dialog, Readline, Result pager @c man .B Dialog, Readline, Result pager: @c man .br Dialog mode prompts for a quoted input line, parses it into words, and performs them as commands with their parameters. It provides assisting services to make dialog more comfortable. @c man .PP @sp 1 Readline is an enhancement for the input line. You may already know it from the bash shell. Whether it is available in @command{xorriso} depends on the availability of package readline-dev at the time when @command{xorriso} was built from its sourcecode. @* Readline lets the user move the cursor over the text in the line by help of the Left and the Right arrow keys. Text may be inserted at the cursor position. The Delete key removes the character under the cursor. Up and Down arrow keys navigate through the history of previous input lines. @* @c man-ignore-lines 1 See info readline @c man See man readline for more info about libreadline. @c man .PP @sp 1 Command -page activates a built-in result text pager which may be convenient in dialog mode. After an action has output the given number of terminal lines, the pager prompts the user for a line of input. @* An empty line lets @command{xorriso} resume work until the next page is output. @* The single character "@@" disables paging for the current action. @* "@@@@@@", "x", "q", "X", or "Q" request that the current action aborts and suppress further result output. @* Any other line input will be interpreted as new dialog line. The current action is requested to abort. Afterwards, the input line is executed. @c man .PP @sp 1 Some actions apply paging to their info output, too. @* The request to abort may or may not be obeyed by the current action. All actions try to abort as soon as possible. @node Commands, Examples, Dialog, Top @chapter Commands @c man .br @c man .SH OPTIONS @c man .br All command words are shown with a leading dash although this dash is not mandatory for the command to be recognized. Nevertheless within command -as the dashes of the emulated commands are mandatory. @* Normally any number of leading dashes is ignored with command words and inner dashes are interpreted as underscores. @menu * ArgSort:: Execution order of program arguments * AqDrive:: Acquiring source and target drive * Loading:: Influencing the behavior of image loading * Insert:: Inserting files into ISO image * SetInsert:: Settings for file insertion * Manip:: File manipulations * CmdFind:: Tree traversal command -find * Filter:: Filters for data file content * Writing:: Writing the result, drive control * SetWrite:: Settings for result writing * Bootable:: Bootable ISO images * Jigdo:: Jigdo Template Extraction * Charset:: Character sets * Exception:: Exception processing * DialogCtl:: Dialog mode control * Inquiry:: Drive and media related inquiry actions * Navigate:: Navigation in ISO image and disk filesystem * Verify:: Evaluation of readability and recovery * Restore:: osirrox ISO-to-disk restore commands * Emulation:: Command compatibility emulations (cdrtools) * Scripting:: Scripting, dialog and program control features * Frontend:: Support for frontend programs via stdin and stdout @end menu @c man .TP @node ArgSort, AqDrive, Commands, Commands @section Execution order of program arguments @c man .B Execution order of program arguments: @c man .PP By default the program arguments of a xorriso run are interpreted as a sequence of commands which get performed exactly in the given order. This requires the user to write commands for desired settings before the commands which shall be influenced by those settings. @* Many other programs support program arguments in an arbitrary ordering and perform settings and actions in a sequence at their own discretion. xorriso provides an option to enable such a behavior at the cost of loss of expressivity. @table @asis @sp 1 @c man .TP @item -x @kindex -x enables automatic execution order of arguments @cindex Automatic execution order, of arguments, -x Enable automatic sorting of program arguments into a sequence that (most likely) is sensible. This command may be given at any position among the commands which are handed over as program arguments. @* Note: It works only if it is given as program argument and with a single dash (i.e. "-x"). It will not work in startup files, nor with -options_from_file, nor in dialog mode, nor as "x" and finally not as "@minus{}@minus{}x". It affects only the commands given as program arguments. @c man .TP @item -list_arg_sorting @kindex -list_arg_sorting prints sorting order of -x @cindex Sorting order, for -x, -list_arg_sorting List all xorriso commands in the order which applies if command -x is in effect. @* This list may also be helpful without -x for a user who ponders over the sequence in which to put commands. Deviations from the listed sorting order may well make sense, though. @end table @c man .PP @c man .TP @node AqDrive, Loading, ArgSort, Commands @section Acquiring source and target drive @c man .B Acquiring source and target drive: @c man .PP The effect of acquiring a drive may depend on several commands in the next paragraph "Influencing the behavior of image loading". If desired, their enabling commands have to be performed before the commands which acquire the drive. @table @asis @sp 1 @c man .TP @item -dev address @kindex -dev acquires one drive for input and output @cindex Drive, for input and output, -dev Set input and output drive to the same address and load an ISO image if it is present. If there is no ISO image then create a blank one. Set the image expansion method to growing. @* This is only allowed as long as no changes are pending in the currently loaded ISO image. If changes are pending, then one has to perform -commit or -rollback first. @* Special address string "-" means standard output, to which several restrictions apply. See above paragraph "Libburn drives". @* An empty address string "" gives up the current device without acquiring a new one. @c man .TP @item -indev address @kindex -indev acquires a drive for input @cindex Drive, for input, -indev Set input drive and load an ISO image if present. If the new input drive differs from -outdev then switch from growing to modifying or to blind growing. It depends on the setting of -grow_blindly which of both gets activated. The same rules and restrictions apply as with -dev. @c man .TP @item -outdev address @kindex -outdev acquires a drive for output @cindex Drive, for output, -outdev Set output drive and if it differs from the input drive then switch from growing to modifying or to blind growing. Unlike -dev and -indev this action does not load a new ISO image. So it can be performed even if there are pending changes. @* -outdev can be performed without previous -dev or -indev. In that case an empty ISO image with no changes pending is created. It can either be populated by help of -map, -add et.al. or it can be discarded silently if -dev or -indev are performed afterwards. @* Special address string "-" means standard output, to which several restrictions apply. See above paragraph "Libburn drives". @* An empty address string "" gives up the current output drive without acquiring a new one. No writing is possible without an output drive. @c man .TP @item -drive_class "harmless"|"banned"|"caution"|"clear_list" disk_pattern @kindex -drive_class controls drive accessability @cindex Drive, accessability, -drive_class Add a drive path pattern to one of the safety lists or make those lists empty. There are three lists defined which get tested in the following sequence: @* If a drive address path matches the "harmless" list then the drive will be accepted. If it is not a MMC device then the prefix "stdio:" will be prepended automatically. This list is empty by default. @* Else if the path matches the "banned" list then the drive will not be accepted by @command{xorriso} but rather lead to a FAILURE event. This list is empty by default. @* Else if the path matches the "caution" list and if it is not a MMC device, then its address must have the prefix "stdio:" or it will be rejected. This list has by default one entry: "/dev". @* If a drive path matches no list then it is considered "harmless". By default these are all paths which do not begin with directory "/dev". @* A path matches a list if one of its parent paths or itself matches a list entry. Address prefix "stdio:" or "mmc:" will be ignored when testing for matches. @* By pseudo-class "clear_list" and pseudo-patterns "banned", "caution", "harmless", or "all", the lists may be made empty. @* E.g.: -drive_class clear_list banned @* One will normally define the -drive_class lists in one of the @command{xorriso} Startup Files. @* Note: This is not a security feature but rather a bumper for the superuser to prevent inadverted mishaps. For reliably blocking access to a device file you have to deny its rw-permissions in the filesystem. @c man .TP @item -drive_access "exclusive"|"shared":"unrestricted"|"readonly" @kindex -drive_access control device file locking @cindex Device file locking, -drive_access Control whether device file locking mechanisms shall be used when acquiring a drive, and whether status or content of the medium in the drive may be altered. Useful and most harmless are the setting "shared:readonly" and the default setting "exclusive:unrestricted". @* "exclusive" enables tests and locks when acquiring the drive. It depends on the operating system which locking mechanisms get applied, if any. On GNU/Linux it is open(O_EXCL). On FreeBSD it is flock(LOCK_EX). @* "shared" disables the use of these mechanisms to become able to acquire drives which are mounted, or opened by some process, or guarded by /dev/pktcdvd*. @* "unrestricted" enables all technically appropriate operations on an acquired drive. "shared:unrestricted" risks to get own burn runs spoiled by other processes or to vice versa spoil activities of such processes. So use "exclusive:unrestricted" unless you know for sure that "shared" is safe. @* "readonly" disables operations which might surprise a co-user of the drive. For -outdev these are formatting, blanking, writing, ejecting. For -indev this is ejecting. Be aware that even reading and drive status inquiries can disturb an ongoing burn run on CD-R[W] and DVD-R[W]. @c man .TP @item -scsi_dev_family "default"|"sr"|"scd"|"sg" @kindex -scsi_dev_family choose Linux device file type @cindex Linux device type, -scsi_dev_family GNU/Linux specific: @* By default, xorriso tries to map Linux drive addresses to /dev/sr* before they get opened for operating the drive. This coordinates well with other use cases of optical drives, like mount(8). But since year 2010 all /dev/sr* share a global lock which allows only one drive to process an SCSI command while all others have to wait for its completion. This yields awful throughput if more than one drive is writing or reading simultaneously. The global lock is not applied to device files /dev/sg* and also not if the xorriso drive address is prepended by "stdio:". @* So for simultaneous burn runs on modern GNU/Linux it is advisable to perform -scsi_dev_family "sg" before any -dev, -indev, or -outdev. The drive addresses may then well be given as /dev/sr* but will nevertheless get used as the matching /dev/sg*. @* If you decide so, consider to put the command into a global startup file like /etc/opt/xorriso/rc. @c man .TP @item -grow_blindly "off"|predicted_nwa @kindex -grow_blindly overrides next writeable address @cindex Next writeable address, -grow_blindly If predicted_nwa is a non-negative number then perform blind growing rather than modifying if -indev and -outdev are set to different drives. "off" or "-1" switch to modifying, which is the default. @* predicted_nwa is the block address where the add-on session of blind growing will finally end up. It is the responsibility of the user to ensure this final position and the presence of the older sessions. Else the overall ISO image will not be mountable or will produce read errors when accessing file content. @command{xorriso} will write the session to the address as obtained from examining -outdev and not necessarily to predicted_nwa. @* During a run of blind growing, the input drive is given up before output begins. The output drive is given up when writing is done. @end table @c man .TP @c man .B Influencing the behavior of image loading: @node Loading, Insert, AqDrive, Commands @section Influencing the behavior of image loading @c man .PP The following commands should normally be performed before loading an image by acquiring an input drive. In rare cases it is desirable to activate them only after image loading. @table @asis @sp 1 @c man .TP @item -read_speed code|number[k|m|c|d|b] @kindex -read_speed set read speed @cindex Read, set speed, -read_speed Set the speed for reading. Default is "none", which avoids to send a speed setting command to the drive before reading begins. @* Further special speed codes are: @* "max" (or "0") selects maximum speed as announced by the drive. @* "min" (or "-1") selects minimum speed as announced by the drive. @* Speed can be given in media dependent numbers or as a desired throughput per second in MMC compliant kB (= 1000) or MB (= 1000 kB). Media x-speed factor can be set explicitly by "c" for CD, "d" for DVD, "b" for BD, "x" is optional. @* Example speeds: @* 706k = 706kB/s = 4c = 4xCD @* 5540k = 5540kB/s = 4d = 4xDVD @* If there is no hint about the speed unit attached, then the medium in the -indev will decide. Default unit is CD = 176.4k. @* Depending on the drive, the reported read speeds can be deceivingly low or high. Therefore "min" cannot become higher than 1x speed of the involved medium type. Read speed "max" cannot become lower than 52xCD, 24xDVD, or 20xBD, depending on the medium type. @* MMC drives usually activate their own idea of speed and take the speed value given by the burn program only as hint for their own decision. Friendly drives adjust their constant angular velocity so that the desired speed is reached at the outer rim of the medium. But often there is only the choice between very slow and very loud. @* Sometimes no speed setting is obeyed at all, but speed is adjusted to the demand frequency of the reading program. So xorriso offers to set an additional software enforced limit by prefix "soft_force:". The program will take care not to read faster than the soft_force speed. This may be combined with setting the drive speed to a higher value. Setting "soft_force:0" disables this feature. @* "soft_force:" tries to correct in subsequent waiting periods lost or surplus time of up to 0.25 seconds. This smoothens the overall data stream but also enables short times of higher speed to compensate short times of low speed. Prefix "soft_corr:" sets this hindsight span by giving a number of microseconds. Not more than 1 billion = 1000 seconds. Very short times can cause speed deviations, because systematic inaccuracies of the waiting function cannot be compensated. @* Examples (combinable): @* -read_speed 6xBD @* -read_speed soft_force:4xBD -read_speed soft_corr:100000 @c man .TP @item -load entity id @kindex -load addresses a particular session as input @cindex Session, select as input, -load Load a particular (possibly outdated) ISO session from -dev or -indev. Usually all available sessions are shown with command -toc. @* entity depicts the kind of addressing. id depicts the particular address. The following entities are defined: @* "auto" with any id addresses the last session in -toc. This is the default. @* "session" with id being a number as of a line "ISO session", column "Idx". @* "track" with id being a number as of a line "ISO track", column "Idx". @* "lba" or "sbsector" with a number as of a line "ISO ...", column "sbsector". @* "volid" with a search pattern for a text as of a line "ISO ...", column "Volume Id". @* Addressing a non-existing entity or one which does not represent an ISO image will either abandon -indev or at least lead to a blank image. @* If an input drive is set at the moment when -load is executed, then the addressed ISO image is loaded immediately. Else, the setting will be pending until the next -dev or -indev. After the image has been loaded once, the setting is valid for -rollback until next -dev or -indev, where it will be reset to "auto". @c man .TP @item -displacement [-]lba @kindex -displacement compensate altered image start address @cindex Session, altered start address, -displacement Compensate a displacement of the image versus the start address for which the image was prepared. This affects only loading of ISO images and reading of their files. The multi-session method of growing is not allowed as long as -displacement is non-zero. I.e. -indev and -outdev must be different. The displacement gets reset to 0 before the drive gets re-acquired after writing. @* Examples: @* If a track of a CD starts at block 123456 and gets copied to a disk file where it begins at block 0, then this copy can be loaded with -displacement -123456 @* If an ISO image was written onto a partition with offset of 640000 blocks of 512 bytes, then it can be loaded from the base device by -load sbsector 160000 -displacement 160000 @* (If the partition start address is not divisible by 4, then you will have to employ a loop device instead.) @* In both cases, the ISO sessions should be self contained, i.e. not add-on sessions to an ISO image outside their track or partition. @c man .TP @item -read_fs "any"|"norock"|"nojoliet"|"ecma119" @kindex -read_fs filesystem type for image loading @cindex Image, filesystem to load, -read_fs Specify which kind of filesystem tree to load if present. If the wish cannot be fulfilled, then ECMA-119 names are loaded and converted according to -ecma119_map. @* "any" first tries to read Rock Ridge. If not present, Joliet is tried. @* "norock" does not try Rock Ridge. @* "nojoliet" does not try Joliet. @* "ecma119" tries neither Rock Ridge nor Joliet. @c man .TP @item -assert_volid pattern severity @kindex -assert_volid rejects undesired images @cindex Image, demand volume ID, -assert_volid Refuse to load ISO images with volume IDs which do not match the given search pattern. When refusing an image, give up the input drive and issue an event of the given severity (like FAILURE, see -abort_on). An empty search pattern accepts any image. @* This command does not hamper the creation of an empty image from blank input media and does not discard an already loaded image. @c man .TP @item -in_charset character_set_name @kindex -in_charset sets input character set @cindex Character Set, for input, -in_charset Set the character set from which to convert file names when loading an image. See paragraph "Character sets" for more explanations. When loading the written image after -commit the setting of -out_charset will be copied to -in_charset. @c man .TP @item -auto_charset "on"|"off" @kindex -auto_charset learns character set from image @cindex Character set, learn from image, -auto_charset Enable or disable recording and interpretation of the output character set name in an xattr attribute of the image root directory. If enabled and if a recorded character set name is found, then this name will be used as name of the input character set when reading an image. @* Note that the default output charset is the local character set of the terminal where @command{xorriso} runs. Before attributing this local character set to the produced ISO image, check whether the terminal properly displays all intended filenames, especially exotic national characters. @c man .TP @item -hardlinks mode[:mode...] @kindex -hardlinks controls handling of hard links @cindex Hard links, control handling, -hardlinks Enable or disable loading and recording of hardlink relations. @* In default mode "off", iso_rr files lose their inode numbers at image load time. Each iso_rr file object which has no inode number at image generation time will get a new unique inode number if -compliance is set to new_rr. @* Mode "on" preserves inode numbers from the loaded image if such numbers were recorded. When committing a session it searches for families of iso_rr files which stem from the same disk file, have identical content filtering and have identical properties. The family members all get the same inode number. Whether these numbers are respected at mount time depends on the operating system. @* Command -lsl displays hardlink counts if "lsl_count" is enabled. This can slow down the command substantially after changes to the ISO image have been made. Therefore the default is "no_lsl_count". @* Commands -update and -update_r track splits and fusions of hard links in filesystems which have stable device and inode numbers. This can cause automatic last minute changes before the session gets written. Command -hardlinks "perform_update" may be used to do these changes earlier, e.g. if you need to apply filters to all updated files. @* Mode "without_update" avoids hardlink processing during update commands. Use this if your filesystem situation does not allow -disk_dev_ino "on". @* @command{xorriso} commands which extract files from an ISO image try to hardlink files with identical inode number. The normal scope of this operation is from image load to image load. One may give up the accumulated hard link addresses by -hardlinks "discard_extract". @* A large number of hardlink families may exhaust -temp_mem_limit if not -osirrox "sort_lba_on" and -hardlinks "cheap_sorted_extract" are both in effect. This restricts hard linking to other files restored by the same single extract command. -hardlinks "normal_extract" re-enables wide and expensive hardlink accumulation. @* @c man .TP @item -acl "on"|"off" @kindex -acl controls handling of ACLs @cindex ACL, control handling, -acl Enable or disable processing of ACLs. If enabled, then @command{xorriso} will obtain ACLs from disk file objects, store ACLs in the ISO image using the libisofs specific AAIP format, load AAIP data from ISO images, test ACL during file comparison, and restore ACLs to disk files when extracting them from ISO images. See also commands -getfacl, -setfacl. @c man .TP @item -xattr "on"|"user"|"any"|"off" @kindex -xattr controls handling of xattr (EA) @cindex xattr, control handling, -xattr Enable or disable processing of xattr attributes. If enabled, then @command{xorriso} will handle xattr similar to ACL. See also commands -getfattr, -setfattr and above paragraph about xattr. @* Modes "on" and "user" read and write only attributes from namespace "user". @* Mode "any" processes attributes of all namespaces. This might need administrator privileges, even if the owner of the disk file tries to read or write the attributes. @* Note that xattr from namespace "isofs." are never read from disk or restored to disk. Further it is not possible to set them via xorriso xattr manipulation commands. @c man .TP @item -md5 "on"|"all"|"off"|"load_check_off" @kindex -md5 controls handling of MD5 sums @cindex MD5, control handling, -md5 Enable or disable processing of MD5 checksums for the overall session and for each single data file. If enabled then images with checksum tags get loaded only if the tags of superblock and directory tree match properly. The MD5 checksums of data files and whole session get loaded from the image if there are any. @* With commands -compare and -update the recorded MD5 of a file will be used to avoid content reading from the image. Only the disk file content will be read and compared with that MD5. This can save much time if -disk_dev_ino "on" is not suitable. @* Commands which copy whole data files from ISO to hard disk will verify the copied data stream by the recorded MD5, if -osirrox "check_md5_on" is set. @* At image generation time they are computed for each file which gets its data written into the new session. The checksums of files which have their data in older sessions get copied into the new session. Superblock, tree and whole session get a checksum tag each. @* Mode "all" will additionally check during image generation whether the checksum of a data file changed between the time when its reading began and the time when it ended. This implies reading every file twice. @* Mode "load_check_off" together with "on" or "all" will load recorded MD5 sums but not test the recorded checksum tags of superblock and directory tree. This is necessary if growisofs was used as burn program, because it does not overwrite the superblock checksum tag of the first session. Therefore load_check_off is in effect when @command{xorriso} -as mkisofs option -M is performed. @* The test can be re-enabled by mode "load_check_on". @* Checksums can be exploited via commands -check_md5, -check_md5_r, via find actions get_md5, check_md5, and via -check_media. @c man .TP @item -for_backup @kindex -for_backup -acl,-xattr,-hardlinks,-md5 @cindex Backup, enable features, -for_backup Enable all extra features which help to produce or to restore backups with highest fidelity of file properties. Currently this is a shortcut for: @* -hardlinks on -acl on -xattr any -md5 on @* If you restore a backup with xattr from non-user namespaces, then make sure that the target operating system and filesystem know what these attributes mean. Possibly you will need administrator privileges to record or restore such attributes. At recording time, xorriso will try to tolerate missing privileges and just record what is readable. But at restore time, missing privileges will cause failure events. @* Command -xattr "user" after command -for_backup excludes non-user attributes from being recorded or restored. @c man .TP @item -ecma119_map "stripped"|"unmapped"|"lowercase"|"uppercase" @kindex -ecma119_map names w/o Rock Ridge, Joliet @cindex File names, if neither Rock Ridge nor Joliet Choose the conversion of file names when a session gets loaded, if they stem neither from a Rock Ridge name nor from a Joliet name. @* Mode "stripped" is the default. It shows the names as found in the ISO but removes trailing ";1" or ".;1" if present. @* Mode "unmapped" shows names as found without removing characters. Warning: Multi-session converts "xyz;1" to "xyz_1" and maybe adds new ";1". @* Mode "lowercase" is like "stripped" but also maps uppercase letters to lowercase letters. This is compatible to default GNU/Linux mount behavior. @* Mode "uppercase" is like "stripped" but maps lowercase letters to uppercase, if any occur despite the prescriptions of ECMA-119. @c man .TP @item -joliet_map "stripped"|"unmapped" @kindex -joliet_map Joliet names @cindex File names, if Joliet is loaded Choose the conversion of file names when a session gets loaded from a Joliet tree. @* Mode "stripped" is the default. It removes trailing ";1" or ".;1" if present. @* Mode "unmapped" shows names as found without removing characters. Warning: Multi-session converts "xyz;1" to "xyz_1" and maybe adds new ";1". @c man .TP @item -iso_nowtime "dynamic"|timestring @kindex -iso_nowtime fixed "now" time for ISO 9660 objects @cindex libisofs, fixed "now" time Choose whether to use the current time ("dynamic") or a fixed time point for timestamps of ISO 9660 nodes without a disk source file and as default for superblock timestamps. @* If a timestring is given, then it is used for such timestamps. For the formats of timestrings see command @strong{-alter_date}. @c man .TP @item -disk_dev_ino "on"|"ino_only"|"off" @kindex -disk_dev_ino fast incremental backup @cindex Backup, enable fast incremental, -disk_dev_ino Enable or disable processing of recorded file identification numbers (dev_t and ino_t). If enabled they are stored as xattr and can substantially accelerate file comparison. The root node gets a global start timestamp. If during comparison a file with younger timestamps is found in the ISO image, then it is suspected to have inconsistent content. @* If device numbers and inode numbers of the disk filesystems are persistent and if no irregular alterations of timestamps or system clock happen, then potential content changes can be detected without reading that content. File content change is assumed if any of mtime, ctime, device number or inode number have changed. @* Mode "ino_only" replaces the precondition that device numbers are stable by the precondition that mount points in the compared tree always lead to the same filesystems. Use this if mode "on" always sees all files changed. @* The speed advantage appears only if the loaded session was produced with -disk_dev_ino "on" too. @* Note that -disk_dev_ino "off" is totally in effect only if -hardlinks is "off", too. @c man .TP @item -file_name_limit [+]number @kindex -file_name_limit curbs length of file names @cindex File names, curb length, -file_name_limit Set the maximum permissible length for file names in the range of 64 to 255. Path components which are longer than the given number will get truncated and have their last 33 bytes overwritten by a colon ':' and the hex representation of the MD5 of the first 4095 bytes of the whole oversized name. Potential incomplete UTF-8 characters will get their leading bytes replaced by '_'. @* iso_rr_paths with the long components will still be able to access the file paths with truncated components. @* If -file_name_limit is executed while an ISO tree is present, the file names in the ISO tree get checked for existing truncated file names of the current limit and for name collisions between newly truncated files and existing files. In both cases, the setting will be refused with a SORRY event. @* One may lift this ban by prepending the character "+" to the argument of -file_name_limit. Truncated filenames may then get truncated again, invalidating their MD5 part. Colliding truncated names are made unique, consuming at least 9 more bytes of the remaining name part. @* If writing of xattr is enabled, then the length will be stored in "isofs.nt" of the root directory. If reading of xattr is enabled and "isofs.nt" is found, then the found length will get into effect if it is smaller than the current setting of -file_name_limit. @* File name patterns will only work if they match the truncated name. This might change in future. @* Files with truncated names get deleted and re-added unconditionally during -update and -update_r. This might change in future. @* Linux kernels up to at least 4.1 misrepresent names of length 254 and 255. If you expect such names in or under disk_paths and plan to mount the ISO by such Linux kernels, consider to set -file_name_limit 253. Else just avoid names longer than 253 characters. @c man .TP @item -rom_toc_scan "on"|"force"|"off"[:"emul_off"][:"emul_wide"] @kindex -rom_toc_scan searches for sessions @cindex Table-of-content, search sessions, -rom_toc_scan Read-only drives do not tell the actual media type but show any media as ROM (e.g. as DVD-ROM). The session history of MMC multi-session media might be truncated to first and last session or even be completely false. (The emulated history of overwritable media is not affected by this.) @* To have in case of failure a chance of getting the session history and especially the address of the last session, there is a scan for ISO 9660 filesystem headers which might help but also might yield worse results than the drive's table of content. At its end it can cause read attempts to invalid addresses and thus ugly drive behavior. Setting "on" enables that scan for alleged read-only media. @* Some operating systems are not able to mount the most recent session of multi-session DVD or BD. If on such a system @command{xorriso} has no own MMC capabilities then it may still find that session from a scanned table of content. Setting "force" handles any media like a ROM medium with setting "on". @* On the other hand the emulation of session history on overwritable media can hamper reading of partly damaged media. Setting "off:emul_off" disables the elsewise trustworthy table-of-content scan for those media. @* The table-of-content scan on overwritable media normally searches only up to the end of the session that is pointed to by the superblock at block 0. Setting "on:emul_wide" lets the scan continue up to the end of the medium. This may be useful after copying a medium with -check_media patch_lba0=on when not the last session was loaded. @c man .TP @item -calm_drive "in"|"out"|"all"|"revoke"|"on"|"off" @kindex -calm_drive reduces drive activity @cindex Drive, reduce activity, -calm_drive Reduce drive noise until it is actually used again. Some drives stay alert for substantial time after they have been used for reading. This reduces the startup time for the next drive operation but can be loud and waste energy if no i/o with the drive is expected to happen soon. @* Modes "in", "out", "all" immediately calm down -indev, -outdev, or both, respectively. Mode "revoke" immediately alerts both. Mode "on" causes -calm_drive to be performed automatically after each -dev, -indev, and -outdev. Mode "off" disables this. @c man .TP @item -ban_stdio_write @kindex -ban_stdio_write demands real drive @cindex Drive, demand real MMC, -ban_stdio_write Allow for writing only the usage of MMC optical drives. Disallow to write the result into files of nearly arbitrary type. Once set, this command cannot be revoked. @c man .TP @item -early_stdio_test "on"|"appendable_wo"|"off" @kindex -early_stdio_test classifies stdio drives @cindex Drive, classify stdio, -early_stdio_test If enabled by "on" then regular files and block devices get tested for effective access permissions. This implies to try opening those files for writing, which otherwise will happen only later and only if actual writing is desired. @* The test result is used for classifying the pseudo drives as overwritable, read-only, write-only, or uselessly empty. This may lead to earlier detection of severe problems, and may avoid some less severe error events. @* Mode "appendable_wo" is like "on" with the additional property that non-empty write-only files are regarded as appendable rather than blank. @c man .TP @item -data_cache_size number_of_tiles blocks_per_tile @kindex -data_cache_size adjusts read cache size @cindex Image reading, cache size, -data_cache_size Set the size and granularity of the data cache which is used when ISO images are loaded and when file content is read from ISO images. The cache consists of several tiles, which each consists of several blocks. A larger cache reduces the need for tiles being read multiple times. Larger tiles might additionally improve the data throughput from the drive, but can be wasteful if the data are scattered over the medium. @* Larger cache sizes help best with image loading from MMC drives. They are an inferior alternative to -osirrox option "sort_lba_on". @* blocks_per_tile must be a power of 2. E.g. 16, 32, or 64. The overall cache size must not exceed 1 GiB. The default values can be restored by parameter "default" instead of one or both of the numbers. Currently the default is 32 tiles of 32 blocks = 2 MiB. @end table @c man .TP @c man .B Inserting files into ISO image: @node Insert, SetInsert, Loading, Commands @section Inserting files into ISO image @c man .PP The following commands expect file addresses of two kinds: @c man .br @cindex disk_path, _definition @strong{disk_path} is a path to an object in the local filesystem tree. @c man .br @cindex iso_rr_path, _definition @strong{iso_rr_path} is the Rock Ridge name of a file object in the ISO image. If no Rock Ridge information is recorded in the loaded ISO image, then you will see ISO 9660 names which are of limited length and character set. If no Rock Ridge information shall be stored in an emerging ISO image, then their names will get mapped to such restricted ISO 9660 (aka ECMA-119) names. @c man .PP @sp 1 Note that in the ISO image you are as powerful as the superuser. Access permissions of the existing files in the image do not apply to your write operations. They are intended to be in effect with the read-only mounted image. @c man .PP @sp 1 If the iso_rr_path of a newly inserted file leads to an existing file object in the ISO image, then the following collision handling happens: @* If both objects are directories then they get merged by recursively inserting the subobjects from filesystem into ISO image. If other file types collide then the setting of command @strong{-overwrite} decides. @* Renaming of files has similar collision handling, but directories can only be replaced, not merged. Note that if the target directory exists, then -mv inserts the source objects into this directory rather than attempting to replace it. Command -move, on the other hand, would attempt to replace it. @c man .PP @sp 1 The commands in this section alter the ISO image and not the local filesystem. @table @asis @sp 1 @c man .TP @item -disk_pattern "on"|"ls"|"off" @kindex -disk_pattern controls pattern expansion @cindex Pattern expansion, for disk paths, -disk_pattern Set the pattern expansion mode for the disk_path parameters of several commands which support this feature. @* Setting "off" disables this feature for all commands which are marked in this man page by "disk_path [***]" or "disk_pattern [***]". @* Setting "on" enables it for all those commands. @* Setting "ls" enables it only for those which are marked by "disk_pattern [***]". @* Default is "ls". @c man .TP @item -add pathspec [...] | disk_path [***] @kindex -add inserts one or more paths @cindex Insert, pathspecs, -add Insert the given files or directory trees from filesystem into the ISO image. @* If -pathspecs is set to "on" or "as_mkisofs" then pattern expansion is always disabled and character '=' has a special meaning. It separates the ISO image path from the disk path: @* iso_rr_path=disk_path @* Character '=' in the iso_rr_path must be escaped by '\' (i.e. as "\="). @* With -pathspecs "on", the character '\' must not be escaped. The character '=' in the disk_path must not be escaped. @* With -pathspecs "as_mkisofs", all characters '\' must be escaped in both, iso_rr_path and disk_path. The character '=' may or may not be escaped in the disk_path. @* If iso_rr_path does not begin with '/' then -cd is prepended. If disk_path does not begin with '/' then -cdx is prepended. @* If no '=' is given then the word is used as both, iso_rr_path and disk path. If in this case the word does not begin with '/' then -cdx is prepended to the disk_path and -cd is prepended to the iso_rr_path. @* If -pathspecs is set to "off" then -disk_pattern expansion applies, if enabled. The resulting words are used as both, iso_rr_path and disk path. Relative path words get prepended the setting of -cdx to disk_path and the setting of -cd to iso_rr_path. @c man .TP @item -add_plainly mode @kindex -add_plainly inserts one or more paths @cindex Insert, non-dashed arguments, -add_plainly If set to mode "unknown" then any command word that does not begin with "-" and is not recognized as known command will be subject to a virtual -add command. I.e. it will be used as pathspec or as disk_path and added to the image. If enabled, -disk_pattern expansion applies to disk_paths. @* Mode "dashed" is similar to "unknown" but also adds unrecognized command words even if they begin with "-". @* Mode "any" announces that all further words are to be added as pathspecs or disk_paths. This does not work in dialog mode. @* Mode "none" is the default. It prevents any words from being understood as files to add, if they are not parameters to appropriate commands. @c man .TP @item -path_list disk_path @kindex -path_list inserts paths from disk file @cindex Insert, paths from disk file, -path_list Like -add but read the parameter words from file disk_path or standard input if disk_path is "-". The list must contain exactly one pathspec or disk_path pattern per line. @c man .TP @item -quoted_path_list disk_path @kindex -quoted_path_list inserts paths from disk file @cindex Insert, paths from disk file, -quoted_path_list Like -path_list but with quoted input reading rules. Lines get split into parameter words for -add. Whitespace outside quotes is discarded. @c man .TP @item -map disk_path iso_rr_path @kindex -map inserts path @cindex Insert, path, -map Insert file object disk_path into the ISO image as iso_rr_path. If disk_path is a directory then its whole sub tree is inserted into the ISO image. @c man .TP @item -map_single disk_path iso_rr_path @kindex -map_single inserts path @cindex Insert, path, -map_single Like -map, but if disk_path is a directory then its sub tree is not inserted. @c man .TP @item -map_l disk_prefix iso_rr_prefix disk_path [***] @kindex -map_l inserts paths from disk file @cindex Insert, paths from disk file, -map_l Perform -map with each of the disk_path parameters. iso_rr_path will be composed from disk_path by replacing disk_prefix by iso_rr_prefix. @c man .TP @item -update disk_path iso_rr_path @kindex -update inserts path if different @cindex Insert, if different, -update Compare file object disk_path with file object iso_rr_path. If they do not match, then perform the necessary image manipulations to make iso_rr_path a matching copy of disk_path. By default this comparison will imply lengthy content reading before a decision is made. Commands -disk_dev_ino or -md5 may accelerate comparison if they were already in effect when the loaded session was recorded. @* If disk_path is a directory and iso_rr_path does not exist yet, then the whole subtree will be inserted. Else only directory attributes will be updated. @c man .TP @item -update_r disk_path iso_rr_path @kindex -update_r inserts paths if different @cindex Insert, if different, -update_r Like -update but working recursively. I.e. all file objects below both addresses get compared whether they have counterparts below the other address and whether both counterparts match. If there is a mismatch then the necessary update manipulation is done. @* Note that the comparison result may depend on command -follow. Its setting should always be the same as with the first adding of disk_path as iso_rr_path. @* If iso_rr_path does not exist yet, then it gets added. If disk_path does not exist, then iso_rr_path gets deleted. @c man .TP @item -update_l disk_prefix iso_rr_prefix disk_path [***] @kindex -update_l inserts paths if different @cindex Insert, if different, -update_l Perform -update_r with each of the disk_path parameters. iso_rr_path will be composed from disk_path by replacing disk_prefix by iso_rr_prefix. @c man .TP @item -update_li iso_rr_prefix disk_prefix iso_rr_path [***] @kindex -update_li inserts paths if different @cindex Insert, if different, -update_li Perform -update_r with each of the iso_rr_path parameters. disk_path will be composed from iso_rr_path by replacing iso_rr_prefix by disk_prefix. @c man .TP @item -update_lxi disk_prefix iso_rr_prefix disk_path [***] @kindex -update_l inserts paths if different @cindex Insert, if different, -update_lxi Perform -update_r with each of the disk_path parameters and with iso_rr_paths in the ISO filesystem which are derived from the disk_path parameters after exchanging disk_prefix by iso_rr_prefix. So, other than -update_l, this detects missing matches of disk_path and deletes the corresponding iso_rr_path. @* Note that relative disk_paths and disk_path patterns are interpreted as sub paths of the current disk working directory -cdx. The corresponding iso_rr_paths are derived by exchanging disk_prefix by iso_rr_prefix before pattern expansion happens. The current -cdi directory has no influence. @c man .TP @item -cut_out disk_path byte_offset byte_count iso_rr_path @kindex -cut_out inserts piece of data file @cindex Insert, piece of data file, -cut_out Map a byte interval of a regular disk file into a regular file in the ISO image. This may be necessary if the disk file is larger than a single medium, or if it exceeds the traditional limit of 2 GiB - 1 for old operating systems, or the limit of 4 GiB - 1 for newer ones. Only the newest Linux kernels seem to read properly files >= 4 GiB - 1. @* A clumsy remedy for this limit is to backup file pieces and to concatenate them at restore time. A well tested chopping size is 2047m. It is permissible to request a higher byte_count than available. The resulting file will be truncated to the correct size of a final piece. To request a byte_offset higher than available yields no file in the ISO image but a SORRY event. E.g: @* -cut_out /my/disk/file 0 2047m \ @* /file/part_1_of_3_at_0_with_2047m_of_5753194821 \ @* -cut_out /my/disk/file 2047m 2047m \ @* /file/part_2_of_3_at_2047m_with_2047m_of_5753194821 \ @* -cut_out /my/disk/file 4094m 2047m \ @* /file/part_3_of_3_at_4094m_with_2047m_of_5753194821 @* While command -split_size is set larger than 0, and if all pieces of a file reside in the same ISO directory with no other files, and if the names look like above, then their ISO directory will be recognized and handled like a regular file. This affects commands -compare*, -update*, and overwrite situations. See command -split_size for details. @c man .TP @item -cpr disk_path [***] iso_rr_path @kindex -cpr inserts like with cp -r @cindex Insert, paths, -cpr Insert the given files or directory trees from filesystem into the ISO image. @* The rules for generating the ISO addresses are similar as with shell command cp -r. Nevertheless, directories of the iso_rr_path are created if necessary. Especially a not yet existing iso_rr_path will be handled as directory if multiple disk_paths are present. The leafnames of the multiple disk_paths will be grafted under that directory as would be done with an existing directory. @* If a single disk_path is present then a non-existing iso_rr_path will get the same type as the disk_path. @* If a disk_path does not begin with '/' then -cdx is prepended. If the iso_rr_path does not begin with '/' then -cd is prepended. @c man .TP @item -mkdir iso_rr_path [...] @kindex -mkdir creates ISO directory @cindex Directory, create, -mkdir Create empty directories if they do not exist yet. Existence as directory generates a WARNING event, existence as other file causes a FAILURE event. @c man .TP @item -lns target_text iso_rr_path @kindex -lns creates ISO symbolic link @cindex Symbolic link, create, -lns Create a symbolic link with address iso_rr_path which points to target_text. iso_rr_path may not exist yet. @* Hint: Command -clone produces the ISO equivalent of a hard link. @c man .TP @item -clone iso_rr_path_original iso_rr_path_copy @kindex -clone copies ISO directory tree @cindex Directory, copy, -clone Create a copy of the ISO file object iso_rr_path_original with the new address iso_rr_path_copy. If the original is a directory then copy all files and directories underneath. If iso_rr_path_original is a boot catalog file, then it gets not copied but is silently ignored. @* The copied ISO file objects have the same attributes. Copied data files refer to the same content source as their originals. The copies may then be manipulated independendly of their originals. @* This command will refuse execution if the address iso_rr_path_copy already exists in the ISO tree. @c man .TP @item -cp_clone iso_rr_path_original [***] iso_rr_path_dest @kindex -cp_clone copies ISO directory tree @cindex Directories, copy, -cp_clone Create copies of one or more ISO file objects as with command -clone. In case of collision merge directories with existing ones, but do not overwrite existing ISO file objects. @* The rules for generating the copy addresses are the same as with command -cpr (see above) or shell command cp -r. Other than with -cpr, relative iso_rr_path_original will get prepended the -cd path and not the -cdx path. Consider to -mkdir iso_rr_path_dest before -cp_clone so the copy address does not depend on the number of iso_rr_path_original parameters. @end table @c man .TP @c man .B Settings for file insertion: @node SetInsert, Manip, Insert, Commands @section Settings for file insertion @c man .TP @table @asis @item -file_size_limit value [value [...]] @minus{}@minus{} @kindex -file_size_limit limits data file size @cindex Insert, limit data file size, -file_size_limit Set the maximum permissible size for a single data file. The values get summed up for the actual limit. If the only value is "off" then the file size is not limited by @command{xorriso}. Default is a limit of 100 extents, 4g -2k each: @* -file_size_limit 400g -200k @minus{}@minus{} @* When mounting ISO 9660 filesystems, old operating systems can handle only files up to 2g -1 @minus{}@minus{}. Newer ones are good up to 4g -1 @minus{}@minus{}. You need quite a new Linux kernel to read correctly the final bytes of a file >= 4g if its size is not aligned to 2048 byte blocks. @* @command{xorriso}'s own data read capabilities are not affected by operating system size limits. Such limits apply to mounting only. Nevertheless, the target filesystem of an -extract must be able to take the file size. @c man .TP @item -not_mgt code[:code[...]] @kindex -not_mgt controls file exclusion @cindex Insert, file exclusion, -not_mgt Control the behavior of the exclusion lists. @* Exclusion processing happens before disk_paths get mapped to the ISO image and before disk files get compared with image files. The absolute disk path of the source is matched against the -not_paths list. The leafname of the disk path is matched against the patterns in the -not_leaf list. If a match is detected then the disk path will not be regarded as an existing file and not be added to the ISO image. @* Several codes are defined. The _on/_off settings persist until they are revoked by their_off/_on counterparts. @* "erase" empties the lists which were accumulated by -not_paths and -not_leaf. @* "reset" is like "erase" but also re-installs default behavior. @* "off" disables exclusion processing temporarily without invalidating the lists and settings. @* "on" re-enables exclusion processing. @* "param_off" applies exclusion processing only to paths below disk_path parameter of commands. I.e. explicitly given disk_paths are exempted from exclusion processing. @* "param_on" applies exclusion processing to command parameters as well as to files below such parameters. @* "subtree_off" with "param_on" excludes parameter paths only if they match a -not_paths item exactly. @* "subtree_on" additionally excludes parameter paths which lead to a file address below any -not_paths item. @* "ignore_off" treats excluded disk files as if they were missing. I.e. they get reported with -compare and deleted from the image with -update. @* "ignore_on" keeps excluded files out of -compare or -update activities. @c man .TP @item -not_paths disk_path [***] @kindex -not_paths sets absolute exclusion paths @cindex Insert, file exclusion absolute, -not_paths Add the given paths to the list of excluded absolute disk paths. If a given path is relative, then the current -cdx is prepended to form an absolute path. Pattern matching, if enabled, happens at definition time and not when exclusion checks are made. @* (Do not forget to end the list of disk_paths by "@minus{}@minus{}") @c man .TP @item -not_leaf pattern @kindex -not_leaf sets exclusion pattern @cindex Insert, file exclusion pattern, -not_leaf Add a single shell parser style pattern to the list of exclusions for disk leafnames. These patterns are evaluated when the exclusion checks are made. @c man .TP @item -not_list disk_path @kindex -not_list sets exclusions from disk file @cindex Insert, file exclusion from file, -not_list Read lines from disk_path and use each of them either as -not_paths parameter, if they contain a / character, or as -not_leaf pattern. @c man .TP @item -quoted_not_list disk_path @kindex -quoted_not_list sets exclusions @cindex Insert, file exclusion, -quoted_not_list Like -not_list but with quoted input reading rules. Each word is handled as one parameter for -not_paths or -not_leaf. @c man .TP @item -follow occasion[:occasion[...]] @kindex -follow softlinks and mount points @cindex Insert, links or mount points, -follow Enable or disable resolution of symbolic links and mountpoints under disk_paths. This applies to actions -add, -du*x, -ls*x, -findx, -concat, and to -disk_pattern expansion. @* There are three kinds of follow decisison to be made: @* @strong{link} is the hop from a symbolic link to its target file object for the purpose of reading. I.e. not for command -concat. If enabled then symbolic links are handled as their target file objects, else symbolic links are handled as themselves. @* @strong{mount} is the hop from one filesystem to another subordinate filesystem. If enabled then mountpoint directories are handled as any other directory, else mountpoints are handled as empty directories if they are encountered in directory tree traversals. @* @strong{concat} is the hop from a symbolic link to its target file object for the purpose of writing. I.e. for command -concat. This is a security risk ! @* Less general than above occasions: @* @strong{pattern} is mount and link hopping, but only during -disk_pattern expansion. @* @strong{param} is link hopping for parameter words (after eventual pattern expansion). If enabled then -ls*x will show the link targets rather than the links themselves. -du*x, -findx, and -add will process the link targets but not follow links in an eventual directory tree below the targets (unless "link" is enabled). @* Occasions can be combined in a colon separated list. All occasions mentioned in the list will then lead to a positive follow decision. @* @strong{off} prevents any positive follow decision. Use it if no other occasion applies. @* Shortcuts: @* @strong{default} is equivalent to "pattern:mount:limit=100". @* @strong{on} always decides positive. Equivalent to "link:mount:concat". @* @sp 1 Not an occasion but an optional setting is: @* @strong{limit=} which sets the maximum number of link hops. A link hop consists of a sequence of symbolic links and a final target of different type. Nevertheless those hops can loop. Example: @* $ ln -s .. uploop @* Link hopping has a built-in loop detection which stops hopping at the first repetition of a link target. Then the repeated link is handled as itself and not as its target. Regrettably one can construct link networks which cause exponential workload before their loops get detected. The number given with "limit=" can curb this workload at the risk of truncating an intentional sequence of link hops. @c man .TP @item -pathspecs "on"|"off"|"as_mkisofs" @kindex -pathspecs sets meaning of = with -add @cindex Insert, meaning of = with -add, -pathspecs Control parameter interpretation with @command{xorriso} actions -add and -path_list. @* @cindex Pathspec, _definition Mode "as_mkisofs" enables pathspecs of the form @* @strong{iso_rr_path=disk_path} @* like with program mkisofs -graft-points. @* All characters '\' must be escaped in both, iso_rr_path and disk_path. The character '=' must be escaped in the iso_rr_path and may or may not be escaped in the disk_path. This mode temporarily disables -disk_pattern expansion for command -add. @* Mode "on" does nearly the same. But '=' must only be escaped in the iso_rr_path and '\' must not be escaped at all. This has the disadvantage that one cannot express an iso_rr_path which ends by '\'. @* Mode "off" disables pathspecs of the form target=source and re-enables -disk_pattern expansion. @c man .TP @item -overwrite "on"|"nondir"|"off" @kindex -overwrite enables overwriting in ISO @cindex Insert, enable overwriting, -overwrite Allow or disallow overwriting of existing files in the ISO image by files with the same name. @* With setting "off", name collisions with at least one non-directory file cause FAILURE events. Collisions of two directories lead to merging of their file lists. @* With setting "nondir", only directories are protected by such events, other existing file types get treated with -rm before the new file gets added. Setting "on" enables automatic -rm_r. I.e. a non-directory can replace an existing directory and all its subordinates. @* If restoring of files is enabled, then the overwrite rule applies to the target file objects on disk as well, but "on" is downgraded to "nondir". @c man .TP @item -split_size number["k"|"m"] @kindex -split_size enables large file splitting @cindex Insert, large file splitting, -split_size Set the threshold for automatic splitting of regular files. Such splitting maps a large disk file onto a ISO directory with several part files in it. This is necessary if the size of the disk file exceeds -file_size_limit. Older operating systems can handle files in mounted ISO 9660 filesystems only if they are smaller than 2 GiB or in other cases 4 GiB. @* Default is 0 which will exclude files larger than -file_size_limit by a FAILURE event. A well tested -split_size is 2047m. Sizes above -file_size_limit are not permissible. @* While command -split_size is set larger than 0 such a directory with split file pieces will be recognized and handled like a regular file by commands -compare* , -update*, and in overwrite situations. There are -osirrox parameters "concat_split_on" and "concat_split_off" which control the handling when files get restored to disk. @* In order to be recognizable, the names of the part files have to describe the splitting by 5 numbers: @* part_number,total_parts,byte_offset,byte_count,disk_file_size @* which are embedded in the following text form: @* part_#_of_#_at_#_with_#_of_# @* Scaling characters like "m" or "k" are taken into respect. All digits are interpreted as decimal, even if leading zeros are present. @* E.g: /file/part_1_of_3_at_0_with_2047m_of_5753194821 @* No other files are allowed in the directory. All parts have to be present and their numbers have to be plausible. E.g. byte_count must be valid as -cut_out parameter and their contents may not overlap. @end table @c man .TP @c man .B File manipulations: @node Manip, CmdFind, SetInsert, Commands @section File manipulations @c man .PP The following commands manipulate files in the ISO image, regardless whether they stem from the loaded image or were newly inserted. @c man .PP @table @asis @sp 1 @c man .TP @item -iso_rr_pattern "on"|"ls"|"off" @kindex -iso_rr_pattern controls pattern expansion @cindex Pattern expansion, for ISO paths, -iso_rr_pattern Set the pattern expansion mode for the iso_rr_path parameters of several commands which support this feature. @* Setting "off" disables pattern expansion for all commands which are marked in this man page by "iso_rr_path [***]" or "iso_rr_pattern [***]". @* Setting "on" enables it for all those commands. @* Setting "ls" enables it only for those which are marked by "iso_rr_pattern [***]". @* Default is "on". @c man .TP @item -rm iso_rr_path [***] @kindex -rm deletes files from ISO image @cindex Delete, from ISO image, -rm Delete the given files from the ISO image. @* Note: This does not free any space on the -indev medium, even if the deletion is committed to that same medium. @* The image size will shrink if the image is written to a different medium in modification mode. @c man .TP @item -rm_r iso_rr_path [***] @kindex -rm_r deletes trees from ISO image @cindex Delete, from ISO image, -rm_r Delete the given files or directory trees from the ISO image. See also the note with command -rm. @c man .TP @item -rmdir iso_rr_path [***] @kindex -rmdir deletes ISO directory @cindex Delete, ISO directory, -rmdir @cindex Directory, delete, -rmdir Delete empty directories. @c man .TP @item -move iso_rr_path iso_rr_path @kindex -mv renames single file in ISO image @cindex Rename, in ISO image, -move Rename the file given by the first (origin) iso_rr_path to the second (destination) iso_rr_path. Deviate from rules of shell command mv by not moving the origin file underneath an existing destination directory. The origin file will rather replace such a directory, if this is allowed by command -overwrite. @c man .TP @item -mv iso_rr_path [***] iso_rr_path @kindex -mv renames files in ISO image @cindex Rename, in ISO image, -mv Rename the given file objects in the ISO tree to the last parameter in the list. Use the same rules as with shell command mv. @* If pattern expansion is enabled and if the last parameter contains wildcard characters then it must match exactly one existing file address, or else the command fails with a FAILURE event. @c man .TP @item -chown uid iso_rr_path [***] @kindex -chown sets ownership in ISO image @cindex Ownership, in ISO image, -chown Set ownership of file objects in the ISO image. uid may either be a decimal number or the name of a user known to the operating system. @c man .TP @item -chown_r uid iso_rr_path [***] @kindex -chown_r sets ownership in ISO image @cindex Ownership, in ISO image, -chown_r Like -chown but affecting all files below eventual directories. @c man .TP @item -chgrp gid iso_rr_path [***] @kindex -chgrp sets group in ISO image @cindex Group, in ISO image, -chgrp Set group attribute of file objects in the ISO image. gid may either be a decimal number or the name of a group known to the operating system. @c man .TP @item -chgrp_r gid iso_rr_path [***] @kindex -chgrp_r sets group in ISO image @cindex Group, in ISO image, -chgrp_r Like -chgrp but affecting all files below eventual directories. @c man .TP @item -chmod mode iso_rr_path [***] @kindex -chmod sets permissions in ISO image @cindex Permissions, in ISO image, -chmod Equivalent to shell command chmod in the ISO image. mode is either an octal number beginning with "0" or a comma separated list of statements of the form [ugoa]*[+-=][rwxst]* . @* Like: go-rwx,u+rwx . @* @strong{Personalities}: u=user, g=group, o=others, a=all @* @strong{Operators}: + adds given permissions, - revokes given permissions, = revokes all old permissions and then adds the given ones. @* @strong{Permissions}: r=read, w=write, x=execute|inspect, s=setuid|setgid, t=sticky bit @* For octal numbers see man 2 stat. @c man .TP @item -chmod_r mode iso_rr_path [***] @kindex -chmod_r sets permissions in ISO image @cindex Permissions, in ISO image, -chmod_r Like -chmod but affecting all files below eventual directories. @c man .TP @item -setfacl acl_text iso_rr_path [***] @kindex -setfacl sets ACL in ISO image @cindex ACL, set in ISO image, -setfacl Attach the given ACL to the given iso_rr_paths. If the files already have ACLs, then those get deleted before the new ones get into effect. If acl_text is empty, or contains the text "clear" or the text "@minus{}@minus{}remove-all", then the existing ACLs will be removed and no new ones will be attached. Any other content of acl_text will be interpreted as a list of ACL entries. It may be in the long multi-line format as put out by -getfacl but may also be abbreviated as follows: @* ACL entries are separated by comma or newline. If an entry is empty text or begins with "#" then it will be ignored. A valid entry has to begin by a letter out of @{ugom@} for "user", "group", "other", "mask". It has to contain two colons ":". A non-empty text between those ":" gives a user id or group id. After the second ":" there may be letters out of @{rwx- #@}. The first three give read, write, or execute permission. Letters "-", " " and TAB are ignored. "#" causes the rest of the entry to be ignored. Letter "X" or any other letters are not supported. Examples: @* g:toolies:rw,u:lisa:rw,u:1001:rw,u::wr,g::r,o::r,m::rw @* group:toolies:rw@minus{},user::rw@minus{},group::r@minus{}@minus{},other::r@minus{}@minus{},mask::rw@minus{} @* A valid entry may be prefixed by "d", some following characters and ":". This indicates that the entry goes to the "default" ACL rather than to the "access" ACL. Example: @* u::rwx,g::rx,o::,d:u::rwx,d:g::rx,d:o::,d:u:lisa:rwx,d:m::rwx @c man .TP @item -setfacl_r acl_text iso_rr_path [***] @kindex -setfacl_r sets ACL in ISO image @cindex ACL, set in ISO image, -setfacl_r Like -setfacl but affecting all files below eventual directories. @c man .TP @item -setfacl_list disk_path @kindex -setfacl_list sets ACL in ISO image @cindex ACL, set in ISO image, -setfacl_list Read the output of -getfacl_r or shell command getfacl -R and apply it to the iso_rr_paths as given in lines beginning with "# file:". This will change ownership, group and ACL of the given files. If disk_path is "-" then lines are read from standard input. Line "@@" ends the list, "@@@@@@" aborts without changing the pending iso_rr_path. @* Since -getfacl and getfacl -R strip leading "/" from file paths, the setting of -cd does always matter. @c man .TP @item -setfattr [-]name value iso_rr_path [***] @kindex -setfattr sets xattr in ISO image @cindex xattr, set in ISO image, -setfattr Attach the given xattr pair of name and value to the given iso_rr_paths. If the given name is prefixed by "-", then the pair with that name gets removed from the xattr list. If name is "@minus{}@minus{}remove@minus{}all" then all user namespace xattr of the given iso_rr_paths get deleted. In case of deletion, value must be an empty text. @* Which names are permissible depends on the setting of command -xattr. "on" or "user" restricts them to namespace "user". I.e. a name has to look like "user.x" or "user.whatever". @* -xattr setting "any" enables names from all namespaces except "isofs". @* Values and names undergo the normal input processing of @command{xorriso}. See also command -backslash_codes. Other than with command -setfattr_list, the byte value 0 cannot be expressed via -setfattr. @c man .TP @item -setfattr_r [-]name value iso_rr_path [***] @kindex -setfattr_r sets xattr in ISO image @cindex xattr, set in ISO image, -setfattr_r Like -setfattr but affecting all files below eventual directories. @c man .TP @item -setfattr_list disk_path @kindex -setfattr_list sets xattr in ISO image @cindex xattr, set in ISO image, -setfattr_list Read the output format of -getfattr_r or shell command getfattr -Rd and apply it to the iso_rr_paths as given in lines beginning with "# file:". All previously existing xattr of the acceptable namespaces will be deleted before the new xattr get attached. The set of acceptable names depends on the setting of command -xattr. @* If disk_path is "-" then lines are read from standard input. @* Since -getfattr and getfattr -Rd strip leading "/" from file paths, the setting of -cd does always matter. @* Empty input lines and lines which begin by "#" will be ignored (except "# file:"). Line "@@" ends the list, "@@@@@@" aborts without changing the pending iso_rr_path. Other input lines must have the form @* name="value" @* The separator "=" is not allowed in names. Value may contain any kind of bytes. It must be in quotes. Trailing whitespace after the end quote will be ignored. Non-printables bytes and quotes must be represented as \XYZ by their octal 8-bit code XYZ. Use code \000 for 0-bytes. @c man .TP @item -alter_date type timestring iso_rr_path [***] @kindex -alter_date sets timestamps in ISO image @cindex Timestamps, set in ISO image, -alter_date Alter the date entries of files in the ISO image. type may be one of the following: @* "a" sets access time, updates ctime. @* "m" sets modification time, updates ctime. @* "b" sets access time and modification time, updates ctime. @* "a-c", "m-c", and "b-c" set the times without updating ctime. @* "c" sets the ctime. @* timestring may be in the following formats (see also section EXAMPLES): @* As expected by program date: MMDDhhmm[[CC]YY][.ss]] @* As produced by program date: @* [Day] MMM DD hh:mm:ss [TZON] YYYY @* Relative times counted from current clock time: @* +|-Number["s"|"h"|"d"|"w"|"m"|"y"] @* where "s" means seconds, "h" hours, "d" days, "w" weeks, "m"=30d, "y"=365.25d plus 1d added to multiplication result. @* Absolute seconds counted from Jan 1 1970: @* =Number @* @command{xorriso}'s own timestamps: @* YYYY.MM.DD[.hh[mm[ss]]] @* scdbackup timestamps: @* YYMMDD[.hhmm[ss]] @* where "A0" is year 2000, "B0" is 2010, etc. @* ECMA-119 volume timestamps: @* YYYYMMDDhhmmsscc @* These are normally given as GMT. The suffix "LOC" causes local timezone conversion. E.g. 2013010720574700, 2013010720574700LOC. The last two digits cc (centiseconds) will be ignored, but must be present in order to make the format recognizable. @* Example: @* -alter_date m-c 2013.11.27.103951 /file1 /file2 -- @* This command does not persistently apply to the boot catalog, which gets fresh timestamps at -commit time. Command -volume_date "uuid" can set this time value. @c man .TP @item -alter_date_r type timestring iso_rr_path [***] @kindex -alter_date_r sets timestamps in ISO image @cindex Timestamps, set in ISO image, -alter_date_r Like -alter_date but affecting all files below eventual directories. @c man .TP @item -hide hide_state iso_rr_path [***] @kindex -hide excludes file names from directory trees @cindex hidden, set in ISO image, -hide Prevent the names of the given files from showing up in the directory trees of ISO 9660 and/or Joliet and/or HFS+ when the image gets written. The data content of such hidden files will be included in the resulting image, even if they do not show up in any directory. But you will need own means to find nameless data in the image. @* Warning: Data which are hidden from the ISO 9660 tree will not be copied by the write method of modifying. @* Possible values of hide_state are: "iso_rr" for hiding from ISO 9660 tree, "joliet" for Joliet tree, "hfsplus" for HFS+, "on" for them all. "off" means visibility in all directory trees. @* These values may be combined. E.g.: joliet:hfsplus @* This command does not apply to the boot catalog. Rather use: -boot_image "any" "cat_hidden=on" @end table @c man .TP @c man .B Tree traversal command -find: @node CmdFind, Filter, Manip, Commands @section Tree traversal command -find @c man .PP @table @asis @c man .TP @item -find iso_rr_path [test [op] [test ...]] [-exec action [params]] @minus{}@minus{} @kindex -find traverses and alters ISO tree @cindex Tree, ISO, traverse and alter, -find A restricted substitute for shell command find in the ISO image. It performs an action on matching file objects at or below iso_rr_path. @* If not used as last command in the line then the parameter list needs to get terminated by "@minus{}@minus{}". @* Tests are optional. If they are omitted then action is applied to all file objects. If tests are given then they form together an expression. The action is applied only if the expression matches the file object. Default expression operator between tests is -and, i.e. the expression matches only if all its tests match. @* Available tests are: @* @table @asis @sp 1 @item -name pattern : Matches if pattern matches the file leaf name. If the pattern does not contain any of the characters "*?[", then it will be truncated according to -file_name_limit and thus match the truncated name in the ISO filesystem. @* @item -wholename pattern : Matches if pattern matches the file path as it would be printed by action "echo". Character '/' can be matched by wildcards. If pattern pieces between '/' do not contain any of the characters "*?[", they will be truncated according to -file_name_limit. @* @item -disk_name pattern : Like -name but testing the leaf name of the file source on disk. Can match only data files which do not stem from the loaded image, or for directories above such data files. With directories the result can change between -find runs if their content stems from multiple sources. @* @item -disk_path disk_path : Matches if the given disk_path is equal to the path of the file source on disk. The same restrictions apply as with -disk_name. @* @item -type type_letter : Matches files of the given type: "block", "char", "dir", "pipe", "file", "link", "socket", "eltorito", and "Xotic" which matches what is not matched by the other types. @* Only the first letter is interpreted. E.g.: -find / -type d @* @item -maxdepth number : Matches only files which are at most at the given depth level relative to the iso_rr_path where -find starts. That path itself is at depth 0, its directory children are at 1, their directory children at 2, and so on. @* @item -mindepth number : Matches only files which are at least at the given depth level. @* @item -damaged : Matches files which use data blocks marked as damaged by a previous run of -check_media. The damage info vanishes when a new ISO image gets loaded. @* Note that a MD5 session mismatch marks all files of the session as damaged. If finer distinction is desired, perform -md5 off before -check_media. @* @item -pending_data : Matches files which get their content from outside the loaded ISO image. @* @item -lba_range start_lba block_count : Matches files which use data blocks within the range of start_lba and start_lba+block_count-1. @* @item -has_acl : Matches files which have a non-trivial ACL. @* @item -has_xattr : Matches files which have xattr name-value pairs from user namespace. @* @item -has_aaip : Matches files which have ACL or any xattr. @* @item -has_any_xattr : Matches files which have any xattr other than ACL. @* @item -has_md5 : Matches data files which have MD5 checksums. @* @item -has_hfs_crtp creator type : Matches files which have the given HFS+ creator and type attached. These are codes of 4 characters which get stored if -hfsplus is enabled. Use a single dash '-' as wildcard that matches any such code. E.g:. @* -has_hfs_crtp YYDN TEXT @* -has_hfs_crtp - - @* @item -has_hfs_bless blessing : Matches files which bear the given HFS+ blessing. It may be one of : "ppc_bootdir", "intel_bootfile", "show_folder", "os9_folder", "osx_folder", "any". See also action set_hfs_bless. @* @item -has_filter : Matches files which are filtered by -set_filter. @* @item -hidden hide_state : Matches files which are hidden in "iso_rr" tree, in "joliet" tree, in "hfsplus" tree, in all trees ("on"), or not hidden in any tree ("off"). @* Those which are hidden in some tree match -not -hidden "off". @* @item -bad_outname namespace : Matches files with names which change when converted forth and back between the local character set and one of the namespaces "rockridge", "joliet", "ecma119", "hfsplus". @* All applicable -compliance rules are taken into respect. Rule "omit_version" is always enabled, because else namespaces "joliet" and "ecma119" would cause changes with every non-directory name. Consider to also enable rules "no_force_dots" and "no_j_force_dots". @* The namespaces use different character sets and apply further restrictions to name length, permissible characters, and mandatory name components. "rockridge" uses the character set defined by -out_charset, "joliet" uses UCS-2BE, "ecma119" uses ASCII, "hfsplus" uses UTF-16BE. @* @item -name_limit_blocker length : Matches file names which would prevent command -file_name_limit with the given length. The command itself reports only the first problem file. @* @item -prune : If this test is reached and the tested file is a directory then -find will not dive into that directory. This test itself does always match. @* @item -use_pattern "on"|"off" : This pseudo test controls the interpretation of wildcards with tests -name, -wholename, and -disk_name. Default is "on". If interpretation is disabled by "off", then the parameters of -name, -wholename, and -disk_name have to match literally rather than as search pattern. This test itself does always match. @* @item -or_use_pattern "on"|"off" : Like -use_pattern, but automatically appending the test by -or rather than by -and. Further the test itself does never match. So a subsequent test -or will cause its other operand to be performed. @* @item -decision "yes"|"no" : If this test is reached then the evaluation ends immediately and action is performed if the decision is "yes" or "true". See operator -if. @* @c man \fB\-true\fR and \fB\-false\fR : @c man-ignore-lines 1 @item -true and -false : Always match or match not, respectively. Evaluation goes on. @* @item -sort_lba : Always match. This causes -find to perform its action in a sequence sorted by the ISO image block addresses of the files. It may improve throughput with actions which read data from optical drives. Action will always get the absolute path as parameter. @* Available operators are: @* @item -not : Matches if the next test or sub expression does not match. Several tests do this specifically: @* -undamaged, -lba_range with negative start_lba, -has_no_acl, -has_no_xattr, -has_no_aaip, -has_no_filter . @* @item -and : Matches if both neighboring tests or expressions match. @* @item -or : Matches if at least one of both neighboring tests or expressions matches. @* @c man \fB\-sub\fR ... \fB\-subend\fR or \fB(\fR ... \fB)\fR : @c man-ignore-lines 1 @item -sub ... -subend or ( ... ) : Enclose a sub expression which gets evaluated first before it is processed by neighboring operators. Normal precedence is: -not, -or , -and. @* @c man \fB\-if\fR ... \fB\-then\fR\ ... \fB\-elseif\fR ... \fB\-then\fR ... @c man \fB\-else\fR ... \fB\-endif\fR : @c man-ignore-lines 1 @item -if ... -then ... -elseif ... -then ... -else ... -endif : Enclose one or more sub expressions. If the -if expression matches, then the -then expression is evaluated as the result of the whole expression up to -endif. Else the next -elseif expression is evaluated and if it matches, its -then expression. Finally in case of no match, the -else expression is evaluated. There may be more than one -elseif. Neither -else nor -elseif are mandatory. If -else is missing and would be hit, then the result is a non-match. @* -if-expressions are the main use case for above test -decision. @end table @sp 1 Default action is @strong{echo}, i.e. to print the address of the found file. Other actions are certain @command{xorriso} commands which get performed on the found files. These commands may have specific parameters. See also their particular descriptions. @c man .br @table @asis @sp 1 @c man \fBchown\fR and \fBchown_r\fR @c man-ignore-lines 1 @item chown and chown_r change the ownership and get the user id as parameter. E.g.: -exec chown thomas @minus{}@minus{} @* @c man \fBchgrp\fR and \fBchgrp_r\fR @c man-ignore-lines 1 @item chgrp and chgrp_r change the group attribute and get the group id as parameter. E.g.: -exec chgrp_r staff @minus{}@minus{} @* @c man \fBchmod\fR and \fBchmod_r\fR @c man-ignore-lines 1 @item chmod and chmod_r change access permissions and get a mode string as parameter. E.g.: -exec chmod a-w,a+r @minus{}@minus{} @* @c man \fBalter_date\fR and \fBalter_date_r\fR @c man-ignore-lines 1 @item alter_date and alter_date_r change the timestamps. They get a type character and a timestring as parameters. @* E.g.: -exec alter_date "m" "Dec 30 19:34:12 2007" @minus{}@minus{} @* @c man \fBset_to_mtime\fR @c man-ignore-lines 1 @item set_to_mtime sets the ctime and atime to the value found in mtime. @* @item lsdl prints file information like shell command ls -dl. @* @item compare performs command -compare with the found file address as iso_rr_path and the corresponding file address below its parameter disk_path_start. For this the iso_rr_path of the -find command gets replaced by the disk_path_start. @* E.g.: -find /thomas -exec compare /home/thomas @minus{}@minus{} @* @item update performs command -update with the found file address as iso_rr_path. The corresponding file address is determined like with above action "compare". @* @item update_merge is like update but does not delete the found file if it is missing on disk. It may be run several times and records with all visited files whether their counterpart on disk has already been seen by one of the update_merge runs. Finally, a -find run with action "rm_merge" may remove all files that saw no counterpart on disk. @* Up to the next "rm_merge" or "clear_merge" all newly inserted files will get marked as having a disk counterpart. @* @item rm removes the found iso_rr_path from the image if it is not a directory with files in it. I.e. this "rm" includes "rmdir". @* @item rm_r removes the found iso_rr_path from the image, including whole directory trees. @* @item rm_merge removes the found iso_rr_path if it was visited by one or more previous actions "update_merge" and saw no counterpart on disk in any of them. The marking from the update actions is removed in any case. @* @item clear_merge removes an eventual marking from action "update_merge". @* @item report_damage classifies files whether they hit a data block that is marked as damaged. The result is printed together with the address of the first damaged byte, the maximum span of damages, file size, and the path of the file. @* @item report_lba prints files which are associated to image data blocks. It tells the logical block address, the block number, the byte size, and the path of each file. There may be reported more than one line per file if the file has more than one section. In this case each line has a different extent number in column "xt". @* @item report_sections like report_lba but telling the byte sizes of the particular sections rather than the overall byte size of the file. @* @item getfacl prints access permissions in ACL text form to the result channel. @* @item setfacl attaches ACLs after removing existing ones. The new ACL is given in text form as defined with command -setfacl. @* E.g.: -exec setfacl u:lisa:rw,u::rw,g::r,o::@minus{},m::rw @minus{}@minus{} @* @item getfattr prints xattr name-value pairs to the result channel. The choice of namespaces depends on the setting of command -xattr: "on" or "user" restricts it to the namespace "user", "any" only omits namespace "isofs". @* @item get_any_xattr prints xattr name-value pairs from any namespace except ACL to the result channel. This is mostly for debugging of namespace "isofs". @* @item list_extattr mode prints a script to the result channel, which would use FreeBSD command setextattr to set the file's xattr name-value pairs of user namespace. Parameter mode controls the form of the output of names and values. Default mode "e" prints harmless characters in shell quotation marks, but represents texts with octal 001 to 037 and 0177 to 0377 by an embedded echo -e command. Mode "q" prints any characters in shell quotation marks. This might not be terminal-safe but should work in script files. Mode "r" uses no quotation marks. Not safe. Mode "b" prints backslash encoding. Not suitable for shell parsing. @* E.g. -exec list_extattr e -- @* Command -backslash_codes does not affect the output. @* @item get_md5 prints the MD5 sum, if recorded, together with file path. @* @item check_md5 compares the MD5 sum, if recorded, with the file content and reports if mismatch. @* E.g.: -find / -not -pending_data -exec check_md5 FAILURE @minus{}@minus{} @* @item make_md5 equips a data file with an MD5 sum of its content. Useful to upgrade the files in the loaded image to full MD5 coverage by the next commit with -md5 "on". @* E.g.: -find / -type f -not -has_md5 -exec make_md5 @minus{}@minus{} @* @item setfattr sets or deletes xattr name value pairs. @* E.g.: -find / -has_xattr -exec setfattr @minus{}@minus{}remove-all '' @minus{}@minus{} @* @item set_hfs_crtp adds, changes, or removes HFS+ creator and type attributes. @* E.g.: -exec set_hfs_crtp YYDN TEXT @* E.g.: -find /my/dir -prune -exec set_hfs_crtp --delete - @* @item get_hfs_crtp prints the HFS+ creator and type attributes together with the iso_rr_path, if the file has such attributes at all. @* E.g.: -exec get_hfs_crtp @* @item set_hfs_bless applies or removes HFS+ blessings. They are roles which can be attributed to up to four directories and a data file: @* "ppc_bootdir", "intel_bootfile", "show_folder", "os9_folder", "osx_folder". @* They may be abbreviated as "p", "i", "s", "9", and "x". @* Each such role can be attributed to at most one file object. "intel_bootfile" is the one that would apply to a data file. All others apply to directories. The -find run will end as soon as the first blessing is issued. The previous bearer of the blessing will lose it then. No file object can bear more than one blessing. @* E.g.: -find /my/blessed/directory -exec set_hfs_bless p @* Further there is blessing "none" or "n" which revokes any blessing from the found files. This -find run will not stop when the first match is reached. @* E.g.: -find / -has_hfs_bless any -exec set_hfs_bless none @* @item get_hfs_bless prints the HFS+ blessing role and the iso_rr_path, if the file is blessed at all. @* E.g.: -exec get_hfs_bless @* @item set_filter applies or removes filters. @* E.g.: -exec set_filter @minus{}@minus{}zisofs @minus{}@minus{} @* @item mkisofs_r applies the rules of mkisofs -r to the file object: @* user id and group id become 0, all r-permissions get granted, all w denied. If there is any x-permission, then all three x get granted. s- and t-bits get removed. @* @item sort_weight attributes a LBA weight number to regular files. @* The number may range from -2147483648 to 2147483647. The higher it is, the lower will be the block address of the file data in the emerging ISO image. Currently the boot catalog has a hardcoded weight of 1 billion. Normally it should occupy the block with the lowest possible address. @* Data files which are loaded by -indev or -dev get a weight between 1 and 2 exp 28 = 268,435,456, depending on their block address. This shall keep them roughly in the same order if the write method of modifying is applied. @* Data files which are added by other commands get an initial weight of 0. Boot image files have a default weight of 2. @* E.g.: -exec sort_weight 3 @minus{}@minus{} @* @item show_stream shows the content stream chain of a data file. @* @item show_stream_id is like show_stream, but also prints between stream type and first ":" in square brackets libisofs id numbers: [fs_id,dev_id,ino_id]. @* @item hide brings the file into one of the hide states "on", "iso_rr", "joliet", "hfsplus", "off". They may be combined. E.g.: joliet:hfsplus @* E.g.: @* -find / -disk_name *_secret -exec hide on @* @item print_outname prints in the first line the filename as registered by the program model, and in the second line the filename after conversion forth and back between local character set and one of the namespaces "rockridge", "joliet", "ecma119", or "hfsplus". The third output line is "--" . @* The name conversion does not take into respect the possibility of name collisions in the target namespace. Such collisions are most likely in "joliet" and "ecma119", where they get resolved by automatic file name changes. @* E.g.: @* -find / -bad_outname joliet -exec print_outname joliet @* @item estimate_size prints a lower and an upper estimation of the number of blocks which the found files together will occupy in the emerging ISO image. This does not account for the superblock, for the directories in the -find path, or for image padding. @* @item find performs another run of -find on the matching file address. It accepts the same params as -find, except iso_rr_path. @* E.g.: @* -find / -name '???' -type d -exec find -name '[abc]*' -exec chmod a-w,a+r @minus{}@minus{} @end table @end table @c man .TP @c man .B Filters for data file content: @c man .PP @node Filter, Writing, CmdFind, Commands @section Filters for data file content @cindex Filter, _definition @strong{Filters} may be installed between data files in the ISO image and their content source outside the image. They may also be used vice versa between data content in the image and target files on disk. @* @sp 1 Built-in filters are "@minus{}@minus{}zisofs" and "@minus{}@minus{}zisofs-decode". The former is to be applied via -set_filter, the latter is automatically applied if zisofs compressed content is detected with a file when loading the ISO image. @* Another built-in filter pair is "@minus{}@minus{}gzip" and "@minus{}@minus{}gunzip" with suffix ".gz". They behave about like external gzip and gunzip but avoid forking a process for each single file. So they are much faster if there are many small files. @c man .PP @table @asis @sp 1 @c man .TP @item -external_filter name option[:option] program_path [arguments] @minus{}@minus{} @kindex -external_filter registers data filter @cindex Filter, register, -external_filter Register a content filter by associating a name with a program path, program arguments, and some behavioral options. Once registered it can be applied to multiple data files in the ISO image, regardless whether their content resides in the loaded ISO image or in the local filesystem. External filter processes may produce synthetic file content by reading the original content from stdin and writing to stdout whatever they want. They must deliver the same output on the same input in repeated runs. @* Options are: @* "default" means that no other option is intended. @* "suffix=..." sets a file name suffix. If it is not empty then it will be appended to the file name or removed from it. @* "remove_suffix" will remove a file name suffix rather than appending it. @* "if_nonempty" will leave 0-sized files unfiltered. @* "if_reduction" will try filtering and revoke it if the content size does not shrink. @* "if_block_reduction" will revoke if the number of 2 kB blocks does not shrink. @* "used=..." is ignored. Command -status shows it with the number of files which currently have the filter applied. @* Examples: @* -external_filter bzip2 suffix=.bz2:if_block_reduction \ @* /usr/bin/bzip2 @minus{}@minus{} @* -external_filter bunzip2 suffix=.bz2:remove_suffix \ @* /usr/bin/bunzip2 @minus{}@minus{} @c man .TP @item -unregister_filter name @kindex -external_filter unregisters data filter @cindex Filter, unregister, -unregister_filter Remove an -external_filter registration. This is only possible if the filter is not applied to any file in the ISO image. @c man .TP @item -close_filter_list @kindex -close_filter_list bans filter registration @cindex Filter, ban registration, -close_filter_list Irrevocably ban commands -concat "pipe", -external_filter, and -unregister_filter, but not -set_filter. Use this to prevent external filtering in general or when all intended filters are registered and -concat mode "pipe" shall be disallowed. External filters may also be banned totally at compile time of @command{xorriso}. By default they are banned if @command{xorriso} runs under setuid permission. @c man .TP @item -set_filter name iso_rr_path [***] @kindex -set_filter applies filter to file @cindex Filter, apply to file, -set_filter Apply an -external_filter or a built-in filter to the given data files in the ISO image. If the filter suffix is not empty , then it will be applied to the file name. Renaming only happens if the filter really gets attached and is not revoked by its options. By default files which already bear the suffix will not get filtered. The others will get the suffix appended to their names. If the filter has option "remove_suffix", then the filter will only be applied if the suffix is present and can be removed. Name oversize or collision caused by suffix change will prevent filtering. @* With most filter types this command will immediately run the filter once for each file in order to determine the output size. Content reading operations like -extract , -compare and image generation will perform further filter runs and deliver filtered content. @* At image generation time the filter output must still be the same as the output from the first run. Filtering for image generation does not happen with files from the loaded ISO image if the write method of growing is in effect (i.e -indev and -outdev are identical). @* The reserved filter name "@minus{}@minus{}remove-all-filters" revokes filtering. This will revoke suffix renamings as well. Use "@minus{}@minus{}remove-all-filters+" to prevent any suffix renaming. @* Attaching or detaching filters will not alter the state of -changes_pending. If the filter manipulations shall be the only changes in a write run, then explicitly execute -changes_pending "yes". @c man .TP @item -set_filter_r name iso_rr_path [***] @kindex -set_filter_r applies filter to file tree @cindex Filter, apply to file tree, -set_filter_r Like -set_filter but affecting all data files below eventual directories. @end table @c man .TP @c man .B Writing the result, drive control: @node Writing, SetWrite, Filter, Commands @section Writing the result, drive control @c man .PP (see also paragraph about settings below) @table @asis @sp 1 @c man .TP @item -rollback @kindex -rollback discards pending changes @cindex Image, discard pending changes, -rollback Discard the manipulated ISO image and reload it from -indev. (Use -rollback_end if immediate program end is desired.) @c man .TP @item -changes_pending "no"|"yes"|"mkisofs_printed"|"show_status" @kindex -changes_pending overrides change status @cindex Image, override change status, -changes_pending Write runs are performed only if a change of the image has been made since the image was loaded or created blank. Vice versa the program will start a write run for pending changes when it ends normally (i.e. not by abort and not by command -rollback_end). @* The command -changes_pending can be used to override the automatically determined state. This is mainly useful for setting state "yes" despite no real changes were made. The sequence -changes_pending "no" -end is equivalent to the command -rollback_end. State "mkisofs_printed" is caused by emulation command -as mkisofs if option -print-size is present. @* The pseudo-state "show_status" can be used to print the current state to result channel. @* Image loading or manipulations which happen after this command will again update automatically the change status of the image. @c man .TP @item -commit @kindex -commit writes pending ISO image @cindex Write, pending ISO image, -commit Perform the write operation. Afterwards, if -outdev is readable, make it the new -dev and load the image from there. Switch to growing mode. (A subsequent -outdev will activate modification mode or blind growing.) -commit is performed automatically at end of program if there are uncommitted manipulations pending. @* So, to perform a final write operation with no new -dev and no new loading of image, rather execute command -end. If you want to go on without image loading, execute -commit_eject "none". To eject after write without image loading, use -commit_eject "all". @* To suppress a final write, execute -rollback_end. @* Writing can last quite a while. It is not unnormal with several types of media that there is no progress visible for the first few minutes or that the drive gnaws on the medium for a few minutes after all data have been transmitted. @command{xorriso} and the drives are in a client-server relationship. The drives have much freedom about what to do with the media. Some combinations of drives and media simply do not work, despite the promises by their vendors. If writing fails then try other media or another drive. The reason for such failure is hardly ever in the code of the various burn programs but you may well try some of those listed below under SEE ALSO. @c man .TP @item -eject "in"|"out"|"all" @kindex -eject ejects drive tray @cindex Drive, eject tray, -eject Eject the medium in -indev, -outdev, or both drives, respectively. Note: It is not possible yet to effectively eject disk files. @c man .TP @item -commit_eject "in"|"out"|"all"|"none" @kindex -commit_eject writes and ejects @cindex Drive, write and eject, -commit_eject Combined -commit and -eject. When writing has finished do not make -outdev the new -dev, and load no ISO image. Rather eject -indev and/or -outdev. Give up any non-ejected drive. @c man .TP @item -blank mode @kindex -blank erases media @cindex Media, erase, -blank Make media ready for writing from scratch (if not -dummy is activated). @* This affects only the -outdev not the -indev. If both drives are the same and if the ISO image was altered then this command leads to a FAILURE event. Defined modes are: as_needed, fast, all, deformat, deformat_quickest @* "as_needed" cares for used CD-RW, DVD-RW and for used overwritable media by applying -blank "fast". It applies -format "full" to yet unformatted DVD-RAM and BD-RE. Other media in blank state are gracefully ignored. Media which cannot be made ready for writing from scratch cause a FAILURE event. @* "fast" makes CD-RW and unformatted DVD-RW re-usable, or invalidates overwritable ISO images. "all" might work more thoroughly and need more time. @* "deformat" converts overwritable DVD-RW into unformatted ones. @* "deformat_quickest" is a faster way to deformat or blank DVD-RW but produces media which are only suitable for a single session. Some drives announce this state by not offering feature 21h, but some drives offer it anyway. If feature 21h is missing, then @command{xorriso} will refuse to write on DVD-RW if not command -close is set to "on". @* The progress reports issued by some drives while blanking are quite unrealistic. Do not conclude success or failure from the reported percentages. Blanking was successful if no SORRY event or worse occurred. @* Mode may be prepended by "force:" in order to override the evaluation of the medium state by libburn. E.g. "force:fast". Blanking will nevertheless only succeed if the drive is willing to do it. @* @c man .TP @item -format mode @kindex -format formats media @cindex Media, format, -format Convert unformatted DVD-RW into overwritable ones, "de-ice" DVD+RW, format newly purchased BD-RE or BD-R, re-format DVD-RAM or BD-RE. @* Defined modes are: @* as_needed, full, fast, by_index_, fast_by_index_, by_size_, fast_by_size_, without_spare @* "as_needed" formats yet unformatted DVD-RW, DVD-RAM, BD-RE, or blank unformatted BD-R. Other media are left untouched. @* "full" (re-)formats DVD-RW, DVD+RW, DVD-RAM, BD-RE, or blank unformatted BD-R. @* "fast" does the same as "full" but tries to be quicker. @* "by_index_" selects a format out of the descriptor list issued by command -list_formats. The index number from that list is to be appended to the mode word. E.g: "by_index_3". @* "fast_by_index_" does the same as "by_index_" but tries to be quicker. @* "by_size_" selects a format out of the descriptor list which provides at least the given size. That size is to be appended to the mode word. E.g: "by_size_4100m". This applies to media with Defect Management. On BD-RE it will not choose format 0x31, which offers no Defect Management. @* "fast_by_size_" does the same as "by_size_" but tries to be quicker. @* "without_spare" selects the largest format out of the descriptor list which provides no Spare Area for Defect Management. On BD-RE this will be format 0x31. @* The formatting action has no effect on media if -dummy is activated. @* Formatting is normally needed only once during the lifetime of a medium, if ever. But it is a reason for re-formatting if: @* DVD-RW was deformatted by -blank, @* DVD+RW has read failures (re-format before next write), @* DVD-RAM or BD-RE shall change their amount of defect reserve. @* BD-R may be written unformatted or may be formatted before first use. Formatting activates Defect Management which tries to catch and repair bad spots on media during the write process at the expense of half speed even with flawless media. @* The progress reports issued by some drives while formatting are quite unrealistic. Do not conclude success or failure from the reported percentages. Formatting was successful if no SORRY event or worse occurred. Be patient with apparently frozen progress. @c man .TP @item -list_formats @kindex -list_formats lists available formats @cindex Media, list formats, -list_formats Put out a list of format descriptors as reported by the output drive for the current medium. The list gives the index number after "Format idx", a MMC format code, the announced size in blocks (like "2236704s") and the same size in MiB. @* MMC format codes are manifold. Most important are: "00h" general formatting, "01h" increases reserve space for DVD-RAM, "26h" for DVD+RW, "30h" for BD-RE with reserve space, "31h" for BD-RE without reserve space, "32h" for BD-R. @* Smaller format size with DVD-RAM, BD-RE, or BD-R means more reserve space. @c man .TP @item -list_speeds @kindex -list_speeds lists available write speeds @cindex Media, list write speeds, -list_speeds Put out a list of speed values as reported by the drives with the loaded media. The list tells read speeds of the input drive and of the output drive. Further it tells write speeds of the output drive. @* The list of write speeds does not necessarily mean that the medium is writable or that these speeds are actually achievable. Especially the lists reported with empty drive or with ROM media obviously advertise speeds for other media. @* It is not mandatory to use speed values out of the listed range. The drive is supposed to choose a safe speed that is as near to the desired speed as possible. @* At the end of the list, "Write speed L" and "Write speed H" are the best guesses for lower and upper write speed limit. "Write speed l" and "Write speed h" may appear only with CD and eventually override the list of other speed offers. @* Only if the drive reports contradicting speed information there will appear "Write speed 0", which tells the outcome of speed selection by command -speed 0, if it deviates from "Write speed H". @* "Read speed L" and "Read speed H" tell the minimum and maximum read speeds, as reported by the drive. They would be chosen by -read_speed "min" or "max" if they undercut or surpass the built-in limits. These are "1x", "52xCD", "24xDVD", "20xBD". @c man .TP @item -list_profiles "in"|"out"|"all" @kindex -list_profiles lists supported media @cindex Drive, list supported media, -list_profiles Put out a list of media types supported by -indev, -outdev, or both, respectively. The currently recognized type is marked by text "(current)". @c man .TP @item -truncate_overwritable entity id adjust @kindex -truncate_overwritable activates older session @cindex Older session, activate, -truncate_overwritable On overwritable medium copy the volume descriptors of an existing session to the overall descriptors at LBA 0 ff. This makes all sessions @strong{inaccessible} which are younger than the activated one. A reason to do this would be read errors in the younger sessions and the wish to re-write or skip them. @* This operation is only allowed if no changes to the loaded filesystem are pending. If an -indev is acquired then it is released before the write operation begins and re-acquired only in case of success. @* The parameters "entity" and "id" have the same meaning as with command -load. They choose the existing ISO session which shall become the youngest accessible session. Available entity names are "session", "track", "lba", "sbsector", "volid". "auto" makes few sense. id is a number or search text as appropriate for the given entity. @* Parameter "adjust" controls the claimed size of the activated session. Text "new" means the size of the newly activated session as it was before this command. I.e. the space of the then inaccessible younger sessions will be re-used when appending more sessions. @* "old" means the size up to the end of the previously youngest session. I.e. "old" will not free the space of the then inaccessible younger sessions for re-use. @* A number preceded by "+" gives the number of bytes to be added to "new". A number without "+" gives the overall number of bytes. In any case the result may not be smaller than "new". Numbers may have a unit suffix: "d"=512, "k"=1024, "s"=2048, "m"=1024k, "g"=1024m. @* Examples: @* Activate session 4 and enable overwriting of the blocks of younger sessions: @* -truncate_overwritable session 4 new @* Activate session 4 and claim the blocks of younger sessions as useless part of session 4: @* -truncate_overwritable session 4 old @* Let session 4 claim additional 500 MiB as useless data: @* -truncate_overwritable session 4 +500m @c man .TP @item -close_damaged "as_needed"|"force" @kindex -close_damaged closes damaged track and session @cindex Damaged track and session, close, -close_damaged Try to close the upcoming track and session if the drive reported the medium as damaged. This may apply to CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, DVD+R DL, or BD-R media. It is indicated by warning messages when the drive gets acquired, and by a remark "but next track is damaged" with the line "Media status :" of command -toc. @* The setting of command -close determines whether the medium stays appendable. @* Mode "as_needed" gracefully refuses on media which are not reported as damaged. Mode "force" attempts the close operation even with media which appear undamaged. @* No image changes are allowed to be pending before this command is performed. After closing was attempted, both drives are given up. @end table @c man .TP @c man .B Settings for result writing: @node SetWrite, Bootable, Writing, Commands @section Settings for result writing @c man .PP Rock Ridge info will be generated by default. ACLs will be written according to the setting of command -acl. @table @asis @sp 1 @c man .TP @item -joliet "on"|"off" @kindex -joliet enables production of Joliet tree @cindex Write, enable Joliet, -joliet If enabled by "on", generate Joliet tree additional to ISO 9660 + Rock Ridge tree. @sp 1 @c man .TP @item -hfsplus "on"|"off" @kindex -hfsplus enables production of HFS+ partition @cindex Write, enable HFS+, -hfsplus If enabled by "on", generate a HFS+ filesystem inside the ISO 9660 image and mark it by Apple Partition Map (APM) entries in the System Area, the first 32 KiB of the image. @* This may collide with data submitted by -boot_image system_area=. The first 8 bytes of the System Area get overwritten by @{ 0x45, 0x52, 0x08 0x00, 0xeb, 0x02, 0xff, 0xff @} which can be executed as x86 machine code without negative effects. So if an MBR gets combined with this feature, then its first 8 bytes should contain no essential commands. @* The next blocks of 2 KiB in the System Area will be occupied by APM entries. The first one covers the part of the ISO image before the HFS+ filesystem metadata. The second one marks the range from HFS+ metadata to the end of file content data. If more ISO image data follow, then a third partition entry gets produced. Other features of xorriso might cause the need for more APM entries. @* The HFS+ filesystem is not suitable for add-on sessions produced by the multi-session method of growing. An existing ISO image may nevertheless be the base for a new image produced by the method of modifying. If -hfsplus is enabled when -indev or -dev gets executed, then AAIP attributes get loaded from the input image and checked for information about HFS creator, filetype, or blessing. If found, then they get enabled as settings for the next image production. Therefore it is advisable to perform -hfsplus "on" before -indev or -dev. @* Information about HFS creator, type, and blessings gets stored by xorriso if -hfsplus is enabled at -commit time. It is stored as copy outside the HFS+ partition, but rather along with the Rock Ridge information. xorriso does not read any information from the HFS+ meta data. @* Be aware that HFS+ is case-insensitive although it can record file names with upper-case and lower-case letters. Therefore, file names from the iso_rr name tree may collide in the HFS+ name tree. In this case they get changed by adding underscore characters and counting numbers. In case of very long names, it might be necessary to map them to "MANGLED_...". @* WARNING: @* The HFS+ implementation in libisofs has a limit of 125,829,120 bytes for the size of the overall directory tree. This suffices for about 300,000 files of normal name length. If the limit gets exceeded, a FAILURE event will be issued and the ISO production will not happen. @sp 1 @c man .TP @item -rockridge "on"|"off" @kindex -rockridge disables production of Rock Ridge info @cindex Write, disable Rock Ridge, -rockridge Mode "off" disables production of Rock Ridge information for the ISO 9660 file objects. The multi-session capabilities of xorriso depend much on the naming fidelity of Rock Ridge. So it is strongly discouraged to deviate from default setting "on". @c man .TP @item -compliance rule[:rule...] @kindex -compliance controls standard compliance @cindex Write, compliance to specs, -compliance Adjust the compliance to specifications of ISO 9660/ECMA-119 and its contemporary extensions. In some cases it is worth to deviate a bit in order to circumvent bugs of the intended reader system or to get unofficial extra features. @* There are several adjustable rules which have a keyword each. If they are mentioned with this command then their rule gets added to the relaxation list. This list can be erased by rules "strict" or "clear". It can be reset to its start setting by "default". All of the following relaxation rules can be revoked individually by appending "_off". Like "deep_paths_off". @* Rule keywords are: @* "iso_9660_level="number chooses level 1 with ECMA-119 names of the form 8.3 and -file_size_limit <= 4g - 1, or level 2 with ECMA-119 names up to length 32 and the same -file_size_limit, or level 3 with ECMA-119 names up to length 32 and -file_size_limit >= 400g -200k. If necessary -file_size_limit gets adjusted. @* "allow_dir_id_ext" allows ECMA-119 names of directories to have a name extension as with other file types. It does not force dots and it omits the version number, though. This is a bad tradition of mkisofs which violates ECMA-119. Especially ISO level 1 only allows 8 characters in a directory name and not 8.3. @* "omit_version" does not add versions (";1") to ECMA-119 and Joliet file names. @* "only_iso_version" does not add versions (";1") to Joliet file names. @* "deep_paths" allows ECMA-119 file paths deeper than 8 levels. @* "long_paths" allows ECMA-119 file paths longer than 255 characters. @* "long_names" allows up to 37 characters with ECMA-119 file names. @* "no_force_dots" does not add a dot to ECMA-119 file names which have none. @* "no_j_force_dots" does not add a dot to Joliet file names which have none. @* "lowercase" allows lowercase characters in ECMA-119 file names. @* "7bit_ascii" allows nearly all 7-bit characters in ECMA-119 file names. Not allowed are 0x0 and '/'. If not "lowercase" is enabled, then lowercase letters get converted to uppercase. @* "full_ascii" allows all 8-bit characters except 0x0 and '/' in ECMA-119 file names. @* "untranslated_names" might be dangerous for inadverted reader programs which rely on the restriction to at most 37 characters in ECMA-119 file names. This rule allows ECMA-119 file names up to 96 characters with no character conversion. If a file name has more characters, then image production will fail deliberately. @* "untranslated_name_len="number enables untranslated_names with a smaller limit for the length of file names. 0 disables this feature, -1 chooses maximum length limit, numbers larger than 0 give the desired length limit. @* "joliet_long_names" allows Joliet leaf names up to 103 characters rather than 64. @* "joliet_long_paths" allows Joliet paths longer than 240 characters. @* @cindex UTF-16, for Joliet paths, -compliance "joliet_utf16" encodes Joliet names in UTF-16BE rather than UCS-2. The difference is with characters which are not present in UCS-2 and get encoded in UTF-16 by 2 words of 16 bit each. Both words then stem from a reserved subset of UCS-2. @* "always_gmt" stores timestamps in GMT representation with timezone 0. @* "rec_mtime" records with non-RockRidge directory entries the disk file's mtime and not the creation time of the image. This applies to the ECMA-119 tree (plain ISO 9660), to Joliet, and to ISO 9660:1999. "rec_time" is default. If disabled, it gets automatically re-enabled by -as mkisofs emulation when a pathspec is encountered. @* "new_rr" uses Rock Ridge version 1.12 (suitable for GNU/Linux but not for older FreeBSD or for Solaris). This implies "aaip_susp_1_10_off" which may be changed by subsequent "aaip_susp_1_10". @* Default is "old_rr" which uses Rock Ridge version 1.10. This implies also "aaip_susp_1_10" which may be changed by subsequent "aaip_susp_1_10_off". @* "aaip_susp_1_10" allows AAIP to be written as unofficial extension of RRIP rather than as official extension under SUSP-1.12. @* "no_emul_toc" saves 64 kB with the first session on overwritable media but makes the image incapable of displaying its session history. @* "iso_9660_1999" causes the production of an additional directory tree compliant to ISO 9660:1999. It can record long filenames for readers which do not understand Rock Ridge. @* "old_empty" uses the old way of of giving block addresses in the range of [0,31] to files with no own data content. The new way is to have a dedicated block to which all such files will point. @* Default setting is @* "clear:only_iso_version:deep_paths:long_paths:no_j_force_dots: @* always_gmt:old_rr". @* Note: The term "ECMA-119 name" means the plain ISO 9660 names and attributes which get visible if the reader ignores Rock Ridge. @c man .TP @item -rr_reloc_dir name @kindex -rr_reloc_dir sets name of relocation directory @cindex Relocation directory, set name, -rr_reloc_dir Specify the name of the relocation directory in which deep directory subtrees shall be placed if -compliance is set to "deep_paths_off" or "long_paths_off". A deep directory is one that has a chain of 8 parent directories (including root) above itself, or one that contains a file with an ECMA-119 path of more than 255 characters. @* The overall directory tree will appear originally deep when interpreted as Rock Ridge tree. It will appear as re-arranged if only ECMA-119 information is considered. @* The default relocation directory is the root directory. By giving a non-empty name with -rr_reloc_dir, a directory in the root directory may get this role. If that directory does not already exist at -commit time, then it will get created and marked for Rock Ridge as relocation artefact. At least on GNU/Linux it will not be displayed in mounted Rock Ridge images. @* The name must not contain a '/' character and must not be longer than 255 bytes. @c man .TP @item -volid text @kindex -volid sets volume id @cindex Image, set volume id, -volid Specify the volume ID, which most operating systems will consider to be the volume name of the image or medium. @* @command{xorriso} accepts any text up to 32 characters, but according to rarely obeyed specs stricter rules apply: @* ECMA-119 demands ASCII characters out of [A-Z0-9_]. Like: @* "IMAGE_23" @* Joliet allows 16 UCS-2 characters. Like: @* "Windows name" @* Be aware that the volume id might get used automatically as the name of the mount point when the medium is inserted into a playful computer system. @* If an ISO image gets loaded while the volume ID is set to default "ISOIMAGE" or to "", then the volume ID of the loaded image will become the effective volume id for the next write run. But as soon as command -volid is performed afterwards, this pending ID is overridden by the new setting. @* Consider this when setting -volid "ISOIMAGE" before executing -dev, -indev, or -rollback. If you insist in -volid "ISOIMAGE", set it again after those commands. @c man .TP @item -volset_id text @kindex -volset_id sets volume set id @cindex Image, set volume set id, -volset_id Set the volume set ID string to be written with the next -commit. Permissible are up to 128 characters. This setting gets overridden by image loading. @c man .TP @item -publisher text @kindex -publisher sets publisher id @cindex Image, set publisher id, -publisher Set the publisher ID string to be written with the next -commit. This may identify the person or organisation who specified what shall be recorded. Permissible are up to 128 characters. This setting gets overridden by image loading. @c man .TP @item -application_id text @kindex -application_id sets application id @cindex Image, set application id, -application_id Set the application ID string to be written with the next -commit. This may identify the specification of how the data are recorded. Permissible are up to 128 characters. This setting gets overridden by image loading. @* The special text "@@xorriso@@" gets converted to the ID string of @command{xorriso} which is normally written as -preparer_id. It is a wrong tradition to write the program ID as -application_id. @c man .TP @item -system_id text @kindex -system_id sets system id @cindex Image, set system id, -system_id Set the system ID string to be written with the next -commit. This may identify the system which can recognize and act upon the content of the System Area in image blocks 0 to 15. Permissible are up to 32 characters. This setting gets overridden by image loading. @c man .TP @item -volume_date type timestring @kindex -volume_date sets volume timestamp @cindex Image, set volume timestamp, -volume_date Set one of the four overall timestamps for subsequent image writing. Available types are: @* "c" time when the volume was created. @* "m" time when volume was last modified. @* "x" time when the information in the volume expires. @* "f" time since when the volume is effectively valid. @* "all_file_dates" sets mtime, atime, and ctime of all files and directories to the given time. If the timestring is "set_to_mtime", then the atime and ctime of each file and directory get set to the value found in their mtime. @* These actions stay delayed until actual ISO production begins. Up to then they can be revoked by "all_file_dates" with empty timestring or timestring "default". @* The timestamps of the El Torito boot catalog file get refreshed when the ISO is produced. They can be influenced by "uuid". @* "uuid" sets a timestring that overrides "c" and "m" times literally and sets the time of the El Torito boot catalog. It must consist of 16 decimal digits which form YYYYMMDDhhmmsscc, with YYYY between 1970 and 2999. Time zone is GMT. It is supposed to match this GRUB line: @* search @minus{}@minus{}fs-uuid @minus{}@minus{}set YYYY-MM-DD-hh-mm-ss-cc @* E.g. 2010040711405800 is 7 Apr 2010 11:40:58 (+0 centiseconds). @* Timestrings for the other types may be given as with command -alter_date. Some of them are prone to timezone computations. The timestrings "default" or "overridden" cause default settings: "c" and "m" will show the current time of image creation. "x" and "f" will be marked as insignificant. "uuid" will be deactivated. @* At -commit time, some timestamps get set to the maximum value of effectively written volume creation and modification time: El Torito boot catalog, HFS+ superblock, ECMA-119 file modification time if -compliance "no_rec_mtime". The isohybrid MBR id is computed from "uuid" if given, else from the effective volume modification date. @c man .TP @item -copyright_file text @kindex -copyright_file sets copyright file name @cindex Image, set copyright file name, -copyright_file Set the copyright file name to be written with the next -commit. This should be the ISO 9660 path of a file in the image which contains a copyright statement. Permissible are up to 37 characters. This setting gets overridden by image loading. @c man .TP @item -abstract_file text @kindex -abstract_file sets abstract file name @cindex Image, set abstract file name, -abstract_file Set the abstract file name to be written with the next -commit. This should be the ISO 9660 path of a file in the image which contains an abstract statement about the image content. Permissible are up to 37 characters. This setting gets overridden by image loading. @c man .TP @item -biblio_file text @kindex -biblio_file sets biblio file name @cindex Image, set biblio file name, -biblio_file Set the biblio file name to be written with the next -commit. This should be the ISO 9660 path of a file in the image which contains bibliographic records. Permissible are up to 37 characters. This setting gets overridden by image loading. @c man .TP @item -preparer_id text @kindex -preparer_id sets preparer id @cindex Image, set preparer id, -preparer_id Set the preparer ID string to be written with the next -commit. This may identify the person or other entity which controls the preparation of the data which shall be recorded. Normally this should be the ID of @command{xorriso} and not of the person or program which operates @command{xorriso}. Please avoid to change it. Permissible are up to 128 characters. @* The special text "@@xorriso@@" gets converted to the ID string of @command{xorriso} which is default at program startup. @* Unlike other ID strings, this setting is not influenced by image loading. @c man .TP @item -application_use character|0xXY|disk_path @kindex -application_use sets application use field @cindex Image, set application iuse field, -application_use Specify the content of the Application Use field which can take at most 512 bytes. @* If the parameter of this command is empty, then the field is filled with 512 0-bytes. If it is a single character, then it gets repeated 512 times. If it begins by "0x" followed by two hex digits [0-9a-fA-F], then the digits are read as byte value which gets repeated 512 times. @* Any other parameter text is used as disk_path to open a data file and to read up to 512 bytes from it. If the file is smaller than 512 bytes, then the remaining bytes in the field get set to binary 0. @* This setting is not influenced by image loading. @c man .TP @item -out_charset character_set_name @kindex -out_charset sets output character set @cindex Character Set, for output, -out_charset Set the character set to which file names get converted when writing an image. See paragraph "Character sets" for more explanations. When loading the written image after -commit the setting of -out_charset will be copied to -in_charset. @c man .TP @item -uid uid @kindex -uid sets global ownership @cindex Ownership, global in ISO image, -uid User id to be used for all files when the new ISO tree gets written to media. @c man .TP @item -gid gid @kindex -gid sets global ownership @cindex Group, global in ISO image, -gid Group id to be used for all files when the new ISO tree gets written to media. @c man .TP @item -zisofs parameter[:parameters] @kindex -zisofs controls zisofs production @cindex Filter, zisofs parameters, -zisofs Set global parameters for zisofs compression. This data format is recognized and transparently uncompressed by some Linux kernels. It is to be applied via command -set_filter with built-in filter "@minus{}@minus{}zisofs". @* Note: This command is only permitted while no --zisofs filters are applied to any files. @* Parameters are: @* "level="[0-9] zlib compression: 0=none, 1=fast,..., 9=slow @* "block_size="32k|64k|128k sets the size of version 1 compression blocks. @* "by_magic=on" enables an expensive test at image generation time which checks files from disk whether they already are zisofs compressed, e.g. by program mkzftree. "by_magic=v2" enables processing of already zisofs2 compressed files additionally to those of zisofs version 1. "by_magic=off" disables both. @* "version_2="off|as_needed|on controls compression by experimental version zisofs2 which can encode files of size 4 GiB or larger. The Linux kernel (as of 5.9) does not yet know this format and will complain like @* isofs: Unknown ZF compression algorithm: PZ @* The files will then appear in their compressed form with zisofs2 header, block pointer list, and compressed data. @* zisofs2 is recognized by xorriso in files from loaded images and gets equipped with --zisofs-decode filters, unless restrictions on the number of block pointers prevent this. @* Mode "off" restricts compression to files smaller than 4 GiB uncompressed size. Mode "as_needed" uses zisofs2 for larger files. Mode "on" uses zisofs2 for all zisofs compressed files. @* "susp_z2="off|on controls production of SUSP entries "Z2" instead of "ZF" with zisofs2 compressed files. Unaware Linux kernels are supposed to silently ignore "Z2" entries. @* "block_size_v2="32k|64k|128k|256k|512k|1m sets the size of compression blocks for zisofs2. @* "bpt_target="-1|>0 sets a number of block pointers per file, which is considered low enough to justify a reduction of block size. If this number is larger than 0, then block sizes smaller than the settings of block_size= or block_size_v2= are tried whether they yield not more block pointers than the given number. If so, the smallest suitable block size is applied. @* The inavoidable final block pointer counts. E.g. a file of 55 KiB has 3 block pointers if block size is 32k, and 2 block pointers with block size 64k. @* bpt_target=-1 disables this automatic block size adjustment. @* "max_bpt="1k...128g sets the limit for the overall allocated block pointer memory. Block pointers occupy virtual memory while a file gets uncompressed and while a file, which shall be compressed, waits for ISO filesystem creation. @* One pointer occupies 8 bytes of memory and governs block_size or block_size_v2 uncompressed bytes. I.e. with block size 128k, 1m of block pointer memory suffices for at most 16g of uncompressed file size. Each file consumes one end block pointer, independently of the file size. Partially filled end blocks may further reduce the effective payload. @* In case of overflow of the max_bpt limit while adding compression filters the program tries to go on by discarding all buffered block pointers of previously added --zisofs filters. From then on all newly added filters will discard their block pointers immediately after being added. Discarded block pointers cause an additional read and compression run of the input file during the production of the ISO filesystem. @* "max_bpt_f="1k...128g sets the limit for the memory size of the block pointer list of a single file. max_bpt_f is never larger than max_bpt. If either is set to violate this rule, the other gets set to the same value. If both values are the same before a change by max_bpt= or max_bpt_f=, then both limits stick together unless the limit is decreased by max_bpt_f=. @* "bpt_free_ratio="-1|0.0...1.0 sets a threshold for switching to block pointer discarding during compression. If less than the given fraction of the max_bpt_f= memory is free, then block pointers of compression filters get discarded immediately after being added. Value -1 disables this feature. @* "default" is the same as "level=6:block_size=32k:by_magic=off: version_2=off:block_size_v2=128k:susp_z2=off:max_bpt=256m:max_bpt_f=256m: bpt_free_ratio=-1". @c man .TP @item -speed code|number[k|m|c|d|b] @kindex -speed set write speed @cindex Write, set speed, -speed Set the burn speed. Default is "max" (or "0") = maximum speed as announced by the drive. Further special speed codes are: @* "min" (or "-1") selects minimum speed as announced by the drive. @* "none" avoids to send a speed setting command to the drive before burning begins. @* Speed can be given in media dependent numbers or as a desired throughput per second in MMC compliant kB (= 1000) or MB (= 1000 kB). Media x-speed factor can be set explicitly by "c" for CD, "d" for DVD, "b" for BD, "x" is optional. @* Example speeds: @* 706k = 706kB/s = 4c = 4xCD @* 5540k = 5540kB/s = 4d = 4xDVD @* If there is no hint about the speed unit attached, then the medium in the -outdev will decide. Default unit is CD = 176.4k. @* MMC drives usually activate their own idea of speed and take the speed value given by the burn program only as upper limit for their own decision. @c man .TP @item -stream_recording "on"|"off"|"full"|"data"|number @kindex -stream_recording controls defect management @cindex Write, defect management, -stream_recording Setting "on" tries to circumvent the management of defects on DVD-RAM, BD-RE, or BD-R. Defect management keeps partly damaged media usable. But it reduces write speed to half nominal speed even if the medium is in perfect shape. For the case of flawless media, one may use -stream_recording "on" to get full speed. @* "full" tries full speed with all write operations, whereas "on" does this only above byte address 32s. One may give a number of at least 16s in order to set an own address limit. @* "data" causes full speed to start when superblock and directory entries are written and writing of file content blocks begins. @c man .TP @item -dvd_obs "default"|"32k"|"64k" @kindex -dvd_obs set write block size @cindex Write, block size, -dvd_obs GNU/Linux specific: Set the number of bytes to be transmitted with each write operation to DVD or BD media. A number of 64 KB may improve throughput with bus systems which show latency problems. The default depends on media type, on command -stream_recording , and on compile time options. @c man .TP @item -modesty_on_drive parameter[:parameters] @kindex -modesty_on_drive keep drive buffer hungry @cindex Write, drive buffer, -modesty_on_drive Control whether the drive buffer shall be kept from getting completely filled. Parameter "on" (or "1") keeps the program from trying to write to the burner drive while its buffer is in danger to be filled over a given limit. If this limit is exceeded then the program will wait until the filling reaches a given low percentage value. @* This can ease the load on operating system and drive controller and thus help with achieving better input bandwidth if disk and burner are not on independent controllers (like hda and hdb). It may also help with throughput problems of simultaneous burns on different burners with Linux kernels like 3.16, if one has reason not to fix the problem by -scsi_dev_family "sg". On the other hand it increases the risk of buffer underflow and thus reduced write speed. @* Some burners are not suitable because they report buffer fill with granularity too coarse in size or time, or expect their buffer to be filled to the top before they go to full speed. @* Parameters "off" or "0" disable this feature. @* The threshold for beginning to wait is given by parameter "max_percent=". Parameter "min_percent=" defines the threshold for resuming transmission. Percentages are permissible in the range of 25 to 100. Numbers in this range without a prepended name are interpreted as "on:min_percent=". @* E.g.: -modesty_on_drive 75 @* The optimal values depend on the buffer behavior of the drive. @* Parameter "timeout_sec=" defines after which time of unsuccessful waiting the modesty shall be disabled because it does not work. @* Parameter "min_usec=" defines the initial sleeping period in microseconds. If the drive buffer appears to be too full for sending more data, the program will wait the given time and inquire the buffer fill state again. If repeated inquiry shows not enough free space, the sleep time will slowly be increased to what parameter "max_usec=" defines. @* Parameters, which are not mentioned with a -modesty_on_drive command, stay unchanged. Default is: @* -modesty_on_drive off:min_percent=90:max_percent=95: timeout_sec=120:min_usec=5000:max_usec=25000 @c man .TP @item -use_immed_bit "on"|"off"|"default" @kindex -use_immed_bit controls use of Immed bit @cindex Blank, format, Immed bit, -use_immed_bit Control whether several long lasting SCSI commands shall be executed with the Immed bit, which makes the commands end early while the drive operation is still going on. xorriso then inquires progress indication until the drive reports to be ready again. If this feature is turned off, then blanking and formatting will show no progress indication. @* It may depend on the operating system whether -use_immed_bit is set to "off" by default. Command -status will tell by appending "/on" or "/off" if a drive has already been acquired and -use_immed_bit is currently set to "default". Command -use_immed_bit tolerates and ignores such appended text. @c man .TP @item -stdio_sync "on"|"off"|"end"|number @kindex -stdio_sync controls stdio buffer @cindex Write, buffer syncing, -stdio_sync Set the number of bytes after which to force output to stdio: pseudo drives. This forcing keeps the memory from being clogged with lots of pending data for slow devices. Default "on" is the same as "16m". Forced output can be disabled by "off", or be delayed by "end" until all data are produced. If a number is chosen, then it must be at least 64k. @c man .TP @item -dummy "on"|"off" @kindex -dummy controls write simulation @cindex Write, simulation, -dummy If "on" then simulate burning or refuse with FAILURE event if no simulation is possible, do neither blank nor format. @c man .TP @item -fs number["k"|"m"] @kindex -fs sets size of fifo @cindex Write, fifo size, -fs Set the size of the fifo buffer which smoothens the data stream from ISO image generation to media burning. Default is 4 MiB, minimum 64 kiB, maximum 1 GiB. The number may be followed by letter "k" or "m" which means unit is kiB (= 1024) or MiB (= 1024 kiB). @c man .TP @item -close "on"|"off"|"as_needed" @kindex -close controls media closing @cindex Write, close media, -close If -close is set to "on" then mark the written medium as not appendable any more. This will have no effect on overwritable media types. Setting "on" is the contrary of cdrecord option -multi, and is one aspect of growisofs option -dvd-compat. @* If set to "off" then keep the medium writable for an appended session. @* If set to "as_needed" then use "on" only if "off" is predicted to fail with the given medium and its state. @* Not all drives correctly recognize fast-blanked DVD-RW which need "on". If there is well founded suspicion that a burn run failed due to -close "off", then -close "as_needed" causes a re-try with "on". @* Note that emulation command -as "cdrecord" temporarily overrides the current setting of -close by its own default -close "on" if its option -multi is missing. @c man .TP @item -write_type "auto"|"tao"|"sao/dao" @kindex -write_type chooses TAO or SAO/DAO @cindex Write, TAO or SAO/DAO, -write_type Set the write type for the next burn run. "auto" will select SAO with blank CD media, DAO with blank DVD-R[W] if -close is "on", and elsewise CD TAO or the equivalent write type of the particular DVD/BD media. Choosing TAO or SAO/DAO explicitly might cause the burn run to fail if the desired write type is not possible with the given media state. @c man .TP @item -padding number["k"|"m"]|"included"|"appended" @kindex -padding sets amount or mode of image padding @cindex Write, padding image, -padding Append the given number of extra bytes to the image stream. This is a traditional remedy for a traditional bug in block device read drivers. Needed only for CD recordings in TAO mode. Since one can hardly predict on what media an image might end up, @command{xorriso} adds the traditional 300k of padding by default to all images. @* For images which will never get to a CD it is safe to use -padding 0 . @* Normally padding is not written as part of the ISO image but appended after the image end. This is -padding mode "appended". @* Emulation command -as "mkisofs" and command -jigdo cause padding to be written as part of the image. The same effect is achieved by -padding mode "included". @end table @c man .TP @c man .B Bootable ISO images: @node Bootable, Jigdo, SetWrite, Commands @section Bootable ISO images @c man .PP Contrary to published specifications many BIOSes will load an El Torito record from the first session on media and not from the last one, which gets mounted by default. This makes no problems with overwritable media, because they appear to inadverted readers as one single session. @* But with multi-session media CD-R[W], DVD-R[W], DVD+R, it implies that the whole bootable system has to reside already in the first session and that the last session still has to bear all files which the booted system expects after mounting the ISO image. @* If a boot image from ISOLINUX or GRUB is known to be present on media then it is advised to patch it when a follow-up session gets written. But one should not rely on the capability to influence the bootability of the existing sessions, unless one can assume overwritable media. @* Normally the boot images are data files inside the ISO filesystem. By special path "--interval:appended_partition_NNN:all::" it is possible to refer to an appended partition. The number NNN gives the partition number as used with the corresponding command -append_partition. E.g.: @* -append_partition 2 0xef /tmp/efi.img @* -boot_image any efi_path=--interval:appended_partition_2:all:: @* There are booting mechanisms which do not use an El Torito record but rather start at the first bytes of the image: PC-BIOS MBR or EFI GPT for hard-disk-like devices, APM partition entries for Macs which expect HFS+ boot images, MIPS Volume Header for old SGI computers, DEC Boot Block for old MIPS DECstation, SUN Disk Label for SPARC machines, HP-PA boot sector for HP PA-RISC machines, DEC Alpha SRM boot sector for old DEC Alpha machines. @c man .PP @sp 1 @cindex Interval reader for system area and partitions Several of the following commands expect disk paths as input but also accept description strings for the libisofs interval reader, which is able to cut out data from disk files or -indev and to zeroize parts of the content: command -append_partition, boot specs system_area=, grub2_mbr=, prep_boot_part=, efi_boot_part=. @* The description string consists of the following components, separated by colon ':' @* "@minus{}@minus{}interval:"Flags":"Interval":"Zeroizers":"Source @* The component "@minus{}@minus{}interval" states that this is not a plain disk path but rather an interval reader description string. @* The component Flags modifies the further interpretation: @* "local_fs" demands to read from a file depicted by the path in Source. @* "imported_iso" demands to read from the -indev. This works only if -outdev is not the same as -indev. The Source component is ignored. @* "appended_partition_NNN" with a decimal number NNN works only for -boot_image bootspecs which announce El Torito boot image paths: bin_path=, efi_path=. The number gives the partition number as used with the corresponding command -append_partition. @* The component Interval consists of two byte address numbers separated by a "-" character. E.g. "0-429" means to read bytes 0 to 429. @* The component Zeroizers consists of zero or more comma separated strings. They define which part of the read data to zeroize. Byte number 0 means the byte read from the Interval start address. Each string may be one of: @* "zero_mbrpt" demands to zeroize the MBR partition table if bytes 510 and 511 bear the MBR signature 0x55 0xaa. @* "zero_gpt" demands to check for a GPT header in bytes 512 to 1023, to zeroize it and its partition table blocks. @* "zero_apm" demands to check for an APM block 0 and to zeroize its partition table blocks. @* Start_byte"-"End_byte demands to zeroize the read-in bytes beginning with number Start_byte and ending after End_byte. @* The component Source is the file path with flag "local_fs", and ignored with flag "imported_iso". @* Byte numbers may be scaled by a suffix out of @{k,m,g,t,s,d@} meaning multiplication by @{1024, 1024k, 1024m, 1024g, 2048, 512@}. A scaled value end number depicts the last byte of the scaled range. @* E.g. "0d-0d" is "0-511". @* Examples: @* "local_fs:0-32767:zero_mbrpt,zero_gpt,440-443:/tmp/template.iso" @* "imported_iso:45056d-47103d::" @* @table @asis @sp 1 @c man .TP @item -boot_image "any"|"isolinux"|"grub" @kindex -boot_image controls bootability @cindex Write, bootability, -boot_image @cindex Bootability, control, -boot_image @* "discard"|"keep"|"patch"|"replay"|"show_status"| bootspec|"next" @* @sp 1 Define the equipment of the emerging filesystem with boot entry points. @* With systems which boot via BIOS or EFI this is a set of El Torito boot images, possibly MBR boot code, and possibly partition tables of type MBR, GPT, or APM. Such file sets get produced by boot loader systems like ISOLINUX or GRUB. @* @sp 1 Each -boot_image command has two parameters: type and setting. More than one -boot_image command may be used to define the handling of one or more boot images. Sequence matters. @* Types @strong{isolinux} and @strong{grub} care for known peculiarities. Type @strong{any} makes no assumptions about the origin of the boot images. @* @sp 1 When loading an ISO filesystem, system area and El Torito boot images get loaded, too. The default behavior is not to write loaded El Torito boot images and to write the loaded system area content without alterations. @* @strong{discard} gives up the El Torito boot catalog and its boot images. regardless whether loaded from an ISO filesystem or defined by commands. Any BIOS or EFI related boot options get revoked. Nevertheless, loaded system area data stay valid. If desired, they have to be erased by @* -boot_image any system_area=/dev/zero @* @strong{keep} keeps or copies El Torito boot images unaltered and writes a new catalog. @* @strong{patch} applies patching to existing El Torito boot images if they seem to bear a boot info table. @* A boot info table needs to be patched when the boot image gets newly introduced into the ISO image or if an existing image gets relocated. This is automatically done if type "isolinux" or "grub" is given, but not with "any". @* If patching is enabled, then boot images from previous sessions will be checked whether they seem to bear a boot info table. If not, then they stay unpatched. This check is not infallible. So if you do know that the images need no patching, use "any" "keep". "grub" "patch" will not patch EFI images (platform_id=0xef). @* @strong{replay} is a more modern version of "patch", which not only cares for existing El Torito boot equipment but also for the recognizable boot provisions in the System Area. It discards any existing -boot_image setting and executes the commands proposed by command -report_el_torito "cmd". @* This action will only succeed if the file objects mentioned in the output of command -report_el_torito "cmd" are still available. Do not remove or rename boot image files after -indev. @* Drop unknown El Torito: -boot_image "any" "discard" @* Maintain recognizable stuff: -boot_image "any" "replay" @* El Torito only for GRUB: -boot_image "grub" "patch" @* El Torito only for ISOLINUX: -boot_image "isolinux" "patch" @* @strong{show_status} will print what is known about the loaded boot images and their designated fate. @* @sp 1 A @strong{bootspec} is a word of the form name=value. It is used to describe the parameters of a boot feature. The names "dir", "bin_path", "efi_path" lead to El Torito bootable images. Name "system_area" activates a given file as MBR or other disk header. @* On all media types this is possible within the first session. In further sessions an existing boot image can get replaced by a new one, but depending on the media type this may have few effect at boot time. See above. @* El Torito boot images have to be added to the ISO image by normal means (image loading, -map, -add, ...). In case of ISOLINUX the files should reside either in ISO image directory /isolinux or in /boot/isolinux . In that case it suffices to use as bootspec the text "@strong{dir=/isolinux}" or "dir=/boot/isolinux". E.g.: @* -boot_image isolinux dir=/boot/isolinux @* which bundles these individual settings: @* -boot_image isolinux bin_path=/boot/isolinux/isolinux.bin @* -boot_image isolinux cat_path=/boot/isolinux/boot.cat @* -boot_image isolinux load_size=2048 @* -boot_image any boot_info_table=on @* An El Torito boot catalog file gets inserted into the ISO image with address @strong{cat_path=} with the first -boot_image "any" "next" or at -commit time. It is subject to normal -overwrite and -reassure processing if there is already a file with the same name. The catalog lists the boot images and is read by the boot facility to choose one of the boot images. But it is not necessary that it appears in the directory tree at all. One may hide it in all trees by @strong{cat_hidden=on}. Other possible values are "iso_rr", "joliet", "hfsplus", and the default "off". The timestamps of the boot catalog file are refreshed at commit time. Command -volume_date "uuid" can be used to set their value. @* @strong{bin_path=} depicts an El Torito boot image file, a binary program which is to be started by the hardware boot facility (e.g. the BIOS) at boot time. @* @strong{efi_path=} depicts an El Torito boot image file that is ready for EFI booting. This is normally a FAT filesystem image not larger than 65535 blocks of 512 bytes (= 32 MiB - 512). Its load_size is determined automatically, no boot info table gets written, no boot medium gets emulated, platform_id is 0xef. @* @strong{emul_type=} can be one of "no_emulation", "hard_disk", "diskette". It controls the boot medium emulation code of a boot image. The default "no_emulation" is suitable for ISOLINUX, GRUB, FreeBSD cdboot. @* @strong{load_size=} is a value which depends on the boot image. Default is 2048 which matches the expectations of most boot images. The special value "full" means the full size of the boot image file rounded up to a multiple of 2048 bytes. Maximum is 33,552,384 bytes. @* @strong{boot_info_table=on} causes address patching to bytes 8 to 63 of the boot image which is given by "any" "bin_path=". "boot_info_table=off" disables this patching. @* @strong{grub2_boot_info=on} causes address patching to byte 2548 of the boot image which is given by "any" "bin_path=". The address is written as 64 bit little-endian number. It is the 2KB block address of the boot image content, multiplied by 4, and then incremented by 5. "grub2_boot_info=off" disables this patching. @* @strong{platform_id=} defines by a hexadecimal or decimal number the Platform ID of the boot image. "0x00" is 80x86 PC-BIOS, "0x01" is PowerPC, "0x02" is Mac, "0xef" is EFI (decimal "239"). @* @strong{id_string=}text|56_hexdigits defines the ID string of the boot catalog section where the boot image will be listed. If the value consists of 56 characters [0-9A-Fa-f] then it is converted into 28 bytes, else the first 28 characters become the ID string. The ID string of the first boot image becomes the overall catalog ID. It is limited to 24 characters. Other id_strings become section IDs. @* @strong{sel_crit=}hexdigits defines the Selection Criteria of the boot image. Up to 20 bytes get read from the given characters [0-9A-Fa-f]. They get attributed to the boot image entry in the catalog. @* @strong{next} ends the definition of a boot image and starts a new one. Any following -bootimage bootspecs will affect the new image. The first "next" discards loaded boot images and their catalog. @* @cindex System area, _definition @cindex MBR, set, -boot_image system_area= @strong{system_area=}disk_path copies at most 32768 bytes from the given disk file to the very start of the ISO image. This System Area is reserved for system dependent boot software, e.g. an MBR which can be used to boot from USB stick or hard disk. @* Other than an El Torito boot image, the file disk_path needs not to be added to the ISO image. @* @strong{-boot_image isolinux system_area=} implies "partition_table=on". In this case, the disk path should lead to one of the SYSLINUX files isohdp[fp]x*.bin or to a file which was derived from one of those files. E.g. to the first 512 bytes from an ISOLINUX isohybrid ISO image. @* In this case, El Torito boot images (dir=, bin_path=, efi_path=) may be augmented by @strong{isolinux partition_entry=gpt_basdat} or @strong{isolinux partition_entry=gpt_hfsplus}, and by @strong{isolinux partition_entry=apm_hfsplus}. The boot image will then be mentioned in an invalid GPT as Basic Data or GPT HFS+ partition, and in a valid APM as HFS+ partition. The first three GPT partitions will also be marked by MBR partitions. The MBR partition of type 0xEF is what actually is used by EFI firmware for booting from USB stick. @* In multi-session situations the existing System Area is preserved by default. In in this case, the special disk_path "." prevents reading of a disk file but nevertheless causes adjustments in the loaded system area data. Such adjustments may get ordered by -boot_image commands. @* @cindex GPT, control GUID, -boot_image gpt_disk_guid= @strong{-boot_image any gpt_disk_guid=}value controls whether an emerging GPT shall get a randomly generated disk GUID or whether the GUID is supplied by the user. Value "random" is default. Value "volume_date_uuid" produces a low quality GUID from the value set by -volume_date "uuid". @* A string of 32 hex digits, or a RFC 4122 compliant GUID string may be used to set the disk GUID directly. UEFI prescribes the first three components of a RFC 4122 GUID string to be byte-swapped in the binary representation: @* E.g. gpt_disk_guid=2303cd2a-73c7-424a-a298-25632da7f446 equals gpt_disk_guid=2acd0323c7734a42a29825632da7f446 @* The partition GUIDs get generated by minimally varying the disk GUID. @* @strong{-boot_image any part_like_isohybrid=on} enables -boot_image isolinux partition_entry= even if no -boot_image isolinux system_area= is given. No MBR partition of type 0xee emerges, even if GPT gets produced. Gaps between GPT and APM partitions will not be filled by more partitions. Appended partitions get mentioned in APM if other APM partitions emerge. @* @strong{-boot_image any iso_mbr_part_type=}number sets the partition type of the MBR partition which represents the ISO or at least protects it. @* Number may be 0x00 to 0xff. The text "default" re-enables the default types of the various occasions to create an ISO MBR partition. This is without effect if no such partition emerges by other settings or if the partition type is prescribed mandatorily like 0xee for GPT protective MBR or 0x96 for CHRP. @* If instead a type_guid is given by a 32-digit hex string like a2a0d0ebe5b9334487c068b6b72699c7 or by a structured text like EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, then it will be used as partition type if the ISO filesystem appears as partition in GPT. In MBR, C12A7328-F81F-11D2-BA4B-00A0C93EC93B will be mapped to 0xef. Any other GUID will be mapped to 0x83. @* @strong{grub2_mbr=}disk_path works like "any" system_area= with additional patching for modern GRUB MBRs. The content start address of the first boot image is converted to a count of 512 byte blocks, and an offset of 4 is added. The result is written as 64 bit little-endian number to byte address 0x1b0. @* This feature can be revoked either by grub2_mbr= with empty disk path, or by submitting a disk_path via system_area=. @* @cindex Partition table, _definition @strong{partition_table=on} causes a simple partition table to be written into bytes 446 to 511 of the System Area. @* With type "isolinux" it shows a partition that begins at byte 0 and it causes the LBA of the first boot image to be written into the MBR. For the first session this works only if also "system_area=" and "bin_path=" or "dir=" is given. @* With types "any" and "grub" it shows a single partition which starts at byte 512 and ends where the ISO image ends. This works with or without system_area= or boot image. @* Bootspecs chrp_boot_part=, prep_boot_part=, and efi_boot_part= overwrite this entry in the MBR partition table. @* If types "isolinux" or "grub" are set to "patch", then "partition_table=on" is activated without new boot image. In this case the existing System Area gets checked whether it bears addresses and sizes as if it had been processed by "partition_table=on". If so, then those parameters get updated when the new System Area is written. @* Special "system_area=/dev/zero" causes 32k of NUL-bytes. Use this to discard an MBR which was loaded with the ISO image. @* @cindex Appended partition, in MBR or GPT @strong{appended_part_as=gpt} marks partitions from -append_partition in GPT rather than in MBR. In this case the MBR shows a single partition of type 0xee which covers the whole output data. @* @strong{appended_part_as=mbr} is the default. Appended partitions get marked in GPT only if GPT is produced because of other settings. If given explicitly, this clears setting "gpt" and "apm". Nevertheless "apm" may be added to "mbr". @* @cindex Appended partition, in APM @strong{appended_part_as=apm} marks partitions from -append_partition in APM additionally to "mbr" or "gpt". @* By default, appended partitions get marked in APM only if APM is produced because of other options together with part_like_isohybrid="on". @* @cindex CHRP partition, _definition @strong{chrp_boot_part=on} causes a single partition in MBR which covers the whole ISO image and has type 0x96. This is not compatible with any other feature that produces MBR partition entries. It makes GPT unrecognizable. @* @cindex PReP partition, _definition @strong{prep_boot_part=}disk_path inserts the content of a data file into the image and marks it by an MBR partition of type 0x41. The parts of the ISO image before and after this partition will be covered by further MBR partitions. The data file is supposed to contain ELF executable code. @* @cindex EFI system partition, _definition @strong{efi_boot_part=}disk_path inserts the content of a data file into the image and marks it by a GPT partition. If not chrp_boot_part=on, then the first partition in MBR will have type 0xee to announce the presence of GPT. The data file is supposed to contain a FAT filesystem. @* Instead of a disk_path, the word @minus{}@minus{}efi-boot-image may be given. It exposes in GPT the content of the first El Torito EFI boot image as EFI system partition. EFI boot images are introduced by bootspec efi_path=. The affected EFI boot image cannot show up in HFS+ because it is stored outside the HFS+ partition. @* @cindex Partition offset, _definition @strong{partition_offset=}2kb_block_adr causes a partition table with a single partition that begins at the given block address. This is counted in 2048 byte blocks, not in 512 byte blocks. If the block address is non-zero then it must be at least 16. A non-zero partition offset causes two superblocks to be generated and two sets of directory trees. The image is then mountable from its absolute start as well as from the partition start. @* The offset value of an ISO image gets preserved when a new session is added. So the value defined here is only in effect if a new ISO image gets written. @* @cindex Cylinder size, _definition @strong{partition_hd_cyl=}number gives the number of heads per cylinder for the partition table. 0 chooses a default value. Maximum is 255. @* @strong{partition_sec_hd=}number gives the number of sectors per head for the partition table. 0 chooses a default value. Maximum is 63. @* The product partition_sec_hd * partition_hd_cyl * 512 is the cylinder size. It should be divisible by 2048 in order to make exact alignment possible. With appended partitions and "appended_part_as=gpt" there is no limit for the number of cylinders. Else there may be at most 1024 of them. If the cylinder size is too small to stay below the limit, then appropriate values of partition_hd_cyl are chosen with partition_sec_hd 32 or 63. If the image is larger than 8,422,686,720 bytes, then the cylinder size constraints cannot be fulfilled for MBR. @* @cindex Cylinder alignment, _definition @strong{partition_cyl_align=}mode controls image size alignment to an integer number of cylinders. It is prescribed by isohybrid specs and it seems to please program fdisk. Cylinder size must be divisible by 2048. Images larger than 8,323,596,288 bytes cannot be aligned in MBR partition table. @* Mode "auto" is default. Alignment by padding happens only with "isolinux" "partition_table=on". @* Mode "on" causes alignment by padding with "partition_table=on" for any type. Mode "all" is like "on" but also pads up partitions from -append_partition to an aligned size. @* Mode "off" disables alignment for any type. @* @cindex MBR bootable/active flag, enforce @strong{mbr_force_bootable=}mode enforces an MBR partition with "bootable/active" flag if options like partition_table= or grub2_mbr= indicate production of a bootable MBR. These options normally cause the flag to be set if there is an MBR partition of type other than 0xee or 0xef. If no such partition exists, then no bootflag is set, unless mbr_force_bootable="on" forces creation of a dummy partition of type 0x00 which covers only the first block of the ISO image. @* If no bootable MBR is indicated and a partition gets created by -append_partition, then mbr_force_bootable="on" causes a bootflag like it would do with a bootable MBR. @* @cindex MIPS boot file, activation @strong{mips_path=}iso_rr_path declares a data file in the image to be a MIPS Big Endian boot file and causes production of a MIPS Big Endian Volume Header. This is mutually exclusive with production of other boot blocks like MBR. It will overwrite the first 512 bytes of any data provided by system_area=. Up to 15 boot files can be declared by mips_path=. @* @strong{mipsel_path=}iso_rr_path declares a data file in the image to be the MIPS Little Endian boot file. This is mutually exclusive with other boot blocks. It will overwrite the first 512 bytes of any data provided by system_area=. Only a single boot file can be declared by mipsel_path=. @* @cindex SUN Disk Label, production @strong{sparc_label=}text causes the production of a SUN Disk Label with the given text as ASCII label. Partitions 2 to 8 may be occupied by appended images. Partition 1 will always be the ISO image. See command -append_partition. The first 512 bytes of any data provided by system_area= will be overwritten. @* @strong{grub2_sparc_core=}iso_rr_path causes the content address and size of the given file to be written after the SUN Disk Label. Both numbers are counted in bytes. The address is written as 64 bit big-endian number to byte 0x228. The size is written as 32 bit big-endian number to byte 0x230. @* @cindex HP-PA boot sector, production @strong{hppa_cmdline=}text sets the PALO command line for HP-PA. Up to 1023 characters are permitted by default. With hppa_hdrversion=4 the limit is 127. @* Note that the first five hppa_ bootspecs are mandatory, if any of the hppa_ bootspecs is used. Only hppa_hdrversion= is allowed to be missing. @* @strong{hppa_bootloader=}iso_rr_path designates the given path as HP-PA bootloader file. @* @strong{hppa_kernel_32=}iso_rr_path designates the given path as HP-PA 32 bit kernel file. @* @strong{hppa_kernel_64=}iso_rr_path designates the given path as HP-PA 64 bit kernel file. @* @strong{hppa_ramdisk=}iso_rr_path designates the given path as HP-PA RAM disk file. @* @strong{hppa_hdrversion=}number chooses between PALO header version 5 (default) and version 4. For the appropriate value see in PALO source code: PALOHDRVERSION. @* @cindex DEC Alpha SRM boot sector, production @strong{alpha_boot=}iso_rr_path declares a data file in the image to be the DEC Alpha SRM Secondary Bootstrap Loader and causes production of a boot sector which points to it. This is mutually exclusive with production of other boot blocks like MBR. @* @strong{mips_discard}, @strong{sparc_discard}, @strong{hppa_discard}, @strong{alpha_discard} revoke any boot file declarations made for mips/mipsel, sparc, hppa, or alpha, respectively. This removes the ban on production of other boot blocks. @* @cindex HFS+ serial number @strong{hfsplus_serial=}hexstring sets a string of 16 digits "0" to "9" and letters "a" to "f", which will be used as unique serial number of an emerging HFS+ filesystem. @* @cindex HFS+ allocation block size @strong{hfsplus_block_size=}number sets the allocation block size to be used when producing HFS+ filesystems. Permissible are 512, 2048, or 0. The latter lets the program decide. @* @cindex APM block size @strong{apm_block_size=}number sets the block size to be used when describing partitions by an Apple Partition Map. Permissible are 512, 2048, or 0. The latter lets the program decide. @* Note that size 512 is not compatible with production of GPT, and that size 2048 will not be mountable -t hfsplus at least by older Linux kernels. @end table @* @table @asis @sp 1 @c man .TP @item -append_partition partition_number type_code disk_path @kindex -append_partition adds arbitrary file after image end @cindex Appended Filesystem Image, -append_partition Cause a prepared filesystem image to be appended to the ISO image and to be described by a partition table entry in a boot block at the start of the emerging ISO image. The partition entry will bear the size of the submitted file rounded up to the next multiple of 2048 bytes or to the next multiple of the cylinder size. @* Beware of subsequent multi-session runs. The appended partition will get overwritten. @* Partitions may be appended with boot block type MBR and with SUN Disk Label. @* With MBR: @* partition_number may be 1 to 4. Number 1 will put the whole ISO image into the unclaimed space before partition 1. So together with most @command{xorriso} MBR features, number 2 would be the most natural choice. @* The type_code may be "FAT12", "FAT16", "Linux", or a hexadecimal number between 0x00 and 0xff. Not all those numbers will yield usable results. For a list of MBR partition type codes search the Internet for "Partition Types" or run fdisk command "L". @* type_code may also be a type GUID as plain hex string like a2a0d0ebe5b9334487c068b6b72699c7 or as structured text like EBD0A0A2-B9E5-4433-87C0-68B6B72699C7. It will be used if the partition is mentioned in GPT. In MBR, C12A7328-F81F-11D2-BA4B-00A0C93EC93B will be mapped to 0xef. Any other GUID will be mapped to 0x83. In APM, 48465300-0000-11AA-AA11-00306543ECAC will be mapped to partition type "Apple_HFS", any other to "Data". @* If some other command causes the production of GPT, then the appended partitions will be mentioned there too. @* The disk_path must provide the necessary data bytes at commit time. An empty disk_path disables this feature for the given partition number. @* @cindex SUN SPARC boot images, activation With SUN Disk Label (selected by -boot_image any sparc_label=): @* partition_number may be 2 to 8. Number 1 will always be the ISO image. Partition start addresses are aligned to 320 KiB. The type_code does not matter. Submit 0x0. @* Partition image name "." causes the partition to become a copy of the next lower valid one. @end table @c man .TP @c man .B Jigdo Template Extraction: @node Jigdo, Charset, Bootable, Commands @section Jigdo Template Extraction @c man .PP @cindex Jigdo Template Extraction, _definition From man genisoimage: "Jigdo is a tool to help in the distribution of large files like CD and DVD images; see http://atterer.net/jigdo/ for more details. Debian CDs and DVD ISO images are published on the web in jigdo format to allow end users to download them more efficiently." @* @command{xorriso} can produce a .jigdo and a .template file together with a single-session ISO image. The .jigdo file contains checksums and symbolic file addresses. The .template file contains the compressed ISO image with reference tags instead of the content bytes of the listed files. @* Input for this process are the normal arguments for a @command{xorriso} session on a blank -outdev, and a checksum file which lists those data files which may be listed in the .jigdo file and externally referenced in the .template file. Each designated file is represented in the checksum file by a single text line: @* Checksum as hex digits, 2 blanks, size as 12 decimal digits or blanks, 2 blanks, symbolic file address @* The kind of checksum is chosen by -jigdo "checksum_algorithm" with values "md5" (32 hex digits) or "sha256" (64 hex digits). It will also be used for the file address lines in the .jigdo file. The default is "md5". @* The file address in a checksum file line has to bear the same basename as the disk_path of the file which it shall match. The directory path of the file address is decisive for To=From mapping, not for file recognition. After To=From mapping, the file address gets written into the .jigdo file. Jigdo restore tools will convert these addresses into really reachable data source addresses from which they can read. @* If the list of jigdo parameters is not empty, then @command{xorriso} will refuse to write to non-blank targets, it will disable multi-session emulation, and padding will be counted as part of the ISO image. @* @table @asis @sp 1 @c man .TP @item -jigdo parameter_name value @kindex -jigdo clears JTE or or adds parameter to JTE @cindex Jigdo Template Extraction, -jigdo Clear Jigdo Template Extraction parameter list or add a parameter to that list. The alias names are the corresponding genisoimage options. They are accepted as parameter names as well. Especially they are recognized by the -as mkisofs emulation command. @* Parameter @strong{clear} with any value empties the whole list. No .jigdo and .template file will be produced. @* @strong{checksum_algorithm} chooses the checksum algorithm which shall be used for the data file entries in the .jigdo file and is expected in the checksum file. Permissible are "md5" or "sha256". Default is "md5". @* Alias: -jigdo-checksum-algorithm @* @strong{template_path} sets the disk_path for the .template file with the holed and compressed ISO image copy. @* Alias: -jigdo-template @* @strong{jigdo_path} sets the disk_path for the .jigdo file with the checksums and download addresses for filling the holes in .template. @* Alias: -jigdo-jigdo @* @strong{checksum_path} sets the disk_path where to find the checksum file with symbolic file addresses and checksums according to @strong{checksum_algorithm}. @* Alias: md5_path @* Alias: -checksum-list @* Alias: -md5-list @* @strong{min_size} sets the minimum size for a data file to be listed in the .jigdo file and being a hole in the .template file. @* Alias: -jigdo-min-file-size @* @strong{exclude} adds a regular expression pattern which will get compared with the absolute disk_path of any data file. A match causes the file to stay in .template in any case. @* Alias: -jigdo-exclude @* @strong{demand_checksum} adds a regular expression pattern which will get compared with the absolute disk_path of any data file that was not found in the checksum list file as of "checksum_path". A match causes a MISHAP event. @* Alias: demand_md5 @* Alias: -jigdo-force-checksum @* Alias: -jigdo-force-md5 @* @strong{mapping} adds a string pair of the form To=From to the parameter list. If a data file gets listed in the .jigdo file, then it is referred by the file address from its line in the checksum file. This file address gets checked whether it begins with the From string. If so, then this string will be replaced by the To string and a ':' character, before it goes into the .jigdo file. The From string should end by a '/' character. @* Alias: -jigdo-map @* @strong{compression} chooses one of "bzip2" or "gzip" for the compression of the template file. The jigdo file is put out uncompressed. @* Alias: -jigdo-template-compress @* @strong{checksum_iso} chooses one or more of "md5", "sha1", "sha256", "sha512" for the auxiliary "# Image Hex" checksums in the jigdo file. The value may e.g. look like "md5,sha1,sha512". Value "all" chooses all available algorithms. Note that MD5 stays always enabled. @* Alias: -checksum_algorithm_iso @* @strong{checksum_template} is like checksum_iso but for "# Template Hex". @* Alias: -checksum_algorithm_template @end table @c man .TP @c man .B Character sets: @node Charset, Exception, Jigdo, Commands @section Character sets @c man .PP @cindex Character Set, _definition File names are strings of non-zero bytes with 8 bit each. Unfortunately the same byte string may appear as different peculiar national characters on differently nationalized terminals. The meanings of byte codes are defined in @strong{character sets} which have names. Shell command iconv -l lists them. @* @cindex Local Character Set, _definition The file names on hard disk are assumed to be encoded by the @strong{local character set} which is also used for the communication with the user. Byte codes 32 to 126 of the local character set must match the US-ASCII characters of the same code. ISO-8859 and UTF-8 fulfill this demand. @* By default, @command{xorriso} uses the character set as told by shell command "locale" with argument "charmap". This may be influenced by environment variables LC_ALL, LC_CTYPE, or LANG and should match the expectations of the terminal. In some situations it may be necessary to set it by command -local_charset. @* Local character sets should not matter as long as only english alphanumeric characters are used for file names or as long as all writers and readers of the media use the same local character set. Outside these constraints it may be necessary to let @command{xorriso} convert byte codes from and to other character sets. @* @cindex Input Character Set, _definition The Rock Ridge file names in ISO filesystems are assumed to be encoded by the @strong{input character set}. @cindex Output Character Set, _definition The Rock Ridge file names which get written with ISO filesystems will be encoded by the @strong{output character set}. @* The sets can be defined independently by commands -in_charset and -out_charset. Normally one will have both identical, if ever. Other than the local character set, these two character sets may deviate from US-ASCII. @* The output character sets for Joliet and HFS+ are not influenced by these commands. Joliet uses output character set UCS-2 or UTF-16. HFS+ uses UTF-16. @* The default output charset is the local character set of the terminal where @command{xorriso} runs. So by default no conversion happens between local filesystem names and emerging Rock Ridge names in the image. The situation stays ambiguous and the reader has to riddle what character set was used. @* By command -auto_charset it is possible to attribute the output charset name to the image. This makes the situation unambiguous. But if your terminal character set does not match the character set of the local file names, then this attribute can become plainly wrong and cause problems at read time. To prevent this it is necessary to check whether the terminal properly displays all intended filenames. Check especially the exotic national characters. @* To enforce recording of a particular character set name without any conversion at image generation time, set -charset and -local_charset to the desired name, and enable -backslash_codes to avoid evil character display on your terminal. @table @asis @sp 1 @c man .TP @item -charset character_set_name @kindex -charset sets input/output character set @cindex Character Set, for input/output, -charset Set the character set from which to convert file names when loading an image and to which to convert when writing an image. @c man .TP @item -local_charset character_set_name @kindex -local_charset sets terminal character set @cindex Character Set, of terminal, -local_charset Override the system assumption of the local character set name. If this appears necessary, one should consider to set -backslash_codes to "on" in order to avoid dangerous binary codes being sent to the terminal. @end table @c man .TP @c man .B Exception processing: @node Exception, DialogCtl, Charset, Commands @section Exception processing @c man .PP Since the tasks of @command{xorriso} are manifold and prone to external influence, there may arise the need for @command{xorriso} to report and handle problem events. @* Those events get classified when they are detected by one of the software modules and forwarded to reporting and evaluation modules which decide about reactions. Event classes are sorted by severity: @* "NEVER" The upper end of the severity spectrum. @* "ABORT" The program is being aborted and on its way to end. @* "FATAL" The main purpose of the run failed or an important resource failed unexpectedly. @* "FAILURE" An important part of the job could not be performed. @* "MISHAP" A FAILURE which can be tolerated during ISO image generation. @* "SORRY" A less important part of the job could not be performed. @* "WARNING" A situation is suspicious of being not intended by the user. @* "HINT" A proposal to the user how to achieve better results. @* "NOTE" A harmless information about noteworthy circumstances. @* "UPDATE" A pacifier message during long running operations. @* "DEBUG" A message which would only interest the program developers. @* "ALL" The lower end of the severity spectrum. @table @asis @sp 1 @c man .TP @item -abort_on severity @kindex -abort_on controls abort on error @cindex Process, control abort on error, -abort_on Set the severity threshold for events to abort the program. @* Useful: "NEVER", "ABORT", "FATAL", "FAILURE" , "MISHAP", "SORRY" @* It may become necessary to abort the program anyway, despite the setting by this command. Expect not many "ABORT" events to be ignorable. @* A special property of this command is that it works preemptive if given as program start argument. I.e. the first -abort_on setting among the start arguments is in effect already when the first operations of @command{xorriso} begin. Only "-abort_on" with dash "-" is recognized that way. @c man .TP @item -return_with severity exit_value @kindex -return_with controls exit value @cindex Process, control exit value, -return_with Set the threshold and exit_value to be returned at program end if no abort has happened. This is to allow @command{xorriso} to go on after problems but to get a failure indicating exit value from the program, nevertheless. Useful is a value lower than the -abort_on threshold, down to "WARNING". @* exit_value may be either 0 (indicating success to the starter of the program) or a number between 32 and 63. Some other exit_values are used by @command{xorriso} if it decides to abort the program run: @* 1=abort due to external signal @* 2=no program arguments given @* 3=creation of @command{xorriso} main object failed @* 4=failure to start libburnia-project.org libraries @* 5=program abort during argument processing @* 6=program abort during dialog processing @c man .TP @item -report_about severity @kindex -report_about controls verbosity @cindex Process, control verbosity, -report_about Set the threshold for events to be reported. @* Useful: "SORRY", "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG", "ALL" @* Regardless what is set by -report_about, messages get always reported if they reach the severity threshold of -abort_on . @* Event messages are sent to the info channel "I" which is usually stderr but may be influenced by command -pkt_output. Info messages which belong to no event get attributed severity "NOTE". @* A special property of this command is that the first -report_about setting among the start arguments is in effect already when the first operations of @command{xorriso} begin. Only "-report_about" with dash "-" is recognized that way. @c man .TP @item -signal_handling mode @kindex -signal_handling controls handling of system signals @cindex Control, signal handling, -signal_handling Control the installation of a signal handler which shall react on external signals (e.g. from program "kill" or from keys Ctrl+C) or on signals caused by severe program errors. @* Mode "on" is the default. It uses the signal handler of libburn which produces ugly messages but puts much effort in releasing optical drives before @command{xorriso} ends. @* Mode "off" as first -signal_handling among the start arguments prevents all own signal precautions of @command{xorriso}. Inherited signal handler settings stay as they are. @* It works like "sig_dfl" if given after other signal handling was already established at program start. @* Mode "sig_dfl" uses the system provided default handling of signals, which is normally a sudden abort of the program. To prevent stuck drives, the libburn handler is used during burning, blanking, and formatting on MMC drives. @* Mode "sig_ign" tries to ignore as many signal types as possible. This imposes the risk that @command{xorriso} refuses to end until externally kill -9 if performed. kill -9 then imposes the risk that the drive is left in unusable state and needs poweroff to be reset. So during burning, blanking, and formatting wait for at least their normal run time before killing externally. @* A special property of this command is that the first -signal_handling setting among the start arguments is in effect already when the first operations of @command{xorriso} begin. Only "-signal_handling" with dash "-" is recognized that way. @c man .TP @item -error_behavior occasion behavior @kindex -error_behavior controls error workarounds @cindex Process, error workarounds, -error_behavior Control the program behavior at problem event occasions. For now this applies to occasions "image_loading" which is given while an image tree is read from the input device, and to "file_extraction" which is given with osirrox commands like -extract. @* With "image_loading" there are three behaviors available: @* "best_effort" goes on with reading after events with severity below FAILURE if the threshold of command -abort_on allows this. @* "failure" aborts image tree reading on first event of at least SORRY. It issues an own FAILURE event. This is the default. @* "fatal" acts like "failure" but issues the own event as FATAL. @* With occasion "file_extraction" there are three behaviors: @* "keep" maintains incompletely extracted files on disk. This is the default. @* "delete" removes files which encountered errors during content extraction. @* "best_effort" starts a revovery attempt by means of -extract_cut if the file content stems from the loaded ISO image and is not filtered. @end table @c man .TP @c man .B Dialog mode control: @node DialogCtl, Inquiry, Exception, Commands @section Dialog mode control @table @asis @c man .TP @item -dialog "on"|"off"|"single_line" @kindex -dialog enables dialog mode @cindex Dialog, enable dialog mode, -dialog Enable or disable to enter dialog mode after all program arguments are processed. In dialog mode input lines get prompted via readline or from stdin. @* If no -abort_on severity was set when dialog starts, then "NEVER" is set to avoid abort in most cases of wrong input or other problems. Before dialog begins, the default is "FAILURE" which e.g. aborts on unknown commands. @* Mode "on" supports input of newline characters within quotation marks and line continuation by trailing backslash outside quotation marks. Mode "single_line" does not. @c man .TP @item -page length width @kindex -page set terminal geometry @cindex Dialog, terminal geometry, -page Describe terminal to the text pager. See also above, paragraph Result pager. @* If parameter length is nonzero then the user gets prompted after that number of terminal lines. Zero length disables paging. @* Parameter width is the number of characters per terminal line. It is used to compute the number of terminal lines which get occupied by an output line. A usual terminal width is 80. @c man .TP @item -use_readline "on"|"off" @kindex -use_readline enables readline for dialog @cindex Dialog, line editing, -use_readline If "on" then use readline for dialog. Else use plain stdin. @* See also above, paragraph Dialog, Readline, Result pager. @c man .TP @item -reassure "on"|"tree"|"off" @kindex -reassure enables confirmation question @cindex Dialog, confirmation question, -reassure If "on" then ask the user for "y" or "n": @* before deleting or overwriting any file in the ISO image, @* before overwriting any disk file during restore operations, @* before rolling back pending image changes, @* before committing image changes to media, @* before changing the input drive, @* before blanking or formatting media, @* before ending the program. @* With setting "tree" the reassuring prompt will appear for an eventual directory only once and not for each file in its whole subtree. @* Setting "off" silently kills any kind of image file object and performs above irrevocable actions. @* To really produce user prompts, command -dialog needs to be set to "on". Note that the prompt does not appear in situations where file removal is forbidden by command -overwrite. -reassure only imposes an additional curb for removing existing file objects. @* Be aware that file objects get deleted from the ISO image immediately after confirmation. They are gone even if the running command gets aborted and its desired effect gets revoked. In case of severe mess-up, consider to use -rollback to revoke the whole session. @end table @c man .TP @c man .B Drive and media related inquiry actions: @node Inquiry, Navigate, DialogCtl, Commands @section Drive and media related inquiry actions @table @asis @c man .TP @item -devices @kindex -devices gets list of drives @cindex Drive, get drive list, -devices Show list of available MMC drives with the addresses of their libburn standard device files. @* This is only possible when no ISO image changes are pending. After this command was executed, there is no drive current and no image loaded. @* In order to be visible, a device has to offer rw-permissions with its libburn standard device file. Thus it might be only the @strong{superuser} who is able to see all drives. @* Drives which are occupied by other processes get not shown. @c man .TP @item -device_links @kindex -device_links gets list of drives @cindex Drive, get drive list, -device_links Like -devices, but presenting the drives with addresses of symbolic links which point to the actual device files. @* Modern GNU/Linux systems may shuffle drive addresses from boot to boot. The udev daemon is supposed to create links which always point to the same drive, regardless of its system address. The command -device_links shows the addresses of such links if they begin by "/dev/dvd" or "/dev/cd". Precedence is: "dvdrw", "cdrw", "dvd", "cdrom", "cd". @c man .TP @item -toc @* @kindex -toc shows list of sessions @cindex Table-of-content, show, -toc Show media specific tables of content. This is the session history of the medium, not the ISO image directory tree. @* In case of overwritable media holding a valid ISO image, it may happen that only a single session gets shown. But if the first session on the overwritable media was written by @command{xorriso} then a complete session history can be emulated. @* A drive which is incapable of writing may show any media as CD-ROM or DVD-ROM with only one or two sessions on it. The last of these sessions is supposed to be the most recent real session then. @* Some read-only drives and media show no usable session history at all. Command -rom_toc_scan might help. @* If input device and output device are both acquired and not the same, then both tables-of-content get shown. @c man .TP @item -toc_of "in"|"out"|"all"[":short"] @kindex -toc_of shows list of sessions Like command -toc but explicitly choosing which drive's table-of-content to show. "in" shows -indev or -dev, "out" shows -outdev or -dev, "all" shows the same as -toc. @* If ":short" is appended to the drive choosing word, then only a short summary of drive state and medium content is printed. @* As further difference to -toc, this command does not emit FAILURE events if the desired drive is not acquired. @c man .TP @item -mount_cmd drive entity id path @kindex -mount_cmd composes mount command line @cindex Session, mount command line, -mount_cmd Emit an appropriate command line for mounting the ISO session indicated by drive, entity and id. The result will be different on GNU/Linux and on FreeBSD or NetBSD. @* drive can be "indev" or "outdev" to indicate already acquired drives, or it can be the path of a not yet acquired drive. Prefix "stdio:" for non-MMC drives is not mandatory. @* For entity and id, see also command -load. They must be either "sbsector" with the superblock sector address as id, or "track" with a track number as id, or "session" with a session number, or "volid" with a search pattern for the volume id, or "auto" with which any text as id mounts the first track of the last session. @* path will be used as mount point and must already exist as a directory on disk. @* The command gets printed to the result channel. See command -mount for direct execution of this command. @c man .TP @item -mount_opts option[:option...] @kindex -mount_cmd controls mount command @cindex Session, mount parameters, -mount_opts Set options which influence -mount and -mount_cmd. Currently there is only option "exclusive" which is default and its counterpart "shared". The latter causes @command{xorriso} not to give up the affected drive with command -mount. On GNU/Linux it adds mount option "loop" which may enable mounting of several sessions of the same block device at the same time. One should not write to a mounted optical medium, of course. Take care to umount all sessions before ejecting. @c man .TP @item -session_string drive entity id format @kindex -session_string composes session info line @cindex Session, info string, -session_string Print to the result channel a text which gets composed according to format and the parameters of the addressed session. @* Formats "linux:"path or "freebsd:"path produce the output of -mount_cmd for the given operating systems. @* In other texts @command{xorriso} will substitute the following parameter names. An optional prefix "string:" will be removed. @* "%device%" will be substituted by the mountable device path of the drive address. @* "%sbsector%" will be substituted by the session start sector. @* "%track%", "%session%", "%volid%" will be substituted by track number, session number, or volume id of the depicted session. @c man .TP @item -print_size @kindex -print_size predicts image size @cindex Write, predict image size, -print_size Print the foreseeable consumption of 2048 byte blocks by next -commit. This can last a while as a -commit gets prepared and only in last moment is revoked by this command. The result depends on several settings and also on the kind of output device. If no -jigdo options are set and not command -as "mkisofs" was used, then -padding (300 kB by default) is not counted as part of the image size. @* If an El Torito boot image file is already depicted, then command -print_size automatically executes -boot_image "any" "next". This means that the properties of that boot image cannot be edited by subsequent commands. @c man .TP @item -tell_media_space @kindex -tell_media_space reports free space @cindex Write, free space, -tell_media_space Print available space on the output medium and the free space after subtracting already foreseeable consumption by next -commit. @* Note that the title of the prediction "After commit :" is misleading. It is rather the space that may still be filled in this session without making the next -commit fail from medium overflow. @* The free space after the next -commit might be smaller by several MB. This depends on medium type, number of recorded sessions, and drive habits. @c man .TP @item -pvd_info @kindex -pvd_info shows image id strings @cindex Image, show id strings, -pvd_info Print various ID strings and timestamps which can be found in loaded ISO images. Some of the IDs may be changed by commands like -volid or -publisher. For these IDs -pvd_info reports what would be written with the next -commit. The timestamps get not automatically propagated from loaded image to newly written image. The ones for new images may be set by command -volume_date. See there for the meaning of the particular timestamps. @c man .TP @item -report_el_torito mode @kindex -report_el_torito shows Boot Catalog @cindex Image, show Boot Catalog @* With mode @strong{plain} print a report about the information found in the El Torito boot catalog of the loaded ISO image. @* With mode @strong{help} print a text which explains the meaning of the lines put out by "plain". @* Mode @strong{cmd} tries to print the @strong{xorriso} commands which are necessary to produce the found boot equipment: disk identifiers, El Torito boot images, and System Area. Disk identifiers are strings which the booting operating system might use to find the ISO filesystem from where it comes. Currently known is the use of volume id and modification date. @* The intended use case is modification of the filesystem by having -indev and -outdev pointing to different images or drives. The result might be insufficient, if the found equipment cannot be produced by xorriso. Various SORRY events may arise in this case, but it is not guaranteed that xorriso recognizes all its insufficiencies. @* Mode @strong{as_mkisofs} tries to print the @strong{xorriso -as mkisofs} options, which are necessary to produce the found equipment. The intended use case is to use the mounted filesystem as input tree together with the printed options. @c man .TP @item -report_system_area mode @kindex -report_system_area shows MBR, GPT, and alike @cindex Image, show MBR, GPT, and alike, -pvd_info With mode @strong{plain} print a report about the information found in the System Area of the loaded ISO image. The report consists of zero to many lines with a header text, a colon, and information text. @* With mode @strong{help} print a text which explains the meaning of the lines put out by "plain". You probably will have to look for more documentation which explains the technical details of the mentioned boot facilities. @* Modes @strong{cmd} and @strong{as_mkisofs} work like with command -report_el_torito. See above. @* With mode @strong{gpt_disk_guid} print the GPT disk GUID of the loaded ISO in RFC 4122 text format to result channel. It is not considered an error if no GPT is present. In this case nothing is printed to result channel. @* With mode @strong{gpt_crc_of:}disk_path read up to 32 KiB from the disk file with the path given after the colon. Compute the GPT compliant CRC number and print it to the result channel. The number is shown like "0x690fd979". The special disk_path "-" causes reading from standard input. @* With mode @strong{make_guid} print a pseudo-random GUID in RFC 4122 text format to result channel. @end table @c man .TP @c man .B Navigation in ISO image and disk filesystem: @node Navigate, Verify, Inquiry, Commands @section Navigation in ISO image and disk filesystem @table @asis @c man .TP @item -cd iso_rr_path @kindex -cd sets working directory in ISO @cindex Navigate, set ISO working directory, -cd Change the current working directory in the ISO image. This is prepended to iso_rr_paths which do not begin with '/'. @* It is possible to set the working directory to a path which does not exist yet in the ISO image. The necessary parent directories will be created when the first file object is inserted into that virtual directory. Use -mkdir if you want to enforce the existence of the directory already at first insertion. @c man .TP @item -cdx disk_path @kindex -cdx sets working directory on disk @cindex Navigate, set disk working directory, -cdx Change the current working directory in the local filesystem. To be prepended to disk_paths which do not begin with '/'. @c man .TP @item -pwd @* @kindex -pwd tells working directory in ISO @cindex Navigate, tell ISO working directory, -pwd Tell the current working directory in the ISO image. @c man .TP @item -pwdx @kindex -pwdx tells working directory on disk @cindex Navigate, tell disk working directory, -pwdx @* Tell the current working directory in the local filesystem. @c man .TP @item -ls iso_rr_pattern [***] @kindex -ls lists files in ISO image @cindex Navigate, list ISO files, -ls List files in the ISO image which match shell patterns (i.e. with wildcards '*' '?' '[a-z]'). If a pattern does not begin with '/' then it is compared with addresses relative to -cd. @* Directories are listed by their content rather than as single file item. @* Pattern expansion may be disabled by command -iso_rr_pattern. @c man .TP @item -lsd iso_rr_pattern [***] @kindex -lsd lists files in ISO image @cindex Navigate, list ISO files, -lsd Like -ls but listing directories as themselves and not by their content. This resembles shell command ls -d. @c man .TP @item -lsl iso_rr_pattern [***] @kindex -lsl lists files in ISO image @cindex Navigate, list ISO files, -lsl Like -ls but also list some of the file attributes. The output format resembles shell command ls -ln. @* File type 'e' indicates the El Torito boot catalog. @* If the file has non-trivial ACL, then a '+' is appended to the permission info. If the file is hidden, then 'I' for "iso_rr", 'J' for "joliet", 'A' for "hfsplus", 'H' for multiple hiding gets appended. Together with ACL it is 'i', 'j', 'a', 'h'. @c man .TP @item -lsdl iso_rr_pattern [***] @kindex -lsdl lists files in ISO image @cindex Navigate, list ISO files, -lsdl Like -lsd but also list some of the file attributes. The output format resembles shell command ls -dln. @c man .TP @item -lsx disk_pattern [***] @kindex -lsx lists files on disk @cindex Navigate, list disk files, -lsx List files in the local filesystem which match shell patterns. Patterns which do not begin with '/' are used relative to -cdx. @* Directories are listed by their content rather than as single file item. @* Pattern expansion may be disabled by command -disk_pattern. @c man .TP @item -lsdx disk_pattern [***] @kindex -lsdx lists files on disk @cindex Navigate, list disk files, -lsdx Like -lsx but listing directories as themselves and not by their content. This resembles shell command ls -d. @c man .TP @item -lslx disk_pattern [***] @kindex -lslx lists files on disk @cindex Navigate, list disk files, -lslx Like -lsx but also listing some of the file attributes. Output format resembles shell command ls -ln. @c man .TP @item -lsdlx disk_pattern [***] @kindex -lsdlx lists files on disk @cindex Navigate, list disk files, -lsdlx Like -lsdx but also listing some of the file attributes. Output format resembles shell command ls -dln. @c man .TP @item -getfacl iso_rr_pattern [***] @kindex -getfacl shows ACL in ISO image @cindex ACL, show in ISO image, -getfacl Print the access permissions of the given files in the ISO image using the format of shell command getfacl. If a file has no ACL then it gets fabricated from the -chmod settings. A file may have a real ACL if it was introduced into the ISO image while command -acl was set to "on". @c man .TP @item -getfacl_r iso_rr_pattern [***] @kindex -getfacl_r shows ACL in ISO image @cindex ACL, show in ISO image, -getfacl_r Like -gefacl but listing recursively the whole file trees underneath eventual directories. @c man .TP @item -getfattr iso_rr_pattern [***] @kindex -getfattr shows xattr in ISO image @cindex xattr, show in ISO image, -getfattr Print the xattr of the given files in the ISO image. If a file has no such xattr then noting is printed for it. The choice of namespaces depends on the setting of command -xattr: "on" or "user" restricts it to namespace "user", "any" only omits namespace "isofs". @c man .TP @item -getfattr_r iso_rr_pattern [***] @kindex -getfattr_r shows xattr in ISO image @cindex xattr, show in ISO image, -getfattr_r Like -gefattr but listing recursively the whole file trees underneath of directories. @c man .TP @item -du iso_rr_pattern [***] @kindex -du show directory size in ISO image @cindex Navigate, directory size in ISO image, -du Recursively list size of directories and files in the ISO image which match one of the patterns. similar to shell command du -k. @c man .TP @item -dus iso_rr_pattern [***] @kindex -dus show directory size in ISO image @cindex Navigate, directory size in ISO image, -dus List size of directories and files in the ISO image which match one of the patterns. Similar to shell command du -sk. @c man .TP @item -dux disk_pattern [***] @kindex -dux show directory size on disk @cindex Navigate, directory size in on disk, -dux Recursively list size of directories and files in the local filesystem which match one of the patterns. Similar to shell command du -k. @c man .TP @item -dusx disk_pattern [***] @kindex -dusx show directory size on disk @cindex Navigate, directory size in on disk, -dusx List size of directories and files in the local filesystem which match one of the patterns. Similar to shell command du -sk. @c man .TP @item -findx disk_path [-name pattern] [-type t] [-exec action [params]] @minus{}@minus{} @kindex -findx traverses disk tree @cindex Tree, disk, traverse, -findx Like -find but operating on local filesystem and not on the ISO image. This is subject to the settings of -follow. @* -findx accepts the same -type parameters as -find. Additionally it recognizes type "mountpoint" (or "m") which matches subdirectories which reside on a different device than their parent. It never matches the disk_path given as start address for -findx. @* -findx accepts the -exec actions as does -find. But except the following few actions it will always perform action "echo". @* @table @asis @sp 1 @item in_iso reports the path if its counterpart exists in the ISO image. For this the disk_path of the -findx command gets replaced by the iso_rr_path given as parameter. @* E.g.: -findx /home/thomas -exec in_iso /thomas_on_cd @minus{}@minus{} @* @item not_in_iso reports the path if its counterpart does not exist in the ISO image. The report format is the same as with command -compare. @* @item add_missing iso_rr_path_start adds the counterpart if it does not yet exist in the ISO image and marks it for "rm_merge" as non-removable. @* E.g.: -findx /home/thomas -exec add_missing /thomas_on_cd @minus{}@minus{} @* @item is_full_in_iso reports if the counterpart in the ISO image contains files. To be used with -type "m" to report mount points. @* @item empty_iso_dir deletes all files from the counterpart in the ISO image. To be used with -type "m" to truncate mount points. @* @item estimate_size prints a lower and an upper estimation of the number of blocks which the found files together will occupy in the emerging ISO image. This does not account for the superblock, for the directories in the -findx path, or for image padding. @* @item list_extattr mode prints a script to the result channel, which would use FreeBSD command setextattr to set the file's xattr name-value pairs of user namespace. See -find for a description of parameter mode. @* E.g. -exec list_extattr e -- @end table @c man .TP @item -compare disk_path iso_rr_path @kindex -compare reports ISO/disk differences @cindex Verify, compare ISO and disk file, -compare Compare attributes and eventual data file content of a fileobject in the local filesystem with a file object in the ISO image. The iso_rr_path may well point to an image file object which is not yet committed, i.e. of which the data content still resides in the local filesystem. Such data content is prone to externally caused changes. @* If iso_rr_path is empty then disk_path is used as path in the ISO image too. @* Differing attributes are reported in detail, differing content is summarized. Both to the result channel. In case of no differences no result lines are emitted. @c man .TP @item -compare_r disk_path iso_rr_path @kindex -compare_r reports ISO/disk differences @cindex Verify, compare ISO and disk tree, -compare_r Like -compare but working recursively. I.e. all file objects below both addresses get compared whether they have counterparts below the other address and whether both counterparts match. @c man .TP @item -compare_l disk_prefix iso_rr_prefix disk_path [***] @kindex -compare_l reports ISO/disk differences @cindex Verify, compare ISO and disk, -compare_l Perform -compare_r with each of the disk_path parameters. iso_rr_path will be composed from disk_path by replacing disk_prefix by iso_rr_prefix. @c man .TP @item -show_stream iso_rr_path [***] @kindex -show_stream shows data source and filters @cindex Filter, show chain, -show_stream Display the content stream chain of data files in the ISO image. The chain consists of the iso_rr_name and one or more streams, separated by " < " marks. A stream description consists of one or more texts, separated by ":" characters. The first text tells the stream type, the following ones, if ever, describe its individual properties. Frequently used types are: @* disk:'disk_path' for local filesystem objects. @* image:'iso_rr_path' for ISO image file objects. @* cout:'disk_path offset count' for -cut_out files. @* extf:'filter_name' for external filters. @* --zisofs:algorithm:block_size for zisofs compression filters. @* --zisofs-decode:algorithm:block_size for zisofs uncompression filters. @* --gzip for internal gzip compression filters. @* --gunzip for internal gzip uncompression filters. @* Example: @* '/abc/xyz.gz' < extf:'gzip' < disk:'/home/me/x' @c man .TP @item -show_stream_r iso_rr_path [***] @kindex -show_stream_r shows data source and filters @cindex Filter, show chains of tree, -show_stream_r Like -show_stream but working recursively. @end table @c man .TP @c man .B Evaluation of readability and recovery: @node Verify, Restore, Navigate, Commands @section Evaluation of readability and recovery @c man .PP It is not uncommon that optical media produce read errors. The reasons may be various and get obscured by error correction which is performed by the drives and based on extra data on the media. If a drive returns data then one can quite trust that they are valid. But at some degree of read problems the correction will fail and the drive is supposed to indicate error. @* @command{xorriso} can scan a medium for readable data blocks, classify them according to their read speed, save them to a file, and keep track of successfully saved blocks for further tries on the same medium. @* By command -md5 checksums may get recorded with data files and whole sessions. These checksums are reachable only via indev and a loaded image. They work independently of the media type and can detect transmission errors. @table @asis @sp 1 @c man .TP @item -check_media [option [option ...]] @minus{}@minus{} @kindex -check_media reads media block by block @cindex Verify, check blocks, -check_media @cindex Recovery, retrieve blocks, -check_media Try to read data blocks from the indev drive, optionally copy them to a disk file, and finally report about the encountered quality. Several options may be used to modify the default behavior. @* The parameters given with this command override the default settings which may have been changed by command -check_media_defaults. See there for a description of available options. @* The result list tells intervals of 2 KiB blocks with start address, number of blocks and quality. Qualities which begin with "+" are supposed to be valid readable data. Qualities with "-" are unreadable or corrupted data. "0" indicates qualities which are not covered by the check run or are regularly allowed to be unreadable (e.g. gaps between tracks). @* Alternatively it is possible to report damaged files rather than blocks. @* If -md5 is "on" then the default mode what=tracks looks out for libisofs checksum tags for the ISO session data and checks them against the checksums computed from the data stream. @c man .TP @item -check_media_defaults [option [option ...]] @minus{}@minus{} @kindex -check_media_defaults sets -check_media options @cindex Verify, preset -check_media, -check_media_defaults Preset options for runs of -check_media, -extract_cut and best_effort file extraction. Options given with -check_media will override the preset options. -extract_cut will override some options automatically. @* An option consists of a keyword, a "=" character, and a value. Options may override each other. So their sequence matters. @* The default setting at program start is: @* use=indev what=tracks min_lba=-1 max_lba=-1 retry=default @* time_limit=28800 item_limit=100000 data_to='' event=ALL @* abort_file=/var/opt/xorriso/do_abort_check_media @* sector_map='' map_with_volid=off patch_lba0=off report=blocks @* bad_limit=invalid slow_limit=1.0 chunk_size=0s async_chunks=0 @* Option "reset=now" restores these startup defaults. @* Non-default options are: @* @table @asis @sp 1 @item report="files" lists the files which use damaged blocks (not with use=outdev). The format is like with find -exec report_damage. Note that a MD5 session mismatch marks all files of the session as damaged. If finer distinction is desired, perform -md5 off before -check_media. @* @item report="blocks_files" first lists damaged blocks and then affected files. @* @item use="outdev" reads from the output drive instead of the input drive. This avoids loading the ISO image tree from media. @* @item use="sector_map" does not read any media but loads the file given by option sector_map= and processes this virtual outcome. @* @item what="disc" scans the payload range of a medium without respecting track gaps. @* @item what="image" similar to "disc", but restricts scanning to the range of the ISO 9660 image, if present. @* @item min_lba=limit omits all blocks with addresses lower than limit. @* @item max_lba=limit switches to what=disc and omits all blocks above limit. @* @item chunk_size=size sets the number of bytes to be read in one low-level read operation. This gets rounded down to full blocks of 2048 bytes. 0 means automatic size. @* @item retry="on" forces read retries with minimal senseful chunk size when the normal read chunk produces a read error. This size is 1s with CD and stdio files, 16s with DVD (1 ECC Block), and 32s with BD (1 Cluster). By default, retries are only enabled with CD media. "retry=off" forbits retries for all media types. @* @item abort_file=disk_path gives the path of the file which may abort a scan run. Abort happens if the file exists and its mtime is not older than the start time of the run. Use shell command "touch" to trigger this. Other than an aborted program run, this will report the tested and untested blocks and go on with running @command{xorriso}. @* @item time_limit=seconds gives the number of seconds after which the scan shall be aborted. This is useful for unattended scanning of media which may else overwork the drive in its effort to squeeze out some readable blocks. Abort may be delayed by the drive gnawing on the last single read operation. Value -1 means unlimited time. @* @item item_limit=number gives the number of report list items after which to abort. Value -1 means unlimited item number. @* @item data_to=disk_path copies the valid blocks to the given file, which must support random access writing, unless disk_path is "-" which means standard output. @* In the latter case, patch_lba0= settings other than "off" yield failure. Further the usual result messages of -check_media get redirected to the info channel. But beware of result messages from other commands. Beware of -*dev "-" which redirect standard output to standard error. Keep the run simple: @* xorriso -indev /dev/sr0 -check_media data_to=- -- | md5sum @* xorriso -outdev /dev/sr0 -check_media data_to=- use=outdev \ what=disc min_lba=0 max_lba=999999 -- | sha256sum @* @item event=severity sets the given severity for a problem event which shall be issued at the end of a check run if data blocks were unreadable or failed to match recorded MD5 checksums. Severity "ALL" disables this event. @* @item sector_map=disk_path tries to read the file given by disk_path as sector bitmap and to store such a map file after the scan run. The bitmap tells which blocks have been read successfully in previous runs. It is the persistent memory for several scans on the same medium, even with intermediate eject, in order to collect readable blocks whenever the drive is lucky enough to produce them. The stored file contains a human readable TOC of tracks and their start block addresses, followed by binary bitmap data. @* By default, untested blocks are not considered bad, but rather as intentionally unread. If you expect time_limit= or item_limit= to abort the run, then consider to use bad_limit="untested". @* @item map_with_volid="on" examines tracks whether they are ISO images and prints their volume IDs into the human readable TOC of sector_map=. @* @item patch_lba0="on" transfers within the data_to= file a copy of the currently loaded session head to the start of that file and patches it to be valid at that position. This makes the loaded session the last valid session of the image file when it gets mounted or loaded as stdio: drive. New sessions will be appended after this last session and will overwrite any sessions which have followed it. @* @item patch_lba0="force" performs patch_lba0="on" even if @command{xorriso} believes that the copied data are not valid. @* patch_lba0= may also bear a number. If it is 32 or higher it is taken as start address of the session to be copied. In this case it is not necessary to have an -indev and a loaded image. ":force" may be appended after the number. @* @item bad_limit=threshold sets the highest quality which shall be considered as damage. Choose one of "good", "md5_match", "slow", "partial", "valid", "untested", "md5_mismatch", "invalid", "tao_end", "off_track", "unreadable". @* "valid" and "invalid" are qualities imported from a sector_map file. "tao_end" and "off_track" are intentionally not readable, but not bad either. "partial" are blocks retrieved from a partially readable chunk. They are supposed to be ok but stem from a suspicious neighborhood. @* "md5_match" and "md5_mismatch" regions overlap with regions of other quality. The former is a strong confirmation for quality, the latter only tells that one or more blocks of the region must be wrong. @* By default bad_limit is set higher than md5_mismatch, so that mismatches are classified as quality class "0" rather than "-". This means that the sectors of a MD5 mismatch range are recorded in the sector_map as successfully read, if the drive handed them out at all. Set "bad_limit=md5_mismatch" to let the sector_map record the whole mismatching range as yet not retrieved. @* @item slow_limit=threshold sets the time threshold for a single read chunk to be considered slow. This may be a fractional number like 0.1 or 1.5. @* @item async_chunks=number enables asynchronous MD5 processing if number is 2 or larger. In this case the given number of read chunks is allocated as fifo buffer. On very fast MMC drives try: chunk_size=64s async_chunks=16. @end table @c man .TP @kindex -check_md5 verifies file checksum @cindex Verify, file checksum, -check_md5 @item -check_md5 severity iso_rr_path [***] Compare the data content of the given files in the loaded image with their recorded MD5 checksums, if there are any. In case of any mismatch an event of the given severity is issued. It may then be handled by appropriate settings of commands -abort_on or -return_with which both can cause non-zero exit values of the program run. Severity ALL suppresses that event. @* This command reports match and mismatch of data files to the result channel. Non-data files cause NOTE events. There will also be UPDATE events from data reading. @* If no iso_rr_path is given then the whole loaded session is compared with its MD5 sum. Be aware that this covers only one session and not the whole image if there are older sessions. @c man .TP @item -check_md5_r severity iso_rr_path [***] @kindex -check_md5_r verifies file tree checksums @cindex Verify, file tree checksums, -check_md5_r Like -check_md5 but checking all data files underneath the given paths. Only mismatching data files will be reported. @end table @c man .TP @c man .B osirrox ISO-to-disk restore commands: @node Restore, Emulation, Verify, Commands @section osirrox ISO-to-disk restore commands @c man .PP Normally @command{xorriso} only writes to disk files which were given as stdio: pseudo-drives or as log files. But its alter ego osirrox is able to extract file objects from ISO images and to create, overwrite, or delete file objects on disk. @* Disk file exclusions by -not_mgt, -not_leaf, -not_paths apply. If disk file objects already exist then the settings of -overwrite and -reassure apply. But -overwrite "on" only triggers the behavior of -overwrite "nondir". I.e. directories cannot be deleted. @* Access permissions of files in the ISO image do not restrict restoring. The directory permissions on disk have to allow rwx. @table @asis @sp 1 @c man .TP @item -osirrox setting[:option:...] @kindex -osirrox enables ISO-to-disk copying @cindex Restore, enable ISO-to-disk, -osirrox Setting @strong{off} disables disk filesystem manipulations. This is the default unless the program was started with leafname @strong{osirrox}. Elsewise the capability to restore files can be enabled explicitly by -osirrox @strong{on}. It can be irrevocably disabled by -osirrox @strong{banned}. @* The setting @strong{blocked} is like @strong{off}. But it can only be revoked by setting @strong{unblock}, which elsewise is like @strong{on}. This can be used to curb command scripts which might use @strong{on} undesiredly. @* To enable restoring of special files by @strong{device_files} is potentially dangerous. The meaning of the number st_rdev (see man 2 stat) depends much on the operating system. Best is to restore device files only to the same system from where they were copied. If not enabled, device files in the ISO image are ignored during restore operations. @* Due to a bug of previous versions, device files from previous sessions might have been altered to major=0, minor=1. So this combination does not get restored. @* Option @strong{concat_split_on} is default. It enables restoring of split file directories as data files if the directory contains a complete collection of -cut_out part files. With option @strong{concat_split_off} such directories are handled like any other ISO image directory. @* Option @strong{auto_chmod_off} is default. If @strong{auto_chmod_on} is set then access restrictions for disk directories get circumvented if those directories are owned by the effective user who runs @command{xorriso}. This happens by temporarily granting rwx permission to the owner. @* Option @strong{sort_lba_on} may improve read performance with optical drives. It can restore large numbers of hard links without exhausting -temp_mem_limit. It does not preserve directory mtime and it needs -osirrox option auto_chmod_on in order to extract directories which offer no write permission. Default is @strong{sort_lba_off}. @* Option @strong{o_excl_on} is the default unless the program was started with leafname "osirrox". On GNU/Linux it tries to avoid using drives which are mounted or in use by other libburn programs. Option @strong{o_excl_off} on GNU/Linux enables access to such drives by the equivalent of -drive_access "shared:readonly". I.e. drives which get acquired while @strong{o_excl_off} will refuse to get blanked, formatted, written, or ejected. But be aware that even harmless inquiries can spoil ongoing burns of CD-R[W] and DVD-R[W]. @* Option @strong{strict_acl_off} is default. It tolerates on FreeBSD the presence of directory "default" ACLs in the ISO image. With @strong{strict_acl_on} these GNU/Linux ACLs cause on FreeBSD a FAILURE event during restore with -acl "on". @* Option @strong{check_md5_off} disables MD5 checking during copy to disk. The default option @strong{check_md5_on} enables it if -md5 is "on". If a data file with recorded MD5 is copied as a whole to the disk filesystem, then the MD5 of the copied content gets computed and compared with the recorded MD5. A mismatch causes an error message of severity SORRY. Option @strong{check_md5_force} causes an error message if -md5 is "on" but no MD5 is recorded for the data file. @* Option @strong{sparse=} controls production of sparse files during extraction of files from the ISO filesystem. Default is @strong{sparse=off}. @* A positive number like in @strong{sparse=1m} sets the minimum requirement for the length of a sequence of 0-bytes which shall be represented by a gap. This saves disk space if the disk filesystem supports sparse files. A gap gets created by help of lseek(2) if a sequence of read buffers, which contain only 0-bytes, bears at least the minimum amount of bytes. Expect read buffers to be in the size range of 32k or 64k. @* Command -paste_in creates gaps only if the writing begins at or after the end of the existing disk file. So the sequence of -paste_in commands matters. Command -concat does not create sparse files. @c man .TP @item -extract iso_rr_path disk_path @kindex -extract copies file tree to disk @cindex Restore, copy file tree to disk, -extract Copy the file objects at and underneath iso_rr_path to their corresponding addresses at and underneath disk_path. This is the inverse of -map or -update_r. @* If iso_rr_path is a directory and disk_path is an existing directory then both trees will be merged. Directory attributes get extracted only if the disk directory is newly created by the copy operation. Disk files get removed only if they are to be replaced by file objects from the ISO image. @* As many attributes as possible are copied together with restored file objects. @c man .TP @item -extract_single iso_rr_path disk_path @kindex -extract_single copies file to disk @cindex Restore, copy file to disk, -extract_single Like -extract, but if iso_rr_path is a directory then its sub tree gets not restored. @c man .TP @item -extract_l iso_rr_prefix disk_prefix iso_rr_path [***] @kindex -extract_l copies files to disk @cindex Restore, copy files to disk, -extract_l Perform -extract with each of the iso_rr_path parameters. disk_path will be composed from iso_rr_path by replacing iso_rr_prefix by disk_prefix. @c man .TP @item -extract_cut iso_rr_path byte_offset byte_count disk_path @kindex -extract_cut copies file piece to disk @cindex Restore, copy file piece to disk, -extract_cut Copy a byte interval from a data file out of an ISO image into a newly created disk file. The main purpose for this is to offer a way of handling large files if they are not supported by mount -t iso9660 or if the target disk filesystem cannot store large files. @* If the data bytes of iso_rr_path are stored in the loaded ISO image, and no filter is applied, and byte_offset is a multiple of 2048, then a special run of -check_media is performed. It may be quicker and more rugged than the general reading method. @c man .TP @item -cpx iso_rr_path [***] disk_path @kindex -cpx copies files to disk @cindex Restore, copy files to disk, -cpx Copy single leaf file objects from the ISO image to the address given by disk_path. If more then one iso_rr_path is given then disk_path must be a directory or non-existent. In the latter case it gets created and the extracted files get installed in it with the same leafnames. @* Missing directory components in disk_path will get created, if possible. @* Directories are allowed as iso_rr_path only with -osirrox "concat_split_on" and only if they actually represent a complete collection of -cut_out split file parts. @c man .TP @item -cpax iso_rr_path [***] disk_path @kindex -cpax copies files to disk @cindex Restore, copy files to disk, -cpax Like -cpx but restoring mtime, atime as in ISO image and trying to set ownership and group as in ISO image. @c man .TP @item -cp_rx iso_rr_path [***] disk_path @kindex -cp_rx copies file trees to disk @cindex Restore, copy file trees to disk, -cp_rx Like -cpx but also extracting whole directory trees from the ISO image. @* The resulting disk paths are determined as with shell command cp -r : If disk_path is an existing directory then the trees will be inserted or merged underneath this directory and will keep their leaf names. The ISO directory "/" has no leaf name and thus gets mapped directly to disk_path. @c man .TP @item -cp_rax iso_rr_path [***] disk_path @kindex -cp_rx copies file trees to disk @cindex Restore, copy file trees to disk, -cp_rx Like -cp_rx but restoring mtime, atime as in ISO image and trying to set ownership and group as in ISO image. @c man .TP @item -paste_in iso_rr_path disk_path byte_offset byte_count @kindex -paste_in copies file into disk file @cindex Restore, copy file into disk file, -paste_in Read the content of a ISO data file and write it into a data file on disk beginning at the byte_offset. Write at most byte_count bytes. This is the inverse of command -cut_out. @c man .TP @item -concat mode [target | lim prog [args [...]] lim] iso_rr_path [***] @kindex -concat copies ISO file content @cindex File content, copy, -concat Copy the data content of one or more data files of the ISO image into a disk file object, into a file descriptor, or start a program and copy the data into its standard input. The latter is subject to the security restrictions for external filters. @* Modes @strong{overwrite} and @strong{append} write into the target which is given by the second parameter. This may be the path to a disk file object, or "-" which means standard output, or a text of the form /dev/fd/number, where number is an open file descriptor (e.g. standard error is /dev/fd/2). An existing target file is not removed before writing begins. If it is not able to take content data, then this command fails. Mode overwrite truncates regular data files to 0 size before writing into them. Example: @* @sp 1 -concat append /home/me/accumulated_text /my/iso/text -- @* @sp 1 Mode @strong{pipe} expects as second parameter a delimiter word which shall mark the end of the program argument list. The third argument is the disk_path to the program. It must contain at least one '/'. $PATH is not applied. Further parameters up to the announced delimiter word are used as arguments with the program start. Example: @* @sp 1 -iso_rr_pattern on \ @* -concat pipe + /usr/bin/wc + "/my/iso/files*" -- @* @sp 1 The further parameters in all modes are the iso_rr_paths of data files. Their content gets concatenated in the copy. @c man .TP @item -extract_boot_images disk_path @kindex -extract_boot_images copies boot equipment to disk @cindex Restore, copy boot equipment to disk, -extract_boot_images Copy boot equipment to disk, which is not necessarily represented as data files in the ISO filesystem. The data get written into various files in a disk directory, which may already exist or of which the parent must exist so that it can get created. @* Files may be missing if their corresponding information is not present in the ISO filesystem. Existing files do not get overwritten but rather cause a failure event. @* The same data may appear in different files. E.g. the El Torito boot image for EFI is often the same data as the EFI partition in MBR or GPT. @* File "eltorito_catalog.img" contains the El Torito Boot Catalog. @* Files "eltorito_img*_*.img" contain El Torito Boot images. The first "*" gives the image number, the second "*" gives the type: "bios", "mac", "ppc", "uefi", or a hex number. @* File "mbr_code_isohybrid.img" contains the ISOLINUX MBR template. @* File "mbr_code_grub2.img" contains the GRUB2 MBR template. @* File "systemarea.img" contains the whole 32 KiB of System Area if not all zero. @* Files "mbr_part*_efi.img" contain EFI partition images from the MBR partition table. The "*" text part gives the partition number. @* Files "mbr_part*_prep.img" contain PReP partition images. @* Files "gpt_part*_efi.img" contain EFI partition images from GPT. @* Files "gpt_part*_hfsplus.img" contain HFS+ partition images from GPT. To avoid extracting the whole HFS+ aspect of hybrid ISO filesystems, the partition image is extracted only if it has less than half of the size of the ISO filesystem or if the partition is outside the ISO filesystem. @c man .TP @item -mount drive entity id path @kindex -mount issues mount command for ISO session @cindex Session, issue mount command, -mount Produce the same line as -mount_cmd and then execute it as external program run after giving up the depicted drive. See also -mount_opts. This demands -osirrox to be enabled and normally will succeed only for the superuser. For safety reasons the mount program is only executed if it is reachable as /bin/mount or /sbin/mount. @end table @c man .TP @c man .B Command compatibility emulations: @node Emulation, Scripting, Restore, Commands @section Command compatibility emulations (cdrtools) @c man .PP Writing of ISO 9660 on CD is traditionally done by program mkisofs as ISO 9660 image producer and cdrecord as burn program. @command{xorriso} does not strive for their comprehensive emulation. Nevertheless it is ready to perform some of its core tasks under control of commands which in said programs trigger comparable actions. @table @asis @sp 1 @c man .TP @item -as personality option [options] @minus{}@minus{} @kindex -as emulates mkisofs or cdrecord @cindex Emulation, -as @* Perform the variable length option list as sparse emulation of the program depicted by the personality word. @* @sp 1 @cindex Emulation, mkisofs, -as @cindex mkisofs, Emulation Personality "@strong{mkisofs}" accepts the options listed with: @* -as mkisofs -help @minus{}@minus{} @* Among them: -R (always on), -r, -J, -o, -M, -C, -dir-mode, -file-mode, -path-list, -m, -exclude-list, -f, -print-size, -pad, -no-pad, -V, -v, -version, -graft-points, -z, -no-emul-boot, -b, -c, -boot-info-table, -boot-load-size, -input-charset, -G, -output-charset, -U, -hide, -hide-joliet, -hide-list, -hide-joliet-list, file paths and pathspecs. A lot of options are not supported and lead to failure of the mkisofs emulation. Some are ignored, but better do not rely on this tolerance. @* The supported options are documented in detail in xorrisofs.info and in man xorrisofs. The description here is focused on the effect of mkisofs emulation in the context of a @command{xorriso} run. @* Other than with the "cdrecord" personality there is no automatic -commit at the end of a "mkisofs" option list. Verbosity settings -v (= "UPDATE") and -quiet (= "SORRY") persist. The output file persists until things happen like -commit, -rollback, -dev, or end of @command{xorriso}. @* Options which affect all file objects in the ISO image, like -r or -dir-mode, will be applied only to files which are present in the ISO image when the command -as ends. If you use several -as mkisofs commands in the same run, then consider to put such options into the last -as command. @* If files are added to the image, then -pacifier gets set to "mkisofs" and -stdio_sync is defaulted to "off" if no such setting was made yet. @* -graft-points is equivalent to -pathspecs on. Note that pathspecs without "=" are interpreted differently than with @command{xorriso} command -add. Directories get merged with the root directory of the ISO image, other filetypes get mapped into that root directory. @* If pathspecs are given and if no output file was chosen before or during the "mkisofs" option list, then standard output (-outdev "-") will get into effect. If -o points to a regular file, then it will be truncated to 0 bytes when finally writing begins. This truncation does not happen if the drive is chosen by @command{xorriso} commands before -as mkisofs or after its list delimiter. Directories and symbolic links are no valid -o targets. @* Writing to stdout is possible only if -as "mkisofs" was among the start arguments or if other start arguments pointed the output drive to standard output. @* -print-size inhibits automatic image production at program end. This ban is lifted only if the pending image changes get discarded. @* Padding is counted as part of the ISO image if not option --emul-toc is given. @* If no -iso-level is given, then level 1 is chosen when the first file or directory is added to the image. At the same occasion directory names get allowed to violate the standard by -compliance option allow_dir_id_ext. This may be avoided by option -disallow_dir_id_ext. @* Option -root is supported. Option -old-root is implemented by @command{xorriso} commands -mkdir, -cp_clone, -find update_merge, and -find rm_merge. -root and -old-root set command -disk_dev_ino to "ino_only" and -md5 to "on", by default. @minus{}disk_dev_ino can be set to "off" by @minus{}@minus{}old-root-no-ino or to "on" by @minus{}@minus{}old-root-devno . @minus{}md5 can be set to "off" by @minus{}@minus{}old-root-no-md5 . @* Not original mkisofs options are @minus{}@minus{}quoted_path_list , @minus{}@minus{}hardlinks , @minus{}@minus{}acl , @minus{}@minus{}xattr , @minus{}@minus{}md5 , @minus{}@minus{}stdio_sync . They work like the @command{xorriso} commands with the same name and hardcoded parameter "on", e.g. -acl "on". Explicit parameters are expected by @minus{}@minus{}stdio_sync and @minus{}@minus{}scdbackup_tag. @* The capability to preserve multi-session history on overwritable media gets disabled by default. It can be enabled by using @minus{}@minus{}emul-toc with the first session. See -compliance no_emul_toc. @* @minus{}@minus{}sort-weight gets as parameters a number and an iso_rr_path. The number becomes the LBA sorting weight of regular file iso_rr_path or of all regular files underneath directory iso_rr_path. (See -find -exec sort_weight). @* Adopted from grub-mkisofs are @minus{}@minus{}protective-msdos-label (see -boot_image grub partition_table=on) and @minus{}@minus{}modification-date=YYYYMMDDhhmmsscc (see -volume_date uuid). For EFI bootable GRUB boot images use @minus{}@minus{}efi-boot. It performs @minus{}boot_image grub efi_path= surrounded by two @minus{}boot_image "any" "next". Alternative option @minus{}e from Fedora genisoimage sets bin_path and platform_id for EFI, but performs no "next". @* For MBR bootable ISOLINUX images there is -isohybrid-mbr FILE, where FILE is one of the Syslinux files mbr/isohdp[fp]x*.bin . Use this instead of -G to apply the effect of -boot_image isolinux partition_table=on. @* @minus{}@minus{}boot-catalog-hide is -boot_image any cat_hidden=on. @* @minus{}mips-boot is the same as -boot_image any mips_path= . @* @minus{}mipsel-boot leads to mipsel_path= . @* @minus{}partition_offset number is @minus{}boot_image any partition_offset=number. @* Command @minus{}append_partition is supported. @* @minus{}untranslated_name_len number is @minus{}compliance untranslated_name_len=number. @* @minus{}@minus{}old-empty is -compliance old_empty. @* The options of genisoimage Jigdo Template Extraction are recognized and performed via @command{xorriso} command -jigdo. See the "Alias:" names there for the meaning of the genisoimage options. @* @sp 1 Personalities "@strong{xorrisofs}", "@strong{genisoimage}", and "@strong{genisofs}" are aliases for "mkisofs". @* If @command{xorriso} is started with one of the leafnames "xorrisofs", "genisofs", "mkisofs", or "genisoimage", then it performs -read_mkisofsrc and prepends -as "genisofs" to the program arguments. I.e. all arguments will be interpreted mkisofs style until "@minus{}@minus{}" is encountered. From then on, arguments are interpreted as @command{xorriso} commands. @* @minus{}@minus{}no_rc as first argument of such a program start prevents interpretation of startup files. See section FILES below. @* @sp 1 @cindex Emulation, cdrecord, -as @cindex cdrecord, Emulation Personality "@strong{cdrecord}" accepts the options listed with: @* -as cdrecord -help @minus{}@minus{} @* Among them: -v, dev=, speed=, blank=, fs=, -eject, -atip, padsize=, tsize=, -isosize, -multi, -msinfo, @minus{}@minus{}grow_overwriteable_iso, write_start_address=, track source file path or "-" for standard input as track source. @* It ignores most other options of cdrecord and cdrskin but refuses on -audio, -scanbus, and on blanking modes unknown to @command{xorriso}. @* The scope is only a single data track per session to be written to blank, overwritable, or appendable media. The medium gets closed if closing is applicable and not option -multi is present. @* If an input drive was acquired, then it is given up. This is only allowed if no image changes are pending. @* dev= must be given as @command{xorriso} device address. Addresses like 0,0,0 or ATA:1,1,0 are not supported. @* If a track source is given, then an automatic -commit happens at the end of the "cdrecord" option list. @* @minus{}@minus{}grow_overwriteable_iso enables emulation of multi-session on overwritable media. To enable emulation of a TOC, the first session needs -C 0,32 with -as mkisofs (but no -M) and @minus{}@minus{}grow_overwriteable_iso write_start_address=32s with -as cdrecord. @* A much more elaborate libburn based cdrecord emulator is the program cdrskin. @* Personalites "@strong{xorrecord}", "@strong{wodim}", and "@strong{cdrskin}" are aliases for "cdrecord". @* If @command{xorriso} is started with one of the leafnames "xorrecord", "cdrskin", "cdrecord", or "wodim", then it automatically prepends -as "cdrskin" to the program arguments. I.e. all arguments will be interpreted cdrecord style until "@minus{}@minus{}" is encountered. From then on, arguments are interpreted as @command{xorriso} commands. @* @minus{}@minus{}no_rc as first argument of such a program start prevents interpretation of @command{xorriso} startup files. See section FILES below. @c man .TP @item -read_mkisofsrc @kindex -read_mkisofsrc searches and reads .mkisofsrc file @cindex Emulation, .mkisofsrc, -read_mkisofsrc Try one by one to open for reading: ./.mkisofsrc , $MKISOFSRC , $HOME/.mkisofsrc , $(dirname $0)/.mkisofsrc @* On success interpret the file content as of man mkisofs CONFIGURATION, and end this command. Do not try further files. The last address is used only if start argument 0 has a non-trivial dirname. @* The reader currently interprets the following NAME=VALUE pairs: APPI (-application_id) , PUBL (-publisher) , SYSI (-system_id) , VOLI (-volid) , VOLS (-volset_id) @* Any other lines will be silently ignored. @c man .TP @item -pacifier behavior_code @kindex -pacifier controls pacifier text form @cindex Emulation, pacifier form, -pacifier Control behavior of UPDATE pacifiers during write operations. The following behavior codes are defined: @* "xorriso" is the default format: @* Writing: sector XXXXX of YYYYYY [fifo active, nn% fill] @* "cdrecord" looks like: @* X of Y MB written (fifo nn%) [buf mmm%] @* "mkisofs" @* nn% done, estimate finish Tue Jul 15 20:13:28 2008 @* The frequency of the messages can be adjusted by @* "interval=number" @* where number gives the seconds between two messages. Permissible settings are 0.1 to 60.0. @c man .TP @item -scdbackup_tag list_path record_name @kindex -scdbackup_tag enables scdbackup checksum tag @cindex Backup, scdbackup checksum tag, -scdbackup Set the parameter "name" for a scdbackup checksum record. It will be appended in an scdbackup checksum tag to the -md5 session tag if the image starts at LBA 0. This is the case if it gets written as first session onto a sequential medium, or piped into a program, named pipe or character device. @* If list_path is not empty then the record will also be appended to the data file given by this path. @* Program scdbackup_verify will recognize and verify tag and file record. @* An empty record_name disables this feature. @end table @c man .TP @c man .B Scripting, dialog and program control features: @node Scripting, Frontend, Emulation, Commands @section Scripting, dialog and program control features @table @asis @c man .TP @item -no_rc @kindex -no_rc disables startup files @cindex Process, disable startup files, -no_rc @* Only if used as first program argument this command prevents reading and interpretation of startup files. See section FILES below. @c man .TP @item -options_from_file fileaddress @kindex -options_from_file reads commands from file @cindex Process, read command file, -options_from_file Read quoted input from fileaddress and execute it like dialog lines. Empty lines and lines which begin by # are ignored. Normally one line should hold one @command{xorriso} command and all its parameters. Nevertheless lines may be concatenated by a trailing backslash. @* See also section "Command processing", paragraph "Quoted input". @c man .TP @item -help @kindex -help prints help text @cindex Program, print help text, -help @* Print helptext. @c man .TP @item -version @kindex -version prints help text @cindex Program, print version, -version Print program name and version, component versions, license. @c man .TP @item -list_extras code @kindex -list_extras lists compile time extra features @cindex Program, list extra features, -list_extras Tell whether certain extra features were enabled at compile time. Code "all" lists all features and a headline. Other codes pick a single feature. Code "codes" lists them. They share names with related commands (see also there): @* "acl" tells whether xorriso has an adapter for local filesystems ACLs. @* "xattr" tells whether xorriso has an adapter for local filesystems EA. @* "jigdo" tells whether production of Jigdo files is possible. @* "zisofs" tells whether zisofs and built-in gzip filters are enabled. @* "external_filter" tells whether external filter processes are allowed and whether they are allowed if real user id and effective user id differ. @* "dvd_obs" tells whether 64 kB output to DVD media is default. @* "use_readline" tells whether readline may be enabled in dialog mode. @* @c man .TP @item -history textline @kindex -history brings text into readline history @cindex Dialog, bring text into history, -history Copy textline into libreadline history. @c man .TP @item -status mode|filter @kindex -status shows current settings @cindex Program, show current settings, -status Print the current settings of @command{xorriso}. Modes: @* short... print only important or altered settings @* long ... print all settings including defaults @* long_history like long plus history lines @* Filters begin with '-' and are compared literally against the output lines of -status:long_history. A line is put out only if its start matches the filter text. No wildcards. @c man .TP @item -status_history_max number @kindex -status_history_max curbs -status history @cindex Program, status history, -status_history_max Set maximum number of history lines to be reported with -status "long_history". @c man .TP @item -list_delimiter word @kindex -list_delimiter replaces '@minus{}@minus{}' @cindex Program, replace @minus{}@minus{}, -list_delimiter Set the list delimiter to be used instead of "@minus{}@minus{}". It has to be a single word, must not be empty, not longer than 80 characters, and must not contain quotation marks. @* For brevity the list delimiter is referred as "@minus{}@minus{}" throughout this text. @c man .TP @item -sh_style_result "on"|"off" @kindex -sh_style_result makes results look more like shell @cindex Result layout, more shell-like, -sh_style_result Make the result output of some filesystem inspection commands look more like the output of equivalent shell commands. The most important effect is to prevent the wrapping of file addresses into quotation marks with commands -pwd -pwdx -ls -lsd -lsl -lsdl -lsx -lsdx -lslx -lsdlx -du -dus -dux -dusx -findx -find @* This will make ambiguous the representation of file names which contain newline characters. On the other hand it should facilitate integration of xorriso into shell scripts which already use the corresponding shell commands. @c man .TP @item -backslash_codes "on"|"off"|mode[:mode] @kindex -backslash_codes enables backslash conversion @cindex Program, backslash conversion, -backslash_codes Enable or disable the interpretation of symbolic representations of special characters with quoted input, or with program arguments, or with program text output. If enabled the following translations apply: @* \a=bell(007) \b=backspace(010) \e=Escape(033) \f=formfeed(014) @* \n=linefeed(012) \r=carriage_return(015) \t=tab(011) @* \v=vtab(013) \\=backslash(134) \[0-7][0-7][0-7]=octal_code @* \x[0-9a-f][0-9a-f]=hex_code \cC=control-C @* Translations can occur with quoted input in 3 modes: @* "in_double_quotes" translates only inside " quotation. @* "in_quotes" translates inside " and ' quotation. @* "with_quoted_input" translates inside and outside quotes. @* With the start program arguments there is mode: @* "with_program_arguments" translates program arguments. @* @* Mode "encode_output" encodes output characters. It combines "encode_results" with "encode_infos". Inside single or double quotation marks encoding applies to 8-bit characters octal 001 to 037 , 177 to 377 and to backslash(134). Outside quotation marks some harmless ASCII control characters stay unencoded: bell(007), backspace(010), tab(011), linefeed(012), formfeed(014), carriage_return(015). @* Mode "off" is default and disables any translation. Mode "on" is "with_quoted_input:with_program_arguments:encode_output". @c man .TP @item -temp_mem_limit number["k"|"m"] @kindex -temp_mem_limit curbs memory consumption @cindex Program, curb memory, -temp_mem_limit Set the maximum size of temporary memory to be used for image dependent buffering. Currently this applies to pattern expansion, LBA sorting, restoring of hard links. @* Default is 16m = 16 MiB, minimum 64k = 64 kiB, maximum 1024m = 1 GiB. @c man .TP @item -print text @kindex -print prints result text line @cindex Program, print result text line, -print Print a text line to the result channel which is by default stdout. @c man .TP @item -print_info text @kindex -print_info prints message text line @cindex Program, print message text line, -print_info Print a text line to the info channel which is by default stderr. @c man .TP @item -print_mark text @kindex -print_mark prints synchronizing text line @cindex Program, print synchronizing text line, -print_mark Print a text line to the mark channel which is by default directed to both, result and info channel. An empty text will cause no output at all. @c man .TP @item -prompt text @kindex -prompt prompts for enter key @cindex Program, prompt for enter key, -prompt Show text at beginning of output line and wait for the user to hit the Enter key or to send a line via stdin. @c man .TP @item -sleep seconds @kindex -sleep waits for a given time span @cindex Program, wait a time span, -sleep Wait for the given number of seconds before performing the next command. Expect coarse granularity no better than 1/100 seconds. @c man .TP @item -errfile_log mode path|channel @kindex -errfile_log logs problematic disk files @cindex Write, log problematic disk files, -errfile_log @* If problem events are related to input files from the filesystem, then their disk_paths can be logged to a file or to output channels R or I. @* Mode can either be "plain" or "marked". The latter causes marker lines which give the time of log start, burn session start, burn session end, log end or program end. In mode "plain", only the file paths are logged. @* If path is "-" or "-R" then the log is directed to the result channel. Path "-I" directs it to the info message channel. Any text that does not begin with "-" is used as path for a file to append the log lines. @* Problematic files can be recorded multiple times during one program run. If the program run aborts then the list might not be complete because some input files might not have been processed at all. @* The errfile paths are transported as messages of very low severity "ERRFILE". This transport becomes visible with -report_about "ALL". @c man .TP @item -session_log path @kindex -session_log logs written sessions @cindex Write, log written sessions, -session_log @cindex Session, log when written, -session_log If path is not empty it gives the address of a plain text file where a log record gets appended after each session. This log can be used to determine the start_lba of a session for mount options -o sbsector= (on GNU/Linux) or -s (on FreeBSD) from date or volume ID. @* Record format is: timestamp start_lba size volume-id @* The first three items are single words, the rest of the line is the volume ID. @c man .TP @item -scsi_log "on"|"off" @kindex -scsi_log reports SCSI commands @cindex Drive, report SCSI commands, -scsi_log Mode "on" enables very verbose logging of SCSI commands and drive replies. Logging messages get printed to stderr, not to any of the @command{xorriso} output channels. @* A special property of this command is that the first -scsi_log setting among the start arguments is in effect already when the first operations of @command{xorriso} begin. Only "-scsi_log" with dash "-" is recognized that way. @c man .TP @item -end @kindex -end writes pending session and ends program @cindex Process, end program and write, -end @cindex Program, end and write, -end @* End program after writing pending changes. @c man .TP @item -rollback_end @kindex -rollback_end ends program without writing @cindex Program, end without writing, -rollback_end @cindex Process, end program, no writing, -rollback_end Discard pending changes. End program immediately. @c man .TP @item # any text @kindex # starts a comment line @cindex Comment, # Only in dialog or file execution mode, and only as first non-whitespace in line: Do not execute the line but store it in readline history. @end table @c man .TP @c man .B Support for frontend programs via stdin and stdout: @node Frontend, ExDevices, Scripting, Commands @section Support for frontend programs via stdin and stdout @table @asis @c man .TP @item -pkt_output "on"|"off" @kindex -pkt_output consolidates text output @cindex Process, consolidate text output, -pkt_output Consolidate text output on stdout and classify each line by a channel indicator: @* 'R:' for result lines, @* 'I:' for notes and error messages, @* 'M:' for -mark texts. @* Next is a decimal number of which only bit 0 has a meaning for now. 0 means no newline at end of payload, 1 means that the newline character at the end of the output line belongs to the payload. After another colon and a blank follows the payload text. @* Example: @* I:1: enter option and parameters : @c man .TP @item -logfile channel fileaddress @kindex -logfile logs output channels to file @cindex Process, log output channels to file, -logfile Copy output of a channel to the given file. Channel may be one of: "." for all channels, "I" for info messages, "R" for result lines, "M" for -mark texts. @c man .TP @item -mark text @kindex -mark sets synchronizing message @cindex Process, set synchronizing message, -mark If text is not empty it will get put out on "M" channel each time @command{xorriso} is ready for the next dialog line or before @command{xorriso} performs a command that was entered to the pager prompt. @c man .TP @item -msg_op opcode parameter_text @kindex -msg_op perform operations on program messages @cindex Program messages, perform operations, -msg_op This command shall facilitate extraction of particular information from the message output of other commands. It gives access to the C API function Xorriso_parse_line() and to the message sieve that is provided by the C API. Please refer to their descriptions in file xorriso.h. Further it helps to interpret the severity codes of info messages. @* Intended users are frontend programs which operate xorriso in dialog mode. @* The result output of this command is not caught by the message sieve. @* The following opcodes are defined: @* @strong{start_sieve} @* Install the message sieve as of Xorriso_sieve_big() and start watching program messages. The parameter_text has no meaning. @* @strong{show_sieve} @* Show a list of filter rule names. The parameter_text has no meaning. The list begins by a line with the return value of Xorriso_sieve_get_result() with flag bit3. If this value is larger than 0, then the next line tells the number of names. The following lines show one name each. @* @strong{read_sieve} @* Use the parameter_text as name of a filter rule and inquire its next recorded result. See Xorriso_sieve_big() for a list of names and reply strings. @* The recorded strings are put out on result channel. They get wrapped into lines which tell their structure. The first line tells the return value of Xorriso_sieve_get_result(). The next line tells the number of strings. Each string begins by a line that tells the number of lines of the string. Then follow these lines. They are to be concatenated with a newline character between each of them. Finally the number of still available recorded results of the given name is put out. @* @strong{clear_sieve} @* Dispose all recorded strings and continue watching program messages. The parameter_text has no meaning. @* @strong{end_sieve} @* Dispose the sieve with its filter rules and stop watching program messages. The parameter_text has no meaning. @* @strong{parse} @* Read a text from dialog input and submit it to Xorriso_parse_line(). The parameter_text word shall consist of several words separated by blanks. It will be necessary to use both kinds of quotation marks. @* E.g. "'ISO session :' '' 0 0 1" @* The five parameter words are: prefix, separators, max_words, flag, number_of_input_lines. The former four are handed over to Xorriso_parse_line(). The number of input lines minus one tells xorriso how many newline characters are part of the input text. @* The announced number of text lines will be read from dialog input, concatenated with a newline character between each of them, and submitted to Xorriso_parse_line() as parameter line. Note that newlines outside of quotation marks are interpreted as separators if the separators parameter is empty. @* The parsed strings are put out on result channel. They get wrapped into lines which tell their structure. The first line tells the return value of Xorriso_parse_line(). The next line tells the number of strings. Each string begins by a line that tells the number of lines of the string. Then follow these lines. They are to be concatenated with a newline character between each of them. @* If -backslash_codes "encode_output" is enabled, then the strings undergo encoding as if they were enclosed in quotes. Escpecially each string will be put out as a single result line. @* @strong{parse_bulk} @* Like "parse", but with the fifth parameter word being number_of_input_texts rather than number_of_input_lines. Each input text has to be preceded by a line that tells number_of_input_lines as with "parse". Then come the announced number of text lines. @* All input texts will be read before printing of result lines begins. This consumes memory in xorriso. So the number_of_input_texts should not be extremely high. On the other hand, large transactions of command, input texts, and results are desirable if connection latency is an issue. @* @strong{parse_silently} @* Like "parse" but not issuing a prompting message. Confusing to humans. @* @strong{parse_bulk_silently} @* Like "parse_bulk" but not issuing a prompting message. Confusing to humans. @* @strong{compare_sev} @* The parameter_text should contain two comma separated severity texts as issued by this program. Like "SORRY,UPDATE". See also paragraph "Exception processing". @* These two severity texts get compared and a number gets printed to the result channel. This number is 0 if both severities are equal. It is -1 if the first severity is lower than the second one. It is 1 is the first severity is higher than the second one. @* Above example "SORRY,UPDATE" will yield 1. @* @strong{list_sev} @* Print to the result channel a blank separated list of all severity names. Sorted from low to high severity. @c man .TP @item -named_pipe_loop mode[:mode] disk_path_stdin disk_path_stdout disk_path_stderr @kindex -named_pipe_loop enters EOF resistant dialog @cindex Dialog, EOF resistant, -named_pipe_loop Temporarily replace standard input, standard output and standard error by named pipes. Enter dialog mode without readline. @* Defined modes are: @* "cleanup" removes the submitted pipe files when the loop ends. @* "keep" does not delete them. This is the default. @* "buffered" reads all lines from the input pipe until EOF before it opens the output pipes and processes the input lines. @* "direct" opens the output pipes after the first input line was read. Each line is executed directly after it is read. This is the default. @* The other three parameters must either be disk paths to existing named pipes, or be "-" to leave the according standard i/o channel unreplaced. @* xorriso will open the stdin pipe, read and execute dialog lines from it until the sender closes the pipe. The output pipes get opened depending on mode "buffered" or "direct". After all lines are executed, xorriso will close its side of the pipes and enter a new cycle of opening, reading and executing. @* If an input line consists only of the word "end_named_pipe_loop" then -named_pipe_loop will end and further xorriso commands may be executed from other sources. @c man .TP @item -launch_frontend program [arguments ...] @minus{}@minus{} @kindex -launch_frontend starts frontend program at pipes @cindex Frontend program, start at pipes, -launch_frontend Start the program that is given as first parameter. Submit the other parameters as program arguments. Enable xorriso dialog mode. @* Two nameless pipe objects are created. xorriso standard input gets connected to the standard output of the started program. xorriso standard output and standard error get connected to the standard input of that program. @* xorriso will abort when the started program ends or if it cannot be started at all. In both cases it will return a non-zero exit value. The exit value will be zero if the frontend sends -end or -rollback_end before ending itself. @* This command may be totaly banned at compile time. It is banned by default if xorriso runs under setuid permissions. @* The program name will not be searched in the $PATH directories. To make this clear, it must contain at least one /-character. Best is an absolute path. @* Example: @* xorriso -launch_frontend "$(which xorriso-tcltk)" -stdio -- @* The frontend program should first send via its standard output: @* -mark 0 -pkt_output on -msg_op start_sieve - -reassure off @* It should be ready to decode -pkt_output and to react on -mark messages. Best is to increment the -mark number after each sent command sequence and then to wait for the new number to show up in a mark message: @* ...some...commands... -mark @* Further are advised: @* -report_about UPDATE -abort_on NEVER @* -iso_rr_pattern off -disk_pattern off @* A check of the xorriso version should be done, in order to make sure that all desired features are present. @* Command -launch_frontend will only work once per xorriso run. If no command parameters are submitted or if program is an empty text, then no program will be started but nevertheless -launch_frontend will be irrevocably disabled. @c man .TP @item -prog text @kindex -prog sets program name @cindex Program, set name, -prog Use text as name of this program in subsequent messages @c man .TP @item -prog_help text @kindex -prog_help prints help text @cindex Program, print help text, -prog_help Use text as name of this program and perform -help. @end table @c man .br @node Examples, Files, Commands, Top @chapter Examples @c man .SH EXAMPLES @c man .SS @c man .B Overview of examples: @c man As superuser learn about available drives @c man .br @c man Blank medium and compose a new ISO image as batch run @c man .br @c man A dialog session doing about the same @c man .br @c man Manipulate an existing ISO image on the same medium @c man .br @c man Copy modified ISO image from one medium to another @c man .br @c man Bring a prepared ISOLINUX tree onto medium and make it bootable @c man .br @c man Change existing file name tree from ISO-8859-1 to UTF-8 @c man .br @c man Operate on storage facilities other than optical drives @c man .br @c man Burn an existing ISO image file to medium @c man .br @c man Perform multi-session runs as of cdrtools traditions @c man .br @c man Let xorriso work underneath growisofs @c man .br @c man Adjust thresholds for verbosity, exit value and program abort @c man .br @c man Examples of input timestrings @c man .br @c man Incremental backup of a few directory trees @c man .br @c man Restore directory trees from a particular ISO session to disk @c man .br @c man Try to retrieve blocks from a damaged medium @cindex Examples @menu * ExDevices:: As superuser learn about available drives * ExCreate:: Blank medium and compose a new ISO image as batch run * ExDialog:: A dialog session doing about the same * ExGrowing:: Manipulate an existing ISO image on the same medium * ExModifying:: Copy modified ISO image from one medium to another * ExBootable:: Bring a prepared ISOLINUX tree onto medium and make it bootable * ExCharset:: Change existing file name tree from ISO-8859-1 to UTF-8 * ExPseudo:: Operate on storage facilities other than optical drives * ExCdrecord:: Burn an existing ISO image file to medium * ExMkisofs:: Perform multi-session runs as of cdrtools traditions * ExGrowisofs:: Let @command{xorriso} work underneath growisofs * ExException:: Adjust thresholds for verbosity, exit value and program abort * ExTime:: Examples of input timestrings * ExIncBackup:: Incremental backup of a few directory trees * ExRestore:: Restore directory trees from a particular ISO session to disk * ExRecovery:: Try to retrieve blocks from a damaged medium @end menu @c man .SS @c man .B As superuser learn about available drives @node ExDevices, ExCreate, Frontend, Examples @section As superuser learn about available drives On Linux, FreeBSD or NetBSD consider to give rw-permissions to those users or groups which shall be able to use the drives with @command{xorriso}. On Solaris use pfexec. Consider to restrict privileges of @command{xorriso} to "base,sys_devices" and to give r-permission to user or group. @* @sp 1 $ xorriso -device_links @* 1 -dev '/dev/cdrom1' rwrw@minus{}@minus{} : 'TSSTcorp' 'DVD-ROM SH-D162C @* 1 -dev '/dev/cdrw' rwrw@minus{}@minus{} : 'TSSTcorp' 'CDDVDW SH-S223B' @* 2 -dev '/dev/cdrw3' rwrw@minus{}@minus{} : 'HL-DT-ST' 'BDDVDRW_GGC-H20L' @c man .SS @c man .B Blank medium and compose a new ISO image as batch run @node ExCreate, ExDialog, ExDevices, Examples @section Blank medium and compose a new ISO image as batch run Acquire drive /dev/sr2, make medium ready for writing a new image, fill the image with the files from hard disk directories /home/me/sounds and /home/me/pictures. @* Because no -dialog "on" is given, the program will then end by writing the session to the medium. @* @sp 1 $ xorriso -outdev /dev/sr2 \ @* -blank as_needed \ @* -map /home/me/sounds /sounds \ @* -map /home/me/pictures /pictures @* @sp 1 @* The ISO image may be shaped in a more elaborate way like the following: Omit some unwanted stuff by removing it from the image directory tree. Reintroduce some wanted stuff. @* @sp 1 $ cd /home/me @* $ xorriso -outdev /dev/sr2 \ @* -blank as_needed \ @* -map /home/me/sounds /sounds \ @* -map /home/me/pictures /pictures \ @* -rm_r \ @* /sounds/indecent \ @* '/pictures/*private*' \ @* /pictures/confidential \ @* @minus{}@minus{} \ @* -cd / \ @* -add pictures/confidential/work* @minus{}@minus{} @* @sp 1 Note that '/pictures/*private*' is a pattern for iso_rr_paths while pictures/confidential/work* gets expanded by the shell with addresses from the hard disk. Commands -add and -map have different parameter rules but finally the same effect: they put files into the image. @c man .SS @c man .B A dialog session doing about the same @c man .br @node ExDialog, ExGrowing, ExCreate, Examples @section A dialog session doing about the same as the previous example Some settings are already given as start argument. The other activities are done as dialog input. The pager gets set to 20 lines of 80 characters. @* The drive is acquired by command -dev rather than -outdev in order to see the message about its current content. By command -blank this content is made ready for being overwritten and the loaded ISO image is made empty. @* In order to be able to eject the medium, the session needs to be committed explicitly. @* @c man .B $ xorriso -dialog on -page 20 80 -disk_pattern on @c man .br @c man enter option and arguments : @c man .br @c man .B \-dev /dev/sr2 @c man .br @c man enter option and arguments : @c man .br @c man .B \-blank as_needed @c man .br @c man enter option and arguments : @c man .br @c man .B \-map /home/me/sounds /sounds -map /home/me/pictures /pictures @c man .br @c man enter option and arguments : @c man .br @c man .B \-rm_r /sounds/indecent /pictures/*private* /pictures/confidential @c man .br @c man enter option and arguments : @c man .br @c man .B \-cdx /home/me/pictures -cd /pictures @c man .br @c man enter option and arguments : @c man .br @c man .B \-add confidential/office confidential/factory @c man .br @c man enter option and arguments : @c man .br @c man .B \-du / @c man .br @c man enter option and arguments : @c man .br @c man .B \-commit_eject all -end @c man .br @sp 1 @c man-ignore-lines begin $ xorriso -dialog on -page 20 80 -disk_pattern on @sp 1 enter option and arguments : @* -dev /dev/sr2 @sp 1 enter option and arguments : @* -blank as_needed @sp 1 enter option and arguments : @* -map /home/me/sounds /sounds -map /home/me/pictures /pictures @sp 1 enter option and arguments : @* -rm_r /sounds/indecent /pictures/*private* /pictures/confidential @sp 1 enter option and arguments : @* -cdx /home/me/pictures -cd /pictures @sp 1 enter option and arguments : @* -add confidential/office confidential/factory @sp 1 enter option and arguments : @* -du / @sp 1 enter option and arguments : @* -commit_eject all -end @c man-ignore-lines end @c man .SS @c man .B Manipulate an existing ISO image on the same medium @node ExGrowing, ExModifying, ExDialog, Examples @section Manipulate an existing ISO image on the same medium Load image from drive. Remove (i.e. hide) directory /sounds and its subordinates. Rename directory /pictures/confidential to /pictures/restricted. Change access permissions of directory /pictures/restricted. Add new directory trees /sounds and /movies. Burn to the same medium, check whether the tree can be loaded, and eject. @* @sp 1 $ xorriso -dev /dev/sr2 \ @* -rm_r /sounds @minus{}@minus{} \ @* -mv \ @* /pictures/confidential \ @* /pictures/restricted \ @* @minus{}@minus{} \ @* -chmod go-rwx /pictures/restricted @minus{}@minus{} \ @* -map /home/me/prepared_for_dvd/sounds_dummy /sounds \ @* -map /home/me/prepared_for_dvd/movies /movies \ @* -commit -eject all @c man .SS @c man .B Copy modified ISO image from one medium to another @node ExModifying, ExBootable, ExGrowing, Examples @section Copy modified ISO image from one medium to another Load image from input drive. Do the same manipulations as in the previous example. Acquire output drive and blank it. Burn the modified image as first and only session to the output drive. @* @sp 1 $ xorriso -indev /dev/sr2 \ @* -rm_r /sounds @minus{}@minus{} \ @* ... @* -outdev /dev/sr0 -blank as_needed \ @* -commit -eject all @c man .SS @c man .B Bring a prepared ISOLINUX tree onto medium and make it bootable @node ExBootable, ExCharset, ExModifying, Examples @section Bring a prepared ISOLINUX tree onto medium and make it bootable The user has already created a suitable file tree on disk and copied the ISOLINUX files into subdirectory ./boot/isolinux of that tree. Now @command{xorriso} can burn an El Torito bootable medium: @* @sp 1 $ xorriso -outdev /dev/sr0 -blank as_needed \ @* -map /home/me/ISOLINUX_prepared_tree / \ @* -boot_image isolinux dir=/boot/isolinux @c man .SS @c man .B Change existing file name tree from ISO-8859-1 to UTF-8 @node ExCharset, ExPseudo, ExBootable, Examples @section Change existing file name tree from ISO-8859-1 to UTF-8 This example assumes that the existing ISO image was written with character set ISO-8859-1 but that the readers expected UTF-8. Now a new session gets added with converted file names. Command -changes_pending "yes" enables writing despite the lack of any manipulation command. @* In order to avoid any weaknesses of the local character set, this command pretends that it uses already the final target set UTF-8. Therefore strange file names may appear in messages, which will be made terminal-safe by command -backslash_codes. @* @sp 1 $ xorriso -in_charset ISO-8859-1 -local_charset UTF-8 \ @* -out_charset UTF-8 -backslash_codes on -dev /dev/sr0 \ @* -changes_pending yes -commit -eject all @c man .SS @c man .B Operate on storage facilities other than optical drives @node ExPseudo, ExCdrecord, ExCharset, Examples @section Operate on storage facilities other than optical drives Full read-write operation is possible with regular files and block devices: @* @sp 1 $ xorriso -dev /tmp/regular_file ... @* @sp 1 Paths underneath /dev normally need prefix "stdio:" @* @sp 1 $ xorriso -dev stdio:/dev/sdb ... @* @sp 1 If /dev/sdb is to be used frequently and /dev/sda is the system disk, then consider to place the following lines in a @command{xorriso} Startup File. They allow you to use /dev/sdb without prefix and protect disk /dev/sda from @command{xorriso}: @* @sp 1 -drive_class banned /dev/sda* @* -drive_class harmless /dev/sdb @* @sp 1 Other writeable file types are supported write-only: @* @sp 1 $ xorriso -outdev /tmp/named_pipe ... @* @sp 1 Among the write-only drives is standard output: @* @sp 1 $ xorriso -outdev - \ @* ... @* | gzip >image.iso.gz @c man .SS @c man .B Burn an existing ISO image file to medium @node ExCdrecord, ExMkisofs, ExPseudo, Examples @section Burn an existing ISO image file to medium Actually this works with any kind of data, not only ISO images: @* @sp 1 $ xorriso -as cdrecord -v dev=/dev/sr0 blank=as_needed image.iso @c man .SS @c man .B Perform multi-session runs as of cdrtools traditions @node ExMkisofs, ExGrowisofs, ExCdrecord, Examples @section Perform multi-session runs as of cdrtools traditions Between both processes there can be performed arbitrary transportation or filtering. @* The first session is written like this: @* @sp 1 $ xorriso -as mkisofs prepared_for_iso/tree1 | \ @* xorriso -as cdrecord -v dev=/dev/sr0 blank=fast -multi -eject - @* @sp 1 Follow-up sessions are written like this (the run of dd is only to give demons a chance to spoil it): @* @sp 1 $ m=$(xorriso -as cdrecord dev=/dev/sr0 -msinfo) @* $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 @* $ xorriso -as mkisofs -M /dev/sr0 -C $m prepared_for_iso/tree2 | \ @* xorriso -as cdrecord -v dev=/dev/sr0 -waiti -multi -eject - @* @sp 1 Always eject the drive tray between sessions. @* The run of xorriso -as mkisofs will read old sessions via the CD-ROM driver of /dev/sr0. This driver might not be aware of the changed content as long as the medium is not loaded again. In this case the previous session would not be properly assessed by xorriso and the new session would contain only the newly added files. @* Some systems have not enough patience with automatic tray loading and some demons may interfere with a first CD-ROM driver read attempt from a freshly loaded medium. @* When loading the tray manually, wait 10 seconds after the drive has stopped blinking. @* A safe automatic way seems to be a separate run of xorriso for loading the tray with proper waiting, and a subsequent run of dd which shall offer itself to any problems caused by demons assessing the changed drive status. If this does not help, insert a run of "sleep 10" between xorriso and dd. @* @sp 1 This example works for multi-session media only. Add cdrskin option @minus{}@minus{}grow_overwriteable_iso to all -as cdrecord runs in order to enable multi-session emulation on overwritable media. @c man .SS @c man .B Let xorriso work underneath growisofs @node ExGrowisofs, ExException, ExMkisofs, Examples @section Let @command{xorriso} work underneath growisofs growisofs expects an ISO formatter program which understands options -C and -M. If @command{xorriso} gets started by name "xorrisofs" then it is suitable for that. @* @sp 1 $ export MKISOFS="xorrisofs" @* $ growisofs -Z /dev/dvd /some/files @* $ growisofs -M /dev/dvd /more/files @* @sp 1 If no "xorrisofs" is available on your system, then you will have to create a link pointing to the @command{xorriso} binary and tell growisofs to use it. E.g. by: @* @sp 1 $ ln -s $(which xorriso) "$HOME/xorrisofs" @* $ export MKISOFS="$HOME/xorrisofs" @* @sp 1 One may quit mkisofs emulation by argument "@minus{}@minus{}" and make use of all @command{xorriso} commands. growisofs dislikes options which start with "-o" but -outdev must be set to "-". So use "outdev" instead: @* @sp 1 $ growisofs -Z /dev/dvd @minus{}@minus{} outdev - -update_r /my/files /files @* $ growisofs -M /dev/dvd @minus{}@minus{} outdev - -update_r /my/files /files @* @sp 1 growisofs has excellent burn capabilities with DVD and BD. It does not emulate session history on overwritable media, though. @c man .SS @c man .B Adjust thresholds for verbosity, exit value and program abort @node ExException, ExTime, ExGrowisofs, Examples @section Adjust thresholds for verbosity, exit value and program abort Be quite verbose, exit 32 if severity "FAILURE" was encountered, do not abort prematurely but forcibly go on until the end of commands. @* @sp 1 $ xorriso ... \ @* -report_about UPDATE \ @* -return_with FAILURE 32 \ @* -abort_on NEVER \ @* ... @c man .SS @c man .B Examples of input timestrings @node ExTime, ExIncBackup, ExException, Examples @section Examples of input timestrings @c man .br @c man As printed by program date: @c man .B 'Thu Nov 8 14:51:13 CET 2007' @c man .br @c man The same without ignored parts: @c man .B 'Nov 8 14:51:13 2007' @c man .br @c man The same as expected by date: @c man .B 110814512007.13 @c man .br @c man Four weeks in the future: @c man .B +4w @c man .br @c man The current time: @c man .B +0 @c man .br @c man Three hours ago: @c man .B \-3h @c man .br @c man Seconds since Jan 1 1970: @c man .B =1194531416 @c man-ignore-lines begin As printed by program date: @* 'Thu Nov 8 14:51:13 CET 2007' @sp 1 The same without ignored parts: @* 'Nov 8 14:51:13 2007' @sp 1 The same as expected by date: @* 110814512007.13 @sp 1 Four weeks in the future: @* +4w @sp 1 The current time: @* +0 @sp 1 Three hours ago: @* -3h @sp 1 Seconds since Jan 1 1970: @* =1194531416 @c man-ignore-lines end @c man .SS @c man .B Incremental backup of a few directory trees @node ExIncBackup, ExRestore, ExTime, Examples @section Incremental backup of a few directory trees This changes the directory trees /projects and /personal_mail in the ISO image so that they become exact copies of their disk counterparts. ISO file objects get created, deleted or get their attributes adjusted accordingly. @* ACL, xattr, hard links and MD5 checksums will be recorded. Accelerated comparison is enabled at the expense of potentially larger backup size. Only media with the expected volume ID or blank media are accepted. Files with names matching *.o or *.swp get excluded explicitly. @* When done with writing the new session gets checked by its recorded MD5. @* @sp 1 $ xorriso \ @* -abort_on FATAL \ @* -for_backup -disk_dev_ino on \ @* -assert_volid 'PROJECTS_MAIL_*' FATAL \ @* -dev /dev/sr0 \ @* -volid PROJECTS_MAIL_"$(date '+%Y_%m_%d_%H%M%S')" \ @* -not_leaf '*.o' -not_leaf '*.swp' \ @* -update_r /home/thomas/projects /projects \ @* -update_r /home/thomas/personal_mail /personal_mail \ @* -commit -toc -check_md5 FAILURE @minus{}@minus{} -eject all @* @sp 1 To be used several times on the same medium, whenever an update of the two disk trees to the medium is desired. Begin with a blank medium and update it until the run fails gracefully due to lack of remaining space on the old one. @* This makes sense if the full backup leaves substantial remaining capacity on media and if the expected changes are much smaller than the full backup. To apply zisofs compression to those data files which get newly copied from the local filesystem, insert these commands immediately before -commit : @* @sp 1 -hardlinks perform_update \ @* -find / -type f -pending_data -exec set_filter @minus{}@minus{}zisofs @minus{}@minus{} \ @* @sp 1 Commands -disk_dev_ino and -for_backup depend on stable device and inode numbers on disk. Without them, an update run may use -md5 "on" to match recorded MD5 sums against the current file content on hard disk. This is usually much faster than the default which compares both contents directly. @* With @strong{mount} option @strong{-o "sbsector="} on GNU/Linux or @strong{-s} on FreeBSD or NetBSD it is possible to access the session trees which represent the older backup versions. With CD media, GNU/Linux mount accepts session numbers directly by its option "session=". @* Multi-session media and most overwritable media written by @command{xorriso} can tell the sbsectors of their sessions by @command{xorriso} command -toc. Used after -commit the following command prints the matching mount command for the newly written session (here for mount point /mnt): @* @sp 1 -mount_cmd "indev" "auto" "auto" /mnt @* @sp 1 Commands -mount_cmd and -mount are also able to produce the mount commands for older sessions in the table-of-content. E.g. as superuser: @* @sp 1 # osirrox -mount /dev/sr0 "volid" '*2008_12_05*' /mnt @* @sp 1 @c man .sp 1 Above example produces a result similar to -root / -old-root / with mkisofs. For getting the session trees accumulated in the new sessions, let all -update commands use a common parent directory and clone it after updating is done: @* -update_r /home/thomas/projects /current/projects \ @* -update_r /home/thomas/personal_mail /current/personal_mail \ @* -clone /current /"$(date '+%Y_%m_%d_%H%M%S')" \ @* The cloned tree will have a name like /2011_02_12_155700. @* @sp 1 @c man .sp 1 Sessions on multi-session media are separated by several MB of unused blocks. So with small sessions the payload capacity can become substantially lower than the overall media capacity. If the remaining space on a medium does not suffice for the next gap, the drive is supposed to close the medium automatically. @* @sp 1 @c man .sp 1 @strong{Better do not use your youngest backup for -update_r}. Have at least two media which you use alternatingly. So only older backups get endangered by the new write operation, while the newest backup is stored safely on a different medium. @* Always have a blank medium ready to perform a full backup in case the update attempt fails due to insufficient remaining capacity. This failure will not spoil the old medium, of course. @c man .SS @c man .B Restore directory trees from a particular ISO session to disk @node ExRestore, ExRecovery, ExIncBackup, Examples @section Restore directory trees from a particular ISO session to disk This is an alternative to mounting the medium and using normal file operations. @* First check which backup sessions are on the medium: @* @sp 1 $ xorriso -outdev /dev/sr0 -toc @* @sp 1 Then enable restoring of ACL, xattr and hard links. Load the desired session and copy the file trees to disk. Avoid to create /home/thomas/restored without rwx-permission. @* @sp 1 $ xorriso -for_backup \ @* -load volid 'PROJECTS_MAIL_2008_06_19*' \ @* -indev /dev/sr0 \ @* -osirrox on:auto_chmod_on \ @* -chmod u+rwx / @minus{}@minus{} \ @* -extract /projects /home/thomas/restored/projects \ @* -extract /personal_mail /home/thomas/restored/personal_mail \ @* -rollback_end @* @sp 1 The final command -rollback_end prevents an error message about the altered image being discarded. @c man .SS @c man .B Try to retrieve blocks from a damaged medium @node ExRecovery,, ExRestore, Examples @section Try to retrieve blocks from a damaged medium @* @sp 1 $ xorriso -abort_on NEVER -indev /dev/sr0 \ @* -check_media time_limit=1800 report=blocks_files \ @* data_to="$HOME"/dvd_copy sector_map="$HOME"/dvd_copy.map @minus{}@minus{} @* @sp 1 This can be repeated several times, if necessary with -eject or with other -indev drives. See the human readable part of "$HOME"/dvd_copy.map for addresses which can be used on "$HOME"/dvd_copy with mount option -o sbsector= or -s. @c man .SH FILES @node Files, Environ, Examples, Top @chapter Files @c man .SS @c man .B Program alias names: @* @section Program Alias Names Normal installation of @command{xorriso} creates three links or copies which by their program name pre-select certain settings: @* @sp 1 @strong{xorrisofs} starts @command{xorriso} with -as mkisofs emulation. @* @strong{xorrecord} starts @command{xorriso} with -as cdrecord emulation. @* @strong{osirrox} starts with -osirrox "on:o_excl_off" which allows further commands to copy files from ISO image to disk and to apply command -mount to one or more of the existing ISO sessions. @c man .SS @c man .B Startup files: @section Startup Files @* If not -no_rc is given as the first argument then @command{xorriso} attempts on startup to read and execute lines from the following files: @* @sp 1 /etc/default/xorriso @* /etc/opt/xorriso/rc @* /etc/xorriso/xorriso.conf @* $HOME/.xorrisorc @* @sp 1 The files are read in the sequence given above, but none of them is required to exist. The line format is described with command -options_from_file. @* If mkisofs emulation was enabled by program name "xorrisofs", "mkisofs", "genisoimage", or "genisofs", then afterwards -read_mkisofsrc is performed, which reads .mkisofsrc files. See there. @c man .SS @c man .B Runtime control files: @section Runtime control files @* The default setting of -check_media abort_file= is: @* @sp 1 /var/opt/xorriso/do_abort_check_media @* @sp 1 @c man .SS @c man .SH ENVIRONMENT @node Environ, Seealso, Files, Top @chapter Environ The following environment variables influence the program behavior: @* HOME is used to find startup files of xorriso and mkisofs. @* SOURCE_DATE_EPOCH belongs to the specs of reproducible-builds.org. It is supposed to be either undefined or to contain a decimal number which tells the seconds since january 1st 1970. If it contains a number, then it is used as time value to set the default of -volume date "uuid", sets -boot_image "any" "gpt_disk_guid=" to "volume_date_uuid", -volume_date "all_file_dates" to "set_to_mtime", and -iso_nowtime to "=$SOURCE_DATE_EPOCH". @* Startup files and program options can override the effect of SOURCE_DATE_EPOCH. @* @sp 1 @c man .SS @c man .SH SEE ALSO @c man .TP @c man For the mkisofs emulation of xorriso @c man .BR xorrisofs(1) @c man .TP @c man For the cdrecord emulation of xorriso @c man .BR xorrecord(1) @c man .TP @c man For mounting xorriso generated ISO 9660 images (-t iso9660) @c man .BR mount(8) @c man .TP @c man Libreadline, a comfortable input line facility @c man .BR readline(3) @c man .TP @c man Other programs which produce ISO 9660 images @c man .BR mkisofs(8), @c man .BR genisoimage(1) @c man .TP @c man Other programs which burn sessions to optical media @c man .BR growisofs(1), @c man .BR cdrecord(1), @c man .BR wodim(1), @c man .BR cdrskin(1) @c man .TP @c man ACL and xattr @c man .BR getfacl(1), @c man .BR setfacl(1), @c man .BR getfattr(1), @c man .BR setfattr(1) @c man .TP @c man MD5 checksums @c man .BR md5sum(1) @c man .TP @c man On FreeBSD the commands for xattr and MD5 differ @c man .BR getextattr(8), @c man .BR setextattr(8), @c man .BR md5(1) @c man-ignore-lines begin @node Seealso, Bugreport, Environ, Top @chapter See also @table @asis @item For the mkisofs emulation of @command{xorriso} xorrisofs(1) @item For the cdrecord emulation of @command{xorriso} xorrecord(1) @item For mounting @command{xorriso} generated ISO 9660 images (-t iso9660) mount(8) @item Libreadline, a comfortable input line facility readline(3) @item Other programs which produce ISO 9660 images mkisofs(8), genisoimage(1) @item Other programs which burn sessions to optical media growisofs(1), cdrecord(1), wodim(1), cdrskin(1) @item ACL and xattr getfacl(1), setfacl(1), getfattr(1), setfattr(1) @item MD5 checksums md5sum(1) @item On FreeBSD some commands differ: getextattr(8), setextattr(8), md5(1) @end table @c man-ignore-lines end @c man .SH BUGS @node Bugreport, Legal, Seealso, Top @chapter Reporting bugs @cindex Bugs, reporting @cindex Problems, reporting To report bugs, request help, or suggest enhancements for @command{xorriso}, please send electronic mail to the public list @email{bug-xorriso@@gnu.org}. If more privacy is desired, mail to @email{scdbackup@@gmx.net}. @* @sp 1 Please describe what you expect @command{xorriso} to do, the program arguments or dialog commands by which you tried to achieve it, the messages of @command{xorriso}, and the undesirable outcome of your program run. @* @sp 1 Expect to get asked more questions before solutions can be proposed. @c man .SH AUTHOR @node Legal, CommandIdx, Bugreport, Top @chapter Author, Copyright, Credits @section Author Thomas Schmitt @* for libburnia-project.org @c man .SH COPYRIGHT @section Copyright Copyright (c) 2007 - 2021 Thomas Schmitt @* Permission is granted to distribute this text freely. It shall only be modified in sync with the technical properties of @command{xorriso}. If you make use of the license to derive modified versions of @command{xorriso} then you are entitled to modify this text under that same license. @c man .SH CREDITS @section Credits @command{xorriso} is in part based on work by Vreixo Formoso who provides libisofs together with Mario Danic who also leads the libburnia team. Vladimir Serbinenko contributed the HFS+ filesystem code and related knowledge. Thanks to Andy Polyakov who invented emulated growing, to Derek Foreman and Ben Jansens who once founded libburn. @* Compliments towards Joerg Schilling whose cdrtools served me for ten years. @c man-ignore-lines begin @node CommandIdx, ConceptIdx, Legal, Top @chapter Alphabetic Command List @printindex ky @node ConceptIdx,, CommandIdx, Top @chapter Alphabetic List of Concepts and Objects @printindex cp @c man-ignore-lines end @bye libisoburn-1.5.4/xorriso/sort_cmp.c0000644000175700017510000004373413701321754014337 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2016 Thomas Schmitt, Provided under GPL version 2 or later. This file contains functions which sort and compare tree nodes. */ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "base_obj.h" #include "lib_mgt.h" #include "sort_cmp.h" #include "iso_tree.h" #include "iso_manip.h" int Xorriso__findi_sorted_ino_cmp(const void *p1, const void *p2) { int ret; IsoNode *n1, *n2; n1= *((IsoNode **) p1); n2= *((IsoNode **) p2); ret= Xorriso__node_lba_cmp(&n1, &n2); if(ret) return (ret > 0 ? 1 : -1); ret= iso_node_cmp_ino(n1, n2, 0); return(ret); } /* Not suitable for qsort() but for cross-array comparisons. p1 and p2 are actually IsoNode *p1, IsoNode *p2 */ int Xorriso__hln_cmp(const void *p1, const void *p2) { int ret; ret= Xorriso__findi_sorted_ino_cmp(&p1, &p2); if(ret) return (ret > 0 ? 1 : -1); if(p1 != p2) return(p1 < p2 ? -1 : 1); return(0); } /* p1 and p2 are actually IsoNode **p1, IsoNode **p2 */ int Xorriso__findi_sorted_cmp(const void *p1, const void *p2) { int ret; ret= Xorriso__findi_sorted_ino_cmp(p1, p2); if(ret) return (ret > 0 ? 1 : -1); if(p1 != p2) return(p1 < p2 ? -1 : 1); return(0); } int Xorriso_sort_node_array(struct XorrisO *xorriso, int flag) { if(xorriso->node_counter <= 0) return(0); qsort(xorriso->node_array, xorriso->node_counter, sizeof(IsoNode *), Xorriso__findi_sorted_cmp); return(1); } int Xorriso__search_node(void *node_array[], int n, int (*cmp)(const void *p1, const void *p2), void *node, int *idx, int flag) { int ret, l, r, p, pos; if(n == 0) return(0); l= 0; r= n + 1; while(1) { p= (r - l) / 2; if(p == 0) break; p+= l; /* NULL elements may indicate invalid nodes.Their first valid right neighbor will serve as proxy. If none exists, then the test pushes leftwards. */ for(pos= p - 1; pos < n; pos++) if(node_array[pos] != NULL) break; if(pos < n) ret= (*cmp)(&(node_array[pos]), &node); else ret= 1; if(ret < 0) l= p; else if(ret > 0) r= p; else { *idx= pos; return(1); } } return(0); } int Xorriso_search_in_hln_array(struct XorrisO *xorriso, void *node, int *idx, int flag) { int ret; if(xorriso->hln_array == NULL || xorriso->hln_count <= 0) return(0); ret= Xorriso__search_node(xorriso->hln_array, xorriso->hln_count, Xorriso__findi_sorted_ino_cmp, node, idx, 0); return ret; } int Xorriso__get_di(IsoNode *node, dev_t *dev, ino_t *ino, int flag) { int ret, i, i_end, imgid, error_code; size_t value_length= 0; char *value= NULL, *msg= NULL, severity[80]; unsigned char *vpt; static char *name= "isofs.di"; #ifdef NIX /* <<< */ Xorriso_get_di_counteR++; #endif /* NIX */ msg= TSOB_FELD(char, ISO_MSGS_MESSAGE_LEN); if(msg == NULL) {ret= -1; goto ex;} *dev= 0; *ino= 0; ret= iso_node_lookup_attr(node, name, &value_length, &value, 0); if(ret <= 0) { /* Drop any pending messages because there is no xorriso to take them */ iso_obtain_msgs("NEVER", &error_code, &imgid, msg, severity); goto ex; } vpt= (unsigned char *) value; if(vpt[0] > sizeof(ino_t)) { /* >>> obviously not the same system that recorded the device number */; } for(i= 1; i <= vpt[0] && i < (int) value_length; i++) *dev= ((*dev) << 8) | vpt[i]; i_end= i + vpt[i] + 1; if(vpt[i] > sizeof(ino_t)) { /* >>> obviously not the same system that recorded the inode number */; } for(i++; i < i_end && i < (int) value_length; i++) *ino= ((*ino) << 8) | vpt[i]; free(value); ret= 1; ex:; if(msg != NULL) free(msg); return(ret); } int Xorriso__di_ino_cmp(const void *p1, const void *p2) { int ret; IsoNode *n1, *n2; dev_t d1, d2; ino_t i1, i2; n1= *((IsoNode **) p1); n2= *((IsoNode **) p2); ret= Xorriso__get_di(n1, &d1, &i1, 0); if(ret <= 0) {d1= 0; i1= 0;} ret= Xorriso__get_di(n2, &d2, &i2, 0); if(ret <= 0) {d2= 0; i2= 0;} if(d1 < d2) return(-1); if(d1 > d2) return(1); if(i1 < i2) return(-1); if(i1 > i2) return(1); if(d1 == 0 && i1 == 0 && n1 != n2) return(n1 < n2 ? -1 : 1); return(0); } int Xorriso__di_cmp(const void *p1, const void *p2) { int ret; IsoNode *n1, *n2; ret= Xorriso__di_ino_cmp(p1, p2); if(ret) return(ret); n1= *((IsoNode **) p1); n2= *((IsoNode **) p2); if(n1 != n2) return(n1 < n2 ? -1 : 1); return(0); } int Xorriso__sort_di(void *node_array[], int count, int flag) { if(count <= 0) return(0); qsort(node_array, count, sizeof(IsoNode *), Xorriso__di_cmp); return(1); } int Xorriso_invalidate_di_item(struct XorrisO *xorriso, IsoNode *node, int flag) { int ret, idx; if(xorriso->di_array == NULL) return(1); ret= Xorriso__search_node(xorriso->di_array, xorriso->di_count, Xorriso__di_cmp, node, &idx, 0); if(ret <= 0) return(ret == 0); if(xorriso->di_array[idx] != NULL) iso_node_unref(xorriso->di_array[idx]); xorriso->di_array[idx]= NULL; return(1); } /* @param flag bit0= return 1 even if matching nodes were found but node is not among them bit1= use Xorriso__di_cmp() rather than Xorriso__di_ino_cmp() */ int Xorriso_search_di_range(struct XorrisO *xorriso, IsoNode *node, int *idx, int *low, int *high, int flag) { int ret, i, found; int (*cmp)(const void *p1, const void *p2)= Xorriso__di_ino_cmp; if(flag & 2) cmp= Xorriso__di_cmp; *high= *low= *idx= -1; ret= Xorriso__search_node(xorriso->di_array, xorriso->di_count, cmp, node, &found, 0); if(ret <= 0) return(0); *low= *high= found; for(i= found + 1; i < xorriso->di_count; i++) if(xorriso->di_array[i] != NULL) { if((*cmp)(&node, &(xorriso->di_array[i])) != 0) break; *high= i; } for(i= found - 1; i >= 0; i--) if(xorriso->di_array[i] != NULL) { if((*cmp)(&node, &(xorriso->di_array[i])) != 0) break; *low= i; } for(i= *low; i <= *high; i++) if(xorriso->di_array[i] == node) { *idx= i; break; } return(*idx >= 0 || (flag & 1)); } int Xorriso__node_lba_cmp(const void *node1, const void *node2) { int ret; int lba1= 0, lba2= 0; ret= Xorriso__file_start_lba(*((IsoNode **) node1), &lba1, 0); if(ret!=1) lba1= 0; ret= Xorriso__file_start_lba(*((IsoNode **) node2), &lba2, 0); if(ret!=1) lba2= 0; return(lba1-lba2); } int Xorriso__node_name_cmp(const void *node1, const void *node2) { char *name1, *name2; name1= (char *) iso_node_get_name(*((IsoNode **) node1)); name2= (char *) iso_node_get_name(*((IsoNode **) node2)); return(strcmp(name1,name2)); } /* @param flag bit0= only accept directory nodes bit1= do not report memory usage as DEBUG bit2= do not apply search pattern but accept any node */ int Xorriso_sorted_node_array(struct XorrisO *xorriso, IsoDir *dir_node, int *nodec, IsoNode ***node_array, off_t boss_mem, int flag) { int i, ret, failed_at; char *npt; IsoDirIter *iter= NULL; IsoNode *node; off_t mem; mem= ((*nodec)+1)*sizeof(IsoNode *); ret= Xorriso_check_temp_mem_limit(xorriso, mem+boss_mem, flag&2); if(ret<=0) return(ret); *node_array= calloc(sizeof(IsoNode *), (*nodec)+1); if(*node_array==NULL) { sprintf(xorriso->info_text, "Cannot allocate memory for %d directory entries", *nodec); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); return(-1); } ret= iso_dir_get_children(dir_node, &iter); if(ret<0) { Xorriso_cannot_create_iter(xorriso, ret, 0); return(-1); } for(i= 0; iso_dir_iter_next(iter, &node) == 1 && i<*nodec; ) { npt= (char *) iso_node_get_name(node); if(!(flag&4)) { ret= Xorriso_regexec(xorriso, npt, &failed_at, 0); if(ret) continue; /* no match */ } if(flag&1) if(!LIBISO_ISDIR(node)) continue; (*node_array)[i++]= node; } iso_dir_iter_free(iter); *nodec= i; if(*nodec<=0) return(1); qsort(*node_array, *nodec, sizeof(IsoNode *), Xorriso__node_name_cmp); return(1); } int Xorriso_remake_hln_array(struct XorrisO *xorriso, int flag) { int ret, addon_nodes= 0, i, old_count, old_pt, new_pt; IsoNode **old_nodes; char **old_targets; /* Count hln_targets of which the node has been deleted meanwhile */ for(i= 0; i < xorriso->hln_count; i++) { if(xorriso->hln_targets[i] == NULL) continue; if(Xorriso_node_is_valid(xorriso, xorriso->hln_array[i], 0)) continue; addon_nodes++; } ret= Xorriso_all_node_array(xorriso, addon_nodes, 0); if(ret <= 0) goto ex; if(addon_nodes > 0) { /* Transfer delete nodes with hln_target to node array */ for(i= 0; i < xorriso->hln_count; i++) { if(xorriso->hln_targets[i] == NULL) continue; if(Xorriso_node_is_valid(xorriso, xorriso->hln_array[i], 0)) continue; if(xorriso->node_counter < xorriso->node_array_size) { xorriso->node_array[xorriso->node_counter++]= xorriso->hln_array[i]; iso_node_ref(xorriso->node_array[xorriso->node_counter - 1]); } } } Xorriso_sort_node_array(xorriso, 0); old_nodes= (IsoNode **) xorriso->hln_array; old_targets= (char **) xorriso->hln_targets; old_count= xorriso->hln_count; xorriso->hln_array= 0; xorriso->hln_targets= NULL; /* Transfer node_array to di_array without unrefering nodes */ xorriso->hln_count= xorriso->node_counter; xorriso->hln_array= xorriso->node_array; xorriso->node_counter= 0; xorriso->node_array_size= 0; xorriso->node_array= NULL; /* Allocate hln_targets */ ret= Xorriso_new_hln_array(xorriso, xorriso->temp_mem_limit, 1); if(ret<=0) goto ex; xorriso->node_targets_availmem= xorriso->temp_mem_limit; if(old_targets != NULL) { /* Transfer targets from old target array */; new_pt= old_pt= 0; while(new_pt < xorriso->hln_count && old_pt < old_count) { ret= Xorriso__hln_cmp(xorriso->hln_array[new_pt], old_nodes[old_pt]); if(ret < 0) { new_pt++; } else if(ret > 0) { old_pt++; } else { xorriso->hln_targets[new_pt]= old_targets[old_pt]; if(old_targets[old_pt] != NULL) xorriso->temp_mem_limit-= strlen(old_targets[old_pt]) + 1; old_targets[old_pt]= NULL; new_pt++; old_pt++; } } for(old_pt= 0; old_pt < old_count; old_pt++) if(old_targets[old_pt] != NULL) /* (should not happen) */ free(old_targets[old_pt]); free((char *) old_targets); } if(old_nodes != NULL) { for(old_pt= 0; old_pt < old_count; old_pt++) if(old_nodes[old_pt] != NULL) iso_node_unref(old_nodes[old_pt]); free((char *) old_nodes); } xorriso->hln_change_pending= 0; ret= 1; ex:; return(ret); } /* @param flag bit0= overwrite existing hln_array (else return 2) */ int Xorriso_make_hln_array(struct XorrisO *xorriso, int flag) { int ret; if(xorriso->hln_array != NULL && !(flag & 1)) { /* If no fresh image manipulations occurred: keep old array */ if(!xorriso->hln_change_pending) return(2); ret= Xorriso_remake_hln_array(xorriso, 0); return(ret); } Xorriso_destroy_hln_array(xorriso, 0); ret= Xorriso_all_node_array(xorriso, 0, 0); if(ret <= 0) goto ex; Xorriso_sort_node_array(xorriso, 0); /* Transfer node_array to di_array without unrefering nodes */ xorriso->hln_count= xorriso->node_counter; xorriso->hln_array= xorriso->node_array; xorriso->node_counter= 0; xorriso->node_array_size= 0; xorriso->node_array= NULL; /* Allocate hln_targets */ ret= Xorriso_new_hln_array(xorriso, xorriso->temp_mem_limit, 1); if(ret<=0) { Xorriso_destroy_hln_array(xorriso, 0); goto ex; } xorriso->node_targets_availmem= xorriso->temp_mem_limit; xorriso->hln_change_pending= 0; ret= 1; ex:; return(ret); } /* @param flag bit0= overwrite existing di_array (else return 2) bit1= make di_array despite xorriso->ino_behavior bit 3 */ int Xorriso_make_di_array(struct XorrisO *xorriso, int flag) { int ret, bytes; #ifdef NIX /* <<< */ unsigned long old_gdic; old_gdic= Xorriso_get_di_counteR; #endif /* NIX */ if((xorriso->ino_behavior & 8 ) && !(flag & 2)) return(2); if(xorriso->di_array != NULL && !(flag & 1)) return(2); Xorriso_finish_hl_update(xorriso, 0); ret= Xorriso_all_node_array(xorriso, 0, 0); if(ret <= 0) goto ex; bytes= xorriso->node_array_size / 8 + 1; xorriso->di_do_widen= calloc(bytes, 1); if(xorriso->di_do_widen == NULL) { Xorriso_no_malloc_memory(xorriso, NULL, 0); ret= -1; goto ex; } /* Transfer node_array to di_array without unrefering nodes */ xorriso->di_count= xorriso->node_counter; xorriso->di_array= xorriso->node_array; xorriso->node_counter= 0; xorriso->node_array_size= 0; xorriso->node_array= NULL; Xorriso__sort_di((void *) xorriso->di_array, xorriso->di_count, 0); ret= 1; ex:; #ifdef NIX /* <<< */ fprintf(stderr, "xorriso_DEBUG: sort_count= %lu\n", Xorriso_get_di_counteR - old_gdic); #endif /* NIX */ return(ret); } /* @param flag bit0= iso_rr_path is freshly added and up to date bit1= do not mark as changed content (implied by bit0 too) bit2= -follow: this is not a command parameter @return -1= severe error 0= not applicable for hard links 1= go on with processing 2= iso_rr_path is fully updated */ int Xorriso_hardlink_update(struct XorrisO *xorriso, int *compare_result, char *disk_path, char *iso_rr_path, int flag) { int ret, hret, idx, low, high, i, do_overwrite= 0, did_fake_di= 0; int follow_links, old_idx= -1; IsoNode *node; struct stat stbuf; dev_t old_dev; ino_t old_ino; if(xorriso->di_array == NULL) return(1); follow_links= xorriso->do_follow_links || (xorriso->do_follow_param && !(flag & 4)); ret= Xorriso_node_from_path(xorriso, NULL, iso_rr_path, &node, 0); if(ret <= 0) return(ret); if(LIBISO_ISDIR(node)) return(1); /* Handle eventual hardlink split : */ /* This is achieved by setting the content change bit. Reason: The node needs to be removed from di_array because its di is not matching its array index any more. So it becomes invisible for the join check of eventual later hardlink siblings. Therefore it must be updated now, even if it has currently no siblings which it leaves or which it joins. */ if(!(flag & (1 | 2))) do_overwrite= 1; Xorriso__get_di(node, &old_dev, &old_ino, 0); ret= Xorriso__search_node(xorriso->di_array, xorriso->di_count, Xorriso__di_cmp, node, &idx, 0); if(ret < 0) {ret= 0; goto ex;} if(ret > 0) old_idx= idx; /* Handle eventual hardlink joining : */ if(follow_links) ret= stat(disk_path, &stbuf); else ret= lstat(disk_path, &stbuf); if(ret==-1) {ret= 0; goto ex;} /* Are there new dev-ino-siblings in the image ? */ /* Fake isofs.di */ if(!(flag & 1)) { ret= Xorriso_record_dev_inode(xorriso, disk_path, stbuf.st_dev, stbuf.st_ino, node, iso_rr_path, 1); if(ret <= 0) {ret= -1; goto ex;} did_fake_di= 1; /* temporarily remove node from di_array so it does not disturb search by its fake di info */; if(old_idx >= 0) xorriso->di_array[old_idx]= NULL; } ret= Xorriso_search_di_range(xorriso, node, &idx, &low, &high, 1); if(did_fake_di) { /* Revoke fake of isofs.di */ hret= Xorriso_record_dev_inode(xorriso, disk_path, old_dev, old_ino, node, iso_rr_path, 1); if(hret <= 0) {ret= -1; goto ex;} if(old_idx >= 0) xorriso->di_array[old_idx]= node; } if(ret == 0) {ret= 1; goto ex;} if(ret < 0) {ret= 0; goto ex;} #ifdef Xorriso_hardlink_update_debuG /* <<< */ if(low < high || idx < 0) { fprintf(stderr, "xorriso_DEBUG: old_idx= %d , low= %d , high= %d , iso= '%s' , disk='%s'\n", old_idx, low, high, iso_rr_path, disk_path); fprintf(stderr, "xorriso_DEBUG: old_dev= %lu , old_ino= %.f , dev= %lu , ino= %.f\n", (unsigned long) old_dev, (double) old_ino, (unsigned long) stbuf.st_dev, (double) stbuf.st_ino); if(idx >= 0 && idx != old_idx) fprintf(stderr, "xorriso_DEBUG: idx= %d , old_idx = %d\n", idx, old_idx); } #endif /* Xorriso_hardlink_update_debuG */ /* Overwrite all valid siblings : */ for(i= low; i <= high; i++) { if(i == idx || xorriso->di_array[i] == NULL) continue; #ifdef Xorriso_hardlink_update_debuG /* <<< */ { ino_t ino; dev_t dev; Xorriso__get_di(xorriso->di_array[i], &dev, &ino, 0); fprintf(stderr, "xorriso_DEBUG: iso_sibling= '%s' , dev= %lu , ino= %.f\n", node_path, (unsigned long) dev, (double) ino); } #endif /* Xorriso_hardlink_update_debuG */ xorriso->di_do_widen[i / 8]|= 1 << (i % 8); } ret= 1; ex:; if(do_overwrite) *compare_result|= (1<<15); if(old_idx >= 0 && (*compare_result & (3 << 21))) { /* The old di info is obsolete */ if(xorriso->di_array[old_idx] != NULL) iso_node_unref(xorriso->di_array[old_idx]); xorriso->di_array[old_idx]= NULL; } return(ret); } /* @param flag bit0= do not destroy di_array */ int Xorriso_finish_hl_update(struct XorrisO *xorriso, int flag) { int ret, zero= 0; char *argv[4]; struct Xorriso_lsT *disk_lst, *iso_lst; if(xorriso->di_array == NULL) {ret= 1; goto ex;} disk_lst= xorriso->di_disk_paths; iso_lst= xorriso->di_iso_paths; while(disk_lst != NULL && iso_lst != NULL) { argv[0]= Xorriso_lst_get_text(iso_lst, 0); argv[1]= "-exec"; argv[2]= "widen_hardlinks"; argv[3]= Xorriso_lst_get_text(disk_lst, 0); zero= 0; ret= Xorriso_option_find(xorriso, 4, argv, &zero, 0); /* -findi */ if(ret < 0) goto ex; disk_lst= Xorriso_lst_get_next(disk_lst, 0); iso_lst= Xorriso_lst_get_next(iso_lst, 0); } ret= 1; ex:; if(!(flag & 1)) Xorriso_destroy_di_array(xorriso, 0); return(ret); } libisoburn-1.5.4/xorriso/write_run.h0000644000175700017510000000374313701321754014530 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2010 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of functions which are needed to write sessions. */ #ifndef Xorriso_pvt_write_run_includeD #define Xorriso_pvt_write_run_includeD yes /* CD specs say one shall not write tracks < 600 kiB */ #define Xorriso_cd_min_track_sizE 300 /* Default setting for -compliance */ #define Xorriso_relax_compliance_defaulT \ (isoburn_igopt_allow_deep_paths | isoburn_igopt_allow_longer_paths | \ isoburn_igopt_always_gmt | isoburn_igopt_dir_rec_mtime | \ isoburn_igopt_joliet_rec_mtime | isoburn_igopt_iso1999_rec_mtime | \ isoburn_igopt_rrip_version_1_10 | isoburn_igopt_aaip_susp_1_10 | \ isoburn_igopt_only_iso_versions | isoburn_igopt_no_j_force_dots) int Xorriso_make_write_options( struct XorrisO *xorriso, struct burn_drive *drive, struct burn_write_opts **burn_options, int flag); int Xorriso_sanitize_image_size(struct XorrisO *xorriso, struct burn_drive *drive, struct burn_disc *disc, struct burn_write_opts *burn_options, int flag); int Xorriso_auto_format(struct XorrisO *xorriso, int flag); int Xorriso_set_system_area(struct XorrisO *xorriso, struct burn_drive *drive, IsoImage *img, struct isoburn_imgen_opts *sopts, int flag); int Xorriso_check_burn_abort(struct XorrisO *xorriso, int flag); int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive, int flag); int Xorriso_set_isolinux_options(struct XorrisO *xorriso, IsoImage *image, int flag); int Xorriso_make_iso_write_opts(struct XorrisO *xorriso, IsoImage *image, struct isoburn_imgen_opts *sopts, int flag); #endif /* ! Xorriso_pvt_write_run_includeD */ libisoburn-1.5.4/xorriso/xorriso-tcltk.info0000644000175700017510000001505714005266200016033 00000000000000This is xorriso-tcltk.info, produced by makeinfo version 5.2 from xorriso-tcltk.texi. xorriso-tcltk - Educational GUI frontend for xorriso Copyright (C) 2011 - 2021 Thomas Schmitt Permission is granted to distribute this text freely. INFO-DIR-SECTION Archiving START-INFO-DIR-ENTRY * Xorriso-tcltk: (xorriso-tcltk). Educational GUI frontend for xorriso END-INFO-DIR-ENTRY  File: xorriso-tcltk.info, Node: Top, Next: Overview, Up: (dir) xorriso-tcltk 1.5.4 ******************* xorriso-tcltk - Educational GUI frontend for xorriso * Menu: * Overview:: Overview * Options:: Options * Examples:: Examples * Files:: Files * Seealso:: See also * Bugreport:: Reporting bugs * Legal:: Author, Copyright, Credits * CommandIdx:: Alphabetic Command List * ConceptIdx:: Alphabetic List of Concepts and Objects  File: xorriso-tcltk.info, Node: Overview, Next: Options, Prev: Top, Up: Top 1 Overview ********** 'xorriso-tcltk' demonstrates xorriso use cases by a collection of GUI components. It creates a window with buttons, editable text fields, and list boxes. For exploration simply start 'xorriso-tcltk' without any options. Click on the "Help" button at the upper right edge to get an overview help text in a separate window. It explains the three main parts of the GUI window and it gives examples for a few main use cases of xorriso. Click by the rightmost mouse button on any button, list box, or text field, to get a specific help text in another window. 'xorriso' is a program which copies file objects from POSIX compliant filesystems into Rock Ridge enhanced ISO 9660 filesystems and performs session-wise manipulation of such filesystems. It can load the management information of existing ISO images and it writes the session results to optical media or to filesystem objects. Vice versa 'xorriso' is able to copy file objects out of ISO 9660 filesystems.  File: xorriso-tcltk.info, Node: Options, Next: Examples, Prev: Overview, Up: Top 2 Options ********* Normally, no program options are needed when 'xorriso-tcltk' gets started. Some of the options are for demonstration of program development. This man page lists only those options which may be helpful for end users. --help Print a help text with the complete list of start options and exit. --no_extract Do not allow extraction of files from ISO filesystem to hard disk. This is not revokable during the program run. --geometry {+|-}X{+|-}Y Set the position of the main window on the screen. +0X is the left edge, -0X is the right edge, +0Y is the upper edge, -0Y is the lower edge. --click_to_focus Chooses that input fields and list boxes get the keyboard focus only when being clicked by the mouse. This is the default. --auto_focus Chooses that the keyboard focus is where the mouse pointer is.  File: xorriso-tcltk.info, Node: Examples, Next: Files, Prev: Options, Up: Top 3 Examples ********** Just run 'xorriso-tcltk' in a shell terminal without any further arguments  File: xorriso-tcltk.info, Node: Files, Next: Seealso, Prev: Examples, Up: Top 4 Files ******* 4.1 Startup Files ================= When starting xorriso, its normal startup files get read and their text lines get executed as commands. See section FILES in the man page of xorriso or chapter Files in the info document of xorriso.  File: xorriso-tcltk.info, Node: Seealso, Next: Bugreport, Prev: Files, Up: Top 5 See also ********** info xorriso  File: xorriso-tcltk.info, Node: Bugreport, Next: Legal, Prev: Seealso, Up: Top 6 Reporting bugs **************** To report bugs, request help, or suggest enhancements for 'xorriso' or 'xorriso-tcltk', please send electronic mail to the public list . If more privacy is desired, mail to . Please describe what you expect the program to do, the program arguments, GUI components, or dialog commands by which you tried to achieve it, the messages of 'xorriso', and the undesirable outcome of your program run. Expect to get asked more questions before solutions can be proposed.  File: xorriso-tcltk.info, Node: Legal, Next: CommandIdx, Prev: Bugreport, Up: Top 7 Author, Copyright, Credits **************************** 7.1 Author ========== Thomas Schmitt for libburnia-project.org 7.2 Copyright ============= Copyright (c) 2011 - 2021 Thomas Schmitt Permission is granted to distribute this text freely. It shall only be modified in sync with the technical properties of xorriso-tcltk. If you make use of the license to derive modified versions of xorriso-tcltk then you are entitled to modify this text under that same license. 7.3 Credits =========== 'xorriso' is in part based on work by Vreixo Formoso who provides libisofs together with Mario Danic who also leads the libburnia team. Thanks to Andy Polyakov who invented emulated growing, to Derek Foreman and Ben Jansens who once founded libburn. Compliments towards Joerg Schilling whose cdrtools served me for ten years.  File: xorriso-tcltk.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top 8 Alphabetic Options List ************************* [index] * Menu: * --auto_focus text input where mouse is: Options. (line 23) * --click_to_focus click needed before text input: Options. (line 20) * --geometry set position of main window: Options. (line 16) * --help print help text to stderr: Options. (line 11) * --no_extract ban extraction of files to disk: Options. (line 13)  File: xorriso-tcltk.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top 9 Alphabetic List of Concepts and Objects ***************************************** [index] * Menu: * Bugs, reporting: Bugreport. (line 6) * Extraction of files, ban, --no_extract: Options. (line 13) * Help text, print to stderr, --help: Options. (line 11) * Keyboard focus, change by click, --click_to_focus: Options. (line 20) * Keyboard focus, where mouse is, --auto_focus: Options. (line 23) * Main window, position, --geometry: Options. (line 16) * Problems, reporting: Bugreport. (line 6) * xorriso, options: Options. (line 6)  Tag Table: Node: Top386 Node: Overview922 Node: Options2009 Node: Examples2967 Node: Files3151 Node: Seealso3492 Node: Bugreport3615 Node: Legal4249 Node: CommandIdx5186 Node: ConceptIdx5716  End Tag Table libisoburn-1.5.4/xorriso/text_io.h0000644000175700017510000001046113701321754014160 00000000000000 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. Copyright 2007-2014 Thomas Schmitt, Provided under GPL version 2 or later. This file contains declarations of text i/o functions. */ #ifndef Xorriso_pvt_textio_includeD #define Xorriso_pvt_textio_includeD yes int Xorriso_dialog_input(struct XorrisO *xorriso, char line[], int linesize, int flag); /** @return -1= abort , 0= no , 1= yes */ int Xorriso_reassure(struct XorrisO *xorriso, char *cmd, char *which_will, int flag); int Xorriso_request_confirmation(struct XorrisO *xorriso, int flag); /* @param flag bit0= quoted multiline mode bit1= release allocated memory and return 1 bit2= with bit0: warn of empty text arguments bit3= deliver as single quoted text including all whitespace and without any backslash interpretation @return -1=out of memory , 0=line format error , 1=ok, go on , 2=done */ int Xorriso_read_lines(struct XorrisO *xorriso, FILE *fp, int *linecount, int *argc, char ***argv, int flag); int Xorriso_write_to_channel(struct XorrisO *xorriso, char *in_text, int channel_no, int flag); int Xorriso_result(struct XorrisO *xorriso, int flag); int Xorriso_restxt(struct XorrisO *xorriso, char *text); int Xorriso_info(struct XorrisO *xorriso, int flag); int Xorriso_mark(struct XorrisO *xorriso, int flag); int Xorriso_write_session_log(struct XorrisO *xorriso, int flag); int Xorriso_status_result(struct XorrisO *xorriso, char *filter, FILE *fp, int flag); int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag); int Xorriso_pacifier_reset(struct XorrisO *xorriso, int flag); /* This call is to be issued by long running workers in short intervals. It will check whether enough time has elapsed since the last pacifier message and eventually issue an update message. @param what_done A sparse description of the action, preferably in past tense. E.g. "done" , "files added". @param count The number of objects processed so far. Is ignored if <=0. @param todo The number of objects to be done in total. Is ignored if <=0. @param current_object A string telling the object currently processed. Ignored if "". @param flag bit0= report unconditionally, no time check */ int Xorriso_pacifier_callback(struct XorrisO *xorriso, char *what_done, off_t count, off_t todo, char *current_object, int flag); int Xorriso_reset_counters(struct XorrisO *xorriso, int flag); int Xorriso_no_malloc_memory(struct XorrisO *xorriso, char **to_free, int flag); int Xorriso_much_too_long(struct XorrisO *xorriso, int len, int flag); int Xorriso_no_findjob(struct XorrisO *xorriso, char *cmd, int flag); int Xorriso_report_md5_outcome(struct XorrisO *xorriso, char *severity, int flag); int Xorriso_protect_stdout(struct XorrisO *xorriso, int flag); int Xorriso_msg_op_parse(struct XorrisO *xorriso, char *line, char *prefix, char *separators, int max_words, int pflag, int input_lines, int flag); int Xorriso_msg_op_parse_bulk(struct XorrisO *xorriso, char *prefix, char *separators, int max_words, int pflag, int bulk_lines, int flag); int Xorriso_launch_frontend(struct XorrisO *xorriso, int argc, char **argv, char *cmd_pipe_adr, char *reply_pipe_adr, int flag); int Xorriso_named_pipe_loop(struct XorrisO *xorriso, char *pipe_paths[3], int flag); char *Xorriso_esc_filepath(struct XorrisO *xorriso, char *in_text, char *out_text, int flag); int Xorriso_set_info_text(struct XorrisO *xorriso, char *text, size_t trunc_len, int flag); #ifdef Xorriso_with_editlinE int Xorriso__shutdown_editline(int flag); #endif #ifdef Xorriso_with_readlinE const char *Xorriso__readline_license(int flag); #endif #endif /* ! Xorriso_pvt_textio_includeD */ libisoburn-1.5.4/xorriso/xorriso.info0000644000175700017510000120535614005265774014737 00000000000000This is xorriso.info, produced by makeinfo version 5.2 from xorriso.texi. xorriso - creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. Copyright (C) 2007 - 2021 Thomas Schmitt Permission is granted to distribute this text freely. INFO-DIR-SECTION Archiving START-INFO-DIR-ENTRY * Xorriso: (xorriso). Burns ISO 9660 on CD, DVD, BD. END-INFO-DIR-ENTRY  File: xorriso.info, Node: Top, Next: Overview, Up: (dir) GNU xorriso 1.5.4 ***************** xorriso - creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. * Menu: * Overview:: Overview * Model:: Session model * Media:: Media types and states * Methods:: Creating, Growing, Modifying, Blind Growing * Drives:: Libburn drives * Extras:: Rock Ridge, POSIX, X/Open, El Torito, ACL, xattr * Processing:: Command processing * Dialog:: Dialog, Readline, Result pager * Commands:: Reference of commands * Examples:: Examples * Files:: Files * Environ:: Environment * Seealso:: See also * Bugreport:: Reporting bugs * Legal:: Author, Copyright, Credits * CommandIdx:: Alphabetic Command List * ConceptIdx:: Alphabetic List of Concepts and Objects  File: xorriso.info, Node: Overview, Next: Model, Prev: Top, Up: Top 1 Overview ********** 'xorriso' is a program which copies file objects from POSIX compliant filesystems into Rock Ridge enhanced ISO 9660 filesystems and performs session-wise manipulation of such filesystems. It can load the management information of existing ISO images and it writes the session results to optical media or to filesystem objects. Vice versa 'xorriso' is able to copy file objects out of ISO 9660 filesystems. A special property of 'xorriso' is that it needs neither an external ISO 9660 formatter program nor an external burn program for CD, DVD or BD but rather incorporates the libraries of libburnia-project.org . 1.1 Features ============ Operates on an existing ISO image or creates a new one. Copies files from disk filesystem into the ISO image. Copies files from ISO image to disk filesystem (see osirrox). Renames or deletes file objects in the ISO image. Changes file properties in the ISO image. Updates ISO subtrees incrementally to match given disk subtrees. Writes result either as completely new image or as add-on session to optical media or filesystem objects. Can activate ISOLINUX and GRUB boot images via El Torito and MBR. Can perform multi-session tasks as emulation of mkisofs and cdrecord. Can record and restore hard links and ACL. Content may get zisofs compressed or filtered by external processes. Can issue commands to mount older sessions on GNU/Linux or FreeBSD. Can check media for damages and copy readable blocks to disk. Can attach MD5 checksums to each data file and the whole session. Scans for optical drives, blanks re-usable optical media. Reads its instructions from command line arguments, dialog, and files. Provides navigation commands for interactive ISO image manipulation. Adjustable thresholds for abort, exit value, and problem reporting. Note that 'xorriso' does not write audio CDs and that it does not produce UDF filesystems which are specified for official video DVD or BD.  File: xorriso.info, Node: Model, Next: Media, Prev: Overview, Up: Top 2 Session model *************** Unlike other filesystems, *ISO 9660* (aka *ECMA-119*) is not intended for read-write operation but rather for being generated in a single sweep and being written to media as a *session*. The data content of the session is called filesystem *image*. The written image in its session can then be mounted by the operating system for being used read-only. GNU/Linux is able to mount ISO images from block devices, which may represent optical media, other media or via a loop device even from regular disk files. FreeBSD mounts ISO images from devices that represent arbitrary media or from regular disk files. This session usage model has been extended on CD media by the concept of *multi-session* , which adds information to the CD and gives the mount programs of the operating systems the addresses of the entry points of each session. The mount programs recognize block devices which represent CD media and will by default mount the image in the last session. This session usually contains an updated directory tree for the whole medium which governs the data contents in all recorded sessions. So in the view of the mount program all sessions of a particular medium together form a single filesystem image. Adding a session to an existing ISO image is in this text referred as *growing*. The multi-session model of the MMC standard does not apply to all media types. But program growisofs by Andy Polyakov showed how to extend this functionality to overwritable media or disk files which carry valid ISO 9660 filesystems. 'xorriso' provides growing as well as an own method named *modifying* which produces a completely new ISO image from the old one and the modifications. See paragraph Creating, Growing, Modifying, Blind Growing below. 'xorriso' adopts the concept of multi-session by loading an image directory tree if present, by offering to manipulate it by several actions, and by writing the new image to the target medium. The first session of a 'xorriso' run begins by the definition of the input drive with the ISO image or by the definition of an output drive. The session ends by command -commit which triggers writing. A -commit is done automatically when the program ends regularly. After -commit a new session begins with the freshly written one as input. A new input drive can only be chosen as long as the loaded ISO image was not altered. Pending alteration can be revoked by command -rollback. Writing a session to the target is supposed to be very expensive in terms of time and of consumed space on appendable or write-once media. Therefore all intended manipulations of a particular ISO image should be done in a single session. But in principle it is possible to store intermediate states and to continue with image manipulations.  File: xorriso.info, Node: Media, Next: Methods, Prev: Model, Up: Top 3 Media types and states ************************ There are two families of media in the MMC standard: *Multi-session media* are CD-R, CD-RW, DVD-R, DVD+R, DVD+R/DL, BD-R, and unformatted DVD-RW. These media provide a table of content which describes their existing sessions. See command *-toc*. Similar to multi-session media are DVD-R DL and minimally blanked DVD-RW. They record only a single session of which the size must be known in advance. 'xorriso' will write onto them only if command -close is set to "on". *Overwritable media* are DVD-RAM, DVD+RW, BD-RE, and formatted DVD-RW. They offer random write access but do not provide information about their session history. If they contain one or more ISO 9660 sessions and if the first session was written by 'xorriso', then a table of content can be emulated. Else only a single overall session will be visible. DVD-RW media can be formatted by -format "full". They can be made unformatted by -blank "deformat". Regular files and block devices are handled as overwritable media. Pipes and other writeable file types are handled as blank multi-session media. These media can assume several states in which they offer different capabilities. *Blank* media can be written from scratch. They contain no ISO image suitable for 'xorriso'. Blank is the state of newly purchased optical media. With used CD-RW and DVD-RW it can be achieved by action -blank "as_needed". Overwritable media are considered blank if they are new or if they have been marked as blank by 'xorriso'. Action -blank "as_needed" can be used to do this marking on overwritable media, or to apply mandatory formatting to new media if necessary. *Appendable* media accept further sessions. Either they are MMC multi-session media in appendable state, or they are overwritable media which contain an ISO image suitable for 'xorriso'. Appendable is the state after writing a session with command -close off. *Closed* media cannot be written. They may contain an ISO image suitable for 'xorriso'. Closed is the state of DVD-ROM media and of multi-session media which were written with command -close on. If the drive is read-only hardware then it will probably show any media as closed CD-ROM or DVD-ROM. Overwritable media assume this state in such read-only drives or if they contain unrecognizable data in the first 32 data blocks. Read-only drives may or may not show session histories of multi-session media. Often only the first and the last session are visible. Sometimes not even that. Command -rom_toc_scan might or might not help in such cases.  File: xorriso.info, Node: Methods, Next: Drives, Prev: Media, Up: Top 4 Creating, Growing, Modifying, Blind Growing: ********************************************** A new empty ISO image gets *created* if there is no input drive with a valid ISO 9660 image when the first time an output drive is defined. This is achieved by command -dev on blank media or by command -outdev on media in any state. The new empty image can be populated with directories and files. Before it can be written, the medium in the output drive must get into blank state if it was not blank already. If there is a input drive with a valid ISO image, then this image gets loaded as foundation for manipulations and extension. The constellation of input and output drive determines which write method will be used. They have quite different capabilities and constraints. The method of *growing* adds new data to the existing data on the medium. These data comprise of new file content and they override the existing ISO 9660 + Rock Ridge directory tree. It is possible to hide files from previous sessions but they still exist on the medium and with many types of optical media it is quite easy to recover them by mounting older sessions. Growing is achieved by command -dev. The write method of *modifying* produces compact filesystem images with no outdated files or directory trees. Modifying can write its images to target media which are completely unsuitable for multi-session operations. E.g. DVD-RW which were treated with -blank deformat_quickest, DVD-R DL, named pipes, character devices, sockets. On the other hand modified sessions cannot be written to appendable media but to blank media only. So for this method one needs either two optical drives or has to work with filesystem objects as source and/or target medium. Modifying takes place if input drive and output drive are not the same and if command -grow_blindly is set to its default "off". This is achieved by commands -indev and -outdev. If command -grow_blindly is set to a non-negative number and if -indev and -outdev are both set to different drives, then *blind growing* is performed. It produces an add-on session which is ready for being written to the given block address. This is the usage model of mkisofs -M $indev -C $msc1,$msc2 -o $outdev which gives much room for wrong parameter combinations and should thus only be employed if a strict distinction between ISO formatter 'xorriso' and the burn program is desired. -C $msc1,$msc2 is equivalent to: -load sbsector $msc1 -grow_blindly $msc2  File: xorriso.info, Node: Drives, Next: Extras, Prev: Methods, Up: Top 5 Libburn drives **************** Input drive, i.e. source of an existing or empty ISO image, can be any random access readable libburn drive: optical media with readable data, blank optical media, regular files, block devices. Output drive, i.e. target for writing, can be any libburn drive. Some drive types do not support the method of growing but only the methods of modifying and blind growing. They all are suitable for newly created images. All drive file objects have to offer rw-permission to the user of 'xorriso'. Even those which will not be usable for reading an ISO image. With any type of drive object, the data are considered to be organized in blocks of 2 KiB. Access happens in terms of Logical Block Address (*LBA*) which gives the number of a particular data block. MMC compliant (i.e. optical) drives on GNU/Linux usually get addressed by the path of their block device or of their generic character device. E.g. -dev /dev/sr0 -dev /dev/hdc -dev /dev/sg2 By default xorriso will try to map the given address to /dev/hd* and /dev/sr*. The command -scsi_dev_family can redirect the mapping from sr to scd or sg. The latter does not suffer from the concurrency problems which plague /dev/sr of Linux kernels since version 3. But it does not yield the same addresses which are used by mount(8) or by open(2) for read(2). On FreeBSD the device files have names like -dev /dev/cd0 On NetBSD: -dev /dev/rcd0d On OpenSolaris: -dev /dev/rdsk/c4t0d0s2 Get a list of accessible drives by command -device_links It might be necessary to do this as *superuser* in order to see all drives and to then allow rw-access for the intended users. Consider to bundle the authorized users in a group like old "floppy". Filesystem objects of nearly any type can be addressed by prefix "stdio:" and their path in the filesystem. E.g.: -dev stdio:/dev/sdc The default setting of -drive_class allows the user to address files outside the /dev tree without that prefix. E.g.: -dev /tmp/pseudo_drive If path leads to a regular file or to a block device then the emulated drive is random access readable and can be used for the method of growing if it already contains a valid ISO 9660 image. Any other file type is not readable via "stdio:" and can only be used as target for the method of modifying or blind growing. Non-existing paths in existing directories are handled as empty regular files. A very special kind of pseudo drive are open file descriptors. They are depicted by "stdio:/dev/fd/" and descriptor number (see man 2 open). Addresses "-" or "stdio:/dev/fd/1" depict standard output, which normally is the output channel for result texts. To prevent a fatal intermingling of ISO image and text messages, all result texts get redirected to stderr if -*dev "-" or "stdio:/dev/fd/1" is among the start arguments of the program. Standard output is currently suitable for creating one session per program run without dialog. Use in other situations is discouraged and several restrictions apply: It is not allowed to use standard output as pseudo drive if it was not among the start arguments. Do not try to fool this ban via backdoor addresses to stdout. If stdout is used as drive, then -use_readline is permanently disabled. Use of backdoors can cause severe memory and/or tty corruption. Be aware that especially the superuser can write into any accessible file or device by using its path with the "stdio:" prefix. By default any address in the /dev tree without prefix "stdio:" will work only if it leads to a MMC drive. One may use command *-ban_stdio_write* to surely prevent this risk and to restrict drive usage to MMC drives. One may prepend "mmc:" to a path to surely disallow any automatic "stdio:". By command -drive_class one may ban certain paths or allow access without prefix "stdio:" to other paths.  File: xorriso.info, Node: Extras, Next: Processing, Prev: Drives, Up: Top 6 Rock Ridge, POSIX, X/Open, El Torito, ACL, xattr ************************************************** *Rock Ridge* is the name of a set of additional information which enhance an ISO 9660 filesystem so that it can represent a POSIX compliant filesystem with ownership, access permissions, symbolic links, and other attributes. This is what 'xorriso' uses for a decent representation of the disk files within the ISO image. 'xorriso' produces Rock Ridge information by default. It is strongly discouraged to disable this feature. 'xorriso' is not named "porriso" because POSIX only guarantees 14 characters of filename length. It is the X/Open System Interface standard XSI which demands a file name length of up to 255 characters and paths of up to 1024 characters. Rock Ridge fulfills this demand. An *El Torito* boot record points the BIOS bootstrapping facility to one or more boot images, which are binary program files stored in the ISO image. The content of the boot image files is not in the scope of El Torito. Most bootable GNU/Linux CDs are equipped with ISOLINUX or GRUB boot images. 'xorriso' is able to create or maintain an El Torito object which makes such an image bootable. For details see command -boot_image. It is possible to make ISO images bootable from USB stick or other hard-disk-like media. Several options install a *MBR* (Master Boot Record), It may get adjusted according to the needs of the intended boot firmware and the involved boot loaders, e.g. GRUB2 or ISOLINUX. A MBR contains boot code and a partition table. The new MBR of a follow-up session can get in effect only on overwritable media. MBR is read by PC-BIOS when booting from USB stick or hard disk, and by PowerPC CHRP or PReP when booting. An MBR partition with type 0xee indicates the presence of GPT. Emulation -as mkisofs supports the example options out of the ISOLINUX wiki, the options used in GRUB script grub-mkrescue, and the example in the FreeBSD AvgLiveCD wiki. A *GPT* (GUID Partition Table) marks partitions in a more modern way. It is read by EFI when booting from USB stick or hard disk, and may be used for finding and mounting a HFS+ partition inside the ISO image. An *APM* (Apple Partition Map) marks the HFS+ partition. It is read by Macs for booting and for mounting. MBR, GPT and APM are combinable. APM occupies the first 8 bytes of MBR boot code. All three do not hamper El Torito booting from CDROM. There is support for further facilities: MIPS Big Endian (SGI), MIPS Little Endian (DEC), SUN SPARC, HP-PA. Those are mutually not combinable and also not combinable with MBR, GPT, or APM. *ACL* are an advanced way of controlling access permissions to file objects. Neither ISO 9660 nor Rock Ridge specify a way to record ACLs. So libisofs has introduced a standard conformant extension named AAIP for that purpose. It uses this extension if enabled by command *-acl*. AAIP enhanced images are supposed to be mountable normally, but one cannot expect that the mounted filesystem will show and respect the ACLs. For now, only 'xorriso' is able to retrieve those ACLs. It can bring them into effect when files get restored to an ACL enabled file system or it can print them in a format suitable for tool setfacl. Files with ACL show as group permissions the setting of entry "mask::" if that entry exists. Nevertheless the non-listed group members get handled according to entry "group::". When removing ACL from a file, 'xorriso' brings "group::" into effect. Recording and restoring of ACLs from and to local files works currently only on GNU/Linux and FreeBSD. *xattr* (aka EA, or extattr) are pairs of name and value which can be attached to file objects. AAIP is able to represent them and 'xorriso' can record and restore them. But be aware that pairs with names of non-user namespaces are not necessarily portable between operating systems and not even between filesystems. Only those which begin with "user.", like "user.x" or "user.whatever", can unconditionally be expected to be appropriate on other machines and disks. Processing of other xattr may need administrator privileges. Name has to be a 0 terminated string. Value may be any array of bytes which does not exceed the size of 4095 bytes. xattr processing happens only if it is enabled by command *-xattr*. As with ACL, currently only 'xorriso' is able to retrieve xattr from AAIP enhanced images, to restore them to xattr capable file systems, or to print them. Recording and restoring of xattr from and to local files works currently only on GNU/Linux and FreeBSD, where they are known as extattr.  File: xorriso.info, Node: Processing, Next: Dialog, Prev: Extras, Up: Top 7 Command processing ******************** Commands are either actions which happen immediately or settings which influence following actions. So their sequence does matter, unless they are given as program arguments and command *-x* is among them. Commands consist of a command word, followed by zero or more parameter words. If the list of parameter words is of variable length (indicated by "[...]" or "[***]") then it must be terminated by either the *list delimiter*, occur at the end of the argument list, or occur at the end of an input line. At program start the list delimiter is the string "--". This may be changed with the -list_delimiter command in order to allow "--" as parameter in a variable length list. However, it is advised to reset the delimiter to "--" immediately afterwards. For brevity the list delimiter is referred as "--" throughout this text. The list delimiter is silently ignored if it appears after the parameters of a command with a fixed list length. It is handled as normal text if it appears among the parameters of such a command. *Pattern expansion* converts a list of pattern words into a list of existing file addresses. Unmatched pattern words will appear unaltered in that result list. Pattern matching supports the usual shell parser wildcards '*' '?' '[xyz]' and respects '/' as the path separator, which may only be matched literally. Pattern expansion is a property of some particular commands and not a general feature. It is controlled by commands -iso_rr_pattern and -disk_pattern. Commands which use pattern expansion all have variable parameter lists which are specified in this text by "[***]" rather than "[...]". Some other commands perform pattern matching unconditionally. Command and parameter words are either read from the program arguments, where one argument is one word, or from quoted input lines where words are recognized similar to the quotation rules of a shell parser. 'xorriso' is not a shell, although it might appear so at first glimpse. Be aware that the interaction of quotation marks and pattern symbols like "*" differs from the usual shell parsers. In 'xorriso', a quotation mark does not make a pattern symbol literal. *Quoted input* converts whitespace-separated text into words. The double quotation mark " and the single quotation mark ' can be used to enclose whitespace and make it part of words (e.g. of file names). Each mark type can enclose the marks of the other type. A trailing backslash \ outside quotations or an open quotation cause the next input line to be appended. Quoted input accepts any 8-bit character except NUL (0) as the content of the quotes. Nevertheless it can be cumbersome for the user to produce those characters directly. Therefore quoted input and program arguments offer optional *Backslash Interpretation* which can represent all 8-bit characters except NUL (0) via backslash codes as in $'...' of bash. This is not enabled by default. See command -backslash_codes. When the program starts then it first looks for argument -no_rc. If this is not present then it looks for its startup files and reads their content as command input lines. Then it interprets the program arguments as commands and parameters. Finally it enters dialog mode if command -dialog "on" has been executed by this point. The program ends either by command -end, or by the end of program arguments if dialog mode has not been enabled at that point, or by a problem event which triggers the threshold of command -abort_on.  File: xorriso.info, Node: Dialog, Next: Commands, Prev: Processing, Up: Top 8 Dialog, Readline, Result pager ******************************** Dialog mode prompts for a quoted input line, parses it into words, and performs them as commands with their parameters. It provides assisting services to make dialog more comfortable. Readline is an enhancement for the input line. You may already know it from the bash shell. Whether it is available in 'xorriso' depends on the availability of package readline-dev at the time when 'xorriso' was built from its sourcecode. Readline lets the user move the cursor over the text in the line by help of the Left and the Right arrow keys. Text may be inserted at the cursor position. The Delete key removes the character under the cursor. Up and Down arrow keys navigate through the history of previous input lines. See info readline for more info about libreadline. Command -page activates a built-in result text pager which may be convenient in dialog mode. After an action has output the given number of terminal lines, the pager prompts the user for a line of input. An empty line lets 'xorriso' resume work until the next page is output. The single character "@" disables paging for the current action. "@@@", "x", "q", "X", or "Q" request that the current action aborts and suppress further result output. Any other line input will be interpreted as new dialog line. The current action is requested to abort. Afterwards, the input line is executed. Some actions apply paging to their info output, too. The request to abort may or may not be obeyed by the current action. All actions try to abort as soon as possible.  File: xorriso.info, Node: Commands, Next: Examples, Prev: Dialog, Up: Top 9 Commands ********** All command words are shown with a leading dash although this dash is not mandatory for the command to be recognized. Nevertheless within command -as the dashes of the emulated commands are mandatory. Normally any number of leading dashes is ignored with command words and inner dashes are interpreted as underscores. * Menu: * ArgSort:: Execution order of program arguments * AqDrive:: Acquiring source and target drive * Loading:: Influencing the behavior of image loading * Insert:: Inserting files into ISO image * SetInsert:: Settings for file insertion * Manip:: File manipulations * CmdFind:: Tree traversal command -find * Filter:: Filters for data file content * Writing:: Writing the result, drive control * SetWrite:: Settings for result writing * Bootable:: Bootable ISO images * Jigdo:: Jigdo Template Extraction * Charset:: Character sets * Exception:: Exception processing * DialogCtl:: Dialog mode control * Inquiry:: Drive and media related inquiry actions * Navigate:: Navigation in ISO image and disk filesystem * Verify:: Evaluation of readability and recovery * Restore:: osirrox ISO-to-disk restore commands * Emulation:: Command compatibility emulations (cdrtools) * Scripting:: Scripting, dialog and program control features * Frontend:: Support for frontend programs via stdin and stdout  File: xorriso.info, Node: ArgSort, Next: AqDrive, Prev: Commands, Up: Commands 9.1 Execution order of program arguments ======================================== By default the program arguments of a xorriso run are interpreted as a sequence of commands which get performed exactly in the given order. This requires the user to write commands for desired settings before the commands which shall be influenced by those settings. Many other programs support program arguments in an arbitrary ordering and perform settings and actions in a sequence at their own discretion. xorriso provides an option to enable such a behavior at the cost of loss of expressivity. -x Enable automatic sorting of program arguments into a sequence that (most likely) is sensible. This command may be given at any position among the commands which are handed over as program arguments. Note: It works only if it is given as program argument and with a single dash (i.e. "-x"). It will not work in startup files, nor with -options_from_file, nor in dialog mode, nor as "x" and finally not as "--x". It affects only the commands given as program arguments. -list_arg_sorting List all xorriso commands in the order which applies if command -x is in effect. This list may also be helpful without -x for a user who ponders over the sequence in which to put commands. Deviations from the listed sorting order may well make sense, though.  File: xorriso.info, Node: AqDrive, Next: Loading, Prev: ArgSort, Up: Commands 9.2 Acquiring source and target drive ===================================== The effect of acquiring a drive may depend on several commands in the next paragraph "Influencing the behavior of image loading". If desired, their enabling commands have to be performed before the commands which acquire the drive. -dev address Set input and output drive to the same address and load an ISO image if it is present. If there is no ISO image then create a blank one. Set the image expansion method to growing. This is only allowed as long as no changes are pending in the currently loaded ISO image. If changes are pending, then one has to perform -commit or -rollback first. Special address string "-" means standard output, to which several restrictions apply. See above paragraph "Libburn drives". An empty address string "" gives up the current device without acquiring a new one. -indev address Set input drive and load an ISO image if present. If the new input drive differs from -outdev then switch from growing to modifying or to blind growing. It depends on the setting of -grow_blindly which of both gets activated. The same rules and restrictions apply as with -dev. -outdev address Set output drive and if it differs from the input drive then switch from growing to modifying or to blind growing. Unlike -dev and -indev this action does not load a new ISO image. So it can be performed even if there are pending changes. -outdev can be performed without previous -dev or -indev. In that case an empty ISO image with no changes pending is created. It can either be populated by help of -map, -add et.al. or it can be discarded silently if -dev or -indev are performed afterwards. Special address string "-" means standard output, to which several restrictions apply. See above paragraph "Libburn drives". An empty address string "" gives up the current output drive without acquiring a new one. No writing is possible without an output drive. -drive_class "harmless"|"banned"|"caution"|"clear_list" disk_pattern Add a drive path pattern to one of the safety lists or make those lists empty. There are three lists defined which get tested in the following sequence: If a drive address path matches the "harmless" list then the drive will be accepted. If it is not a MMC device then the prefix "stdio:" will be prepended automatically. This list is empty by default. Else if the path matches the "banned" list then the drive will not be accepted by 'xorriso' but rather lead to a FAILURE event. This list is empty by default. Else if the path matches the "caution" list and if it is not a MMC device, then its address must have the prefix "stdio:" or it will be rejected. This list has by default one entry: "/dev". If a drive path matches no list then it is considered "harmless". By default these are all paths which do not begin with directory "/dev". A path matches a list if one of its parent paths or itself matches a list entry. Address prefix "stdio:" or "mmc:" will be ignored when testing for matches. By pseudo-class "clear_list" and pseudo-patterns "banned", "caution", "harmless", or "all", the lists may be made empty. E.g.: -drive_class clear_list banned One will normally define the -drive_class lists in one of the 'xorriso' Startup Files. Note: This is not a security feature but rather a bumper for the superuser to prevent inadverted mishaps. For reliably blocking access to a device file you have to deny its rw-permissions in the filesystem. -drive_access "exclusive"|"shared":"unrestricted"|"readonly" Control whether device file locking mechanisms shall be used when acquiring a drive, and whether status or content of the medium in the drive may be altered. Useful and most harmless are the setting "shared:readonly" and the default setting "exclusive:unrestricted". "exclusive" enables tests and locks when acquiring the drive. It depends on the operating system which locking mechanisms get applied, if any. On GNU/Linux it is open(O_EXCL). On FreeBSD it is flock(LOCK_EX). "shared" disables the use of these mechanisms to become able to acquire drives which are mounted, or opened by some process, or guarded by /dev/pktcdvd*. "unrestricted" enables all technically appropriate operations on an acquired drive. "shared:unrestricted" risks to get own burn runs spoiled by other processes or to vice versa spoil activities of such processes. So use "exclusive:unrestricted" unless you know for sure that "shared" is safe. "readonly" disables operations which might surprise a co-user of the drive. For -outdev these are formatting, blanking, writing, ejecting. For -indev this is ejecting. Be aware that even reading and drive status inquiries can disturb an ongoing burn run on CD-R[W] and DVD-R[W]. -scsi_dev_family "default"|"sr"|"scd"|"sg" GNU/Linux specific: By default, xorriso tries to map Linux drive addresses to /dev/sr* before they get opened for operating the drive. This coordinates well with other use cases of optical drives, like mount(8). But since year 2010 all /dev/sr* share a global lock which allows only one drive to process an SCSI command while all others have to wait for its completion. This yields awful throughput if more than one drive is writing or reading simultaneously. The global lock is not applied to device files /dev/sg* and also not if the xorriso drive address is prepended by "stdio:". So for simultaneous burn runs on modern GNU/Linux it is advisable to perform -scsi_dev_family "sg" before any -dev, -indev, or -outdev. The drive addresses may then well be given as /dev/sr* but will nevertheless get used as the matching /dev/sg*. If you decide so, consider to put the command into a global startup file like /etc/opt/xorriso/rc. -grow_blindly "off"|predicted_nwa If predicted_nwa is a non-negative number then perform blind growing rather than modifying if -indev and -outdev are set to different drives. "off" or "-1" switch to modifying, which is the default. predicted_nwa is the block address where the add-on session of blind growing will finally end up. It is the responsibility of the user to ensure this final position and the presence of the older sessions. Else the overall ISO image will not be mountable or will produce read errors when accessing file content. 'xorriso' will write the session to the address as obtained from examining -outdev and not necessarily to predicted_nwa. During a run of blind growing, the input drive is given up before output begins. The output drive is given up when writing is done.  File: xorriso.info, Node: Loading, Next: Insert, Prev: AqDrive, Up: Commands 9.3 Influencing the behavior of image loading ============================================= The following commands should normally be performed before loading an image by acquiring an input drive. In rare cases it is desirable to activate them only after image loading. -read_speed code|number[k|m|c|d|b] Set the speed for reading. Default is "none", which avoids to send a speed setting command to the drive before reading begins. Further special speed codes are: "max" (or "0") selects maximum speed as announced by the drive. "min" (or "-1") selects minimum speed as announced by the drive. Speed can be given in media dependent numbers or as a desired throughput per second in MMC compliant kB (= 1000) or MB (= 1000 kB). Media x-speed factor can be set explicitly by "c" for CD, "d" for DVD, "b" for BD, "x" is optional. Example speeds: 706k = 706kB/s = 4c = 4xCD 5540k = 5540kB/s = 4d = 4xDVD If there is no hint about the speed unit attached, then the medium in the -indev will decide. Default unit is CD = 176.4k. Depending on the drive, the reported read speeds can be deceivingly low or high. Therefore "min" cannot become higher than 1x speed of the involved medium type. Read speed "max" cannot become lower than 52xCD, 24xDVD, or 20xBD, depending on the medium type. MMC drives usually activate their own idea of speed and take the speed value given by the burn program only as hint for their own decision. Friendly drives adjust their constant angular velocity so that the desired speed is reached at the outer rim of the medium. But often there is only the choice between very slow and very loud. Sometimes no speed setting is obeyed at all, but speed is adjusted to the demand frequency of the reading program. So xorriso offers to set an additional software enforced limit by prefix "soft_force:". The program will take care not to read faster than the soft_force speed. This may be combined with setting the drive speed to a higher value. Setting "soft_force:0" disables this feature. "soft_force:" tries to correct in subsequent waiting periods lost or surplus time of up to 0.25 seconds. This smoothens the overall data stream but also enables short times of higher speed to compensate short times of low speed. Prefix "soft_corr:" sets this hindsight span by giving a number of microseconds. Not more than 1 billion = 1000 seconds. Very short times can cause speed deviations, because systematic inaccuracies of the waiting function cannot be compensated. Examples (combinable): -read_speed 6xBD -read_speed soft_force:4xBD -read_speed soft_corr:100000 -load entity id Load a particular (possibly outdated) ISO session from -dev or -indev. Usually all available sessions are shown with command -toc. entity depicts the kind of addressing. id depicts the particular address. The following entities are defined: "auto" with any id addresses the last session in -toc. This is the default. "session" with id being a number as of a line "ISO session", column "Idx". "track" with id being a number as of a line "ISO track", column "Idx". "lba" or "sbsector" with a number as of a line "ISO ...", column "sbsector". "volid" with a search pattern for a text as of a line "ISO ...", column "Volume Id". Addressing a non-existing entity or one which does not represent an ISO image will either abandon -indev or at least lead to a blank image. If an input drive is set at the moment when -load is executed, then the addressed ISO image is loaded immediately. Else, the setting will be pending until the next -dev or -indev. After the image has been loaded once, the setting is valid for -rollback until next -dev or -indev, where it will be reset to "auto". -displacement [-]lba Compensate a displacement of the image versus the start address for which the image was prepared. This affects only loading of ISO images and reading of their files. The multi-session method of growing is not allowed as long as -displacement is non-zero. I.e. -indev and -outdev must be different. The displacement gets reset to 0 before the drive gets re-acquired after writing. Examples: If a track of a CD starts at block 123456 and gets copied to a disk file where it begins at block 0, then this copy can be loaded with -displacement -123456 If an ISO image was written onto a partition with offset of 640000 blocks of 512 bytes, then it can be loaded from the base device by -load sbsector 160000 -displacement 160000 (If the partition start address is not divisible by 4, then you will have to employ a loop device instead.) In both cases, the ISO sessions should be self contained, i.e. not add-on sessions to an ISO image outside their track or partition. -read_fs "any"|"norock"|"nojoliet"|"ecma119" Specify which kind of filesystem tree to load if present. If the wish cannot be fulfilled, then ECMA-119 names are loaded and converted according to -ecma119_map. "any" first tries to read Rock Ridge. If not present, Joliet is tried. "norock" does not try Rock Ridge. "nojoliet" does not try Joliet. "ecma119" tries neither Rock Ridge nor Joliet. -assert_volid pattern severity Refuse to load ISO images with volume IDs which do not match the given search pattern. When refusing an image, give up the input drive and issue an event of the given severity (like FAILURE, see -abort_on). An empty search pattern accepts any image. This command does not hamper the creation of an empty image from blank input media and does not discard an already loaded image. -in_charset character_set_name Set the character set from which to convert file names when loading an image. See paragraph "Character sets" for more explanations. When loading the written image after -commit the setting of -out_charset will be copied to -in_charset. -auto_charset "on"|"off" Enable or disable recording and interpretation of the output character set name in an xattr attribute of the image root directory. If enabled and if a recorded character set name is found, then this name will be used as name of the input character set when reading an image. Note that the default output charset is the local character set of the terminal where 'xorriso' runs. Before attributing this local character set to the produced ISO image, check whether the terminal properly displays all intended filenames, especially exotic national characters. -hardlinks mode[:mode...] Enable or disable loading and recording of hardlink relations. In default mode "off", iso_rr files lose their inode numbers at image load time. Each iso_rr file object which has no inode number at image generation time will get a new unique inode number if -compliance is set to new_rr. Mode "on" preserves inode numbers from the loaded image if such numbers were recorded. When committing a session it searches for families of iso_rr files which stem from the same disk file, have identical content filtering and have identical properties. The family members all get the same inode number. Whether these numbers are respected at mount time depends on the operating system. Command -lsl displays hardlink counts if "lsl_count" is enabled. This can slow down the command substantially after changes to the ISO image have been made. Therefore the default is "no_lsl_count". Commands -update and -update_r track splits and fusions of hard links in filesystems which have stable device and inode numbers. This can cause automatic last minute changes before the session gets written. Command -hardlinks "perform_update" may be used to do these changes earlier, e.g. if you need to apply filters to all updated files. Mode "without_update" avoids hardlink processing during update commands. Use this if your filesystem situation does not allow -disk_dev_ino "on". 'xorriso' commands which extract files from an ISO image try to hardlink files with identical inode number. The normal scope of this operation is from image load to image load. One may give up the accumulated hard link addresses by -hardlinks "discard_extract". A large number of hardlink families may exhaust -temp_mem_limit if not -osirrox "sort_lba_on" and -hardlinks "cheap_sorted_extract" are both in effect. This restricts hard linking to other files restored by the same single extract command. -hardlinks "normal_extract" re-enables wide and expensive hardlink accumulation. -acl "on"|"off" Enable or disable processing of ACLs. If enabled, then 'xorriso' will obtain ACLs from disk file objects, store ACLs in the ISO image using the libisofs specific AAIP format, load AAIP data from ISO images, test ACL during file comparison, and restore ACLs to disk files when extracting them from ISO images. See also commands -getfacl, -setfacl. -xattr "on"|"user"|"any"|"off" Enable or disable processing of xattr attributes. If enabled, then 'xorriso' will handle xattr similar to ACL. See also commands -getfattr, -setfattr and above paragraph about xattr. Modes "on" and "user" read and write only attributes from namespace "user". Mode "any" processes attributes of all namespaces. This might need administrator privileges, even if the owner of the disk file tries to read or write the attributes. Note that xattr from namespace "isofs." are never read from disk or restored to disk. Further it is not possible to set them via xorriso xattr manipulation commands. -md5 "on"|"all"|"off"|"load_check_off" Enable or disable processing of MD5 checksums for the overall session and for each single data file. If enabled then images with checksum tags get loaded only if the tags of superblock and directory tree match properly. The MD5 checksums of data files and whole session get loaded from the image if there are any. With commands -compare and -update the recorded MD5 of a file will be used to avoid content reading from the image. Only the disk file content will be read and compared with that MD5. This can save much time if -disk_dev_ino "on" is not suitable. Commands which copy whole data files from ISO to hard disk will verify the copied data stream by the recorded MD5, if -osirrox "check_md5_on" is set. At image generation time they are computed for each file which gets its data written into the new session. The checksums of files which have their data in older sessions get copied into the new session. Superblock, tree and whole session get a checksum tag each. Mode "all" will additionally check during image generation whether the checksum of a data file changed between the time when its reading began and the time when it ended. This implies reading every file twice. Mode "load_check_off" together with "on" or "all" will load recorded MD5 sums but not test the recorded checksum tags of superblock and directory tree. This is necessary if growisofs was used as burn program, because it does not overwrite the superblock checksum tag of the first session. Therefore load_check_off is in effect when 'xorriso' -as mkisofs option -M is performed. The test can be re-enabled by mode "load_check_on". Checksums can be exploited via commands -check_md5, -check_md5_r, via find actions get_md5, check_md5, and via -check_media. -for_backup Enable all extra features which help to produce or to restore backups with highest fidelity of file properties. Currently this is a shortcut for: -hardlinks on -acl on -xattr any -md5 on If you restore a backup with xattr from non-user namespaces, then make sure that the target operating system and filesystem know what these attributes mean. Possibly you will need administrator privileges to record or restore such attributes. At recording time, xorriso will try to tolerate missing privileges and just record what is readable. But at restore time, missing privileges will cause failure events. Command -xattr "user" after command -for_backup excludes non-user attributes from being recorded or restored. -ecma119_map "stripped"|"unmapped"|"lowercase"|"uppercase" Choose the conversion of file names when a session gets loaded, if they stem neither from a Rock Ridge name nor from a Joliet name. Mode "stripped" is the default. It shows the names as found in the ISO but removes trailing ";1" or ".;1" if present. Mode "unmapped" shows names as found without removing characters. Warning: Multi-session converts "xyz;1" to "xyz_1" and maybe adds new ";1". Mode "lowercase" is like "stripped" but also maps uppercase letters to lowercase letters. This is compatible to default GNU/Linux mount behavior. Mode "uppercase" is like "stripped" but maps lowercase letters to uppercase, if any occur despite the prescriptions of ECMA-119. -joliet_map "stripped"|"unmapped" Choose the conversion of file names when a session gets loaded from a Joliet tree. Mode "stripped" is the default. It removes trailing ";1" or ".;1" if present. Mode "unmapped" shows names as found without removing characters. Warning: Multi-session converts "xyz;1" to "xyz_1" and maybe adds new ";1". -iso_nowtime "dynamic"|timestring Choose whether to use the current time ("dynamic") or a fixed time point for timestamps of ISO 9660 nodes without a disk source file and as default for superblock timestamps. If a timestring is given, then it is used for such timestamps. For the formats of timestrings see command *-alter_date*. -disk_dev_ino "on"|"ino_only"|"off" Enable or disable processing of recorded file identification numbers (dev_t and ino_t). If enabled they are stored as xattr and can substantially accelerate file comparison. The root node gets a global start timestamp. If during comparison a file with younger timestamps is found in the ISO image, then it is suspected to have inconsistent content. If device numbers and inode numbers of the disk filesystems are persistent and if no irregular alterations of timestamps or system clock happen, then potential content changes can be detected without reading that content. File content change is assumed if any of mtime, ctime, device number or inode number have changed. Mode "ino_only" replaces the precondition that device numbers are stable by the precondition that mount points in the compared tree always lead to the same filesystems. Use this if mode "on" always sees all files changed. The speed advantage appears only if the loaded session was produced with -disk_dev_ino "on" too. Note that -disk_dev_ino "off" is totally in effect only if -hardlinks is "off", too. -file_name_limit [+]number Set the maximum permissible length for file names in the range of 64 to 255. Path components which are longer than the given number will get truncated and have their last 33 bytes overwritten by a colon ':' and the hex representation of the MD5 of the first 4095 bytes of the whole oversized name. Potential incomplete UTF-8 characters will get their leading bytes replaced by '_'. iso_rr_paths with the long components will still be able to access the file paths with truncated components. If -file_name_limit is executed while an ISO tree is present, the file names in the ISO tree get checked for existing truncated file names of the current limit and for name collisions between newly truncated files and existing files. In both cases, the setting will be refused with a SORRY event. One may lift this ban by prepending the character "+" to the argument of -file_name_limit. Truncated filenames may then get truncated again, invalidating their MD5 part. Colliding truncated names are made unique, consuming at least 9 more bytes of the remaining name part. If writing of xattr is enabled, then the length will be stored in "isofs.nt" of the root directory. If reading of xattr is enabled and "isofs.nt" is found, then the found length will get into effect if it is smaller than the current setting of -file_name_limit. File name patterns will only work if they match the truncated name. This might change in future. Files with truncated names get deleted and re-added unconditionally during -update and -update_r. This might change in future. Linux kernels up to at least 4.1 misrepresent names of length 254 and 255. If you expect such names in or under disk_paths and plan to mount the ISO by such Linux kernels, consider to set -file_name_limit 253. Else just avoid names longer than 253 characters. -rom_toc_scan "on"|"force"|"off"[:"emul_off"][:"emul_wide"] Read-only drives do not tell the actual media type but show any media as ROM (e.g. as DVD-ROM). The session history of MMC multi-session media might be truncated to first and last session or even be completely false. (The emulated history of overwritable media is not affected by this.) To have in case of failure a chance of getting the session history and especially the address of the last session, there is a scan for ISO 9660 filesystem headers which might help but also might yield worse results than the drive's table of content. At its end it can cause read attempts to invalid addresses and thus ugly drive behavior. Setting "on" enables that scan for alleged read-only media. Some operating systems are not able to mount the most recent session of multi-session DVD or BD. If on such a system 'xorriso' has no own MMC capabilities then it may still find that session from a scanned table of content. Setting "force" handles any media like a ROM medium with setting "on". On the other hand the emulation of session history on overwritable media can hamper reading of partly damaged media. Setting "off:emul_off" disables the elsewise trustworthy table-of-content scan for those media. The table-of-content scan on overwritable media normally searches only up to the end of the session that is pointed to by the superblock at block 0. Setting "on:emul_wide" lets the scan continue up to the end of the medium. This may be useful after copying a medium with -check_media patch_lba0=on when not the last session was loaded. -calm_drive "in"|"out"|"all"|"revoke"|"on"|"off" Reduce drive noise until it is actually used again. Some drives stay alert for substantial time after they have been used for reading. This reduces the startup time for the next drive operation but can be loud and waste energy if no i/o with the drive is expected to happen soon. Modes "in", "out", "all" immediately calm down -indev, -outdev, or both, respectively. Mode "revoke" immediately alerts both. Mode "on" causes -calm_drive to be performed automatically after each -dev, -indev, and -outdev. Mode "off" disables this. -ban_stdio_write Allow for writing only the usage of MMC optical drives. Disallow to write the result into files of nearly arbitrary type. Once set, this command cannot be revoked. -early_stdio_test "on"|"appendable_wo"|"off" If enabled by "on" then regular files and block devices get tested for effective access permissions. This implies to try opening those files for writing, which otherwise will happen only later and only if actual writing is desired. The test result is used for classifying the pseudo drives as overwritable, read-only, write-only, or uselessly empty. This may lead to earlier detection of severe problems, and may avoid some less severe error events. Mode "appendable_wo" is like "on" with the additional property that non-empty write-only files are regarded as appendable rather than blank. -data_cache_size number_of_tiles blocks_per_tile Set the size and granularity of the data cache which is used when ISO images are loaded and when file content is read from ISO images. The cache consists of several tiles, which each consists of several blocks. A larger cache reduces the need for tiles being read multiple times. Larger tiles might additionally improve the data throughput from the drive, but can be wasteful if the data are scattered over the medium. Larger cache sizes help best with image loading from MMC drives. They are an inferior alternative to -osirrox option "sort_lba_on". blocks_per_tile must be a power of 2. E.g. 16, 32, or 64. The overall cache size must not exceed 1 GiB. The default values can be restored by parameter "default" instead of one or both of the numbers. Currently the default is 32 tiles of 32 blocks = 2 MiB.  File: xorriso.info, Node: Insert, Next: SetInsert, Prev: Loading, Up: Commands 9.4 Inserting files into ISO image ================================== The following commands expect file addresses of two kinds: *disk_path* is a path to an object in the local filesystem tree. *iso_rr_path* is the Rock Ridge name of a file object in the ISO image. If no Rock Ridge information is recorded in the loaded ISO image, then you will see ISO 9660 names which are of limited length and character set. If no Rock Ridge information shall be stored in an emerging ISO image, then their names will get mapped to such restricted ISO 9660 (aka ECMA-119) names. Note that in the ISO image you are as powerful as the superuser. Access permissions of the existing files in the image do not apply to your write operations. They are intended to be in effect with the read-only mounted image. If the iso_rr_path of a newly inserted file leads to an existing file object in the ISO image, then the following collision handling happens: If both objects are directories then they get merged by recursively inserting the subobjects from filesystem into ISO image. If other file types collide then the setting of command *-overwrite* decides. Renaming of files has similar collision handling, but directories can only be replaced, not merged. Note that if the target directory exists, then -mv inserts the source objects into this directory rather than attempting to replace it. Command -move, on the other hand, would attempt to replace it. The commands in this section alter the ISO image and not the local filesystem. -disk_pattern "on"|"ls"|"off" Set the pattern expansion mode for the disk_path parameters of several commands which support this feature. Setting "off" disables this feature for all commands which are marked in this man page by "disk_path [***]" or "disk_pattern [***]". Setting "on" enables it for all those commands. Setting "ls" enables it only for those which are marked by "disk_pattern [***]". Default is "ls". -add pathspec [...] | disk_path [***] Insert the given files or directory trees from filesystem into the ISO image. If -pathspecs is set to "on" or "as_mkisofs" then pattern expansion is always disabled and character '=' has a special meaning. It separates the ISO image path from the disk path: iso_rr_path=disk_path Character '=' in the iso_rr_path must be escaped by '\' (i.e. as "\="). With -pathspecs "on", the character '\' must not be escaped. The character '=' in the disk_path must not be escaped. With -pathspecs "as_mkisofs", all characters '\' must be escaped in both, iso_rr_path and disk_path. The character '=' may or may not be escaped in the disk_path. If iso_rr_path does not begin with '/' then -cd is prepended. If disk_path does not begin with '/' then -cdx is prepended. If no '=' is given then the word is used as both, iso_rr_path and disk path. If in this case the word does not begin with '/' then -cdx is prepended to the disk_path and -cd is prepended to the iso_rr_path. If -pathspecs is set to "off" then -disk_pattern expansion applies, if enabled. The resulting words are used as both, iso_rr_path and disk path. Relative path words get prepended the setting of -cdx to disk_path and the setting of -cd to iso_rr_path. -add_plainly mode If set to mode "unknown" then any command word that does not begin with "-" and is not recognized as known command will be subject to a virtual -add command. I.e. it will be used as pathspec or as disk_path and added to the image. If enabled, -disk_pattern expansion applies to disk_paths. Mode "dashed" is similar to "unknown" but also adds unrecognized command words even if they begin with "-". Mode "any" announces that all further words are to be added as pathspecs or disk_paths. This does not work in dialog mode. Mode "none" is the default. It prevents any words from being understood as files to add, if they are not parameters to appropriate commands. -path_list disk_path Like -add but read the parameter words from file disk_path or standard input if disk_path is "-". The list must contain exactly one pathspec or disk_path pattern per line. -quoted_path_list disk_path Like -path_list but with quoted input reading rules. Lines get split into parameter words for -add. Whitespace outside quotes is discarded. -map disk_path iso_rr_path Insert file object disk_path into the ISO image as iso_rr_path. If disk_path is a directory then its whole sub tree is inserted into the ISO image. -map_single disk_path iso_rr_path Like -map, but if disk_path is a directory then its sub tree is not inserted. -map_l disk_prefix iso_rr_prefix disk_path [***] Perform -map with each of the disk_path parameters. iso_rr_path will be composed from disk_path by replacing disk_prefix by iso_rr_prefix. -update disk_path iso_rr_path Compare file object disk_path with file object iso_rr_path. If they do not match, then perform the necessary image manipulations to make iso_rr_path a matching copy of disk_path. By default this comparison will imply lengthy content reading before a decision is made. Commands -disk_dev_ino or -md5 may accelerate comparison if they were already in effect when the loaded session was recorded. If disk_path is a directory and iso_rr_path does not exist yet, then the whole subtree will be inserted. Else only directory attributes will be updated. -update_r disk_path iso_rr_path Like -update but working recursively. I.e. all file objects below both addresses get compared whether they have counterparts below the other address and whether both counterparts match. If there is a mismatch then the necessary update manipulation is done. Note that the comparison result may depend on command -follow. Its setting should always be the same as with the first adding of disk_path as iso_rr_path. If iso_rr_path does not exist yet, then it gets added. If disk_path does not exist, then iso_rr_path gets deleted. -update_l disk_prefix iso_rr_prefix disk_path [***] Perform -update_r with each of the disk_path parameters. iso_rr_path will be composed from disk_path by replacing disk_prefix by iso_rr_prefix. -update_li iso_rr_prefix disk_prefix iso_rr_path [***] Perform -update_r with each of the iso_rr_path parameters. disk_path will be composed from iso_rr_path by replacing iso_rr_prefix by disk_prefix. -update_lxi disk_prefix iso_rr_prefix disk_path [***] Perform -update_r with each of the disk_path parameters and with iso_rr_paths in the ISO filesystem which are derived from the disk_path parameters after exchanging disk_prefix by iso_rr_prefix. So, other than -update_l, this detects missing matches of disk_path and deletes the corresponding iso_rr_path. Note that relative disk_paths and disk_path patterns are interpreted as sub paths of the current disk working directory -cdx. The corresponding iso_rr_paths are derived by exchanging disk_prefix by iso_rr_prefix before pattern expansion happens. The current -cdi directory has no influence. -cut_out disk_path byte_offset byte_count iso_rr_path Map a byte interval of a regular disk file into a regular file in the ISO image. This may be necessary if the disk file is larger than a single medium, or if it exceeds the traditional limit of 2 GiB - 1 for old operating systems, or the limit of 4 GiB - 1 for newer ones. Only the newest Linux kernels seem to read properly files >= 4 GiB - 1. A clumsy remedy for this limit is to backup file pieces and to concatenate them at restore time. A well tested chopping size is 2047m. It is permissible to request a higher byte_count than available. The resulting file will be truncated to the correct size of a final piece. To request a byte_offset higher than available yields no file in the ISO image but a SORRY event. E.g: -cut_out /my/disk/file 0 2047m \ /file/part_1_of_3_at_0_with_2047m_of_5753194821 \ -cut_out /my/disk/file 2047m 2047m \ /file/part_2_of_3_at_2047m_with_2047m_of_5753194821 \ -cut_out /my/disk/file 4094m 2047m \ /file/part_3_of_3_at_4094m_with_2047m_of_5753194821 While command -split_size is set larger than 0, and if all pieces of a file reside in the same ISO directory with no other files, and if the names look like above, then their ISO directory will be recognized and handled like a regular file. This affects commands -compare*, -update*, and overwrite situations. See command -split_size for details. -cpr disk_path [***] iso_rr_path Insert the given files or directory trees from filesystem into the ISO image. The rules for generating the ISO addresses are similar as with shell command cp -r. Nevertheless, directories of the iso_rr_path are created if necessary. Especially a not yet existing iso_rr_path will be handled as directory if multiple disk_paths are present. The leafnames of the multiple disk_paths will be grafted under that directory as would be done with an existing directory. If a single disk_path is present then a non-existing iso_rr_path will get the same type as the disk_path. If a disk_path does not begin with '/' then -cdx is prepended. If the iso_rr_path does not begin with '/' then -cd is prepended. -mkdir iso_rr_path [...] Create empty directories if they do not exist yet. Existence as directory generates a WARNING event, existence as other file causes a FAILURE event. -lns target_text iso_rr_path Create a symbolic link with address iso_rr_path which points to target_text. iso_rr_path may not exist yet. Hint: Command -clone produces the ISO equivalent of a hard link. -clone iso_rr_path_original iso_rr_path_copy Create a copy of the ISO file object iso_rr_path_original with the new address iso_rr_path_copy. If the original is a directory then copy all files and directories underneath. If iso_rr_path_original is a boot catalog file, then it gets not copied but is silently ignored. The copied ISO file objects have the same attributes. Copied data files refer to the same content source as their originals. The copies may then be manipulated independendly of their originals. This command will refuse execution if the address iso_rr_path_copy already exists in the ISO tree. -cp_clone iso_rr_path_original [***] iso_rr_path_dest Create copies of one or more ISO file objects as with command -clone. In case of collision merge directories with existing ones, but do not overwrite existing ISO file objects. The rules for generating the copy addresses are the same as with command -cpr (see above) or shell command cp -r. Other than with -cpr, relative iso_rr_path_original will get prepended the -cd path and not the -cdx path. Consider to -mkdir iso_rr_path_dest before -cp_clone so the copy address does not depend on the number of iso_rr_path_original parameters.  File: xorriso.info, Node: SetInsert, Next: Manip, Prev: Insert, Up: Commands 9.5 Settings for file insertion =============================== -file_size_limit value [value [...]] -- Set the maximum permissible size for a single data file. The values get summed up for the actual limit. If the only value is "off" then the file size is not limited by 'xorriso'. Default is a limit of 100 extents, 4g -2k each: -file_size_limit 400g -200k -- When mounting ISO 9660 filesystems, old operating systems can handle only files up to 2g -1 --. Newer ones are good up to 4g -1 --. You need quite a new Linux kernel to read correctly the final bytes of a file >= 4g if its size is not aligned to 2048 byte blocks. 'xorriso''s own data read capabilities are not affected by operating system size limits. Such limits apply to mounting only. Nevertheless, the target filesystem of an -extract must be able to take the file size. -not_mgt code[:code[...]] Control the behavior of the exclusion lists. Exclusion processing happens before disk_paths get mapped to the ISO image and before disk files get compared with image files. The absolute disk path of the source is matched against the -not_paths list. The leafname of the disk path is matched against the patterns in the -not_leaf list. If a match is detected then the disk path will not be regarded as an existing file and not be added to the ISO image. Several codes are defined. The _on/_off settings persist until they are revoked by their_off/_on counterparts. "erase" empties the lists which were accumulated by -not_paths and -not_leaf. "reset" is like "erase" but also re-installs default behavior. "off" disables exclusion processing temporarily without invalidating the lists and settings. "on" re-enables exclusion processing. "param_off" applies exclusion processing only to paths below disk_path parameter of commands. I.e. explicitly given disk_paths are exempted from exclusion processing. "param_on" applies exclusion processing to command parameters as well as to files below such parameters. "subtree_off" with "param_on" excludes parameter paths only if they match a -not_paths item exactly. "subtree_on" additionally excludes parameter paths which lead to a file address below any -not_paths item. "ignore_off" treats excluded disk files as if they were missing. I.e. they get reported with -compare and deleted from the image with -update. "ignore_on" keeps excluded files out of -compare or -update activities. -not_paths disk_path [***] Add the given paths to the list of excluded absolute disk paths. If a given path is relative, then the current -cdx is prepended to form an absolute path. Pattern matching, if enabled, happens at definition time and not when exclusion checks are made. (Do not forget to end the list of disk_paths by "--") -not_leaf pattern Add a single shell parser style pattern to the list of exclusions for disk leafnames. These patterns are evaluated when the exclusion checks are made. -not_list disk_path Read lines from disk_path and use each of them either as -not_paths parameter, if they contain a / character, or as -not_leaf pattern. -quoted_not_list disk_path Like -not_list but with quoted input reading rules. Each word is handled as one parameter for -not_paths or -not_leaf. -follow occasion[:occasion[...]] Enable or disable resolution of symbolic links and mountpoints under disk_paths. This applies to actions -add, -du*x, -ls*x, -findx, -concat, and to -disk_pattern expansion. There are three kinds of follow decisison to be made: *link* is the hop from a symbolic link to its target file object for the purpose of reading. I.e. not for command -concat. If enabled then symbolic links are handled as their target file objects, else symbolic links are handled as themselves. *mount* is the hop from one filesystem to another subordinate filesystem. If enabled then mountpoint directories are handled as any other directory, else mountpoints are handled as empty directories if they are encountered in directory tree traversals. *concat* is the hop from a symbolic link to its target file object for the purpose of writing. I.e. for command -concat. This is a security risk ! Less general than above occasions: *pattern* is mount and link hopping, but only during -disk_pattern expansion. *param* is link hopping for parameter words (after eventual pattern expansion). If enabled then -ls*x will show the link targets rather than the links themselves. -du*x, -findx, and -add will process the link targets but not follow links in an eventual directory tree below the targets (unless "link" is enabled). Occasions can be combined in a colon separated list. All occasions mentioned in the list will then lead to a positive follow decision. *off* prevents any positive follow decision. Use it if no other occasion applies. Shortcuts: *default* is equivalent to "pattern:mount:limit=100". *on* always decides positive. Equivalent to "link:mount:concat". Not an occasion but an optional setting is: *limit=* which sets the maximum number of link hops. A link hop consists of a sequence of symbolic links and a final target of different type. Nevertheless those hops can loop. Example: $ ln -s .. uploop Link hopping has a built-in loop detection which stops hopping at the first repetition of a link target. Then the repeated link is handled as itself and not as its target. Regrettably one can construct link networks which cause exponential workload before their loops get detected. The number given with "limit=" can curb this workload at the risk of truncating an intentional sequence of link hops. -pathspecs "on"|"off"|"as_mkisofs" Control parameter interpretation with 'xorriso' actions -add and -path_list. Mode "as_mkisofs" enables pathspecs of the form *iso_rr_path=disk_path* like with program mkisofs -graft-points. All characters '\' must be escaped in both, iso_rr_path and disk_path. The character '=' must be escaped in the iso_rr_path and may or may not be escaped in the disk_path. This mode temporarily disables -disk_pattern expansion for command -add. Mode "on" does nearly the same. But '=' must only be escaped in the iso_rr_path and '\' must not be escaped at all. This has the disadvantage that one cannot express an iso_rr_path which ends by '\'. Mode "off" disables pathspecs of the form target=source and re-enables -disk_pattern expansion. -overwrite "on"|"nondir"|"off" Allow or disallow overwriting of existing files in the ISO image by files with the same name. With setting "off", name collisions with at least one non-directory file cause FAILURE events. Collisions of two directories lead to merging of their file lists. With setting "nondir", only directories are protected by such events, other existing file types get treated with -rm before the new file gets added. Setting "on" enables automatic -rm_r. I.e. a non-directory can replace an existing directory and all its subordinates. If restoring of files is enabled, then the overwrite rule applies to the target file objects on disk as well, but "on" is downgraded to "nondir". -split_size number["k"|"m"] Set the threshold for automatic splitting of regular files. Such splitting maps a large disk file onto a ISO directory with several part files in it. This is necessary if the size of the disk file exceeds -file_size_limit. Older operating systems can handle files in mounted ISO 9660 filesystems only if they are smaller than 2 GiB or in other cases 4 GiB. Default is 0 which will exclude files larger than -file_size_limit by a FAILURE event. A well tested -split_size is 2047m. Sizes above -file_size_limit are not permissible. While command -split_size is set larger than 0 such a directory with split file pieces will be recognized and handled like a regular file by commands -compare* , -update*, and in overwrite situations. There are -osirrox parameters "concat_split_on" and "concat_split_off" which control the handling when files get restored to disk. In order to be recognizable, the names of the part files have to describe the splitting by 5 numbers: part_number,total_parts,byte_offset,byte_count,disk_file_size which are embedded in the following text form: part_#_of_#_at_#_with_#_of_# Scaling characters like "m" or "k" are taken into respect. All digits are interpreted as decimal, even if leading zeros are present. E.g: /file/part_1_of_3_at_0_with_2047m_of_5753194821 No other files are allowed in the directory. All parts have to be present and their numbers have to be plausible. E.g. byte_count must be valid as -cut_out parameter and their contents may not overlap.  File: xorriso.info, Node: Manip, Next: CmdFind, Prev: SetInsert, Up: Commands 9.6 File manipulations ====================== The following commands manipulate files in the ISO image, regardless whether they stem from the loaded image or were newly inserted. -iso_rr_pattern "on"|"ls"|"off" Set the pattern expansion mode for the iso_rr_path parameters of several commands which support this feature. Setting "off" disables pattern expansion for all commands which are marked in this man page by "iso_rr_path [***]" or "iso_rr_pattern [***]". Setting "on" enables it for all those commands. Setting "ls" enables it only for those which are marked by "iso_rr_pattern [***]". Default is "on". -rm iso_rr_path [***] Delete the given files from the ISO image. Note: This does not free any space on the -indev medium, even if the deletion is committed to that same medium. The image size will shrink if the image is written to a different medium in modification mode. -rm_r iso_rr_path [***] Delete the given files or directory trees from the ISO image. See also the note with command -rm. -rmdir iso_rr_path [***] Delete empty directories. -move iso_rr_path iso_rr_path Rename the file given by the first (origin) iso_rr_path to the second (destination) iso_rr_path. Deviate from rules of shell command mv by not moving the origin file underneath an existing destination directory. The origin file will rather replace such a directory, if this is allowed by command -overwrite. -mv iso_rr_path [***] iso_rr_path Rename the given file objects in the ISO tree to the last parameter in the list. Use the same rules as with shell command mv. If pattern expansion is enabled and if the last parameter contains wildcard characters then it must match exactly one existing file address, or else the command fails with a FAILURE event. -chown uid iso_rr_path [***] Set ownership of file objects in the ISO image. uid may either be a decimal number or the name of a user known to the operating system. -chown_r uid iso_rr_path [***] Like -chown but affecting all files below eventual directories. -chgrp gid iso_rr_path [***] Set group attribute of file objects in the ISO image. gid may either be a decimal number or the name of a group known to the operating system. -chgrp_r gid iso_rr_path [***] Like -chgrp but affecting all files below eventual directories. -chmod mode iso_rr_path [***] Equivalent to shell command chmod in the ISO image. mode is either an octal number beginning with "0" or a comma separated list of statements of the form [ugoa]*[+-=][rwxst]* . Like: go-rwx,u+rwx . *Personalities*: u=user, g=group, o=others, a=all *Operators*: + adds given permissions, - revokes given permissions, = revokes all old permissions and then adds the given ones. *Permissions*: r=read, w=write, x=execute|inspect, s=setuid|setgid, t=sticky bit For octal numbers see man 2 stat. -chmod_r mode iso_rr_path [***] Like -chmod but affecting all files below eventual directories. -setfacl acl_text iso_rr_path [***] Attach the given ACL to the given iso_rr_paths. If the files already have ACLs, then those get deleted before the new ones get into effect. If acl_text is empty, or contains the text "clear" or the text "--remove-all", then the existing ACLs will be removed and no new ones will be attached. Any other content of acl_text will be interpreted as a list of ACL entries. It may be in the long multi-line format as put out by -getfacl but may also be abbreviated as follows: ACL entries are separated by comma or newline. If an entry is empty text or begins with "#" then it will be ignored. A valid entry has to begin by a letter out of {ugom} for "user", "group", "other", "mask". It has to contain two colons ":". A non-empty text between those ":" gives a user id or group id. After the second ":" there may be letters out of {rwx- #}. The first three give read, write, or execute permission. Letters "-", " " and TAB are ignored. "#" causes the rest of the entry to be ignored. Letter "X" or any other letters are not supported. Examples: g:toolies:rw,u:lisa:rw,u:1001:rw,u::wr,g::r,o::r,m::rw group:toolies:rw-,user::rw-,group::r--,other::r--,mask::rw- A valid entry may be prefixed by "d", some following characters and ":". This indicates that the entry goes to the "default" ACL rather than to the "access" ACL. Example: u::rwx,g::rx,o::,d:u::rwx,d:g::rx,d:o::,d:u:lisa:rwx,d:m::rwx -setfacl_r acl_text iso_rr_path [***] Like -setfacl but affecting all files below eventual directories. -setfacl_list disk_path Read the output of -getfacl_r or shell command getfacl -R and apply it to the iso_rr_paths as given in lines beginning with "# file:". This will change ownership, group and ACL of the given files. If disk_path is "-" then lines are read from standard input. Line "@" ends the list, "@@@" aborts without changing the pending iso_rr_path. Since -getfacl and getfacl -R strip leading "/" from file paths, the setting of -cd does always matter. -setfattr [-]name value iso_rr_path [***] Attach the given xattr pair of name and value to the given iso_rr_paths. If the given name is prefixed by "-", then the pair with that name gets removed from the xattr list. If name is "--remove-all" then all user namespace xattr of the given iso_rr_paths get deleted. In case of deletion, value must be an empty text. Which names are permissible depends on the setting of command -xattr. "on" or "user" restricts them to namespace "user". I.e. a name has to look like "user.x" or "user.whatever". -xattr setting "any" enables names from all namespaces except "isofs". Values and names undergo the normal input processing of 'xorriso'. See also command -backslash_codes. Other than with command -setfattr_list, the byte value 0 cannot be expressed via -setfattr. -setfattr_r [-]name value iso_rr_path [***] Like -setfattr but affecting all files below eventual directories. -setfattr_list disk_path Read the output format of -getfattr_r or shell command getfattr -Rd and apply it to the iso_rr_paths as given in lines beginning with "# file:". All previously existing xattr of the acceptable namespaces will be deleted before the new xattr get attached. The set of acceptable names depends on the setting of command -xattr. If disk_path is "-" then lines are read from standard input. Since -getfattr and getfattr -Rd strip leading "/" from file paths, the setting of -cd does always matter. Empty input lines and lines which begin by "#" will be ignored (except "# file:"). Line "@" ends the list, "@@@" aborts without changing the pending iso_rr_path. Other input lines must have the form name="value" The separator "=" is not allowed in names. Value may contain any kind of bytes. It must be in quotes. Trailing whitespace after the end quote will be ignored. Non-printables bytes and quotes must be represented as \XYZ by their octal 8-bit code XYZ. Use code \000 for 0-bytes. -alter_date type timestring iso_rr_path [***] Alter the date entries of files in the ISO image. type may be one of the following: "a" sets access time, updates ctime. "m" sets modification time, updates ctime. "b" sets access time and modification time, updates ctime. "a-c", "m-c", and "b-c" set the times without updating ctime. "c" sets the ctime. timestring may be in the following formats (see also section EXAMPLES): As expected by program date: MMDDhhmm[[CC]YY][.ss]] As produced by program date: [Day] MMM DD hh:mm:ss [TZON] YYYY Relative times counted from current clock time: +|-Number["s"|"h"|"d"|"w"|"m"|"y"] where "s" means seconds, "h" hours, "d" days, "w" weeks, "m"=30d, "y"=365.25d plus 1d added to multiplication result. Absolute seconds counted from Jan 1 1970: =Number 'xorriso''s own timestamps: YYYY.MM.DD[.hh[mm[ss]]] scdbackup timestamps: YYMMDD[.hhmm[ss]] where "A0" is year 2000, "B0" is 2010, etc. ECMA-119 volume timestamps: YYYYMMDDhhmmsscc These are normally given as GMT. The suffix "LOC" causes local timezone conversion. E.g. 2013010720574700, 2013010720574700LOC. The last two digits cc (centiseconds) will be ignored, but must be present in order to make the format recognizable. Example: -alter_date m-c 2013.11.27.103951 /file1 /file2 - This command does not persistently apply to the boot catalog, which gets fresh timestamps at -commit time. Command -volume_date "uuid" can set this time value. -alter_date_r type timestring iso_rr_path [***] Like -alter_date but affecting all files below eventual directories. -hide hide_state iso_rr_path [***] Prevent the names of the given files from showing up in the directory trees of ISO 9660 and/or Joliet and/or HFS+ when the image gets written. The data content of such hidden files will be included in the resulting image, even if they do not show up in any directory. But you will need own means to find nameless data in the image. Warning: Data which are hidden from the ISO 9660 tree will not be copied by the write method of modifying. Possible values of hide_state are: "iso_rr" for hiding from ISO 9660 tree, "joliet" for Joliet tree, "hfsplus" for HFS+, "on" for them all. "off" means visibility in all directory trees. These values may be combined. E.g.: joliet:hfsplus This command does not apply to the boot catalog. Rather use: -boot_image "any" "cat_hidden=on"  File: xorriso.info, Node: CmdFind, Next: Filter, Prev: Manip, Up: Commands 9.7 Tree traversal command -find ================================ -find iso_rr_path [test [op] [test ...]] [-exec action [params]] -- A restricted substitute for shell command find in the ISO image. It performs an action on matching file objects at or below iso_rr_path. If not used as last command in the line then the parameter list needs to get terminated by "--". Tests are optional. If they are omitted then action is applied to all file objects. If tests are given then they form together an expression. The action is applied only if the expression matches the file object. Default expression operator between tests is -and, i.e. the expression matches only if all its tests match. Available tests are: -name pattern : Matches if pattern matches the file leaf name. If the pattern does not contain any of the characters "*?[", then it will be truncated according to -file_name_limit and thus match the truncated name in the ISO filesystem. -wholename pattern : Matches if pattern matches the file path as it would be printed by action "echo". Character '/' can be matched by wildcards. If pattern pieces between '/' do not contain any of the characters "*?[", they will be truncated according to -file_name_limit. -disk_name pattern : Like -name but testing the leaf name of the file source on disk. Can match only data files which do not stem from the loaded image, or for directories above such data files. With directories the result can change between -find runs if their content stems from multiple sources. -disk_path disk_path : Matches if the given disk_path is equal to the path of the file source on disk. The same restrictions apply as with -disk_name. -type type_letter : Matches files of the given type: "block", "char", "dir", "pipe", "file", "link", "socket", "eltorito", and "Xotic" which matches what is not matched by the other types. Only the first letter is interpreted. E.g.: -find / -type d -maxdepth number : Matches only files which are at most at the given depth level relative to the iso_rr_path where -find starts. That path itself is at depth 0, its directory children are at 1, their directory children at 2, and so on. -mindepth number : Matches only files which are at least at the given depth level. -damaged : Matches files which use data blocks marked as damaged by a previous run of -check_media. The damage info vanishes when a new ISO image gets loaded. Note that a MD5 session mismatch marks all files of the session as damaged. If finer distinction is desired, perform -md5 off before -check_media. -pending_data : Matches files which get their content from outside the loaded ISO image. -lba_range start_lba block_count : Matches files which use data blocks within the range of start_lba and start_lba+block_count-1. -has_acl : Matches files which have a non-trivial ACL. -has_xattr : Matches files which have xattr name-value pairs from user namespace. -has_aaip : Matches files which have ACL or any xattr. -has_any_xattr : Matches files which have any xattr other than ACL. -has_md5 : Matches data files which have MD5 checksums. -has_hfs_crtp creator type : Matches files which have the given HFS+ creator and type attached. These are codes of 4 characters which get stored if -hfsplus is enabled. Use a single dash '-' as wildcard that matches any such code. E.g:. -has_hfs_crtp YYDN TEXT -has_hfs_crtp - - -has_hfs_bless blessing : Matches files which bear the given HFS+ blessing. It may be one of : "ppc_bootdir", "intel_bootfile", "show_folder", "os9_folder", "osx_folder", "any". See also action set_hfs_bless. -has_filter : Matches files which are filtered by -set_filter. -hidden hide_state : Matches files which are hidden in "iso_rr" tree, in "joliet" tree, in "hfsplus" tree, in all trees ("on"), or not hidden in any tree ("off"). Those which are hidden in some tree match -not -hidden "off". -bad_outname namespace : Matches files with names which change when converted forth and back between the local character set and one of the namespaces "rockridge", "joliet", "ecma119", "hfsplus". All applicable -compliance rules are taken into respect. Rule "omit_version" is always enabled, because else namespaces "joliet" and "ecma119" would cause changes with every non-directory name. Consider to also enable rules "no_force_dots" and "no_j_force_dots". The namespaces use different character sets and apply further restrictions to name length, permissible characters, and mandatory name components. "rockridge" uses the character set defined by -out_charset, "joliet" uses UCS-2BE, "ecma119" uses ASCII, "hfsplus" uses UTF-16BE. -name_limit_blocker length : Matches file names which would prevent command -file_name_limit with the given length. The command itself reports only the first problem file. -prune : If this test is reached and the tested file is a directory then -find will not dive into that directory. This test itself does always match. -use_pattern "on"|"off" : This pseudo test controls the interpretation of wildcards with tests -name, -wholename, and -disk_name. Default is "on". If interpretation is disabled by "off", then the parameters of -name, -wholename, and -disk_name have to match literally rather than as search pattern. This test itself does always match. -or_use_pattern "on"|"off" : Like -use_pattern, but automatically appending the test by -or rather than by -and. Further the test itself does never match. So a subsequent test -or will cause its other operand to be performed. -decision "yes"|"no" : If this test is reached then the evaluation ends immediately and action is performed if the decision is "yes" or "true". See operator -if. -true and -false : Always match or match not, respectively. Evaluation goes on. -sort_lba : Always match. This causes -find to perform its action in a sequence sorted by the ISO image block addresses of the files. It may improve throughput with actions which read data from optical drives. Action will always get the absolute path as parameter. Available operators are: -not : Matches if the next test or sub expression does not match. Several tests do this specifically: -undamaged, -lba_range with negative start_lba, -has_no_acl, -has_no_xattr, -has_no_aaip, -has_no_filter . -and : Matches if both neighboring tests or expressions match. -or : Matches if at least one of both neighboring tests or expressions matches. -sub ... -subend or ( ... ) : Enclose a sub expression which gets evaluated first before it is processed by neighboring operators. Normal precedence is: -not, -or , -and. -if ... -then ... -elseif ... -then ... -else ... -endif : Enclose one or more sub expressions. If the -if expression matches, then the -then expression is evaluated as the result of the whole expression up to -endif. Else the next -elseif expression is evaluated and if it matches, its -then expression. Finally in case of no match, the -else expression is evaluated. There may be more than one -elseif. Neither -else nor -elseif are mandatory. If -else is missing and would be hit, then the result is a non-match. -if-expressions are the main use case for above test -decision. Default action is *echo*, i.e. to print the address of the found file. Other actions are certain 'xorriso' commands which get performed on the found files. These commands may have specific parameters. See also their particular descriptions. chown and chown_r change the ownership and get the user id as parameter. E.g.: -exec chown thomas -- chgrp and chgrp_r change the group attribute and get the group id as parameter. E.g.: -exec chgrp_r staff -- chmod and chmod_r change access permissions and get a mode string as parameter. E.g.: -exec chmod a-w,a+r -- alter_date and alter_date_r change the timestamps. They get a type character and a timestring as parameters. E.g.: -exec alter_date "m" "Dec 30 19:34:12 2007" -- set_to_mtime sets the ctime and atime to the value found in mtime. lsdl prints file information like shell command ls -dl. compare performs command -compare with the found file address as iso_rr_path and the corresponding file address below its parameter disk_path_start. For this the iso_rr_path of the -find command gets replaced by the disk_path_start. E.g.: -find /thomas -exec compare /home/thomas -- update performs command -update with the found file address as iso_rr_path. The corresponding file address is determined like with above action "compare". update_merge is like update but does not delete the found file if it is missing on disk. It may be run several times and records with all visited files whether their counterpart on disk has already been seen by one of the update_merge runs. Finally, a -find run with action "rm_merge" may remove all files that saw no counterpart on disk. Up to the next "rm_merge" or "clear_merge" all newly inserted files will get marked as having a disk counterpart. rm removes the found iso_rr_path from the image if it is not a directory with files in it. I.e. this "rm" includes "rmdir". rm_r removes the found iso_rr_path from the image, including whole directory trees. rm_merge removes the found iso_rr_path if it was visited by one or more previous actions "update_merge" and saw no counterpart on disk in any of them. The marking from the update actions is removed in any case. clear_merge removes an eventual marking from action "update_merge". report_damage classifies files whether they hit a data block that is marked as damaged. The result is printed together with the address of the first damaged byte, the maximum span of damages, file size, and the path of the file. report_lba prints files which are associated to image data blocks. It tells the logical block address, the block number, the byte size, and the path of each file. There may be reported more than one line per file if the file has more than one section. In this case each line has a different extent number in column "xt". report_sections like report_lba but telling the byte sizes of the particular sections rather than the overall byte size of the file. getfacl prints access permissions in ACL text form to the result channel. setfacl attaches ACLs after removing existing ones. The new ACL is given in text form as defined with command -setfacl. E.g.: -exec setfacl u:lisa:rw,u::rw,g::r,o::-,m::rw -- getfattr prints xattr name-value pairs to the result channel. The choice of namespaces depends on the setting of command -xattr: "on" or "user" restricts it to the namespace "user", "any" only omits namespace "isofs". get_any_xattr prints xattr name-value pairs from any namespace except ACL to the result channel. This is mostly for debugging of namespace "isofs". list_extattr mode prints a script to the result channel, which would use FreeBSD command setextattr to set the file's xattr name-value pairs of user namespace. Parameter mode controls the form of the output of names and values. Default mode "e" prints harmless characters in shell quotation marks, but represents texts with octal 001 to 037 and 0177 to 0377 by an embedded echo -e command. Mode "q" prints any characters in shell quotation marks. This might not be terminal-safe but should work in script files. Mode "r" uses no quotation marks. Not safe. Mode "b" prints backslash encoding. Not suitable for shell parsing. E.g. -exec list_extattr e - Command -backslash_codes does not affect the output. get_md5 prints the MD5 sum, if recorded, together with file path. check_md5 compares the MD5 sum, if recorded, with the file content and reports if mismatch. E.g.: -find / -not -pending_data -exec check_md5 FAILURE -- make_md5 equips a data file with an MD5 sum of its content. Useful to upgrade the files in the loaded image to full MD5 coverage by the next commit with -md5 "on". E.g.: -find / -type f -not -has_md5 -exec make_md5 -- setfattr sets or deletes xattr name value pairs. E.g.: -find / -has_xattr -exec setfattr --remove-all " -- set_hfs_crtp adds, changes, or removes HFS+ creator and type attributes. E.g.: -exec set_hfs_crtp YYDN TEXT E.g.: -find /my/dir -prune -exec set_hfs_crtp -delete - get_hfs_crtp prints the HFS+ creator and type attributes together with the iso_rr_path, if the file has such attributes at all. E.g.: -exec get_hfs_crtp set_hfs_bless applies or removes HFS+ blessings. They are roles which can be attributed to up to four directories and a data file: "ppc_bootdir", "intel_bootfile", "show_folder", "os9_folder", "osx_folder". They may be abbreviated as "p", "i", "s", "9", and "x". Each such role can be attributed to at most one file object. "intel_bootfile" is the one that would apply to a data file. All others apply to directories. The -find run will end as soon as the first blessing is issued. The previous bearer of the blessing will lose it then. No file object can bear more than one blessing. E.g.: -find /my/blessed/directory -exec set_hfs_bless p Further there is blessing "none" or "n" which revokes any blessing from the found files. This -find run will not stop when the first match is reached. E.g.: -find / -has_hfs_bless any -exec set_hfs_bless none get_hfs_bless prints the HFS+ blessing role and the iso_rr_path, if the file is blessed at all. E.g.: -exec get_hfs_bless set_filter applies or removes filters. E.g.: -exec set_filter --zisofs -- mkisofs_r applies the rules of mkisofs -r to the file object: user id and group id become 0, all r-permissions get granted, all w denied. If there is any x-permission, then all three x get granted. s- and t-bits get removed. sort_weight attributes a LBA weight number to regular files. The number may range from -2147483648 to 2147483647. The higher it is, the lower will be the block address of the file data in the emerging ISO image. Currently the boot catalog has a hardcoded weight of 1 billion. Normally it should occupy the block with the lowest possible address. Data files which are loaded by -indev or -dev get a weight between 1 and 2 exp 28 = 268,435,456, depending on their block address. This shall keep them roughly in the same order if the write method of modifying is applied. Data files which are added by other commands get an initial weight of 0. Boot image files have a default weight of 2. E.g.: -exec sort_weight 3 -- show_stream shows the content stream chain of a data file. show_stream_id is like show_stream, but also prints between stream type and first ":" in square brackets libisofs id numbers: [fs_id,dev_id,ino_id]. hide brings the file into one of the hide states "on", "iso_rr", "joliet", "hfsplus", "off". They may be combined. E.g.: joliet:hfsplus E.g.: -find / -disk_name *_secret -exec hide on print_outname prints in the first line the filename as registered by the program model, and in the second line the filename after conversion forth and back between local character set and one of the namespaces "rockridge", "joliet", "ecma119", or "hfsplus". The third output line is "-" . The name conversion does not take into respect the possibility of name collisions in the target namespace. Such collisions are most likely in "joliet" and "ecma119", where they get resolved by automatic file name changes. E.g.: -find / -bad_outname joliet -exec print_outname joliet estimate_size prints a lower and an upper estimation of the number of blocks which the found files together will occupy in the emerging ISO image. This does not account for the superblock, for the directories in the -find path, or for image padding. find performs another run of -find on the matching file address. It accepts the same params as -find, except iso_rr_path. E.g.: -find / -name '???' -type d -exec find -name '[abc]*' -exec chmod a-w,a+r --  File: xorriso.info, Node: Filter, Next: Writing, Prev: CmdFind, Up: Commands 9.8 Filters for data file content ================================= *Filters* may be installed between data files in the ISO image and their content source outside the image. They may also be used vice versa between data content in the image and target files on disk. Built-in filters are "--zisofs" and "--zisofs-decode". The former is to be applied via -set_filter, the latter is automatically applied if zisofs compressed content is detected with a file when loading the ISO image. Another built-in filter pair is "--gzip" and "--gunzip" with suffix ".gz". They behave about like external gzip and gunzip but avoid forking a process for each single file. So they are much faster if there are many small files. -external_filter name option[:option] program_path [arguments] -- Register a content filter by associating a name with a program path, program arguments, and some behavioral options. Once registered it can be applied to multiple data files in the ISO image, regardless whether their content resides in the loaded ISO image or in the local filesystem. External filter processes may produce synthetic file content by reading the original content from stdin and writing to stdout whatever they want. They must deliver the same output on the same input in repeated runs. Options are: "default" means that no other option is intended. "suffix=..." sets a file name suffix. If it is not empty then it will be appended to the file name or removed from it. "remove_suffix" will remove a file name suffix rather than appending it. "if_nonempty" will leave 0-sized files unfiltered. "if_reduction" will try filtering and revoke it if the content size does not shrink. "if_block_reduction" will revoke if the number of 2 kB blocks does not shrink. "used=..." is ignored. Command -status shows it with the number of files which currently have the filter applied. Examples: -external_filter bzip2 suffix=.bz2:if_block_reduction \ /usr/bin/bzip2 -- -external_filter bunzip2 suffix=.bz2:remove_suffix \ /usr/bin/bunzip2 -- -unregister_filter name Remove an -external_filter registration. This is only possible if the filter is not applied to any file in the ISO image. -close_filter_list Irrevocably ban commands -concat "pipe", -external_filter, and -unregister_filter, but not -set_filter. Use this to prevent external filtering in general or when all intended filters are registered and -concat mode "pipe" shall be disallowed. External filters may also be banned totally at compile time of 'xorriso'. By default they are banned if 'xorriso' runs under setuid permission. -set_filter name iso_rr_path [***] Apply an -external_filter or a built-in filter to the given data files in the ISO image. If the filter suffix is not empty , then it will be applied to the file name. Renaming only happens if the filter really gets attached and is not revoked by its options. By default files which already bear the suffix will not get filtered. The others will get the suffix appended to their names. If the filter has option "remove_suffix", then the filter will only be applied if the suffix is present and can be removed. Name oversize or collision caused by suffix change will prevent filtering. With most filter types this command will immediately run the filter once for each file in order to determine the output size. Content reading operations like -extract , -compare and image generation will perform further filter runs and deliver filtered content. At image generation time the filter output must still be the same as the output from the first run. Filtering for image generation does not happen with files from the loaded ISO image if the write method of growing is in effect (i.e -indev and -outdev are identical). The reserved filter name "--remove-all-filters" revokes filtering. This will revoke suffix renamings as well. Use "--remove-all-filters+" to prevent any suffix renaming. Attaching or detaching filters will not alter the state of -changes_pending. If the filter manipulations shall be the only changes in a write run, then explicitly execute -changes_pending "yes". -set_filter_r name iso_rr_path [***] Like -set_filter but affecting all data files below eventual directories.  File: xorriso.info, Node: Writing, Next: SetWrite, Prev: Filter, Up: Commands 9.9 Writing the result, drive control ===================================== (see also paragraph about settings below) -rollback Discard the manipulated ISO image and reload it from -indev. (Use -rollback_end if immediate program end is desired.) -changes_pending "no"|"yes"|"mkisofs_printed"|"show_status" Write runs are performed only if a change of the image has been made since the image was loaded or created blank. Vice versa the program will start a write run for pending changes when it ends normally (i.e. not by abort and not by command -rollback_end). The command -changes_pending can be used to override the automatically determined state. This is mainly useful for setting state "yes" despite no real changes were made. The sequence -changes_pending "no" -end is equivalent to the command -rollback_end. State "mkisofs_printed" is caused by emulation command -as mkisofs if option -print-size is present. The pseudo-state "show_status" can be used to print the current state to result channel. Image loading or manipulations which happen after this command will again update automatically the change status of the image. -commit Perform the write operation. Afterwards, if -outdev is readable, make it the new -dev and load the image from there. Switch to growing mode. (A subsequent -outdev will activate modification mode or blind growing.) -commit is performed automatically at end of program if there are uncommitted manipulations pending. So, to perform a final write operation with no new -dev and no new loading of image, rather execute command -end. If you want to go on without image loading, execute -commit_eject "none". To eject after write without image loading, use -commit_eject "all". To suppress a final write, execute -rollback_end. Writing can last quite a while. It is not unnormal with several types of media that there is no progress visible for the first few minutes or that the drive gnaws on the medium for a few minutes after all data have been transmitted. 'xorriso' and the drives are in a client-server relationship. The drives have much freedom about what to do with the media. Some combinations of drives and media simply do not work, despite the promises by their vendors. If writing fails then try other media or another drive. The reason for such failure is hardly ever in the code of the various burn programs but you may well try some of those listed below under SEE ALSO. -eject "in"|"out"|"all" Eject the medium in -indev, -outdev, or both drives, respectively. Note: It is not possible yet to effectively eject disk files. -commit_eject "in"|"out"|"all"|"none" Combined -commit and -eject. When writing has finished do not make -outdev the new -dev, and load no ISO image. Rather eject -indev and/or -outdev. Give up any non-ejected drive. -blank mode Make media ready for writing from scratch (if not -dummy is activated). This affects only the -outdev not the -indev. If both drives are the same and if the ISO image was altered then this command leads to a FAILURE event. Defined modes are: as_needed, fast, all, deformat, deformat_quickest "as_needed" cares for used CD-RW, DVD-RW and for used overwritable media by applying -blank "fast". It applies -format "full" to yet unformatted DVD-RAM and BD-RE. Other media in blank state are gracefully ignored. Media which cannot be made ready for writing from scratch cause a FAILURE event. "fast" makes CD-RW and unformatted DVD-RW re-usable, or invalidates overwritable ISO images. "all" might work more thoroughly and need more time. "deformat" converts overwritable DVD-RW into unformatted ones. "deformat_quickest" is a faster way to deformat or blank DVD-RW but produces media which are only suitable for a single session. Some drives announce this state by not offering feature 21h, but some drives offer it anyway. If feature 21h is missing, then 'xorriso' will refuse to write on DVD-RW if not command -close is set to "on". The progress reports issued by some drives while blanking are quite unrealistic. Do not conclude success or failure from the reported percentages. Blanking was successful if no SORRY event or worse occurred. Mode may be prepended by "force:" in order to override the evaluation of the medium state by libburn. E.g. "force:fast". Blanking will nevertheless only succeed if the drive is willing to do it. -format mode Convert unformatted DVD-RW into overwritable ones, "de-ice" DVD+RW, format newly purchased BD-RE or BD-R, re-format DVD-RAM or BD-RE. Defined modes are: as_needed, full, fast, by_index_, fast_by_index_, by_size_, fast_by_size_, without_spare "as_needed" formats yet unformatted DVD-RW, DVD-RAM, BD-RE, or blank unformatted BD-R. Other media are left untouched. "full" (re-)formats DVD-RW, DVD+RW, DVD-RAM, BD-RE, or blank unformatted BD-R. "fast" does the same as "full" but tries to be quicker. "by_index_" selects a format out of the descriptor list issued by command -list_formats. The index number from that list is to be appended to the mode word. E.g: "by_index_3". "fast_by_index_" does the same as "by_index_" but tries to be quicker. "by_size_" selects a format out of the descriptor list which provides at least the given size. That size is to be appended to the mode word. E.g: "by_size_4100m". This applies to media with Defect Management. On BD-RE it will not choose format 0x31, which offers no Defect Management. "fast_by_size_" does the same as "by_size_" but tries to be quicker. "without_spare" selects the largest format out of the descriptor list which provides no Spare Area for Defect Management. On BD-RE this will be format 0x31. The formatting action has no effect on media if -dummy is activated. Formatting is normally needed only once during the lifetime of a medium, if ever. But it is a reason for re-formatting if: DVD-RW was deformatted by -blank, DVD+RW has read failures (re-format before next write), DVD-RAM or BD-RE shall change their amount of defect reserve. BD-R may be written unformatted or may be formatted before first use. Formatting activates Defect Management which tries to catch and repair bad spots on media during the write process at the expense of half speed even with flawless media. The progress reports issued by some drives while formatting are quite unrealistic. Do not conclude success or failure from the reported percentages. Formatting was successful if no SORRY event or worse occurred. Be patient with apparently frozen progress. -list_formats Put out a list of format descriptors as reported by the output drive for the current medium. The list gives the index number after "Format idx", a MMC format code, the announced size in blocks (like "2236704s") and the same size in MiB. MMC format codes are manifold. Most important are: "00h" general formatting, "01h" increases reserve space for DVD-RAM, "26h" for DVD+RW, "30h" for BD-RE with reserve space, "31h" for BD-RE without reserve space, "32h" for BD-R. Smaller format size with DVD-RAM, BD-RE, or BD-R means more reserve space. -list_speeds Put out a list of speed values as reported by the drives with the loaded media. The list tells read speeds of the input drive and of the output drive. Further it tells write speeds of the output drive. The list of write speeds does not necessarily mean that the medium is writable or that these speeds are actually achievable. Especially the lists reported with empty drive or with ROM media obviously advertise speeds for other media. It is not mandatory to use speed values out of the listed range. The drive is supposed to choose a safe speed that is as near to the desired speed as possible. At the end of the list, "Write speed L" and "Write speed H" are the best guesses for lower and upper write speed limit. "Write speed l" and "Write speed h" may appear only with CD and eventually override the list of other speed offers. Only if the drive reports contradicting speed information there will appear "Write speed 0", which tells the outcome of speed selection by command -speed 0, if it deviates from "Write speed H". "Read speed L" and "Read speed H" tell the minimum and maximum read speeds, as reported by the drive. They would be chosen by -read_speed "min" or "max" if they undercut or surpass the built-in limits. These are "1x", "52xCD", "24xDVD", "20xBD". -list_profiles "in"|"out"|"all" Put out a list of media types supported by -indev, -outdev, or both, respectively. The currently recognized type is marked by text "(current)". -truncate_overwritable entity id adjust On overwritable medium copy the volume descriptors of an existing session to the overall descriptors at LBA 0 ff. This makes all sessions *inaccessible* which are younger than the activated one. A reason to do this would be read errors in the younger sessions and the wish to re-write or skip them. This operation is only allowed if no changes to the loaded filesystem are pending. If an -indev is acquired then it is released before the write operation begins and re-acquired only in case of success. The parameters "entity" and "id" have the same meaning as with command -load. They choose the existing ISO session which shall become the youngest accessible session. Available entity names are "session", "track", "lba", "sbsector", "volid". "auto" makes few sense. id is a number or search text as appropriate for the given entity. Parameter "adjust" controls the claimed size of the activated session. Text "new" means the size of the newly activated session as it was before this command. I.e. the space of the then inaccessible younger sessions will be re-used when appending more sessions. "old" means the size up to the end of the previously youngest session. I.e. "old" will not free the space of the then inaccessible younger sessions for re-use. A number preceded by "+" gives the number of bytes to be added to "new". A number without "+" gives the overall number of bytes. In any case the result may not be smaller than "new". Numbers may have a unit suffix: "d"=512, "k"=1024, "s"=2048, "m"=1024k, "g"=1024m. Examples: Activate session 4 and enable overwriting of the blocks of younger sessions: -truncate_overwritable session 4 new Activate session 4 and claim the blocks of younger sessions as useless part of session 4: -truncate_overwritable session 4 old Let session 4 claim additional 500 MiB as useless data: -truncate_overwritable session 4 +500m -close_damaged "as_needed"|"force" Try to close the upcoming track and session if the drive reported the medium as damaged. This may apply to CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, DVD+R DL, or BD-R media. It is indicated by warning messages when the drive gets acquired, and by a remark "but next track is damaged" with the line "Media status :" of command -toc. The setting of command -close determines whether the medium stays appendable. Mode "as_needed" gracefully refuses on media which are not reported as damaged. Mode "force" attempts the close operation even with media which appear undamaged. No image changes are allowed to be pending before this command is performed. After closing was attempted, both drives are given up.  File: xorriso.info, Node: SetWrite, Next: Bootable, Prev: Writing, Up: Commands 9.10 Settings for result writing ================================ Rock Ridge info will be generated by default. ACLs will be written according to the setting of command -acl. -joliet "on"|"off" If enabled by "on", generate Joliet tree additional to ISO 9660 + Rock Ridge tree. -hfsplus "on"|"off" If enabled by "on", generate a HFS+ filesystem inside the ISO 9660 image and mark it by Apple Partition Map (APM) entries in the System Area, the first 32 KiB of the image. This may collide with data submitted by -boot_image system_area=. The first 8 bytes of the System Area get overwritten by { 0x45, 0x52, 0x08 0x00, 0xeb, 0x02, 0xff, 0xff } which can be executed as x86 machine code without negative effects. So if an MBR gets combined with this feature, then its first 8 bytes should contain no essential commands. The next blocks of 2 KiB in the System Area will be occupied by APM entries. The first one covers the part of the ISO image before the HFS+ filesystem metadata. The second one marks the range from HFS+ metadata to the end of file content data. If more ISO image data follow, then a third partition entry gets produced. Other features of xorriso might cause the need for more APM entries. The HFS+ filesystem is not suitable for add-on sessions produced by the multi-session method of growing. An existing ISO image may nevertheless be the base for a new image produced by the method of modifying. If -hfsplus is enabled when -indev or -dev gets executed, then AAIP attributes get loaded from the input image and checked for information about HFS creator, filetype, or blessing. If found, then they get enabled as settings for the next image production. Therefore it is advisable to perform -hfsplus "on" before -indev or -dev. Information about HFS creator, type, and blessings gets stored by xorriso if -hfsplus is enabled at -commit time. It is stored as copy outside the HFS+ partition, but rather along with the Rock Ridge information. xorriso does not read any information from the HFS+ meta data. Be aware that HFS+ is case-insensitive although it can record file names with upper-case and lower-case letters. Therefore, file names from the iso_rr name tree may collide in the HFS+ name tree. In this case they get changed by adding underscore characters and counting numbers. In case of very long names, it might be necessary to map them to "MANGLED_...". WARNING: The HFS+ implementation in libisofs has a limit of 125,829,120 bytes for the size of the overall directory tree. This suffices for about 300,000 files of normal name length. If the limit gets exceeded, a FAILURE event will be issued and the ISO production will not happen. -rockridge "on"|"off" Mode "off" disables production of Rock Ridge information for the ISO 9660 file objects. The multi-session capabilities of xorriso depend much on the naming fidelity of Rock Ridge. So it is strongly discouraged to deviate from default setting "on". -compliance rule[:rule...] Adjust the compliance to specifications of ISO 9660/ECMA-119 and its contemporary extensions. In some cases it is worth to deviate a bit in order to circumvent bugs of the intended reader system or to get unofficial extra features. There are several adjustable rules which have a keyword each. If they are mentioned with this command then their rule gets added to the relaxation list. This list can be erased by rules "strict" or "clear". It can be reset to its start setting by "default". All of the following relaxation rules can be revoked individually by appending "_off". Like "deep_paths_off". Rule keywords are: "iso_9660_level="number chooses level 1 with ECMA-119 names of the form 8.3 and -file_size_limit <= 4g - 1, or level 2 with ECMA-119 names up to length 32 and the same -file_size_limit, or level 3 with ECMA-119 names up to length 32 and -file_size_limit >= 400g -200k. If necessary -file_size_limit gets adjusted. "allow_dir_id_ext" allows ECMA-119 names of directories to have a name extension as with other file types. It does not force dots and it omits the version number, though. This is a bad tradition of mkisofs which violates ECMA-119. Especially ISO level 1 only allows 8 characters in a directory name and not 8.3. "omit_version" does not add versions (";1") to ECMA-119 and Joliet file names. "only_iso_version" does not add versions (";1") to Joliet file names. "deep_paths" allows ECMA-119 file paths deeper than 8 levels. "long_paths" allows ECMA-119 file paths longer than 255 characters. "long_names" allows up to 37 characters with ECMA-119 file names. "no_force_dots" does not add a dot to ECMA-119 file names which have none. "no_j_force_dots" does not add a dot to Joliet file names which have none. "lowercase" allows lowercase characters in ECMA-119 file names. "7bit_ascii" allows nearly all 7-bit characters in ECMA-119 file names. Not allowed are 0x0 and '/'. If not "lowercase" is enabled, then lowercase letters get converted to uppercase. "full_ascii" allows all 8-bit characters except 0x0 and '/' in ECMA-119 file names. "untranslated_names" might be dangerous for inadverted reader programs which rely on the restriction to at most 37 characters in ECMA-119 file names. This rule allows ECMA-119 file names up to 96 characters with no character conversion. If a file name has more characters, then image production will fail deliberately. "untranslated_name_len="number enables untranslated_names with a smaller limit for the length of file names. 0 disables this feature, -1 chooses maximum length limit, numbers larger than 0 give the desired length limit. "joliet_long_names" allows Joliet leaf names up to 103 characters rather than 64. "joliet_long_paths" allows Joliet paths longer than 240 characters. "joliet_utf16" encodes Joliet names in UTF-16BE rather than UCS-2. The difference is with characters which are not present in UCS-2 and get encoded in UTF-16 by 2 words of 16 bit each. Both words then stem from a reserved subset of UCS-2. "always_gmt" stores timestamps in GMT representation with timezone 0. "rec_mtime" records with non-RockRidge directory entries the disk file's mtime and not the creation time of the image. This applies to the ECMA-119 tree (plain ISO 9660), to Joliet, and to ISO 9660:1999. "rec_time" is default. If disabled, it gets automatically re-enabled by -as mkisofs emulation when a pathspec is encountered. "new_rr" uses Rock Ridge version 1.12 (suitable for GNU/Linux but not for older FreeBSD or for Solaris). This implies "aaip_susp_1_10_off" which may be changed by subsequent "aaip_susp_1_10". Default is "old_rr" which uses Rock Ridge version 1.10. This implies also "aaip_susp_1_10" which may be changed by subsequent "aaip_susp_1_10_off". "aaip_susp_1_10" allows AAIP to be written as unofficial extension of RRIP rather than as official extension under SUSP-1.12. "no_emul_toc" saves 64 kB with the first session on overwritable media but makes the image incapable of displaying its session history. "iso_9660_1999" causes the production of an additional directory tree compliant to ISO 9660:1999. It can record long filenames for readers which do not understand Rock Ridge. "old_empty" uses the old way of of giving block addresses in the range of [0,31] to files with no own data content. The new way is to have a dedicated block to which all such files will point. Default setting is "clear:only_iso_version:deep_paths:long_paths:no_j_force_dots: always_gmt:old_rr". Note: The term "ECMA-119 name" means the plain ISO 9660 names and attributes which get visible if the reader ignores Rock Ridge. -rr_reloc_dir name Specify the name of the relocation directory in which deep directory subtrees shall be placed if -compliance is set to "deep_paths_off" or "long_paths_off". A deep directory is one that has a chain of 8 parent directories (including root) above itself, or one that contains a file with an ECMA-119 path of more than 255 characters. The overall directory tree will appear originally deep when interpreted as Rock Ridge tree. It will appear as re-arranged if only ECMA-119 information is considered. The default relocation directory is the root directory. By giving a non-empty name with -rr_reloc_dir, a directory in the root directory may get this role. If that directory does not already exist at -commit time, then it will get created and marked for Rock Ridge as relocation artefact. At least on GNU/Linux it will not be displayed in mounted Rock Ridge images. The name must not contain a '/' character and must not be longer than 255 bytes. -volid text Specify the volume ID, which most operating systems will consider to be the volume name of the image or medium. 'xorriso' accepts any text up to 32 characters, but according to rarely obeyed specs stricter rules apply: ECMA-119 demands ASCII characters out of [A-Z0-9_]. Like: "IMAGE_23" Joliet allows 16 UCS-2 characters. Like: "Windows name" Be aware that the volume id might get used automatically as the name of the mount point when the medium is inserted into a playful computer system. If an ISO image gets loaded while the volume ID is set to default "ISOIMAGE" or to "", then the volume ID of the loaded image will become the effective volume id for the next write run. But as soon as command -volid is performed afterwards, this pending ID is overridden by the new setting. Consider this when setting -volid "ISOIMAGE" before executing -dev, -indev, or -rollback. If you insist in -volid "ISOIMAGE", set it again after those commands. -volset_id text Set the volume set ID string to be written with the next -commit. Permissible are up to 128 characters. This setting gets overridden by image loading. -publisher text Set the publisher ID string to be written with the next -commit. This may identify the person or organisation who specified what shall be recorded. Permissible are up to 128 characters. This setting gets overridden by image loading. -application_id text Set the application ID string to be written with the next -commit. This may identify the specification of how the data are recorded. Permissible are up to 128 characters. This setting gets overridden by image loading. The special text "@xorriso@" gets converted to the ID string of 'xorriso' which is normally written as -preparer_id. It is a wrong tradition to write the program ID as -application_id. -system_id text Set the system ID string to be written with the next -commit. This may identify the system which can recognize and act upon the content of the System Area in image blocks 0 to 15. Permissible are up to 32 characters. This setting gets overridden by image loading. -volume_date type timestring Set one of the four overall timestamps for subsequent image writing. Available types are: "c" time when the volume was created. "m" time when volume was last modified. "x" time when the information in the volume expires. "f" time since when the volume is effectively valid. "all_file_dates" sets mtime, atime, and ctime of all files and directories to the given time. If the timestring is "set_to_mtime", then the atime and ctime of each file and directory get set to the value found in their mtime. These actions stay delayed until actual ISO production begins. Up to then they can be revoked by "all_file_dates" with empty timestring or timestring "default". The timestamps of the El Torito boot catalog file get refreshed when the ISO is produced. They can be influenced by "uuid". "uuid" sets a timestring that overrides "c" and "m" times literally and sets the time of the El Torito boot catalog. It must consist of 16 decimal digits which form YYYYMMDDhhmmsscc, with YYYY between 1970 and 2999. Time zone is GMT. It is supposed to match this GRUB line: search --fs-uuid --set YYYY-MM-DD-hh-mm-ss-cc E.g. 2010040711405800 is 7 Apr 2010 11:40:58 (+0 centiseconds). Timestrings for the other types may be given as with command -alter_date. Some of them are prone to timezone computations. The timestrings "default" or "overridden" cause default settings: "c" and "m" will show the current time of image creation. "x" and "f" will be marked as insignificant. "uuid" will be deactivated. At -commit time, some timestamps get set to the maximum value of effectively written volume creation and modification time: El Torito boot catalog, HFS+ superblock, ECMA-119 file modification time if -compliance "no_rec_mtime". The isohybrid MBR id is computed from "uuid" if given, else from the effective volume modification date. -copyright_file text Set the copyright file name to be written with the next -commit. This should be the ISO 9660 path of a file in the image which contains a copyright statement. Permissible are up to 37 characters. This setting gets overridden by image loading. -abstract_file text Set the abstract file name to be written with the next -commit. This should be the ISO 9660 path of a file in the image which contains an abstract statement about the image content. Permissible are up to 37 characters. This setting gets overridden by image loading. -biblio_file text Set the biblio file name to be written with the next -commit. This should be the ISO 9660 path of a file in the image which contains bibliographic records. Permissible are up to 37 characters. This setting gets overridden by image loading. -preparer_id text Set the preparer ID string to be written with the next -commit. This may identify the person or other entity which controls the preparation of the data which shall be recorded. Normally this should be the ID of 'xorriso' and not of the person or program which operates 'xorriso'. Please avoid to change it. Permissible are up to 128 characters. The special text "@xorriso@" gets converted to the ID string of 'xorriso' which is default at program startup. Unlike other ID strings, this setting is not influenced by image loading. -application_use character|0xXY|disk_path Specify the content of the Application Use field which can take at most 512 bytes. If the parameter of this command is empty, then the field is filled with 512 0-bytes. If it is a single character, then it gets repeated 512 times. If it begins by "0x" followed by two hex digits [0-9a-fA-F], then the digits are read as byte value which gets repeated 512 times. Any other parameter text is used as disk_path to open a data file and to read up to 512 bytes from it. If the file is smaller than 512 bytes, then the remaining bytes in the field get set to binary 0. This setting is not influenced by image loading. -out_charset character_set_name Set the character set to which file names get converted when writing an image. See paragraph "Character sets" for more explanations. When loading the written image after -commit the setting of -out_charset will be copied to -in_charset. -uid uid User id to be used for all files when the new ISO tree gets written to media. -gid gid Group id to be used for all files when the new ISO tree gets written to media. -zisofs parameter[:parameters] Set global parameters for zisofs compression. This data format is recognized and transparently uncompressed by some Linux kernels. It is to be applied via command -set_filter with built-in filter "--zisofs". Note: This command is only permitted while no -zisofs filters are applied to any files. Parameters are: "level="[0-9] zlib compression: 0=none, 1=fast,..., 9=slow "block_size="32k|64k|128k sets the size of version 1 compression blocks. "by_magic=on" enables an expensive test at image generation time which checks files from disk whether they already are zisofs compressed, e.g. by program mkzftree. "by_magic=v2" enables processing of already zisofs2 compressed files additionally to those of zisofs version 1. "by_magic=off" disables both. "version_2="off|as_needed|on controls compression by experimental version zisofs2 which can encode files of size 4 GiB or larger. The Linux kernel (as of 5.9) does not yet know this format and will complain like isofs: Unknown ZF compression algorithm: PZ The files will then appear in their compressed form with zisofs2 header, block pointer list, and compressed data. zisofs2 is recognized by xorriso in files from loaded images and gets equipped with -zisofs-decode filters, unless restrictions on the number of block pointers prevent this. Mode "off" restricts compression to files smaller than 4 GiB uncompressed size. Mode "as_needed" uses zisofs2 for larger files. Mode "on" uses zisofs2 for all zisofs compressed files. "susp_z2="off|on controls production of SUSP entries "Z2" instead of "ZF" with zisofs2 compressed files. Unaware Linux kernels are supposed to silently ignore "Z2" entries. "block_size_v2="32k|64k|128k|256k|512k|1m sets the size of compression blocks for zisofs2. "bpt_target="-1|>0 sets a number of block pointers per file, which is considered low enough to justify a reduction of block size. If this number is larger than 0, then block sizes smaller than the settings of block_size= or block_size_v2= are tried whether they yield not more block pointers than the given number. If so, the smallest suitable block size is applied. The inavoidable final block pointer counts. E.g. a file of 55 KiB has 3 block pointers if block size is 32k, and 2 block pointers with block size 64k. bpt_target=-1 disables this automatic block size adjustment. "max_bpt="1k...128g sets the limit for the overall allocated block pointer memory. Block pointers occupy virtual memory while a file gets uncompressed and while a file, which shall be compressed, waits for ISO filesystem creation. One pointer occupies 8 bytes of memory and governs block_size or block_size_v2 uncompressed bytes. I.e. with block size 128k, 1m of block pointer memory suffices for at most 16g of uncompressed file size. Each file consumes one end block pointer, independently of the file size. Partially filled end blocks may further reduce the effective payload. In case of overflow of the max_bpt limit while adding compression filters the program tries to go on by discarding all buffered block pointers of previously added -zisofs filters. From then on all newly added filters will discard their block pointers immediately after being added. Discarded block pointers cause an additional read and compression run of the input file during the production of the ISO filesystem. "max_bpt_f="1k...128g sets the limit for the memory size of the block pointer list of a single file. max_bpt_f is never larger than max_bpt. If either is set to violate this rule, the other gets set to the same value. If both values are the same before a change by max_bpt= or max_bpt_f=, then both limits stick together unless the limit is decreased by max_bpt_f=. "bpt_free_ratio="-1|0.0...1.0 sets a threshold for switching to block pointer discarding during compression. If less than the given fraction of the max_bpt_f= memory is free, then block pointers of compression filters get discarded immediately after being added. Value -1 disables this feature. "default" is the same as "level=6:block_size=32k:by_magic=off: version_2=off:block_size_v2=128k:susp_z2=off:max_bpt=256m:max_bpt_f=256m: bpt_free_ratio=-1". -speed code|number[k|m|c|d|b] Set the burn speed. Default is "max" (or "0") = maximum speed as announced by the drive. Further special speed codes are: "min" (or "-1") selects minimum speed as announced by the drive. "none" avoids to send a speed setting command to the drive before burning begins. Speed can be given in media dependent numbers or as a desired throughput per second in MMC compliant kB (= 1000) or MB (= 1000 kB). Media x-speed factor can be set explicitly by "c" for CD, "d" for DVD, "b" for BD, "x" is optional. Example speeds: 706k = 706kB/s = 4c = 4xCD 5540k = 5540kB/s = 4d = 4xDVD If there is no hint about the speed unit attached, then the medium in the -outdev will decide. Default unit is CD = 176.4k. MMC drives usually activate their own idea of speed and take the speed value given by the burn program only as upper limit for their own decision. -stream_recording "on"|"off"|"full"|"data"|number Setting "on" tries to circumvent the management of defects on DVD-RAM, BD-RE, or BD-R. Defect management keeps partly damaged media usable. But it reduces write speed to half nominal speed even if the medium is in perfect shape. For the case of flawless media, one may use -stream_recording "on" to get full speed. "full" tries full speed with all write operations, whereas "on" does this only above byte address 32s. One may give a number of at least 16s in order to set an own address limit. "data" causes full speed to start when superblock and directory entries are written and writing of file content blocks begins. -dvd_obs "default"|"32k"|"64k" GNU/Linux specific: Set the number of bytes to be transmitted with each write operation to DVD or BD media. A number of 64 KB may improve throughput with bus systems which show latency problems. The default depends on media type, on command -stream_recording , and on compile time options. -modesty_on_drive parameter[:parameters] Control whether the drive buffer shall be kept from getting completely filled. Parameter "on" (or "1") keeps the program from trying to write to the burner drive while its buffer is in danger to be filled over a given limit. If this limit is exceeded then the program will wait until the filling reaches a given low percentage value. This can ease the load on operating system and drive controller and thus help with achieving better input bandwidth if disk and burner are not on independent controllers (like hda and hdb). It may also help with throughput problems of simultaneous burns on different burners with Linux kernels like 3.16, if one has reason not to fix the problem by -scsi_dev_family "sg". On the other hand it increases the risk of buffer underflow and thus reduced write speed. Some burners are not suitable because they report buffer fill with granularity too coarse in size or time, or expect their buffer to be filled to the top before they go to full speed. Parameters "off" or "0" disable this feature. The threshold for beginning to wait is given by parameter "max_percent=". Parameter "min_percent=" defines the threshold for resuming transmission. Percentages are permissible in the range of 25 to 100. Numbers in this range without a prepended name are interpreted as "on:min_percent=". E.g.: -modesty_on_drive 75 The optimal values depend on the buffer behavior of the drive. Parameter "timeout_sec=" defines after which time of unsuccessful waiting the modesty shall be disabled because it does not work. Parameter "min_usec=" defines the initial sleeping period in microseconds. If the drive buffer appears to be too full for sending more data, the program will wait the given time and inquire the buffer fill state again. If repeated inquiry shows not enough free space, the sleep time will slowly be increased to what parameter "max_usec=" defines. Parameters, which are not mentioned with a -modesty_on_drive command, stay unchanged. Default is: -modesty_on_drive off:min_percent=90:max_percent=95: timeout_sec=120:min_usec=5000:max_usec=25000 -use_immed_bit "on"|"off"|"default" Control whether several long lasting SCSI commands shall be executed with the Immed bit, which makes the commands end early while the drive operation is still going on. xorriso then inquires progress indication until the drive reports to be ready again. If this feature is turned off, then blanking and formatting will show no progress indication. It may depend on the operating system whether -use_immed_bit is set to "off" by default. Command -status will tell by appending "/on" or "/off" if a drive has already been acquired and -use_immed_bit is currently set to "default". Command -use_immed_bit tolerates and ignores such appended text. -stdio_sync "on"|"off"|"end"|number Set the number of bytes after which to force output to stdio: pseudo drives. This forcing keeps the memory from being clogged with lots of pending data for slow devices. Default "on" is the same as "16m". Forced output can be disabled by "off", or be delayed by "end" until all data are produced. If a number is chosen, then it must be at least 64k. -dummy "on"|"off" If "on" then simulate burning or refuse with FAILURE event if no simulation is possible, do neither blank nor format. -fs number["k"|"m"] Set the size of the fifo buffer which smoothens the data stream from ISO image generation to media burning. Default is 4 MiB, minimum 64 kiB, maximum 1 GiB. The number may be followed by letter "k" or "m" which means unit is kiB (= 1024) or MiB (= 1024 kiB). -close "on"|"off"|"as_needed" If -close is set to "on" then mark the written medium as not appendable any more. This will have no effect on overwritable media types. Setting "on" is the contrary of cdrecord option -multi, and is one aspect of growisofs option -dvd-compat. If set to "off" then keep the medium writable for an appended session. If set to "as_needed" then use "on" only if "off" is predicted to fail with the given medium and its state. Not all drives correctly recognize fast-blanked DVD-RW which need "on". If there is well founded suspicion that a burn run failed due to -close "off", then -close "as_needed" causes a re-try with "on". Note that emulation command -as "cdrecord" temporarily overrides the current setting of -close by its own default -close "on" if its option -multi is missing. -write_type "auto"|"tao"|"sao/dao" Set the write type for the next burn run. "auto" will select SAO with blank CD media, DAO with blank DVD-R[W] if -close is "on", and elsewise CD TAO or the equivalent write type of the particular DVD/BD media. Choosing TAO or SAO/DAO explicitly might cause the burn run to fail if the desired write type is not possible with the given media state. -padding number["k"|"m"]|"included"|"appended" Append the given number of extra bytes to the image stream. This is a traditional remedy for a traditional bug in block device read drivers. Needed only for CD recordings in TAO mode. Since one can hardly predict on what media an image might end up, 'xorriso' adds the traditional 300k of padding by default to all images. For images which will never get to a CD it is safe to use -padding 0 . Normally padding is not written as part of the ISO image but appended after the image end. This is -padding mode "appended". Emulation command -as "mkisofs" and command -jigdo cause padding to be written as part of the image. The same effect is achieved by -padding mode "included".  File: xorriso.info, Node: Bootable, Next: Jigdo, Prev: SetWrite, Up: Commands 9.11 Bootable ISO images ======================== Contrary to published specifications many BIOSes will load an El Torito record from the first session on media and not from the last one, which gets mounted by default. This makes no problems with overwritable media, because they appear to inadverted readers as one single session. But with multi-session media CD-R[W], DVD-R[W], DVD+R, it implies that the whole bootable system has to reside already in the first session and that the last session still has to bear all files which the booted system expects after mounting the ISO image. If a boot image from ISOLINUX or GRUB is known to be present on media then it is advised to patch it when a follow-up session gets written. But one should not rely on the capability to influence the bootability of the existing sessions, unless one can assume overwritable media. Normally the boot images are data files inside the ISO filesystem. By special path "-interval:appended_partition_NNN:all::" it is possible to refer to an appended partition. The number NNN gives the partition number as used with the corresponding command -append_partition. E.g.: -append_partition 2 0xef /tmp/efi.img -boot_image any efi_path=-interval:appended_partition_2:all:: There are booting mechanisms which do not use an El Torito record but rather start at the first bytes of the image: PC-BIOS MBR or EFI GPT for hard-disk-like devices, APM partition entries for Macs which expect HFS+ boot images, MIPS Volume Header for old SGI computers, DEC Boot Block for old MIPS DECstation, SUN Disk Label for SPARC machines, HP-PA boot sector for HP PA-RISC machines, DEC Alpha SRM boot sector for old DEC Alpha machines. Several of the following commands expect disk paths as input but also accept description strings for the libisofs interval reader, which is able to cut out data from disk files or -indev and to zeroize parts of the content: command -append_partition, boot specs system_area=, grub2_mbr=, prep_boot_part=, efi_boot_part=. The description string consists of the following components, separated by colon ':' "--interval:"Flags":"Interval":"Zeroizers":"Source The component "--interval" states that this is not a plain disk path but rather an interval reader description string. The component Flags modifies the further interpretation: "local_fs" demands to read from a file depicted by the path in Source. "imported_iso" demands to read from the -indev. This works only if -outdev is not the same as -indev. The Source component is ignored. "appended_partition_NNN" with a decimal number NNN works only for -boot_image bootspecs which announce El Torito boot image paths: bin_path=, efi_path=. The number gives the partition number as used with the corresponding command -append_partition. The component Interval consists of two byte address numbers separated by a "-" character. E.g. "0-429" means to read bytes 0 to 429. The component Zeroizers consists of zero or more comma separated strings. They define which part of the read data to zeroize. Byte number 0 means the byte read from the Interval start address. Each string may be one of: "zero_mbrpt" demands to zeroize the MBR partition table if bytes 510 and 511 bear the MBR signature 0x55 0xaa. "zero_gpt" demands to check for a GPT header in bytes 512 to 1023, to zeroize it and its partition table blocks. "zero_apm" demands to check for an APM block 0 and to zeroize its partition table blocks. Start_byte"-"End_byte demands to zeroize the read-in bytes beginning with number Start_byte and ending after End_byte. The component Source is the file path with flag "local_fs", and ignored with flag "imported_iso". Byte numbers may be scaled by a suffix out of {k,m,g,t,s,d} meaning multiplication by {1024, 1024k, 1024m, 1024g, 2048, 512}. A scaled value end number depicts the last byte of the scaled range. E.g. "0d-0d" is "0-511". Examples: "local_fs:0-32767:zero_mbrpt,zero_gpt,440-443:/tmp/template.iso" "imported_iso:45056d-47103d::" -boot_image "any"|"isolinux"|"grub" "discard"|"keep"|"patch"|"replay"|"show_status"| bootspec|"next" Define the equipment of the emerging filesystem with boot entry points. With systems which boot via BIOS or EFI this is a set of El Torito boot images, possibly MBR boot code, and possibly partition tables of type MBR, GPT, or APM. Such file sets get produced by boot loader systems like ISOLINUX or GRUB. Each -boot_image command has two parameters: type and setting. More than one -boot_image command may be used to define the handling of one or more boot images. Sequence matters. Types *isolinux* and *grub* care for known peculiarities. Type *any* makes no assumptions about the origin of the boot images. When loading an ISO filesystem, system area and El Torito boot images get loaded, too. The default behavior is not to write loaded El Torito boot images and to write the loaded system area content without alterations. *discard* gives up the El Torito boot catalog and its boot images. regardless whether loaded from an ISO filesystem or defined by commands. Any BIOS or EFI related boot options get revoked. Nevertheless, loaded system area data stay valid. If desired, they have to be erased by -boot_image any system_area=/dev/zero *keep* keeps or copies El Torito boot images unaltered and writes a new catalog. *patch* applies patching to existing El Torito boot images if they seem to bear a boot info table. A boot info table needs to be patched when the boot image gets newly introduced into the ISO image or if an existing image gets relocated. This is automatically done if type "isolinux" or "grub" is given, but not with "any". If patching is enabled, then boot images from previous sessions will be checked whether they seem to bear a boot info table. If not, then they stay unpatched. This check is not infallible. So if you do know that the images need no patching, use "any" "keep". "grub" "patch" will not patch EFI images (platform_id=0xef). *replay* is a more modern version of "patch", which not only cares for existing El Torito boot equipment but also for the recognizable boot provisions in the System Area. It discards any existing -boot_image setting and executes the commands proposed by command -report_el_torito "cmd". This action will only succeed if the file objects mentioned in the output of command -report_el_torito "cmd" are still available. Do not remove or rename boot image files after -indev. Drop unknown El Torito: -boot_image "any" "discard" Maintain recognizable stuff: -boot_image "any" "replay" El Torito only for GRUB: -boot_image "grub" "patch" El Torito only for ISOLINUX: -boot_image "isolinux" "patch" *show_status* will print what is known about the loaded boot images and their designated fate. A *bootspec* is a word of the form name=value. It is used to describe the parameters of a boot feature. The names "dir", "bin_path", "efi_path" lead to El Torito bootable images. Name "system_area" activates a given file as MBR or other disk header. On all media types this is possible within the first session. In further sessions an existing boot image can get replaced by a new one, but depending on the media type this may have few effect at boot time. See above. El Torito boot images have to be added to the ISO image by normal means (image loading, -map, -add, ...). In case of ISOLINUX the files should reside either in ISO image directory /isolinux or in /boot/isolinux . In that case it suffices to use as bootspec the text "*dir=/isolinux*" or "dir=/boot/isolinux". E.g.: -boot_image isolinux dir=/boot/isolinux which bundles these individual settings: -boot_image isolinux bin_path=/boot/isolinux/isolinux.bin -boot_image isolinux cat_path=/boot/isolinux/boot.cat -boot_image isolinux load_size=2048 -boot_image any boot_info_table=on An El Torito boot catalog file gets inserted into the ISO image with address *cat_path=* with the first -boot_image "any" "next" or at -commit time. It is subject to normal -overwrite and -reassure processing if there is already a file with the same name. The catalog lists the boot images and is read by the boot facility to choose one of the boot images. But it is not necessary that it appears in the directory tree at all. One may hide it in all trees by *cat_hidden=on*. Other possible values are "iso_rr", "joliet", "hfsplus", and the default "off". The timestamps of the boot catalog file are refreshed at commit time. Command -volume_date "uuid" can be used to set their value. *bin_path=* depicts an El Torito boot image file, a binary program which is to be started by the hardware boot facility (e.g. the BIOS) at boot time. *efi_path=* depicts an El Torito boot image file that is ready for EFI booting. This is normally a FAT filesystem image not larger than 65535 blocks of 512 bytes (= 32 MiB - 512). Its load_size is determined automatically, no boot info table gets written, no boot medium gets emulated, platform_id is 0xef. *emul_type=* can be one of "no_emulation", "hard_disk", "diskette". It controls the boot medium emulation code of a boot image. The default "no_emulation" is suitable for ISOLINUX, GRUB, FreeBSD cdboot. *load_size=* is a value which depends on the boot image. Default is 2048 which matches the expectations of most boot images. The special value "full" means the full size of the boot image file rounded up to a multiple of 2048 bytes. Maximum is 33,552,384 bytes. *boot_info_table=on* causes address patching to bytes 8 to 63 of the boot image which is given by "any" "bin_path=". "boot_info_table=off" disables this patching. *grub2_boot_info=on* causes address patching to byte 2548 of the boot image which is given by "any" "bin_path=". The address is written as 64 bit little-endian number. It is the 2KB block address of the boot image content, multiplied by 4, and then incremented by 5. "grub2_boot_info=off" disables this patching. *platform_id=* defines by a hexadecimal or decimal number the Platform ID of the boot image. "0x00" is 80x86 PC-BIOS, "0x01" is PowerPC, "0x02" is Mac, "0xef" is EFI (decimal "239"). *id_string=*text|56_hexdigits defines the ID string of the boot catalog section where the boot image will be listed. If the value consists of 56 characters [0-9A-Fa-f] then it is converted into 28 bytes, else the first 28 characters become the ID string. The ID string of the first boot image becomes the overall catalog ID. It is limited to 24 characters. Other id_strings become section IDs. *sel_crit=*hexdigits defines the Selection Criteria of the boot image. Up to 20 bytes get read from the given characters [0-9A-Fa-f]. They get attributed to the boot image entry in the catalog. *next* ends the definition of a boot image and starts a new one. Any following -bootimage bootspecs will affect the new image. The first "next" discards loaded boot images and their catalog. *system_area=*disk_path copies at most 32768 bytes from the given disk file to the very start of the ISO image. This System Area is reserved for system dependent boot software, e.g. an MBR which can be used to boot from USB stick or hard disk. Other than an El Torito boot image, the file disk_path needs not to be added to the ISO image. *-boot_image isolinux system_area=* implies "partition_table=on". In this case, the disk path should lead to one of the SYSLINUX files isohdp[fp]x*.bin or to a file which was derived from one of those files. E.g. to the first 512 bytes from an ISOLINUX isohybrid ISO image. In this case, El Torito boot images (dir=, bin_path=, efi_path=) may be augmented by *isolinux partition_entry=gpt_basdat* or *isolinux partition_entry=gpt_hfsplus*, and by *isolinux partition_entry=apm_hfsplus*. The boot image will then be mentioned in an invalid GPT as Basic Data or GPT HFS+ partition, and in a valid APM as HFS+ partition. The first three GPT partitions will also be marked by MBR partitions. The MBR partition of type 0xEF is what actually is used by EFI firmware for booting from USB stick. In multi-session situations the existing System Area is preserved by default. In in this case, the special disk_path "." prevents reading of a disk file but nevertheless causes adjustments in the loaded system area data. Such adjustments may get ordered by -boot_image commands. *-boot_image any gpt_disk_guid=*value controls whether an emerging GPT shall get a randomly generated disk GUID or whether the GUID is supplied by the user. Value "random" is default. Value "volume_date_uuid" produces a low quality GUID from the value set by -volume_date "uuid". A string of 32 hex digits, or a RFC 4122 compliant GUID string may be used to set the disk GUID directly. UEFI prescribes the first three components of a RFC 4122 GUID string to be byte-swapped in the binary representation: E.g. gpt_disk_guid=2303cd2a-73c7-424a-a298-25632da7f446 equals gpt_disk_guid=2acd0323c7734a42a29825632da7f446 The partition GUIDs get generated by minimally varying the disk GUID. *-boot_image any part_like_isohybrid=on* enables -boot_image isolinux partition_entry= even if no -boot_image isolinux system_area= is given. No MBR partition of type 0xee emerges, even if GPT gets produced. Gaps between GPT and APM partitions will not be filled by more partitions. Appended partitions get mentioned in APM if other APM partitions emerge. *-boot_image any iso_mbr_part_type=*number sets the partition type of the MBR partition which represents the ISO or at least protects it. Number may be 0x00 to 0xff. The text "default" re-enables the default types of the various occasions to create an ISO MBR partition. This is without effect if no such partition emerges by other settings or if the partition type is prescribed mandatorily like 0xee for GPT protective MBR or 0x96 for CHRP. If instead a type_guid is given by a 32-digit hex string like a2a0d0ebe5b9334487c068b6b72699c7 or by a structured text like EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, then it will be used as partition type if the ISO filesystem appears as partition in GPT. In MBR, C12A7328-F81F-11D2-BA4B-00A0C93EC93B will be mapped to 0xef. Any other GUID will be mapped to 0x83. *grub2_mbr=*disk_path works like "any" system_area= with additional patching for modern GRUB MBRs. The content start address of the first boot image is converted to a count of 512 byte blocks, and an offset of 4 is added. The result is written as 64 bit little-endian number to byte address 0x1b0. This feature can be revoked either by grub2_mbr= with empty disk path, or by submitting a disk_path via system_area=. *partition_table=on* causes a simple partition table to be written into bytes 446 to 511 of the System Area. With type "isolinux" it shows a partition that begins at byte 0 and it causes the LBA of the first boot image to be written into the MBR. For the first session this works only if also "system_area=" and "bin_path=" or "dir=" is given. With types "any" and "grub" it shows a single partition which starts at byte 512 and ends where the ISO image ends. This works with or without system_area= or boot image. Bootspecs chrp_boot_part=, prep_boot_part=, and efi_boot_part= overwrite this entry in the MBR partition table. If types "isolinux" or "grub" are set to "patch", then "partition_table=on" is activated without new boot image. In this case the existing System Area gets checked whether it bears addresses and sizes as if it had been processed by "partition_table=on". If so, then those parameters get updated when the new System Area is written. Special "system_area=/dev/zero" causes 32k of NUL-bytes. Use this to discard an MBR which was loaded with the ISO image. *appended_part_as=gpt* marks partitions from -append_partition in GPT rather than in MBR. In this case the MBR shows a single partition of type 0xee which covers the whole output data. *appended_part_as=mbr* is the default. Appended partitions get marked in GPT only if GPT is produced because of other settings. If given explicitly, this clears setting "gpt" and "apm". Nevertheless "apm" may be added to "mbr". *appended_part_as=apm* marks partitions from -append_partition in APM additionally to "mbr" or "gpt". By default, appended partitions get marked in APM only if APM is produced because of other options together with part_like_isohybrid="on". *chrp_boot_part=on* causes a single partition in MBR which covers the whole ISO image and has type 0x96. This is not compatible with any other feature that produces MBR partition entries. It makes GPT unrecognizable. *prep_boot_part=*disk_path inserts the content of a data file into the image and marks it by an MBR partition of type 0x41. The parts of the ISO image before and after this partition will be covered by further MBR partitions. The data file is supposed to contain ELF executable code. *efi_boot_part=*disk_path inserts the content of a data file into the image and marks it by a GPT partition. If not chrp_boot_part=on, then the first partition in MBR will have type 0xee to announce the presence of GPT. The data file is supposed to contain a FAT filesystem. Instead of a disk_path, the word --efi-boot-image may be given. It exposes in GPT the content of the first El Torito EFI boot image as EFI system partition. EFI boot images are introduced by bootspec efi_path=. The affected EFI boot image cannot show up in HFS+ because it is stored outside the HFS+ partition. *partition_offset=*2kb_block_adr causes a partition table with a single partition that begins at the given block address. This is counted in 2048 byte blocks, not in 512 byte blocks. If the block address is non-zero then it must be at least 16. A non-zero partition offset causes two superblocks to be generated and two sets of directory trees. The image is then mountable from its absolute start as well as from the partition start. The offset value of an ISO image gets preserved when a new session is added. So the value defined here is only in effect if a new ISO image gets written. *partition_hd_cyl=*number gives the number of heads per cylinder for the partition table. 0 chooses a default value. Maximum is 255. *partition_sec_hd=*number gives the number of sectors per head for the partition table. 0 chooses a default value. Maximum is 63. The product partition_sec_hd * partition_hd_cyl * 512 is the cylinder size. It should be divisible by 2048 in order to make exact alignment possible. With appended partitions and "appended_part_as=gpt" there is no limit for the number of cylinders. Else there may be at most 1024 of them. If the cylinder size is too small to stay below the limit, then appropriate values of partition_hd_cyl are chosen with partition_sec_hd 32 or 63. If the image is larger than 8,422,686,720 bytes, then the cylinder size constraints cannot be fulfilled for MBR. *partition_cyl_align=*mode controls image size alignment to an integer number of cylinders. It is prescribed by isohybrid specs and it seems to please program fdisk. Cylinder size must be divisible by 2048. Images larger than 8,323,596,288 bytes cannot be aligned in MBR partition table. Mode "auto" is default. Alignment by padding happens only with "isolinux" "partition_table=on". Mode "on" causes alignment by padding with "partition_table=on" for any type. Mode "all" is like "on" but also pads up partitions from -append_partition to an aligned size. Mode "off" disables alignment for any type. *mbr_force_bootable=*mode enforces an MBR partition with "bootable/active" flag if options like partition_table= or grub2_mbr= indicate production of a bootable MBR. These options normally cause the flag to be set if there is an MBR partition of type other than 0xee or 0xef. If no such partition exists, then no bootflag is set, unless mbr_force_bootable="on" forces creation of a dummy partition of type 0x00 which covers only the first block of the ISO image. If no bootable MBR is indicated and a partition gets created by -append_partition, then mbr_force_bootable="on" causes a bootflag like it would do with a bootable MBR. *mips_path=*iso_rr_path declares a data file in the image to be a MIPS Big Endian boot file and causes production of a MIPS Big Endian Volume Header. This is mutually exclusive with production of other boot blocks like MBR. It will overwrite the first 512 bytes of any data provided by system_area=. Up to 15 boot files can be declared by mips_path=. *mipsel_path=*iso_rr_path declares a data file in the image to be the MIPS Little Endian boot file. This is mutually exclusive with other boot blocks. It will overwrite the first 512 bytes of any data provided by system_area=. Only a single boot file can be declared by mipsel_path=. *sparc_label=*text causes the production of a SUN Disk Label with the given text as ASCII label. Partitions 2 to 8 may be occupied by appended images. Partition 1 will always be the ISO image. See command -append_partition. The first 512 bytes of any data provided by system_area= will be overwritten. *grub2_sparc_core=*iso_rr_path causes the content address and size of the given file to be written after the SUN Disk Label. Both numbers are counted in bytes. The address is written as 64 bit big-endian number to byte 0x228. The size is written as 32 bit big-endian number to byte 0x230. *hppa_cmdline=*text sets the PALO command line for HP-PA. Up to 1023 characters are permitted by default. With hppa_hdrversion=4 the limit is 127. Note that the first five hppa_ bootspecs are mandatory, if any of the hppa_ bootspecs is used. Only hppa_hdrversion= is allowed to be missing. *hppa_bootloader=*iso_rr_path designates the given path as HP-PA bootloader file. *hppa_kernel_32=*iso_rr_path designates the given path as HP-PA 32 bit kernel file. *hppa_kernel_64=*iso_rr_path designates the given path as HP-PA 64 bit kernel file. *hppa_ramdisk=*iso_rr_path designates the given path as HP-PA RAM disk file. *hppa_hdrversion=*number chooses between PALO header version 5 (default) and version 4. For the appropriate value see in PALO source code: PALOHDRVERSION. *alpha_boot=*iso_rr_path declares a data file in the image to be the DEC Alpha SRM Secondary Bootstrap Loader and causes production of a boot sector which points to it. This is mutually exclusive with production of other boot blocks like MBR. *mips_discard*, *sparc_discard*, *hppa_discard*, *alpha_discard* revoke any boot file declarations made for mips/mipsel, sparc, hppa, or alpha, respectively. This removes the ban on production of other boot blocks. *hfsplus_serial=*hexstring sets a string of 16 digits "0" to "9" and letters "a" to "f", which will be used as unique serial number of an emerging HFS+ filesystem. *hfsplus_block_size=*number sets the allocation block size to be used when producing HFS+ filesystems. Permissible are 512, 2048, or 0. The latter lets the program decide. *apm_block_size=*number sets the block size to be used when describing partitions by an Apple Partition Map. Permissible are 512, 2048, or 0. The latter lets the program decide. Note that size 512 is not compatible with production of GPT, and that size 2048 will not be mountable -t hfsplus at least by older Linux kernels. -append_partition partition_number type_code disk_path Cause a prepared filesystem image to be appended to the ISO image and to be described by a partition table entry in a boot block at the start of the emerging ISO image. The partition entry will bear the size of the submitted file rounded up to the next multiple of 2048 bytes or to the next multiple of the cylinder size. Beware of subsequent multi-session runs. The appended partition will get overwritten. Partitions may be appended with boot block type MBR and with SUN Disk Label. With MBR: partition_number may be 1 to 4. Number 1 will put the whole ISO image into the unclaimed space before partition 1. So together with most 'xorriso' MBR features, number 2 would be the most natural choice. The type_code may be "FAT12", "FAT16", "Linux", or a hexadecimal number between 0x00 and 0xff. Not all those numbers will yield usable results. For a list of MBR partition type codes search the Internet for "Partition Types" or run fdisk command "L". type_code may also be a type GUID as plain hex string like a2a0d0ebe5b9334487c068b6b72699c7 or as structured text like EBD0A0A2-B9E5-4433-87C0-68B6B72699C7. It will be used if the partition is mentioned in GPT. In MBR, C12A7328-F81F-11D2-BA4B-00A0C93EC93B will be mapped to 0xef. Any other GUID will be mapped to 0x83. In APM, 48465300-0000-11AA-AA11-00306543ECAC will be mapped to partition type "Apple_HFS", any other to "Data". If some other command causes the production of GPT, then the appended partitions will be mentioned there too. The disk_path must provide the necessary data bytes at commit time. An empty disk_path disables this feature for the given partition number. With SUN Disk Label (selected by -boot_image any sparc_label=): partition_number may be 2 to 8. Number 1 will always be the ISO image. Partition start addresses are aligned to 320 KiB. The type_code does not matter. Submit 0x0. Partition image name "." causes the partition to become a copy of the next lower valid one.  File: xorriso.info, Node: Jigdo, Next: Charset, Prev: Bootable, Up: Commands 9.12 Jigdo Template Extraction ============================== From man genisoimage: "Jigdo is a tool to help in the distribution of large files like CD and DVD images; see http://atterer.net/jigdo/ for more details. Debian CDs and DVD ISO images are published on the web in jigdo format to allow end users to download them more efficiently." 'xorriso' can produce a .jigdo and a .template file together with a single-session ISO image. The .jigdo file contains checksums and symbolic file addresses. The .template file contains the compressed ISO image with reference tags instead of the content bytes of the listed files. Input for this process are the normal arguments for a 'xorriso' session on a blank -outdev, and a checksum file which lists those data files which may be listed in the .jigdo file and externally referenced in the .template file. Each designated file is represented in the checksum file by a single text line: Checksum as hex digits, 2 blanks, size as 12 decimal digits or blanks, 2 blanks, symbolic file address The kind of checksum is chosen by -jigdo "checksum_algorithm" with values "md5" (32 hex digits) or "sha256" (64 hex digits). It will also be used for the file address lines in the .jigdo file. The default is "md5". The file address in a checksum file line has to bear the same basename as the disk_path of the file which it shall match. The directory path of the file address is decisive for To=From mapping, not for file recognition. After To=From mapping, the file address gets written into the .jigdo file. Jigdo restore tools will convert these addresses into really reachable data source addresses from which they can read. If the list of jigdo parameters is not empty, then 'xorriso' will refuse to write to non-blank targets, it will disable multi-session emulation, and padding will be counted as part of the ISO image. -jigdo parameter_name value Clear Jigdo Template Extraction parameter list or add a parameter to that list. The alias names are the corresponding genisoimage options. They are accepted as parameter names as well. Especially they are recognized by the -as mkisofs emulation command. Parameter *clear* with any value empties the whole list. No .jigdo and .template file will be produced. *checksum_algorithm* chooses the checksum algorithm which shall be used for the data file entries in the .jigdo file and is expected in the checksum file. Permissible are "md5" or "sha256". Default is "md5". Alias: -jigdo-checksum-algorithm *template_path* sets the disk_path for the .template file with the holed and compressed ISO image copy. Alias: -jigdo-template *jigdo_path* sets the disk_path for the .jigdo file with the checksums and download addresses for filling the holes in .template. Alias: -jigdo-jigdo *checksum_path* sets the disk_path where to find the checksum file with symbolic file addresses and checksums according to *checksum_algorithm*. Alias: md5_path Alias: -checksum-list Alias: -md5-list *min_size* sets the minimum size for a data file to be listed in the .jigdo file and being a hole in the .template file. Alias: -jigdo-min-file-size *exclude* adds a regular expression pattern which will get compared with the absolute disk_path of any data file. A match causes the file to stay in .template in any case. Alias: -jigdo-exclude *demand_checksum* adds a regular expression pattern which will get compared with the absolute disk_path of any data file that was not found in the checksum list file as of "checksum_path". A match causes a MISHAP event. Alias: demand_md5 Alias: -jigdo-force-checksum Alias: -jigdo-force-md5 *mapping* adds a string pair of the form To=From to the parameter list. If a data file gets listed in the .jigdo file, then it is referred by the file address from its line in the checksum file. This file address gets checked whether it begins with the From string. If so, then this string will be replaced by the To string and a ':' character, before it goes into the .jigdo file. The From string should end by a '/' character. Alias: -jigdo-map *compression* chooses one of "bzip2" or "gzip" for the compression of the template file. The jigdo file is put out uncompressed. Alias: -jigdo-template-compress *checksum_iso* chooses one or more of "md5", "sha1", "sha256", "sha512" for the auxiliary "# Image Hex" checksums in the jigdo file. The value may e.g. look like "md5,sha1,sha512". Value "all" chooses all available algorithms. Note that MD5 stays always enabled. Alias: -checksum_algorithm_iso *checksum_template* is like checksum_iso but for "# Template Hex". Alias: -checksum_algorithm_template  File: xorriso.info, Node: Charset, Next: Exception, Prev: Jigdo, Up: Commands 9.13 Character sets =================== File names are strings of non-zero bytes with 8 bit each. Unfortunately the same byte string may appear as different peculiar national characters on differently nationalized terminals. The meanings of byte codes are defined in *character sets* which have names. Shell command iconv -l lists them. The file names on hard disk are assumed to be encoded by the *local character set* which is also used for the communication with the user. Byte codes 32 to 126 of the local character set must match the US-ASCII characters of the same code. ISO-8859 and UTF-8 fulfill this demand. By default, 'xorriso' uses the character set as told by shell command "locale" with argument "charmap". This may be influenced by environment variables LC_ALL, LC_CTYPE, or LANG and should match the expectations of the terminal. In some situations it may be necessary to set it by command -local_charset. Local character sets should not matter as long as only english alphanumeric characters are used for file names or as long as all writers and readers of the media use the same local character set. Outside these constraints it may be necessary to let 'xorriso' convert byte codes from and to other character sets. The Rock Ridge file names in ISO filesystems are assumed to be encoded by the *input character set*. The Rock Ridge file names which get written with ISO filesystems will be encoded by the *output character set*. The sets can be defined independently by commands -in_charset and -out_charset. Normally one will have both identical, if ever. Other than the local character set, these two character sets may deviate from US-ASCII. The output character sets for Joliet and HFS+ are not influenced by these commands. Joliet uses output character set UCS-2 or UTF-16. HFS+ uses UTF-16. The default output charset is the local character set of the terminal where 'xorriso' runs. So by default no conversion happens between local filesystem names and emerging Rock Ridge names in the image. The situation stays ambiguous and the reader has to riddle what character set was used. By command -auto_charset it is possible to attribute the output charset name to the image. This makes the situation unambiguous. But if your terminal character set does not match the character set of the local file names, then this attribute can become plainly wrong and cause problems at read time. To prevent this it is necessary to check whether the terminal properly displays all intended filenames. Check especially the exotic national characters. To enforce recording of a particular character set name without any conversion at image generation time, set -charset and -local_charset to the desired name, and enable -backslash_codes to avoid evil character display on your terminal. -charset character_set_name Set the character set from which to convert file names when loading an image and to which to convert when writing an image. -local_charset character_set_name Override the system assumption of the local character set name. If this appears necessary, one should consider to set -backslash_codes to "on" in order to avoid dangerous binary codes being sent to the terminal.  File: xorriso.info, Node: Exception, Next: DialogCtl, Prev: Charset, Up: Commands 9.14 Exception processing ========================= Since the tasks of 'xorriso' are manifold and prone to external influence, there may arise the need for 'xorriso' to report and handle problem events. Those events get classified when they are detected by one of the software modules and forwarded to reporting and evaluation modules which decide about reactions. Event classes are sorted by severity: "NEVER" The upper end of the severity spectrum. "ABORT" The program is being aborted and on its way to end. "FATAL" The main purpose of the run failed or an important resource failed unexpectedly. "FAILURE" An important part of the job could not be performed. "MISHAP" A FAILURE which can be tolerated during ISO image generation. "SORRY" A less important part of the job could not be performed. "WARNING" A situation is suspicious of being not intended by the user. "HINT" A proposal to the user how to achieve better results. "NOTE" A harmless information about noteworthy circumstances. "UPDATE" A pacifier message during long running operations. "DEBUG" A message which would only interest the program developers. "ALL" The lower end of the severity spectrum. -abort_on severity Set the severity threshold for events to abort the program. Useful: "NEVER", "ABORT", "FATAL", "FAILURE" , "MISHAP", "SORRY" It may become necessary to abort the program anyway, despite the setting by this command. Expect not many "ABORT" events to be ignorable. A special property of this command is that it works preemptive if given as program start argument. I.e. the first -abort_on setting among the start arguments is in effect already when the first operations of 'xorriso' begin. Only "-abort_on" with dash "-" is recognized that way. -return_with severity exit_value Set the threshold and exit_value to be returned at program end if no abort has happened. This is to allow 'xorriso' to go on after problems but to get a failure indicating exit value from the program, nevertheless. Useful is a value lower than the -abort_on threshold, down to "WARNING". exit_value may be either 0 (indicating success to the starter of the program) or a number between 32 and 63. Some other exit_values are used by 'xorriso' if it decides to abort the program run: 1=abort due to external signal 2=no program arguments given 3=creation of 'xorriso' main object failed 4=failure to start libburnia-project.org libraries 5=program abort during argument processing 6=program abort during dialog processing -report_about severity Set the threshold for events to be reported. Useful: "SORRY", "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG", "ALL" Regardless what is set by -report_about, messages get always reported if they reach the severity threshold of -abort_on . Event messages are sent to the info channel "I" which is usually stderr but may be influenced by command -pkt_output. Info messages which belong to no event get attributed severity "NOTE". A special property of this command is that the first -report_about setting among the start arguments is in effect already when the first operations of 'xorriso' begin. Only "-report_about" with dash "-" is recognized that way. -signal_handling mode Control the installation of a signal handler which shall react on external signals (e.g. from program "kill" or from keys Ctrl+C) or on signals caused by severe program errors. Mode "on" is the default. It uses the signal handler of libburn which produces ugly messages but puts much effort in releasing optical drives before 'xorriso' ends. Mode "off" as first -signal_handling among the start arguments prevents all own signal precautions of 'xorriso'. Inherited signal handler settings stay as they are. It works like "sig_dfl" if given after other signal handling was already established at program start. Mode "sig_dfl" uses the system provided default handling of signals, which is normally a sudden abort of the program. To prevent stuck drives, the libburn handler is used during burning, blanking, and formatting on MMC drives. Mode "sig_ign" tries to ignore as many signal types as possible. This imposes the risk that 'xorriso' refuses to end until externally kill -9 if performed. kill -9 then imposes the risk that the drive is left in unusable state and needs poweroff to be reset. So during burning, blanking, and formatting wait for at least their normal run time before killing externally. A special property of this command is that the first -signal_handling setting among the start arguments is in effect already when the first operations of 'xorriso' begin. Only "-signal_handling" with dash "-" is recognized that way. -error_behavior occasion behavior Control the program behavior at problem event occasions. For now this applies to occasions "image_loading" which is given while an image tree is read from the input device, and to "file_extraction" which is given with osirrox commands like -extract. With "image_loading" there are three behaviors available: "best_effort" goes on with reading after events with severity below FAILURE if the threshold of command -abort_on allows this. "failure" aborts image tree reading on first event of at least SORRY. It issues an own FAILURE event. This is the default. "fatal" acts like "failure" but issues the own event as FATAL. With occasion "file_extraction" there are three behaviors: "keep" maintains incompletely extracted files on disk. This is the default. "delete" removes files which encountered errors during content extraction. "best_effort" starts a revovery attempt by means of -extract_cut if the file content stems from the loaded ISO image and is not filtered.  File: xorriso.info, Node: DialogCtl, Next: Inquiry, Prev: Exception, Up: Commands 9.15 Dialog mode control ======================== -dialog "on"|"off"|"single_line" Enable or disable to enter dialog mode after all program arguments are processed. In dialog mode input lines get prompted via readline or from stdin. If no -abort_on severity was set when dialog starts, then "NEVER" is set to avoid abort in most cases of wrong input or other problems. Before dialog begins, the default is "FAILURE" which e.g. aborts on unknown commands. Mode "on" supports input of newline characters within quotation marks and line continuation by trailing backslash outside quotation marks. Mode "single_line" does not. -page length width Describe terminal to the text pager. See also above, paragraph Result pager. If parameter length is nonzero then the user gets prompted after that number of terminal lines. Zero length disables paging. Parameter width is the number of characters per terminal line. It is used to compute the number of terminal lines which get occupied by an output line. A usual terminal width is 80. -use_readline "on"|"off" If "on" then use readline for dialog. Else use plain stdin. See also above, paragraph Dialog, Readline, Result pager. -reassure "on"|"tree"|"off" If "on" then ask the user for "y" or "n": before deleting or overwriting any file in the ISO image, before overwriting any disk file during restore operations, before rolling back pending image changes, before committing image changes to media, before changing the input drive, before blanking or formatting media, before ending the program. With setting "tree" the reassuring prompt will appear for an eventual directory only once and not for each file in its whole subtree. Setting "off" silently kills any kind of image file object and performs above irrevocable actions. To really produce user prompts, command -dialog needs to be set to "on". Note that the prompt does not appear in situations where file removal is forbidden by command -overwrite. -reassure only imposes an additional curb for removing existing file objects. Be aware that file objects get deleted from the ISO image immediately after confirmation. They are gone even if the running command gets aborted and its desired effect gets revoked. In case of severe mess-up, consider to use -rollback to revoke the whole session.  File: xorriso.info, Node: Inquiry, Next: Navigate, Prev: DialogCtl, Up: Commands 9.16 Drive and media related inquiry actions ============================================ -devices Show list of available MMC drives with the addresses of their libburn standard device files. This is only possible when no ISO image changes are pending. After this command was executed, there is no drive current and no image loaded. In order to be visible, a device has to offer rw-permissions with its libburn standard device file. Thus it might be only the *superuser* who is able to see all drives. Drives which are occupied by other processes get not shown. -device_links Like -devices, but presenting the drives with addresses of symbolic links which point to the actual device files. Modern GNU/Linux systems may shuffle drive addresses from boot to boot. The udev daemon is supposed to create links which always point to the same drive, regardless of its system address. The command -device_links shows the addresses of such links if they begin by "/dev/dvd" or "/dev/cd". Precedence is: "dvdrw", "cdrw", "dvd", "cdrom", "cd". -toc Show media specific tables of content. This is the session history of the medium, not the ISO image directory tree. In case of overwritable media holding a valid ISO image, it may happen that only a single session gets shown. But if the first session on the overwritable media was written by 'xorriso' then a complete session history can be emulated. A drive which is incapable of writing may show any media as CD-ROM or DVD-ROM with only one or two sessions on it. The last of these sessions is supposed to be the most recent real session then. Some read-only drives and media show no usable session history at all. Command -rom_toc_scan might help. If input device and output device are both acquired and not the same, then both tables-of-content get shown. -toc_of "in"|"out"|"all"[":short"] Like command -toc but explicitly choosing which drive's table-of-content to show. "in" shows -indev or -dev, "out" shows -outdev or -dev, "all" shows the same as -toc. If ":short" is appended to the drive choosing word, then only a short summary of drive state and medium content is printed. As further difference to -toc, this command does not emit FAILURE events if the desired drive is not acquired. -mount_cmd drive entity id path Emit an appropriate command line for mounting the ISO session indicated by drive, entity and id. The result will be different on GNU/Linux and on FreeBSD or NetBSD. drive can be "indev" or "outdev" to indicate already acquired drives, or it can be the path of a not yet acquired drive. Prefix "stdio:" for non-MMC drives is not mandatory. For entity and id, see also command -load. They must be either "sbsector" with the superblock sector address as id, or "track" with a track number as id, or "session" with a session number, or "volid" with a search pattern for the volume id, or "auto" with which any text as id mounts the first track of the last session. path will be used as mount point and must already exist as a directory on disk. The command gets printed to the result channel. See command -mount for direct execution of this command. -mount_opts option[:option...] Set options which influence -mount and -mount_cmd. Currently there is only option "exclusive" which is default and its counterpart "shared". The latter causes 'xorriso' not to give up the affected drive with command -mount. On GNU/Linux it adds mount option "loop" which may enable mounting of several sessions of the same block device at the same time. One should not write to a mounted optical medium, of course. Take care to umount all sessions before ejecting. -session_string drive entity id format Print to the result channel a text which gets composed according to format and the parameters of the addressed session. Formats "linux:"path or "freebsd:"path produce the output of -mount_cmd for the given operating systems. In other texts 'xorriso' will substitute the following parameter names. An optional prefix "string:" will be removed. "%device%" will be substituted by the mountable device path of the drive address. "%sbsector%" will be substituted by the session start sector. "%track%", "%session%", "%volid%" will be substituted by track number, session number, or volume id of the depicted session. -print_size Print the foreseeable consumption of 2048 byte blocks by next -commit. This can last a while as a -commit gets prepared and only in last moment is revoked by this command. The result depends on several settings and also on the kind of output device. If no -jigdo options are set and not command -as "mkisofs" was used, then -padding (300 kB by default) is not counted as part of the image size. If an El Torito boot image file is already depicted, then command -print_size automatically executes -boot_image "any" "next". This means that the properties of that boot image cannot be edited by subsequent commands. -tell_media_space Print available space on the output medium and the free space after subtracting already foreseeable consumption by next -commit. Note that the title of the prediction "After commit :" is misleading. It is rather the space that may still be filled in this session without making the next -commit fail from medium overflow. The free space after the next -commit might be smaller by several MB. This depends on medium type, number of recorded sessions, and drive habits. -pvd_info Print various ID strings and timestamps which can be found in loaded ISO images. Some of the IDs may be changed by commands like -volid or -publisher. For these IDs -pvd_info reports what would be written with the next -commit. The timestamps get not automatically propagated from loaded image to newly written image. The ones for new images may be set by command -volume_date. See there for the meaning of the particular timestamps. -report_el_torito mode With mode *plain* print a report about the information found in the El Torito boot catalog of the loaded ISO image. With mode *help* print a text which explains the meaning of the lines put out by "plain". Mode *cmd* tries to print the *xorriso* commands which are necessary to produce the found boot equipment: disk identifiers, El Torito boot images, and System Area. Disk identifiers are strings which the booting operating system might use to find the ISO filesystem from where it comes. Currently known is the use of volume id and modification date. The intended use case is modification of the filesystem by having -indev and -outdev pointing to different images or drives. The result might be insufficient, if the found equipment cannot be produced by xorriso. Various SORRY events may arise in this case, but it is not guaranteed that xorriso recognizes all its insufficiencies. Mode *as_mkisofs* tries to print the *xorriso -as mkisofs* options, which are necessary to produce the found equipment. The intended use case is to use the mounted filesystem as input tree together with the printed options. -report_system_area mode With mode *plain* print a report about the information found in the System Area of the loaded ISO image. The report consists of zero to many lines with a header text, a colon, and information text. With mode *help* print a text which explains the meaning of the lines put out by "plain". You probably will have to look for more documentation which explains the technical details of the mentioned boot facilities. Modes *cmd* and *as_mkisofs* work like with command -report_el_torito. See above. With mode *gpt_disk_guid* print the GPT disk GUID of the loaded ISO in RFC 4122 text format to result channel. It is not considered an error if no GPT is present. In this case nothing is printed to result channel. With mode *gpt_crc_of:*disk_path read up to 32 KiB from the disk file with the path given after the colon. Compute the GPT compliant CRC number and print it to the result channel. The number is shown like "0x690fd979". The special disk_path "-" causes reading from standard input. With mode *make_guid* print a pseudo-random GUID in RFC 4122 text format to result channel.  File: xorriso.info, Node: Navigate, Next: Verify, Prev: Inquiry, Up: Commands 9.17 Navigation in ISO image and disk filesystem ================================================ -cd iso_rr_path Change the current working directory in the ISO image. This is prepended to iso_rr_paths which do not begin with '/'. It is possible to set the working directory to a path which does not exist yet in the ISO image. The necessary parent directories will be created when the first file object is inserted into that virtual directory. Use -mkdir if you want to enforce the existence of the directory already at first insertion. -cdx disk_path Change the current working directory in the local filesystem. To be prepended to disk_paths which do not begin with '/'. -pwd Tell the current working directory in the ISO image. -pwdx Tell the current working directory in the local filesystem. -ls iso_rr_pattern [***] List files in the ISO image which match shell patterns (i.e. with wildcards '*' '?' '[a-z]'). If a pattern does not begin with '/' then it is compared with addresses relative to -cd. Directories are listed by their content rather than as single file item. Pattern expansion may be disabled by command -iso_rr_pattern. -lsd iso_rr_pattern [***] Like -ls but listing directories as themselves and not by their content. This resembles shell command ls -d. -lsl iso_rr_pattern [***] Like -ls but also list some of the file attributes. The output format resembles shell command ls -ln. File type 'e' indicates the El Torito boot catalog. If the file has non-trivial ACL, then a '+' is appended to the permission info. If the file is hidden, then 'I' for "iso_rr", 'J' for "joliet", 'A' for "hfsplus", 'H' for multiple hiding gets appended. Together with ACL it is 'i', 'j', 'a', 'h'. -lsdl iso_rr_pattern [***] Like -lsd but also list some of the file attributes. The output format resembles shell command ls -dln. -lsx disk_pattern [***] List files in the local filesystem which match shell patterns. Patterns which do not begin with '/' are used relative to -cdx. Directories are listed by their content rather than as single file item. Pattern expansion may be disabled by command -disk_pattern. -lsdx disk_pattern [***] Like -lsx but listing directories as themselves and not by their content. This resembles shell command ls -d. -lslx disk_pattern [***] Like -lsx but also listing some of the file attributes. Output format resembles shell command ls -ln. -lsdlx disk_pattern [***] Like -lsdx but also listing some of the file attributes. Output format resembles shell command ls -dln. -getfacl iso_rr_pattern [***] Print the access permissions of the given files in the ISO image using the format of shell command getfacl. If a file has no ACL then it gets fabricated from the -chmod settings. A file may have a real ACL if it was introduced into the ISO image while command -acl was set to "on". -getfacl_r iso_rr_pattern [***] Like -gefacl but listing recursively the whole file trees underneath eventual directories. -getfattr iso_rr_pattern [***] Print the xattr of the given files in the ISO image. If a file has no such xattr then noting is printed for it. The choice of namespaces depends on the setting of command -xattr: "on" or "user" restricts it to namespace "user", "any" only omits namespace "isofs". -getfattr_r iso_rr_pattern [***] Like -gefattr but listing recursively the whole file trees underneath of directories. -du iso_rr_pattern [***] Recursively list size of directories and files in the ISO image which match one of the patterns. similar to shell command du -k. -dus iso_rr_pattern [***] List size of directories and files in the ISO image which match one of the patterns. Similar to shell command du -sk. -dux disk_pattern [***] Recursively list size of directories and files in the local filesystem which match one of the patterns. Similar to shell command du -k. -dusx disk_pattern [***] List size of directories and files in the local filesystem which match one of the patterns. Similar to shell command du -sk. -findx disk_path [-name pattern] [-type t] [-exec action [params]] -- Like -find but operating on local filesystem and not on the ISO image. This is subject to the settings of -follow. -findx accepts the same -type parameters as -find. Additionally it recognizes type "mountpoint" (or "m") which matches subdirectories which reside on a different device than their parent. It never matches the disk_path given as start address for -findx. -findx accepts the -exec actions as does -find. But except the following few actions it will always perform action "echo". in_iso reports the path if its counterpart exists in the ISO image. For this the disk_path of the -findx command gets replaced by the iso_rr_path given as parameter. E.g.: -findx /home/thomas -exec in_iso /thomas_on_cd -- not_in_iso reports the path if its counterpart does not exist in the ISO image. The report format is the same as with command -compare. add_missing iso_rr_path_start adds the counterpart if it does not yet exist in the ISO image and marks it for "rm_merge" as non-removable. E.g.: -findx /home/thomas -exec add_missing /thomas_on_cd -- is_full_in_iso reports if the counterpart in the ISO image contains files. To be used with -type "m" to report mount points. empty_iso_dir deletes all files from the counterpart in the ISO image. To be used with -type "m" to truncate mount points. estimate_size prints a lower and an upper estimation of the number of blocks which the found files together will occupy in the emerging ISO image. This does not account for the superblock, for the directories in the -findx path, or for image padding. list_extattr mode prints a script to the result channel, which would use FreeBSD command setextattr to set the file's xattr name-value pairs of user namespace. See -find for a description of parameter mode. E.g. -exec list_extattr e - -compare disk_path iso_rr_path Compare attributes and eventual data file content of a fileobject in the local filesystem with a file object in the ISO image. The iso_rr_path may well point to an image file object which is not yet committed, i.e. of which the data content still resides in the local filesystem. Such data content is prone to externally caused changes. If iso_rr_path is empty then disk_path is used as path in the ISO image too. Differing attributes are reported in detail, differing content is summarized. Both to the result channel. In case of no differences no result lines are emitted. -compare_r disk_path iso_rr_path Like -compare but working recursively. I.e. all file objects below both addresses get compared whether they have counterparts below the other address and whether both counterparts match. -compare_l disk_prefix iso_rr_prefix disk_path [***] Perform -compare_r with each of the disk_path parameters. iso_rr_path will be composed from disk_path by replacing disk_prefix by iso_rr_prefix. -show_stream iso_rr_path [***] Display the content stream chain of data files in the ISO image. The chain consists of the iso_rr_name and one or more streams, separated by " < " marks. A stream description consists of one or more texts, separated by ":" characters. The first text tells the stream type, the following ones, if ever, describe its individual properties. Frequently used types are: disk:'disk_path' for local filesystem objects. image:'iso_rr_path' for ISO image file objects. cout:'disk_path offset count' for -cut_out files. extf:'filter_name' for external filters. -zisofs:algorithm:block_size for zisofs compression filters. -zisofs-decode:algorithm:block_size for zisofs uncompression filters. -gzip for internal gzip compression filters. -gunzip for internal gzip uncompression filters. Example: '/abc/xyz.gz' < extf:'gzip' < disk:'/home/me/x' -show_stream_r iso_rr_path [***] Like -show_stream but working recursively.  File: xorriso.info, Node: Verify, Next: Restore, Prev: Navigate, Up: Commands 9.18 Evaluation of readability and recovery =========================================== It is not uncommon that optical media produce read errors. The reasons may be various and get obscured by error correction which is performed by the drives and based on extra data on the media. If a drive returns data then one can quite trust that they are valid. But at some degree of read problems the correction will fail and the drive is supposed to indicate error. 'xorriso' can scan a medium for readable data blocks, classify them according to their read speed, save them to a file, and keep track of successfully saved blocks for further tries on the same medium. By command -md5 checksums may get recorded with data files and whole sessions. These checksums are reachable only via indev and a loaded image. They work independently of the media type and can detect transmission errors. -check_media [option [option ...]] -- Try to read data blocks from the indev drive, optionally copy them to a disk file, and finally report about the encountered quality. Several options may be used to modify the default behavior. The parameters given with this command override the default settings which may have been changed by command -check_media_defaults. See there for a description of available options. The result list tells intervals of 2 KiB blocks with start address, number of blocks and quality. Qualities which begin with "+" are supposed to be valid readable data. Qualities with "-" are unreadable or corrupted data. "0" indicates qualities which are not covered by the check run or are regularly allowed to be unreadable (e.g. gaps between tracks). Alternatively it is possible to report damaged files rather than blocks. If -md5 is "on" then the default mode what=tracks looks out for libisofs checksum tags for the ISO session data and checks them against the checksums computed from the data stream. -check_media_defaults [option [option ...]] -- Preset options for runs of -check_media, -extract_cut and best_effort file extraction. Options given with -check_media will override the preset options. -extract_cut will override some options automatically. An option consists of a keyword, a "=" character, and a value. Options may override each other. So their sequence matters. The default setting at program start is: use=indev what=tracks min_lba=-1 max_lba=-1 retry=default time_limit=28800 item_limit=100000 data_to=" event=ALL abort_file=/var/opt/xorriso/do_abort_check_media sector_map=" map_with_volid=off patch_lba0=off report=blocks bad_limit=invalid slow_limit=1.0 chunk_size=0s async_chunks=0 Option "reset=now" restores these startup defaults. Non-default options are: report="files" lists the files which use damaged blocks (not with use=outdev). The format is like with find -exec report_damage. Note that a MD5 session mismatch marks all files of the session as damaged. If finer distinction is desired, perform -md5 off before -check_media. report="blocks_files" first lists damaged blocks and then affected files. use="outdev" reads from the output drive instead of the input drive. This avoids loading the ISO image tree from media. use="sector_map" does not read any media but loads the file given by option sector_map= and processes this virtual outcome. what="disc" scans the payload range of a medium without respecting track gaps. what="image" similar to "disc", but restricts scanning to the range of the ISO 9660 image, if present. min_lba=limit omits all blocks with addresses lower than limit. max_lba=limit switches to what=disc and omits all blocks above limit. chunk_size=size sets the number of bytes to be read in one low-level read operation. This gets rounded down to full blocks of 2048 bytes. 0 means automatic size. retry="on" forces read retries with minimal senseful chunk size when the normal read chunk produces a read error. This size is 1s with CD and stdio files, 16s with DVD (1 ECC Block), and 32s with BD (1 Cluster). By default, retries are only enabled with CD media. "retry=off" forbits retries for all media types. abort_file=disk_path gives the path of the file which may abort a scan run. Abort happens if the file exists and its mtime is not older than the start time of the run. Use shell command "touch" to trigger this. Other than an aborted program run, this will report the tested and untested blocks and go on with running 'xorriso'. time_limit=seconds gives the number of seconds after which the scan shall be aborted. This is useful for unattended scanning of media which may else overwork the drive in its effort to squeeze out some readable blocks. Abort may be delayed by the drive gnawing on the last single read operation. Value -1 means unlimited time. item_limit=number gives the number of report list items after which to abort. Value -1 means unlimited item number. data_to=disk_path copies the valid blocks to the given file, which must support random access writing, unless disk_path is "-" which means standard output. In the latter case, patch_lba0= settings other than "off" yield failure. Further the usual result messages of -check_media get redirected to the info channel. But beware of result messages from other commands. Beware of -*dev "-" which redirect standard output to standard error. Keep the run simple: xorriso -indev /dev/sr0 -check_media data_to=- - | md5sum xorriso -outdev /dev/sr0 -check_media data_to=- use=outdev \ what=disc min_lba=0 max_lba=999999 - | sha256sum event=severity sets the given severity for a problem event which shall be issued at the end of a check run if data blocks were unreadable or failed to match recorded MD5 checksums. Severity "ALL" disables this event. sector_map=disk_path tries to read the file given by disk_path as sector bitmap and to store such a map file after the scan run. The bitmap tells which blocks have been read successfully in previous runs. It is the persistent memory for several scans on the same medium, even with intermediate eject, in order to collect readable blocks whenever the drive is lucky enough to produce them. The stored file contains a human readable TOC of tracks and their start block addresses, followed by binary bitmap data. By default, untested blocks are not considered bad, but rather as intentionally unread. If you expect time_limit= or item_limit= to abort the run, then consider to use bad_limit="untested". map_with_volid="on" examines tracks whether they are ISO images and prints their volume IDs into the human readable TOC of sector_map=. patch_lba0="on" transfers within the data_to= file a copy of the currently loaded session head to the start of that file and patches it to be valid at that position. This makes the loaded session the last valid session of the image file when it gets mounted or loaded as stdio: drive. New sessions will be appended after this last session and will overwrite any sessions which have followed it. patch_lba0="force" performs patch_lba0="on" even if 'xorriso' believes that the copied data are not valid. patch_lba0= may also bear a number. If it is 32 or higher it is taken as start address of the session to be copied. In this case it is not necessary to have an -indev and a loaded image. ":force" may be appended after the number. bad_limit=threshold sets the highest quality which shall be considered as damage. Choose one of "good", "md5_match", "slow", "partial", "valid", "untested", "md5_mismatch", "invalid", "tao_end", "off_track", "unreadable". "valid" and "invalid" are qualities imported from a sector_map file. "tao_end" and "off_track" are intentionally not readable, but not bad either. "partial" are blocks retrieved from a partially readable chunk. They are supposed to be ok but stem from a suspicious neighborhood. "md5_match" and "md5_mismatch" regions overlap with regions of other quality. The former is a strong confirmation for quality, the latter only tells that one or more blocks of the region must be wrong. By default bad_limit is set higher than md5_mismatch, so that mismatches are classified as quality class "0" rather than "-". This means that the sectors of a MD5 mismatch range are recorded in the sector_map as successfully read, if the drive handed them out at all. Set "bad_limit=md5_mismatch" to let the sector_map record the whole mismatching range as yet not retrieved. slow_limit=threshold sets the time threshold for a single read chunk to be considered slow. This may be a fractional number like 0.1 or 1.5. async_chunks=number enables asynchronous MD5 processing if number is 2 or larger. In this case the given number of read chunks is allocated as fifo buffer. On very fast MMC drives try: chunk_size=64s async_chunks=16. -check_md5 severity iso_rr_path [***] Compare the data content of the given files in the loaded image with their recorded MD5 checksums, if there are any. In case of any mismatch an event of the given severity is issued. It may then be handled by appropriate settings of commands -abort_on or -return_with which both can cause non-zero exit values of the program run. Severity ALL suppresses that event. This command reports match and mismatch of data files to the result channel. Non-data files cause NOTE events. There will also be UPDATE events from data reading. If no iso_rr_path is given then the whole loaded session is compared with its MD5 sum. Be aware that this covers only one session and not the whole image if there are older sessions. -check_md5_r severity iso_rr_path [***] Like -check_md5 but checking all data files underneath the given paths. Only mismatching data files will be reported.  File: xorriso.info, Node: Restore, Next: Emulation, Prev: Verify, Up: Commands 9.19 osirrox ISO-to-disk restore commands ========================================= Normally 'xorriso' only writes to disk files which were given as stdio: pseudo-drives or as log files. But its alter ego osirrox is able to extract file objects from ISO images and to create, overwrite, or delete file objects on disk. Disk file exclusions by -not_mgt, -not_leaf, -not_paths apply. If disk file objects already exist then the settings of -overwrite and -reassure apply. But -overwrite "on" only triggers the behavior of -overwrite "nondir". I.e. directories cannot be deleted. Access permissions of files in the ISO image do not restrict restoring. The directory permissions on disk have to allow rwx. -osirrox setting[:option:...] Setting *off* disables disk filesystem manipulations. This is the default unless the program was started with leafname *osirrox*. Elsewise the capability to restore files can be enabled explicitly by -osirrox *on*. It can be irrevocably disabled by -osirrox *banned*. The setting *blocked* is like *off*. But it can only be revoked by setting *unblock*, which elsewise is like *on*. This can be used to curb command scripts which might use *on* undesiredly. To enable restoring of special files by *device_files* is potentially dangerous. The meaning of the number st_rdev (see man 2 stat) depends much on the operating system. Best is to restore device files only to the same system from where they were copied. If not enabled, device files in the ISO image are ignored during restore operations. Due to a bug of previous versions, device files from previous sessions might have been altered to major=0, minor=1. So this combination does not get restored. Option *concat_split_on* is default. It enables restoring of split file directories as data files if the directory contains a complete collection of -cut_out part files. With option *concat_split_off* such directories are handled like any other ISO image directory. Option *auto_chmod_off* is default. If *auto_chmod_on* is set then access restrictions for disk directories get circumvented if those directories are owned by the effective user who runs 'xorriso'. This happens by temporarily granting rwx permission to the owner. Option *sort_lba_on* may improve read performance with optical drives. It can restore large numbers of hard links without exhausting -temp_mem_limit. It does not preserve directory mtime and it needs -osirrox option auto_chmod_on in order to extract directories which offer no write permission. Default is *sort_lba_off*. Option *o_excl_on* is the default unless the program was started with leafname "osirrox". On GNU/Linux it tries to avoid using drives which are mounted or in use by other libburn programs. Option *o_excl_off* on GNU/Linux enables access to such drives by the equivalent of -drive_access "shared:readonly". I.e. drives which get acquired while *o_excl_off* will refuse to get blanked, formatted, written, or ejected. But be aware that even harmless inquiries can spoil ongoing burns of CD-R[W] and DVD-R[W]. Option *strict_acl_off* is default. It tolerates on FreeBSD the presence of directory "default" ACLs in the ISO image. With *strict_acl_on* these GNU/Linux ACLs cause on FreeBSD a FAILURE event during restore with -acl "on". Option *check_md5_off* disables MD5 checking during copy to disk. The default option *check_md5_on* enables it if -md5 is "on". If a data file with recorded MD5 is copied as a whole to the disk filesystem, then the MD5 of the copied content gets computed and compared with the recorded MD5. A mismatch causes an error message of severity SORRY. Option *check_md5_force* causes an error message if -md5 is "on" but no MD5 is recorded for the data file. Option *sparse=* controls production of sparse files during extraction of files from the ISO filesystem. Default is *sparse=off*. A positive number like in *sparse=1m* sets the minimum requirement for the length of a sequence of 0-bytes which shall be represented by a gap. This saves disk space if the disk filesystem supports sparse files. A gap gets created by help of lseek(2) if a sequence of read buffers, which contain only 0-bytes, bears at least the minimum amount of bytes. Expect read buffers to be in the size range of 32k or 64k. Command -paste_in creates gaps only if the writing begins at or after the end of the existing disk file. So the sequence of -paste_in commands matters. Command -concat does not create sparse files. -extract iso_rr_path disk_path Copy the file objects at and underneath iso_rr_path to their corresponding addresses at and underneath disk_path. This is the inverse of -map or -update_r. If iso_rr_path is a directory and disk_path is an existing directory then both trees will be merged. Directory attributes get extracted only if the disk directory is newly created by the copy operation. Disk files get removed only if they are to be replaced by file objects from the ISO image. As many attributes as possible are copied together with restored file objects. -extract_single iso_rr_path disk_path Like -extract, but if iso_rr_path is a directory then its sub tree gets not restored. -extract_l iso_rr_prefix disk_prefix iso_rr_path [***] Perform -extract with each of the iso_rr_path parameters. disk_path will be composed from iso_rr_path by replacing iso_rr_prefix by disk_prefix. -extract_cut iso_rr_path byte_offset byte_count disk_path Copy a byte interval from a data file out of an ISO image into a newly created disk file. The main purpose for this is to offer a way of handling large files if they are not supported by mount -t iso9660 or if the target disk filesystem cannot store large files. If the data bytes of iso_rr_path are stored in the loaded ISO image, and no filter is applied, and byte_offset is a multiple of 2048, then a special run of -check_media is performed. It may be quicker and more rugged than the general reading method. -cpx iso_rr_path [***] disk_path Copy single leaf file objects from the ISO image to the address given by disk_path. If more then one iso_rr_path is given then disk_path must be a directory or non-existent. In the latter case it gets created and the extracted files get installed in it with the same leafnames. Missing directory components in disk_path will get created, if possible. Directories are allowed as iso_rr_path only with -osirrox "concat_split_on" and only if they actually represent a complete collection of -cut_out split file parts. -cpax iso_rr_path [***] disk_path Like -cpx but restoring mtime, atime as in ISO image and trying to set ownership and group as in ISO image. -cp_rx iso_rr_path [***] disk_path Like -cpx but also extracting whole directory trees from the ISO image. The resulting disk paths are determined as with shell command cp -r : If disk_path is an existing directory then the trees will be inserted or merged underneath this directory and will keep their leaf names. The ISO directory "/" has no leaf name and thus gets mapped directly to disk_path. -cp_rax iso_rr_path [***] disk_path Like -cp_rx but restoring mtime, atime as in ISO image and trying to set ownership and group as in ISO image. -paste_in iso_rr_path disk_path byte_offset byte_count Read the content of a ISO data file and write it into a data file on disk beginning at the byte_offset. Write at most byte_count bytes. This is the inverse of command -cut_out. -concat mode [target | lim prog [args [...]] lim] iso_rr_path [***] Copy the data content of one or more data files of the ISO image into a disk file object, into a file descriptor, or start a program and copy the data into its standard input. The latter is subject to the security restrictions for external filters. Modes *overwrite* and *append* write into the target which is given by the second parameter. This may be the path to a disk file object, or "-" which means standard output, or a text of the form /dev/fd/number, where number is an open file descriptor (e.g. standard error is /dev/fd/2). An existing target file is not removed before writing begins. If it is not able to take content data, then this command fails. Mode overwrite truncates regular data files to 0 size before writing into them. Example: -concat append /home/me/accumulated_text /my/iso/text - Mode *pipe* expects as second parameter a delimiter word which shall mark the end of the program argument list. The third argument is the disk_path to the program. It must contain at least one '/'. $PATH is not applied. Further parameters up to the announced delimiter word are used as arguments with the program start. Example: -iso_rr_pattern on \ -concat pipe + /usr/bin/wc + "/my/iso/files*" - The further parameters in all modes are the iso_rr_paths of data files. Their content gets concatenated in the copy. -extract_boot_images disk_path Copy boot equipment to disk, which is not necessarily represented as data files in the ISO filesystem. The data get written into various files in a disk directory, which may already exist or of which the parent must exist so that it can get created. Files may be missing if their corresponding information is not present in the ISO filesystem. Existing files do not get overwritten but rather cause a failure event. The same data may appear in different files. E.g. the El Torito boot image for EFI is often the same data as the EFI partition in MBR or GPT. File "eltorito_catalog.img" contains the El Torito Boot Catalog. Files "eltorito_img*_*.img" contain El Torito Boot images. The first "*" gives the image number, the second "*" gives the type: "bios", "mac", "ppc", "uefi", or a hex number. File "mbr_code_isohybrid.img" contains the ISOLINUX MBR template. File "mbr_code_grub2.img" contains the GRUB2 MBR template. File "systemarea.img" contains the whole 32 KiB of System Area if not all zero. Files "mbr_part*_efi.img" contain EFI partition images from the MBR partition table. The "*" text part gives the partition number. Files "mbr_part*_prep.img" contain PReP partition images. Files "gpt_part*_efi.img" contain EFI partition images from GPT. Files "gpt_part*_hfsplus.img" contain HFS+ partition images from GPT. To avoid extracting the whole HFS+ aspect of hybrid ISO filesystems, the partition image is extracted only if it has less than half of the size of the ISO filesystem or if the partition is outside the ISO filesystem. -mount drive entity id path Produce the same line as -mount_cmd and then execute it as external program run after giving up the depicted drive. See also -mount_opts. This demands -osirrox to be enabled and normally will succeed only for the superuser. For safety reasons the mount program is only executed if it is reachable as /bin/mount or /sbin/mount.  File: xorriso.info, Node: Emulation, Next: Scripting, Prev: Restore, Up: Commands 9.20 Command compatibility emulations (cdrtools) ================================================ Writing of ISO 9660 on CD is traditionally done by program mkisofs as ISO 9660 image producer and cdrecord as burn program. 'xorriso' does not strive for their comprehensive emulation. Nevertheless it is ready to perform some of its core tasks under control of commands which in said programs trigger comparable actions. -as personality option [options] -- Perform the variable length option list as sparse emulation of the program depicted by the personality word. Personality "*mkisofs*" accepts the options listed with: -as mkisofs -help -- Among them: -R (always on), -r, -J, -o, -M, -C, -dir-mode, -file-mode, -path-list, -m, -exclude-list, -f, -print-size, -pad, -no-pad, -V, -v, -version, -graft-points, -z, -no-emul-boot, -b, -c, -boot-info-table, -boot-load-size, -input-charset, -G, -output-charset, -U, -hide, -hide-joliet, -hide-list, -hide-joliet-list, file paths and pathspecs. A lot of options are not supported and lead to failure of the mkisofs emulation. Some are ignored, but better do not rely on this tolerance. The supported options are documented in detail in xorrisofs.info and in man xorrisofs. The description here is focused on the effect of mkisofs emulation in the context of a 'xorriso' run. Other than with the "cdrecord" personality there is no automatic -commit at the end of a "mkisofs" option list. Verbosity settings -v (= "UPDATE") and -quiet (= "SORRY") persist. The output file persists until things happen like -commit, -rollback, -dev, or end of 'xorriso'. Options which affect all file objects in the ISO image, like -r or -dir-mode, will be applied only to files which are present in the ISO image when the command -as ends. If you use several -as mkisofs commands in the same run, then consider to put such options into the last -as command. If files are added to the image, then -pacifier gets set to "mkisofs" and -stdio_sync is defaulted to "off" if no such setting was made yet. -graft-points is equivalent to -pathspecs on. Note that pathspecs without "=" are interpreted differently than with 'xorriso' command -add. Directories get merged with the root directory of the ISO image, other filetypes get mapped into that root directory. If pathspecs are given and if no output file was chosen before or during the "mkisofs" option list, then standard output (-outdev "-") will get into effect. If -o points to a regular file, then it will be truncated to 0 bytes when finally writing begins. This truncation does not happen if the drive is chosen by 'xorriso' commands before -as mkisofs or after its list delimiter. Directories and symbolic links are no valid -o targets. Writing to stdout is possible only if -as "mkisofs" was among the start arguments or if other start arguments pointed the output drive to standard output. -print-size inhibits automatic image production at program end. This ban is lifted only if the pending image changes get discarded. Padding is counted as part of the ISO image if not option -emul-toc is given. If no -iso-level is given, then level 1 is chosen when the first file or directory is added to the image. At the same occasion directory names get allowed to violate the standard by -compliance option allow_dir_id_ext. This may be avoided by option -disallow_dir_id_ext. Option -root is supported. Option -old-root is implemented by 'xorriso' commands -mkdir, -cp_clone, -find update_merge, and -find rm_merge. -root and -old-root set command -disk_dev_ino to "ino_only" and -md5 to "on", by default. -disk_dev_ino can be set to "off" by --old-root-no-ino or to "on" by --old-root-devno . -md5 can be set to "off" by --old-root-no-md5 . Not original mkisofs options are --quoted_path_list , --hardlinks , --acl , --xattr , --md5 , --stdio_sync . They work like the 'xorriso' commands with the same name and hardcoded parameter "on", e.g. -acl "on". Explicit parameters are expected by --stdio_sync and --scdbackup_tag. The capability to preserve multi-session history on overwritable media gets disabled by default. It can be enabled by using --emul-toc with the first session. See -compliance no_emul_toc. --sort-weight gets as parameters a number and an iso_rr_path. The number becomes the LBA sorting weight of regular file iso_rr_path or of all regular files underneath directory iso_rr_path. (See -find -exec sort_weight). Adopted from grub-mkisofs are --protective-msdos-label (see -boot_image grub partition_table=on) and --modification-date=YYYYMMDDhhmmsscc (see -volume_date uuid). For EFI bootable GRUB boot images use --efi-boot. It performs -boot_image grub efi_path= surrounded by two -boot_image "any" "next". Alternative option -e from Fedora genisoimage sets bin_path and platform_id for EFI, but performs no "next". For MBR bootable ISOLINUX images there is -isohybrid-mbr FILE, where FILE is one of the Syslinux files mbr/isohdp[fp]x*.bin . Use this instead of -G to apply the effect of -boot_image isolinux partition_table=on. --boot-catalog-hide is -boot_image any cat_hidden=on. -mips-boot is the same as -boot_image any mips_path= . -mipsel-boot leads to mipsel_path= . -partition_offset number is -boot_image any partition_offset=number. Command -append_partition is supported. -untranslated_name_len number is -compliance untranslated_name_len=number. --old-empty is -compliance old_empty. The options of genisoimage Jigdo Template Extraction are recognized and performed via 'xorriso' command -jigdo. See the "Alias:" names there for the meaning of the genisoimage options. Personalities "*xorrisofs*", "*genisoimage*", and "*genisofs*" are aliases for "mkisofs". If 'xorriso' is started with one of the leafnames "xorrisofs", "genisofs", "mkisofs", or "genisoimage", then it performs -read_mkisofsrc and prepends -as "genisofs" to the program arguments. I.e. all arguments will be interpreted mkisofs style until "--" is encountered. From then on, arguments are interpreted as 'xorriso' commands. --no_rc as first argument of such a program start prevents interpretation of startup files. See section FILES below. Personality "*cdrecord*" accepts the options listed with: -as cdrecord -help -- Among them: -v, dev=, speed=, blank=, fs=, -eject, -atip, padsize=, tsize=, -isosize, -multi, -msinfo, --grow_overwriteable_iso, write_start_address=, track source file path or "-" for standard input as track source. It ignores most other options of cdrecord and cdrskin but refuses on -audio, -scanbus, and on blanking modes unknown to 'xorriso'. The scope is only a single data track per session to be written to blank, overwritable, or appendable media. The medium gets closed if closing is applicable and not option -multi is present. If an input drive was acquired, then it is given up. This is only allowed if no image changes are pending. dev= must be given as 'xorriso' device address. Addresses like 0,0,0 or ATA:1,1,0 are not supported. If a track source is given, then an automatic -commit happens at the end of the "cdrecord" option list. --grow_overwriteable_iso enables emulation of multi-session on overwritable media. To enable emulation of a TOC, the first session needs -C 0,32 with -as mkisofs (but no -M) and --grow_overwriteable_iso write_start_address=32s with -as cdrecord. A much more elaborate libburn based cdrecord emulator is the program cdrskin. Personalites "*xorrecord*", "*wodim*", and "*cdrskin*" are aliases for "cdrecord". If 'xorriso' is started with one of the leafnames "xorrecord", "cdrskin", "cdrecord", or "wodim", then it automatically prepends -as "cdrskin" to the program arguments. I.e. all arguments will be interpreted cdrecord style until "--" is encountered. From then on, arguments are interpreted as 'xorriso' commands. --no_rc as first argument of such a program start prevents interpretation of 'xorriso' startup files. See section FILES below. -read_mkisofsrc Try one by one to open for reading: ./.mkisofsrc , $MKISOFSRC , $HOME/.mkisofsrc , $(dirname $0)/.mkisofsrc On success interpret the file content as of man mkisofs CONFIGURATION, and end this command. Do not try further files. The last address is used only if start argument 0 has a non-trivial dirname. The reader currently interprets the following NAME=VALUE pairs: APPI (-application_id) , PUBL (-publisher) , SYSI (-system_id) , VOLI (-volid) , VOLS (-volset_id) Any other lines will be silently ignored. -pacifier behavior_code Control behavior of UPDATE pacifiers during write operations. The following behavior codes are defined: "xorriso" is the default format: Writing: sector XXXXX of YYYYYY [fifo active, nn% fill] "cdrecord" looks like: X of Y MB written (fifo nn%) [buf mmm%] "mkisofs" nn% done, estimate finish Tue Jul 15 20:13:28 2008 The frequency of the messages can be adjusted by "interval=number" where number gives the seconds between two messages. Permissible settings are 0.1 to 60.0. -scdbackup_tag list_path record_name Set the parameter "name" for a scdbackup checksum record. It will be appended in an scdbackup checksum tag to the -md5 session tag if the image starts at LBA 0. This is the case if it gets written as first session onto a sequential medium, or piped into a program, named pipe or character device. If list_path is not empty then the record will also be appended to the data file given by this path. Program scdbackup_verify will recognize and verify tag and file record. An empty record_name disables this feature.  File: xorriso.info, Node: Scripting, Next: Frontend, Prev: Emulation, Up: Commands 9.21 Scripting, dialog and program control features =================================================== -no_rc Only if used as first program argument this command prevents reading and interpretation of startup files. See section FILES below. -options_from_file fileaddress Read quoted input from fileaddress and execute it like dialog lines. Empty lines and lines which begin by # are ignored. Normally one line should hold one 'xorriso' command and all its parameters. Nevertheless lines may be concatenated by a trailing backslash. See also section "Command processing", paragraph "Quoted input". -help Print helptext. -version Print program name and version, component versions, license. -list_extras code Tell whether certain extra features were enabled at compile time. Code "all" lists all features and a headline. Other codes pick a single feature. Code "codes" lists them. They share names with related commands (see also there): "acl" tells whether xorriso has an adapter for local filesystems ACLs. "xattr" tells whether xorriso has an adapter for local filesystems EA. "jigdo" tells whether production of Jigdo files is possible. "zisofs" tells whether zisofs and built-in gzip filters are enabled. "external_filter" tells whether external filter processes are allowed and whether they are allowed if real user id and effective user id differ. "dvd_obs" tells whether 64 kB output to DVD media is default. "use_readline" tells whether readline may be enabled in dialog mode. -history textline Copy textline into libreadline history. -status mode|filter Print the current settings of 'xorriso'. Modes: short... print only important or altered settings long ... print all settings including defaults long_history like long plus history lines Filters begin with '-' and are compared literally against the output lines of -status:long_history. A line is put out only if its start matches the filter text. No wildcards. -status_history_max number Set maximum number of history lines to be reported with -status "long_history". -list_delimiter word Set the list delimiter to be used instead of "--". It has to be a single word, must not be empty, not longer than 80 characters, and must not contain quotation marks. For brevity the list delimiter is referred as "--" throughout this text. -sh_style_result "on"|"off" Make the result output of some filesystem inspection commands look more like the output of equivalent shell commands. The most important effect is to prevent the wrapping of file addresses into quotation marks with commands -pwd -pwdx -ls -lsd -lsl -lsdl -lsx -lsdx -lslx -lsdlx -du -dus -dux -dusx -findx -find This will make ambiguous the representation of file names which contain newline characters. On the other hand it should facilitate integration of xorriso into shell scripts which already use the corresponding shell commands. -backslash_codes "on"|"off"|mode[:mode] Enable or disable the interpretation of symbolic representations of special characters with quoted input, or with program arguments, or with program text output. If enabled the following translations apply: \a=bell(007) \b=backspace(010) \e=Escape(033) \f=formfeed(014) \n=linefeed(012) \r=carriage_return(015) \t=tab(011) \v=vtab(013) \\=backslash(134) \[0-7][0-7][0-7]=octal_code \x[0-9a-f][0-9a-f]=hex_code \cC=control-C Translations can occur with quoted input in 3 modes: "in_double_quotes" translates only inside " quotation. "in_quotes" translates inside " and ' quotation. "with_quoted_input" translates inside and outside quotes. With the start program arguments there is mode: "with_program_arguments" translates program arguments. Mode "encode_output" encodes output characters. It combines "encode_results" with "encode_infos". Inside single or double quotation marks encoding applies to 8-bit characters octal 001 to 037 , 177 to 377 and to backslash(134). Outside quotation marks some harmless ASCII control characters stay unencoded: bell(007), backspace(010), tab(011), linefeed(012), formfeed(014), carriage_return(015). Mode "off" is default and disables any translation. Mode "on" is "with_quoted_input:with_program_arguments:encode_output". -temp_mem_limit number["k"|"m"] Set the maximum size of temporary memory to be used for image dependent buffering. Currently this applies to pattern expansion, LBA sorting, restoring of hard links. Default is 16m = 16 MiB, minimum 64k = 64 kiB, maximum 1024m = 1 GiB. -print text Print a text line to the result channel which is by default stdout. -print_info text Print a text line to the info channel which is by default stderr. -print_mark text Print a text line to the mark channel which is by default directed to both, result and info channel. An empty text will cause no output at all. -prompt text Show text at beginning of output line and wait for the user to hit the Enter key or to send a line via stdin. -sleep seconds Wait for the given number of seconds before performing the next command. Expect coarse granularity no better than 1/100 seconds. -errfile_log mode path|channel If problem events are related to input files from the filesystem, then their disk_paths can be logged to a file or to output channels R or I. Mode can either be "plain" or "marked". The latter causes marker lines which give the time of log start, burn session start, burn session end, log end or program end. In mode "plain", only the file paths are logged. If path is "-" or "-R" then the log is directed to the result channel. Path "-I" directs it to the info message channel. Any text that does not begin with "-" is used as path for a file to append the log lines. Problematic files can be recorded multiple times during one program run. If the program run aborts then the list might not be complete because some input files might not have been processed at all. The errfile paths are transported as messages of very low severity "ERRFILE". This transport becomes visible with -report_about "ALL". -session_log path If path is not empty it gives the address of a plain text file where a log record gets appended after each session. This log can be used to determine the start_lba of a session for mount options -o sbsector= (on GNU/Linux) or -s (on FreeBSD) from date or volume ID. Record format is: timestamp start_lba size volume-id The first three items are single words, the rest of the line is the volume ID. -scsi_log "on"|"off" Mode "on" enables very verbose logging of SCSI commands and drive replies. Logging messages get printed to stderr, not to any of the 'xorriso' output channels. A special property of this command is that the first -scsi_log setting among the start arguments is in effect already when the first operations of 'xorriso' begin. Only "-scsi_log" with dash "-" is recognized that way. -end End program after writing pending changes. -rollback_end Discard pending changes. End program immediately. # any text Only in dialog or file execution mode, and only as first non-whitespace in line: Do not execute the line but store it in readline history.  File: xorriso.info, Node: Frontend, Next: ExDevices, Prev: Scripting, Up: Commands 9.22 Support for frontend programs via stdin and stdout ======================================================= -pkt_output "on"|"off" Consolidate text output on stdout and classify each line by a channel indicator: 'R:' for result lines, 'I:' for notes and error messages, 'M:' for -mark texts. Next is a decimal number of which only bit 0 has a meaning for now. 0 means no newline at end of payload, 1 means that the newline character at the end of the output line belongs to the payload. After another colon and a blank follows the payload text. Example: I:1: enter option and parameters : -logfile channel fileaddress Copy output of a channel to the given file. Channel may be one of: "." for all channels, "I" for info messages, "R" for result lines, "M" for -mark texts. -mark text If text is not empty it will get put out on "M" channel each time 'xorriso' is ready for the next dialog line or before 'xorriso' performs a command that was entered to the pager prompt. -msg_op opcode parameter_text This command shall facilitate extraction of particular information from the message output of other commands. It gives access to the C API function Xorriso_parse_line() and to the message sieve that is provided by the C API. Please refer to their descriptions in file xorriso.h. Further it helps to interpret the severity codes of info messages. Intended users are frontend programs which operate xorriso in dialog mode. The result output of this command is not caught by the message sieve. The following opcodes are defined: *start_sieve* Install the message sieve as of Xorriso_sieve_big() and start watching program messages. The parameter_text has no meaning. *show_sieve* Show a list of filter rule names. The parameter_text has no meaning. The list begins by a line with the return value of Xorriso_sieve_get_result() with flag bit3. If this value is larger than 0, then the next line tells the number of names. The following lines show one name each. *read_sieve* Use the parameter_text as name of a filter rule and inquire its next recorded result. See Xorriso_sieve_big() for a list of names and reply strings. The recorded strings are put out on result channel. They get wrapped into lines which tell their structure. The first line tells the return value of Xorriso_sieve_get_result(). The next line tells the number of strings. Each string begins by a line that tells the number of lines of the string. Then follow these lines. They are to be concatenated with a newline character between each of them. Finally the number of still available recorded results of the given name is put out. *clear_sieve* Dispose all recorded strings and continue watching program messages. The parameter_text has no meaning. *end_sieve* Dispose the sieve with its filter rules and stop watching program messages. The parameter_text has no meaning. *parse* Read a text from dialog input and submit it to Xorriso_parse_line(). The parameter_text word shall consist of several words separated by blanks. It will be necessary to use both kinds of quotation marks. E.g. "'ISO session :' " 0 0 1" The five parameter words are: prefix, separators, max_words, flag, number_of_input_lines. The former four are handed over to Xorriso_parse_line(). The number of input lines minus one tells xorriso how many newline characters are part of the input text. The announced number of text lines will be read from dialog input, concatenated with a newline character between each of them, and submitted to Xorriso_parse_line() as parameter line. Note that newlines outside of quotation marks are interpreted as separators if the separators parameter is empty. The parsed strings are put out on result channel. They get wrapped into lines which tell their structure. The first line tells the return value of Xorriso_parse_line(). The next line tells the number of strings. Each string begins by a line that tells the number of lines of the string. Then follow these lines. They are to be concatenated with a newline character between each of them. If -backslash_codes "encode_output" is enabled, then the strings undergo encoding as if they were enclosed in quotes. Escpecially each string will be put out as a single result line. *parse_bulk* Like "parse", but with the fifth parameter word being number_of_input_texts rather than number_of_input_lines. Each input text has to be preceded by a line that tells number_of_input_lines as with "parse". Then come the announced number of text lines. All input texts will be read before printing of result lines begins. This consumes memory in xorriso. So the number_of_input_texts should not be extremely high. On the other hand, large transactions of command, input texts, and results are desirable if connection latency is an issue. *parse_silently* Like "parse" but not issuing a prompting message. Confusing to humans. *parse_bulk_silently* Like "parse_bulk" but not issuing a prompting message. Confusing to humans. *compare_sev* The parameter_text should contain two comma separated severity texts as issued by this program. Like "SORRY,UPDATE". See also paragraph "Exception processing". These two severity texts get compared and a number gets printed to the result channel. This number is 0 if both severities are equal. It is -1 if the first severity is lower than the second one. It is 1 is the first severity is higher than the second one. Above example "SORRY,UPDATE" will yield 1. *list_sev* Print to the result channel a blank separated list of all severity names. Sorted from low to high severity. -named_pipe_loop mode[:mode] disk_path_stdin disk_path_stdout disk_path_stderr Temporarily replace standard input, standard output and standard error by named pipes. Enter dialog mode without readline. Defined modes are: "cleanup" removes the submitted pipe files when the loop ends. "keep" does not delete them. This is the default. "buffered" reads all lines from the input pipe until EOF before it opens the output pipes and processes the input lines. "direct" opens the output pipes after the first input line was read. Each line is executed directly after it is read. This is the default. The other three parameters must either be disk paths to existing named pipes, or be "-" to leave the according standard i/o channel unreplaced. xorriso will open the stdin pipe, read and execute dialog lines from it until the sender closes the pipe. The output pipes get opened depending on mode "buffered" or "direct". After all lines are executed, xorriso will close its side of the pipes and enter a new cycle of opening, reading and executing. If an input line consists only of the word "end_named_pipe_loop" then -named_pipe_loop will end and further xorriso commands may be executed from other sources. -launch_frontend program [arguments ...] -- Start the program that is given as first parameter. Submit the other parameters as program arguments. Enable xorriso dialog mode. Two nameless pipe objects are created. xorriso standard input gets connected to the standard output of the started program. xorriso standard output and standard error get connected to the standard input of that program. xorriso will abort when the started program ends or if it cannot be started at all. In both cases it will return a non-zero exit value. The exit value will be zero if the frontend sends -end or -rollback_end before ending itself. This command may be totaly banned at compile time. It is banned by default if xorriso runs under setuid permissions. The program name will not be searched in the $PATH directories. To make this clear, it must contain at least one /-character. Best is an absolute path. Example: xorriso -launch_frontend "$(which xorriso-tcltk)" -stdio - The frontend program should first send via its standard output: -mark 0 -pkt_output on -msg_op start_sieve - -reassure off It should be ready to decode -pkt_output and to react on -mark messages. Best is to increment the -mark number after each sent command sequence and then to wait for the new number to show up in a mark message: ...some...commands... -mark Further are advised: -report_about UPDATE -abort_on NEVER -iso_rr_pattern off -disk_pattern off A check of the xorriso version should be done, in order to make sure that all desired features are present. Command -launch_frontend will only work once per xorriso run. If no command parameters are submitted or if program is an empty text, then no program will be started but nevertheless -launch_frontend will be irrevocably disabled. -prog text Use text as name of this program in subsequent messages -prog_help text Use text as name of this program and perform -help.  File: xorriso.info, Node: Examples, Next: Files, Prev: Commands, Up: Top 10 Examples *********** * Menu: * ExDevices:: As superuser learn about available drives * ExCreate:: Blank medium and compose a new ISO image as batch run * ExDialog:: A dialog session doing about the same * ExGrowing:: Manipulate an existing ISO image on the same medium * ExModifying:: Copy modified ISO image from one medium to another * ExBootable:: Bring a prepared ISOLINUX tree onto medium and make it bootable * ExCharset:: Change existing file name tree from ISO-8859-1 to UTF-8 * ExPseudo:: Operate on storage facilities other than optical drives * ExCdrecord:: Burn an existing ISO image file to medium * ExMkisofs:: Perform multi-session runs as of cdrtools traditions * ExGrowisofs:: Let 'xorriso' work underneath growisofs * ExException:: Adjust thresholds for verbosity, exit value and program abort * ExTime:: Examples of input timestrings * ExIncBackup:: Incremental backup of a few directory trees * ExRestore:: Restore directory trees from a particular ISO session to disk * ExRecovery:: Try to retrieve blocks from a damaged medium  File: xorriso.info, Node: ExDevices, Next: ExCreate, Prev: Frontend, Up: Examples 10.1 As superuser learn about available drives ============================================== On Linux, FreeBSD or NetBSD consider to give rw-permissions to those users or groups which shall be able to use the drives with 'xorriso'. On Solaris use pfexec. Consider to restrict privileges of 'xorriso' to "base,sys_devices" and to give r-permission to user or group. $ xorriso -device_links 1 -dev '/dev/cdrom1' rwrw-- : 'TSSTcorp' 'DVD-ROM SH-D162C 1 -dev '/dev/cdrw' rwrw-- : 'TSSTcorp' 'CDDVDW SH-S223B' 2 -dev '/dev/cdrw3' rwrw-- : 'HL-DT-ST' 'BDDVDRW_GGC-H20L'  File: xorriso.info, Node: ExCreate, Next: ExDialog, Prev: ExDevices, Up: Examples 10.2 Blank medium and compose a new ISO image as batch run ========================================================== Acquire drive /dev/sr2, make medium ready for writing a new image, fill the image with the files from hard disk directories /home/me/sounds and /home/me/pictures. Because no -dialog "on" is given, the program will then end by writing the session to the medium. $ xorriso -outdev /dev/sr2 \ -blank as_needed \ -map /home/me/sounds /sounds \ -map /home/me/pictures /pictures The ISO image may be shaped in a more elaborate way like the following: Omit some unwanted stuff by removing it from the image directory tree. Reintroduce some wanted stuff. $ cd /home/me $ xorriso -outdev /dev/sr2 \ -blank as_needed \ -map /home/me/sounds /sounds \ -map /home/me/pictures /pictures \ -rm_r \ /sounds/indecent \ '/pictures/*private*' \ /pictures/confidential \ -- \ -cd / \ -add pictures/confidential/work* -- Note that '/pictures/*private*' is a pattern for iso_rr_paths while pictures/confidential/work* gets expanded by the shell with addresses from the hard disk. Commands -add and -map have different parameter rules but finally the same effect: they put files into the image.  File: xorriso.info, Node: ExDialog, Next: ExGrowing, Prev: ExCreate, Up: Examples 10.3 A dialog session doing about the same as the previous example ================================================================== Some settings are already given as start argument. The other activities are done as dialog input. The pager gets set to 20 lines of 80 characters. The drive is acquired by command -dev rather than -outdev in order to see the message about its current content. By command -blank this content is made ready for being overwritten and the loaded ISO image is made empty. In order to be able to eject the medium, the session needs to be committed explicitly. $ xorriso -dialog on -page 20 80 -disk_pattern on enter option and arguments : -dev /dev/sr2 enter option and arguments : -blank as_needed enter option and arguments : -map /home/me/sounds /sounds -map /home/me/pictures /pictures enter option and arguments : -rm_r /sounds/indecent /pictures/*private* /pictures/confidential enter option and arguments : -cdx /home/me/pictures -cd /pictures enter option and arguments : -add confidential/office confidential/factory enter option and arguments : -du / enter option and arguments : -commit_eject all -end  File: xorriso.info, Node: ExGrowing, Next: ExModifying, Prev: ExDialog, Up: Examples 10.4 Manipulate an existing ISO image on the same medium ======================================================== Load image from drive. Remove (i.e. hide) directory /sounds and its subordinates. Rename directory /pictures/confidential to /pictures/restricted. Change access permissions of directory /pictures/restricted. Add new directory trees /sounds and /movies. Burn to the same medium, check whether the tree can be loaded, and eject. $ xorriso -dev /dev/sr2 \ -rm_r /sounds -- \ -mv \ /pictures/confidential \ /pictures/restricted \ -- \ -chmod go-rwx /pictures/restricted -- \ -map /home/me/prepared_for_dvd/sounds_dummy /sounds \ -map /home/me/prepared_for_dvd/movies /movies \ -commit -eject all  File: xorriso.info, Node: ExModifying, Next: ExBootable, Prev: ExGrowing, Up: Examples 10.5 Copy modified ISO image from one medium to another ======================================================= Load image from input drive. Do the same manipulations as in the previous example. Acquire output drive and blank it. Burn the modified image as first and only session to the output drive. $ xorriso -indev /dev/sr2 \ -rm_r /sounds -- \ ... -outdev /dev/sr0 -blank as_needed \ -commit -eject all  File: xorriso.info, Node: ExBootable, Next: ExCharset, Prev: ExModifying, Up: Examples 10.6 Bring a prepared ISOLINUX tree onto medium and make it bootable ==================================================================== The user has already created a suitable file tree on disk and copied the ISOLINUX files into subdirectory ./boot/isolinux of that tree. Now 'xorriso' can burn an El Torito bootable medium: $ xorriso -outdev /dev/sr0 -blank as_needed \ -map /home/me/ISOLINUX_prepared_tree / \ -boot_image isolinux dir=/boot/isolinux  File: xorriso.info, Node: ExCharset, Next: ExPseudo, Prev: ExBootable, Up: Examples 10.7 Change existing file name tree from ISO-8859-1 to UTF-8 ============================================================ This example assumes that the existing ISO image was written with character set ISO-8859-1 but that the readers expected UTF-8. Now a new session gets added with converted file names. Command -changes_pending "yes" enables writing despite the lack of any manipulation command. In order to avoid any weaknesses of the local character set, this command pretends that it uses already the final target set UTF-8. Therefore strange file names may appear in messages, which will be made terminal-safe by command -backslash_codes. $ xorriso -in_charset ISO-8859-1 -local_charset UTF-8 \ -out_charset UTF-8 -backslash_codes on -dev /dev/sr0 \ -changes_pending yes -commit -eject all  File: xorriso.info, Node: ExPseudo, Next: ExCdrecord, Prev: ExCharset, Up: Examples 10.8 Operate on storage facilities other than optical drives ============================================================ Full read-write operation is possible with regular files and block devices: $ xorriso -dev /tmp/regular_file ... Paths underneath /dev normally need prefix "stdio:" $ xorriso -dev stdio:/dev/sdb ... If /dev/sdb is to be used frequently and /dev/sda is the system disk, then consider to place the following lines in a 'xorriso' Startup File. They allow you to use /dev/sdb without prefix and protect disk /dev/sda from 'xorriso': -drive_class banned /dev/sda* -drive_class harmless /dev/sdb Other writeable file types are supported write-only: $ xorriso -outdev /tmp/named_pipe ... Among the write-only drives is standard output: $ xorriso -outdev - \ ... | gzip >image.iso.gz  File: xorriso.info, Node: ExCdrecord, Next: ExMkisofs, Prev: ExPseudo, Up: Examples 10.9 Burn an existing ISO image file to medium ============================================== Actually this works with any kind of data, not only ISO images: $ xorriso -as cdrecord -v dev=/dev/sr0 blank=as_needed image.iso  File: xorriso.info, Node: ExMkisofs, Next: ExGrowisofs, Prev: ExCdrecord, Up: Examples 10.10 Perform multi-session runs as of cdrtools traditions ========================================================== Between both processes there can be performed arbitrary transportation or filtering. The first session is written like this: $ xorriso -as mkisofs prepared_for_iso/tree1 | \ xorriso -as cdrecord -v dev=/dev/sr0 blank=fast -multi -eject - Follow-up sessions are written like this (the run of dd is only to give demons a chance to spoil it): $ m=$(xorriso -as cdrecord dev=/dev/sr0 -msinfo) $ dd if=/dev/sr0 count=1 >/dev/null 2>&1 $ xorriso -as mkisofs -M /dev/sr0 -C $m prepared_for_iso/tree2 | \ xorriso -as cdrecord -v dev=/dev/sr0 -waiti -multi -eject - Always eject the drive tray between sessions. The run of xorriso -as mkisofs will read old sessions via the CD-ROM driver of /dev/sr0. This driver might not be aware of the changed content as long as the medium is not loaded again. In this case the previous session would not be properly assessed by xorriso and the new session would contain only the newly added files. Some systems have not enough patience with automatic tray loading and some demons may interfere with a first CD-ROM driver read attempt from a freshly loaded medium. When loading the tray manually, wait 10 seconds after the drive has stopped blinking. A safe automatic way seems to be a separate run of xorriso for loading the tray with proper waiting, and a subsequent run of dd which shall offer itself to any problems caused by demons assessing the changed drive status. If this does not help, insert a run of "sleep 10" between xorriso and dd. This example works for multi-session media only. Add cdrskin option --grow_overwriteable_iso to all -as cdrecord runs in order to enable multi-session emulation on overwritable media.  File: xorriso.info, Node: ExGrowisofs, Next: ExException, Prev: ExMkisofs, Up: Examples 10.11 Let 'xorriso' work underneath growisofs ============================================= growisofs expects an ISO formatter program which understands options -C and -M. If 'xorriso' gets started by name "xorrisofs" then it is suitable for that. $ export MKISOFS="xorrisofs" $ growisofs -Z /dev/dvd /some/files $ growisofs -M /dev/dvd /more/files If no "xorrisofs" is available on your system, then you will have to create a link pointing to the 'xorriso' binary and tell growisofs to use it. E.g. by: $ ln -s $(which xorriso) "$HOME/xorrisofs" $ export MKISOFS="$HOME/xorrisofs" One may quit mkisofs emulation by argument "--" and make use of all 'xorriso' commands. growisofs dislikes options which start with "-o" but -outdev must be set to "-". So use "outdev" instead: $ growisofs -Z /dev/dvd -- outdev - -update_r /my/files /files $ growisofs -M /dev/dvd -- outdev - -update_r /my/files /files growisofs has excellent burn capabilities with DVD and BD. It does not emulate session history on overwritable media, though.  File: xorriso.info, Node: ExException, Next: ExTime, Prev: ExGrowisofs, Up: Examples 10.12 Adjust thresholds for verbosity, exit value and program abort =================================================================== Be quite verbose, exit 32 if severity "FAILURE" was encountered, do not abort prematurely but forcibly go on until the end of commands. $ xorriso ... \ -report_about UPDATE \ -return_with FAILURE 32 \ -abort_on NEVER \ ...  File: xorriso.info, Node: ExTime, Next: ExIncBackup, Prev: ExException, Up: Examples 10.13 Examples of input timestrings =================================== As printed by program date: 'Thu Nov 8 14:51:13 CET 2007' The same without ignored parts: 'Nov 8 14:51:13 2007' The same as expected by date: 110814512007.13 Four weeks in the future: +4w The current time: +0 Three hours ago: -3h Seconds since Jan 1 1970: =1194531416  File: xorriso.info, Node: ExIncBackup, Next: ExRestore, Prev: ExTime, Up: Examples 10.14 Incremental backup of a few directory trees ================================================= This changes the directory trees /projects and /personal_mail in the ISO image so that they become exact copies of their disk counterparts. ISO file objects get created, deleted or get their attributes adjusted accordingly. ACL, xattr, hard links and MD5 checksums will be recorded. Accelerated comparison is enabled at the expense of potentially larger backup size. Only media with the expected volume ID or blank media are accepted. Files with names matching *.o or *.swp get excluded explicitly. When done with writing the new session gets checked by its recorded MD5. $ xorriso \ -abort_on FATAL \ -for_backup -disk_dev_ino on \ -assert_volid 'PROJECTS_MAIL_*' FATAL \ -dev /dev/sr0 \ -volid PROJECTS_MAIL_"$(date '+%Y_%m_%d_%H%M%S')" \ -not_leaf '*.o' -not_leaf '*.swp' \ -update_r /home/thomas/projects /projects \ -update_r /home/thomas/personal_mail /personal_mail \ -commit -toc -check_md5 FAILURE -- -eject all To be used several times on the same medium, whenever an update of the two disk trees to the medium is desired. Begin with a blank medium and update it until the run fails gracefully due to lack of remaining space on the old one. This makes sense if the full backup leaves substantial remaining capacity on media and if the expected changes are much smaller than the full backup. To apply zisofs compression to those data files which get newly copied from the local filesystem, insert these commands immediately before -commit : -hardlinks perform_update \ -find / -type f -pending_data -exec set_filter --zisofs -- \ Commands -disk_dev_ino and -for_backup depend on stable device and inode numbers on disk. Without them, an update run may use -md5 "on" to match recorded MD5 sums against the current file content on hard disk. This is usually much faster than the default which compares both contents directly. With *mount* option *-o "sbsector="* on GNU/Linux or *-s* on FreeBSD or NetBSD it is possible to access the session trees which represent the older backup versions. With CD media, GNU/Linux mount accepts session numbers directly by its option "session=". Multi-session media and most overwritable media written by 'xorriso' can tell the sbsectors of their sessions by 'xorriso' command -toc. Used after -commit the following command prints the matching mount command for the newly written session (here for mount point /mnt): -mount_cmd "indev" "auto" "auto" /mnt Commands -mount_cmd and -mount are also able to produce the mount commands for older sessions in the table-of-content. E.g. as superuser: # osirrox -mount /dev/sr0 "volid" '*2008_12_05*' /mnt Above example produces a result similar to -root / -old-root / with mkisofs. For getting the session trees accumulated in the new sessions, let all -update commands use a common parent directory and clone it after updating is done: -update_r /home/thomas/projects /current/projects \ -update_r /home/thomas/personal_mail /current/personal_mail \ -clone /current /"$(date '+%Y_%m_%d_%H%M%S')" \ The cloned tree will have a name like /2011_02_12_155700. Sessions on multi-session media are separated by several MB of unused blocks. So with small sessions the payload capacity can become substantially lower than the overall media capacity. If the remaining space on a medium does not suffice for the next gap, the drive is supposed to close the medium automatically. *Better do not use your youngest backup for -update_r*. Have at least two media which you use alternatingly. So only older backups get endangered by the new write operation, while the newest backup is stored safely on a different medium. Always have a blank medium ready to perform a full backup in case the update attempt fails due to insufficient remaining capacity. This failure will not spoil the old medium, of course.  File: xorriso.info, Node: ExRestore, Next: ExRecovery, Prev: ExIncBackup, Up: Examples 10.15 Restore directory trees from a particular ISO session to disk =================================================================== This is an alternative to mounting the medium and using normal file operations. First check which backup sessions are on the medium: $ xorriso -outdev /dev/sr0 -toc Then enable restoring of ACL, xattr and hard links. Load the desired session and copy the file trees to disk. Avoid to create /home/thomas/restored without rwx-permission. $ xorriso -for_backup \ -load volid 'PROJECTS_MAIL_2008_06_19*' \ -indev /dev/sr0 \ -osirrox on:auto_chmod_on \ -chmod u+rwx / -- \ -extract /projects /home/thomas/restored/projects \ -extract /personal_mail /home/thomas/restored/personal_mail \ -rollback_end The final command -rollback_end prevents an error message about the altered image being discarded.  File: xorriso.info, Node: ExRecovery, Prev: ExRestore, Up: Examples 10.16 Try to retrieve blocks from a damaged medium ================================================== $ xorriso -abort_on NEVER -indev /dev/sr0 \ -check_media time_limit=1800 report=blocks_files \ data_to="$HOME"/dvd_copy sector_map="$HOME"/dvd_copy.map -- This can be repeated several times, if necessary with -eject or with other -indev drives. See the human readable part of "$HOME"/dvd_copy.map for addresses which can be used on "$HOME"/dvd_copy with mount option -o sbsector= or -s.  File: xorriso.info, Node: Files, Next: Environ, Prev: Examples, Up: Top 11 Files ******** 11.1 Program Alias Names ======================== Normal installation of 'xorriso' creates three links or copies which by their program name pre-select certain settings: *xorrisofs* starts 'xorriso' with -as mkisofs emulation. *xorrecord* starts 'xorriso' with -as cdrecord emulation. *osirrox* starts with -osirrox "on:o_excl_off" which allows further commands to copy files from ISO image to disk and to apply command -mount to one or more of the existing ISO sessions. 11.2 Startup Files ================== If not -no_rc is given as the first argument then 'xorriso' attempts on startup to read and execute lines from the following files: /etc/default/xorriso /etc/opt/xorriso/rc /etc/xorriso/xorriso.conf $HOME/.xorrisorc The files are read in the sequence given above, but none of them is required to exist. The line format is described with command -options_from_file. If mkisofs emulation was enabled by program name "xorrisofs", "mkisofs", "genisoimage", or "genisofs", then afterwards -read_mkisofsrc is performed, which reads .mkisofsrc files. See there. 11.3 Runtime control files ========================== The default setting of -check_media abort_file= is: /var/opt/xorriso/do_abort_check_media  File: xorriso.info, Node: Environ, Next: Seealso, Prev: Files, Up: Top 12 Environ ********** The following environment variables influence the program behavior: HOME is used to find startup files of xorriso and mkisofs. SOURCE_DATE_EPOCH belongs to the specs of reproducible-builds.org. It is supposed to be either undefined or to contain a decimal number which tells the seconds since january 1st 1970. If it contains a number, then it is used as time value to set the default of -volume date "uuid", sets -boot_image "any" "gpt_disk_guid=" to "volume_date_uuid", -volume_date "all_file_dates" to "set_to_mtime", and -iso_nowtime to "=$SOURCE_DATE_EPOCH". Startup files and program options can override the effect of SOURCE_DATE_EPOCH.  File: xorriso.info, Node: Seealso, Next: Bugreport, Prev: Environ, Up: Top 13 See also *********** For the mkisofs emulation of 'xorriso' xorrisofs(1) For the cdrecord emulation of 'xorriso' xorrecord(1) For mounting 'xorriso' generated ISO 9660 images (-t iso9660) mount(8) Libreadline, a comfortable input line facility readline(3) Other programs which produce ISO 9660 images mkisofs(8), genisoimage(1) Other programs which burn sessions to optical media growisofs(1), cdrecord(1), wodim(1), cdrskin(1) ACL and xattr getfacl(1), setfacl(1), getfattr(1), setfattr(1) MD5 checksums md5sum(1) On FreeBSD some commands differ: getextattr(8), setextattr(8), md5(1)  File: xorriso.info, Node: Bugreport, Next: Legal, Prev: Seealso, Up: Top 14 Reporting bugs ***************** To report bugs, request help, or suggest enhancements for 'xorriso', please send electronic mail to the public list . If more privacy is desired, mail to . Please describe what you expect 'xorriso' to do, the program arguments or dialog commands by which you tried to achieve it, the messages of 'xorriso', and the undesirable outcome of your program run. Expect to get asked more questions before solutions can be proposed.  File: xorriso.info, Node: Legal, Next: CommandIdx, Prev: Bugreport, Up: Top 15 Author, Copyright, Credits ***************************** 15.1 Author =========== Thomas Schmitt for libburnia-project.org 15.2 Copyright ============== Copyright (c) 2007 - 2021 Thomas Schmitt Permission is granted to distribute this text freely. It shall only be modified in sync with the technical properties of 'xorriso'. If you make use of the license to derive modified versions of 'xorriso' then you are entitled to modify this text under that same license. 15.3 Credits ============ 'xorriso' is in part based on work by Vreixo Formoso who provides libisofs together with Mario Danic who also leads the libburnia team. Vladimir Serbinenko contributed the HFS+ filesystem code and related knowledge. Thanks to Andy Polyakov who invented emulated growing, to Derek Foreman and Ben Jansens who once founded libburn. Compliments towards Joerg Schilling whose cdrtools served me for ten years.  File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top 16 Alphabetic Command List ************************** [index] * Menu: * # starts a comment line: Scripting. (line 156) * -abort_on controls abort on error: Exception. (line 27) * -abstract_file sets abstract file name: SetWrite. (line 250) * -acl controls handling of ACLs: Loading. (line 165) * -add inserts one or more paths: Insert. (line 44) * -add_plainly inserts one or more paths: Insert. (line 68) * -alter_date sets timestamps in ISO image: Manip. (line 139) * -alter_date_r sets timestamps in ISO image: Manip. (line 174) * -append_partition adds arbitrary file after image end: Bootable. (line 423) * -application_id sets application id: SetWrite. (line 197) * -application_use sets application use field: SetWrite. (line 272) * -as emulates mkisofs or cdrecord: Emulation. (line 13) * -assert_volid rejects undesired images: Loading. (line 105) * -auto_charset learns character set from image: Loading. (line 117) * -backslash_codes enables backslash conversion: Scripting. (line 71) * -ban_stdio_write demands real drive: Loading. (line 346) * -biblio_file sets biblio file name: SetWrite. (line 256) * -blank erases media: Writing. (line 57) * -boot_image controls bootability: Bootable. (line 75) * -calm_drive reduces drive activity: Loading. (line 336) * -cd sets working directory in ISO: Navigate. (line 7) * -cdx sets working directory on disk: Navigate. (line 15) * -changes_pending overrides change status: Writing. (line 12) * -charset sets input/output character set: Charset. (line 54) * -check_md5 verifies file checksum: Verify. (line 184) * -check_md5_r verifies file tree checksums: Verify. (line 198) * -check_media reads media block by block: Verify. (line 21) * -check_media_defaults sets -check_media options: Verify. (line 40) * -chgrp sets group in ISO image: Manip. (line 49) * -chgrp_r sets group in ISO image: Manip. (line 53) * -chmod sets permissions in ISO image: Manip. (line 55) * -chmod_r sets permissions in ISO image: Manip. (line 66) * -chown sets ownership in ISO image: Manip. (line 43) * -chown_r sets ownership in ISO image: Manip. (line 47) * -clone copies ISO directory tree: Insert. (line 185) * -close controls media closing: SetWrite. (line 471) * -close_damaged closes damaged track and session: Writing. (line 205) * -close_filter_list bans filter registration: Filter. (line 50) * -commit writes pending ISO image: Writing. (line 27) * -commit_eject writes and ejects: Writing. (line 53) * -compare reports ISO/disk differences: Navigate. (line 131) * -compare_l reports ISO/disk differences: Navigate. (line 147) * -compare_r reports ISO/disk differences: Navigate. (line 143) * -compliance controls standard compliance: SetWrite. (line 62) * -concat copies ISO file content: Restore. (line 139) * -copyright_file sets copyright file name: SetWrite. (line 245) * -cpax copies files to disk: Restore. (line 121) * -cpr inserts like with cp -r: Insert. (line 164) * -cpx copies files to disk: Restore. (line 110) * -cp_clone copies ISO directory tree: Insert. (line 196) * -cp_rx copies file trees to disk: Restore. (line 124) * -cp_rx copies file trees to disk <1>: Restore. (line 132) * -cut_out inserts piece of data file: Insert. (line 139) * -data_cache_size adjusts read cache size: Loading. (line 362) * -dev acquires one drive for input and output: AqDrive. (line 12) * -devices gets list of drives: Inquiry. (line 7) * -device_links gets list of drives: Inquiry. (line 17) * -dialog enables dialog mode: DialogCtl. (line 7) * -disk_dev_ino fast incremental backup: Loading. (line 256) * -disk_pattern controls pattern expansion: Insert. (line 34) * -displacement compensate altered image start address: Loading. (line 78) * -drive_access control device file locking: AqDrive. (line 72) * -drive_class controls drive accessability: AqDrive. (line 43) * -du show directory size in ISO image: Navigate. (line 78) * -dummy controls write simulation: SetWrite. (line 463) * -dus show directory size in ISO image: Navigate. (line 81) * -dusx show directory size on disk: Navigate. (line 88) * -dux show directory size on disk: Navigate. (line 84) * -dvd_obs set write block size: SetWrite. (line 400) * -early_stdio_test classifies stdio drives: Loading. (line 350) * -ecma119_map names w/o Rock Ridge, Joliet: Loading. (line 229) * -eject ejects drive tray: Writing. (line 50) * -end writes pending session and ends program: Scripting. (line 151) * -errfile_log logs problematic disk files: Scripting. (line 116) * -error_behavior controls error workarounds: Exception. (line 92) * -external_filter registers data filter: Filter. (line 20) * -external_filter unregisters data filter: Filter. (line 47) * -extract copies file tree to disk: Restore. (line 83) * -extract_boot_images copies boot equipment to disk: Restore. (line 167) * -extract_cut copies file piece to disk: Restore. (line 101) * -extract_l copies files to disk: Restore. (line 97) * -extract_single copies file to disk: Restore. (line 94) * -file_name_limit curbs length of file names: Loading. (line 276) * -file_size_limit limits data file size: SetInsert. (line 7) * -find traverses and alters ISO tree: CmdFind. (line 7) * -findx traverses disk tree: Navigate. (line 91) * -follow softlinks and mount points: SetInsert. (line 69) * -format formats media: Writing. (line 87) * -for_backup -acl,-xattr,-hardlinks,-md5: Loading. (line 215) * -fs sets size of fifo: SetWrite. (line 466) * -getfacl shows ACL in ISO image: Navigate. (line 60) * -getfacl_r shows ACL in ISO image: Navigate. (line 66) * -getfattr shows xattr in ISO image: Navigate. (line 69) * -getfattr_r shows xattr in ISO image: Navigate. (line 75) * -gid sets global ownership: SetWrite. (line 293) * -grow_blindly overrides next writeable address: AqDrive. (line 112) * -hardlinks controls handling of hard links: Loading. (line 128) * -help prints help text: Scripting. (line 19) * -hfsplus enables production of HFS+ partition: SetWrite. (line 14) * -hide excludes file names from directory trees: Manip. (line 177) * -history brings text into readline history: Scripting. (line 42) * -indev acquires a drive for input: AqDrive. (line 23) * -in_charset sets input character set: Loading. (line 112) * -iso_nowtime fixed "now" time for ISO 9660 objects: Loading. (line 250) * -iso_rr_pattern controls pattern expansion: Manip. (line 10) * -jigdo clears JTE or or adds parameter to JTE: Jigdo. (line 37) * -joliet enables production of Joliet tree: SetWrite. (line 10) * -joliet_map Joliet names: Loading. (line 242) * -launch_frontend starts frontend program at pipes: Frontend. (line 141) * -list_arg_sorting prints sorting order of -x: ArgSort. (line 26) * -list_delimiter replaces '--': Scripting. (line 55) * -list_extras lists compile time extra features: Scripting. (line 24) * -list_formats lists available formats: Writing. (line 128) * -list_profiles lists supported media: Writing. (line 163) * -list_speeds lists available write speeds: Writing. (line 139) * -lns creates ISO symbolic link: Insert. (line 181) * -load addresses a particular session as input: Loading. (line 54) * -local_charset sets terminal character set: Charset. (line 57) * -logfile logs output channels to file: Frontend. (line 19) * -ls lists files in ISO image: Navigate. (line 24) * -lsd lists files in ISO image: Navigate. (line 31) * -lsdl lists files in ISO image: Navigate. (line 42) * -lsdlx lists files on disk: Navigate. (line 57) * -lsdx lists files on disk: Navigate. (line 51) * -lsl lists files in ISO image: Navigate. (line 34) * -lslx lists files on disk: Navigate. (line 54) * -lsx lists files on disk: Navigate. (line 45) * -map inserts path: Insert. (line 89) * -map_l inserts paths from disk file: Insert. (line 96) * -map_single inserts path: Insert. (line 93) * -mark sets synchronizing message: Frontend. (line 23) * -md5 controls handling of MD5 sums: Loading. (line 184) * -mkdir creates ISO directory: Insert. (line 177) * -modesty_on_drive keep drive buffer hungry: SetWrite. (line 406) * -mount issues mount command for ISO session: Restore. (line 195) * -mount_cmd composes mount command line: Inquiry. (line 49) * -mount_cmd controls mount command: Inquiry. (line 65) * -msg_op perform operations on program messages: Frontend. (line 27) * -mv renames files in ISO image: Manip. (line 37) * -mv renames single file in ISO image: Manip. (line 31) * -named_pipe_loop enters EOF resistant dialog: Frontend. (line 119) * -not_leaf sets exclusion pattern: SetInsert. (line 59) * -not_list sets exclusions from disk file: SetInsert. (line 63) * -not_mgt controls file exclusion: SetInsert. (line 22) * -not_paths sets absolute exclusion paths: SetInsert. (line 53) * -no_rc disables startup files: Scripting. (line 7) * -options_from_file reads commands from file: Scripting. (line 12) * -osirrox enables ISO-to-disk copying: Restore. (line 18) * -outdev acquires a drive for output: AqDrive. (line 29) * -out_charset sets output character set: SetWrite. (line 285) * -overwrite enables overwriting in ISO: SetInsert. (line 131) * -pacifier controls pacifier text form: Emulation. (line 166) * -padding sets amount or mode of image padding: SetWrite. (line 494) * -page set terminal geometry: DialogCtl. (line 18) * -paste_in copies file into disk file: Restore. (line 135) * -pathspecs sets meaning of = with -add: SetInsert. (line 115) * -path_list inserts paths from disk file: Insert. (line 81) * -pkt_output consolidates text output: Frontend. (line 7) * -preparer_id sets preparer id: SetWrite. (line 261) * -print prints result text line: Scripting. (line 102) * -print_info prints message text line: Scripting. (line 104) * -print_mark prints synchronizing text line: Scripting. (line 106) * -print_size predicts image size: Inquiry. (line 86) * -prog sets program name: Frontend. (line 176) * -prog_help prints help text: Frontend. (line 178) * -prompt prompts for enter key: Scripting. (line 110) * -publisher sets publisher id: SetWrite. (line 192) * -pvd_info shows image id strings: Inquiry. (line 108) * -pwd tells working directory in ISO: Navigate. (line 19) * -pwdx tells working directory on disk: Navigate. (line 21) * -quoted_not_list sets exclusions: SetInsert. (line 66) * -quoted_path_list inserts paths from disk file: Insert. (line 85) * -read_fs filesystem type for image loading: Loading. (line 96) * -read_mkisofsrc searches and reads .mkisofsrc file: Emulation. (line 155) * -read_speed set read speed: Loading. (line 11) * -reassure enables confirmation question: DialogCtl. (line 29) * -report_about controls verbosity: Exception. (line 53) * -report_el_torito shows Boot Catalog: Inquiry. (line 116) * -report_system_area shows MBR, GPT, and alike: Inquiry. (line 138) * -return_with controls exit value: Exception. (line 38) * -rm deletes files from ISO image: Manip. (line 20) * -rmdir deletes ISO directory: Manip. (line 29) * -rm_r deletes trees from ISO image: Manip. (line 26) * -rockridge disables production of Rock Ridge info: SetWrite. (line 57) * -rollback discards pending changes: Writing. (line 9) * -rollback_end ends program without writing: Scripting. (line 154) * -rom_toc_scan searches for sessions: Loading. (line 308) * -rr_reloc_dir sets name of relocation directory: SetWrite. (line 150) * -scdbackup_tag enables scdbackup checksum tag: Emulation. (line 179) * -scsi_dev_family choose Linux device file type: AqDrive. (line 95) * -scsi_log reports SCSI commands: Scripting. (line 143) * -session_log logs written sessions: Scripting. (line 134) * -session_string composes session info line: Inquiry. (line 74) * -setfacl sets ACL in ISO image: Manip. (line 68) * -setfacl_list sets ACL in ISO image: Manip. (line 94) * -setfacl_r sets ACL in ISO image: Manip. (line 92) * -setfattr sets xattr in ISO image: Manip. (line 103) * -setfattr_list sets xattr in ISO image: Manip. (line 120) * -setfattr_r sets xattr in ISO image: Manip. (line 118) * -set_filter applies filter to file: Filter. (line 58) * -set_filter_r applies filter to file tree: Filter. (line 84) * -show_stream shows data source and filters: Navigate. (line 151) * -show_stream_r shows data source and filters: Navigate. (line 169) * -sh_style_result makes results look more like shell: Scripting. (line 61) * -signal_handling controls handling of system signals: Exception. (line 66) * -sleep waits for a given time span: Scripting. (line 113) * -speed set write speed: SetWrite. (line 371) * -split_size enables large file splitting: SetInsert. (line 145) * -status shows current settings: Scripting. (line 44) * -status_history_max curbs -status history: Scripting. (line 52) * -stdio_sync controls stdio buffer: SetWrite. (line 456) * -stream_recording controls defect management: SetWrite. (line 389) * -system_id sets system id: SetWrite. (line 205) * -tell_media_space reports free space: Inquiry. (line 98) * -temp_mem_limit curbs memory consumption: Scripting. (line 96) * -toc shows list of sessions: Inquiry. (line 27) * -toc_of shows list of sessions: Inquiry. (line 41) * -truncate_overwritable activates older session: Writing. (line 167) * -uid sets global ownership: SetWrite. (line 290) * -update inserts path if different: Insert. (line 100) * -update_l inserts paths if different: Insert. (line 120) * -update_l inserts paths if different <1>: Insert. (line 128) * -update_li inserts paths if different: Insert. (line 124) * -update_r inserts paths if different: Insert. (line 110) * -use_immed_bit controls use of Immed bit: SetWrite. (line 444) * -use_readline enables readline for dialog: DialogCtl. (line 26) * -version prints help text: Scripting. (line 22) * -volid sets volume id: SetWrite. (line 168) * -volset_id sets volume set id: SetWrite. (line 188) * -volume_date sets volume timestamp: SetWrite. (line 211) * -write_type chooses TAO or SAO/DAO: SetWrite. (line 487) * -x enables automatic execution order of arguments: ArgSort. (line 16) * -xattr controls handling of xattr (EA): Loading. (line 172) * -zisofs controls zisofs production: SetWrite. (line 296)  File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top 17 Alphabetic List of Concepts and Objects ****************************************** [index] * Menu: * ACL, control handling, -acl: Loading. (line 165) * ACL, set in ISO image, -setfacl: Manip. (line 68) * ACL, set in ISO image, -setfacl_list: Manip. (line 94) * ACL, set in ISO image, -setfacl_r: Manip. (line 92) * ACL, show in ISO image, -getfacl: Navigate. (line 60) * ACL, show in ISO image, -getfacl_r: Navigate. (line 66) * ACL, _definition: Extras. (line 50) * APM block size: Bootable. (line 414) * APM, _definition: Extras. (line 42) * Appendable media, _definition: Media. (line 38) * Appended Filesystem Image, -append_partition: Bootable. (line 423) * Appended partition, in APM: Bootable. (line 291) * Appended partition, in MBR or GPT: Bootable. (line 284) * Automatic execution order, of arguments, -x: ArgSort. (line 16) * Backslash Interpretation, _definition: Processing. (line 53) * Backup, enable fast incremental, -disk_dev_ino: Loading. (line 256) * Backup, enable features, -for_backup: Loading. (line 215) * Backup, scdbackup checksum tag, -scdbackup: Emulation. (line 179) * Blank media, _definition: Media. (line 29) * Blank, format, Immed bit, -use_immed_bit: SetWrite. (line 444) * Blind growing, _definition: Methods. (line 41) * Bootability, control, -boot_image: Bootable. (line 75) * Bugs, reporting: Bugreport. (line 6) * cdrecord, Emulation: Emulation. (line 120) * Character Set, for input, -in_charset: Loading. (line 112) * Character Set, for input/output, -charset: Charset. (line 54) * Character Set, for output, -out_charset: SetWrite. (line 285) * Character set, learn from image, -auto_charset: Loading. (line 117) * Character Set, of terminal, -local_charset: Charset. (line 57) * Character Set, _definition: Charset. (line 6) * CHRP partition, _definition: Bootable. (line 296) * Closed media, _definition: Media. (line 44) * Comment, #: Scripting. (line 156) * Control, signal handling, -signal_handling: Exception. (line 66) * Create, new ISO image, _definition: Methods. (line 7) * Cylinder alignment, _definition: Bootable. (line 340) * Cylinder size, _definition: Bootable. (line 325) * Damaged track and session, close, -close_damaged: Writing. (line 205) * DEC Alpha SRM boot sector, production: Bootable. (line 400) * Delete, from ISO image, -rm: Manip. (line 20) * Delete, from ISO image, -rm_r: Manip. (line 26) * Delete, ISO directory, -rmdir: Manip. (line 29) * Device file locking, -drive_access: AqDrive. (line 72) * Dialog, bring text into history, -history: Scripting. (line 42) * Dialog, confirmation question, -reassure: DialogCtl. (line 29) * Dialog, enable dialog mode, -dialog: DialogCtl. (line 7) * Dialog, EOF resistant, -named_pipe_loop: Frontend. (line 119) * Dialog, line editing, -use_readline: DialogCtl. (line 26) * Dialog, terminal geometry, -page: DialogCtl. (line 18) * Directories, copy, -cp_clone: Insert. (line 196) * Directory, copy, -clone: Insert. (line 185) * Directory, create, -mkdir: Insert. (line 177) * Directory, delete, -rmdir: Manip. (line 29) * disk_path, _definition: Insert. (line 6) * Drive, accessability, -drive_class: AqDrive. (line 43) * Drive, classify stdio, -early_stdio_test: Loading. (line 350) * Drive, demand real MMC, -ban_stdio_write: Loading. (line 346) * Drive, eject tray, -eject: Writing. (line 50) * Drive, for input and output, -dev: AqDrive. (line 12) * Drive, for input, -indev: AqDrive. (line 23) * Drive, for output, -outdev: AqDrive. (line 29) * Drive, get drive list, -devices: Inquiry. (line 7) * Drive, get drive list, -device_links: Inquiry. (line 17) * Drive, list supported media, -list_profiles: Writing. (line 163) * Drive, reduce activity, -calm_drive: Loading. (line 336) * Drive, report SCSI commands, -scsi_log: Scripting. (line 143) * Drive, write and eject, -commit_eject: Writing. (line 53) * Drive, _definition: Drives. (line 6) * EA, _definition: Extras. (line 66) * ECMA-119, _definition: Model. (line 6) * EFI system partition, _definition: Bootable. (line 305) * El Torito, _definition: Extras. (line 19) * Emulation, -as: Emulation. (line 13) * Emulation, .mkisofsrc, -read_mkisofsrc: Emulation. (line 155) * Emulation, cdrecord, -as: Emulation. (line 120) * Emulation, mkisofs, -as: Emulation. (line 17) * Emulation, pacifier form, -pacifier: Emulation. (line 166) * Examples: Examples. (line 6) * extattr, _definition: Extras. (line 66) * File content, copy, -concat: Restore. (line 139) * File names, curb length, -file_name_limit: Loading. (line 276) * File names, if Joliet is loaded: Loading. (line 242) * File names, if neither Rock Ridge nor Joliet: Loading. (line 229) * Filter, apply to file tree, -set_filter_r: Filter. (line 84) * Filter, apply to file, -set_filter: Filter. (line 58) * Filter, ban registration, -close_filter_list: Filter. (line 50) * Filter, register, -external_filter: Filter. (line 20) * Filter, show chain, -show_stream: Navigate. (line 151) * Filter, show chains of tree, -show_stream_r: Navigate. (line 169) * Filter, unregister, -unregister_filter: Filter. (line 47) * Filter, zisofs parameters, -zisofs: SetWrite. (line 296) * Filter, _definition: Filter. (line 6) * Frontend program, start at pipes, -launch_frontend: Frontend. (line 141) * GPT, control GUID, -boot_image gpt_disk_guid=: Bootable. (line 225) * GPT, _definition: Extras. (line 39) * Group, global in ISO image, -gid: SetWrite. (line 293) * Group, in ISO image, -chgrp: Manip. (line 49) * Group, in ISO image, -chgrp_r: Manip. (line 53) * Growing, _definition: Methods. (line 20) * Hard links, control handling, -hardlinks: Loading. (line 128) * HFS+ allocation block size: Bootable. (line 411) * HFS+ serial number: Bootable. (line 408) * hidden, set in ISO image, -hide: Manip. (line 177) * HP-PA boot sector, production: Bootable. (line 383) * Image reading, cache size, -data_cache_size: Loading. (line 362) * Image, demand volume ID, -assert_volid: Loading. (line 105) * Image, discard pending changes, -rollback: Writing. (line 9) * Image, filesystem to load, -read_fs: Loading. (line 96) * Image, override change status, -changes_pending: Writing. (line 12) * Image, set abstract file name, -abstract_file: SetWrite. (line 250) * Image, set application id, -application_id: SetWrite. (line 197) * Image, set application iuse field, -application_use: SetWrite. (line 272) * Image, set biblio file name, -biblio_file: SetWrite. (line 256) * Image, set copyright file name, -copyright_file: SetWrite. (line 245) * Image, set preparer id, -preparer_id: SetWrite. (line 261) * Image, set publisher id, -publisher: SetWrite. (line 192) * Image, set system id, -system_id: SetWrite. (line 205) * Image, set volume id, -volid: SetWrite. (line 168) * Image, set volume set id, -volset_id: SetWrite. (line 188) * Image, set volume timestamp, -volume_date: SetWrite. (line 211) * Image, show Boot Catalog: Inquiry. (line 116) * Image, show id strings, -pvd_info: Inquiry. (line 108) * Image, show MBR, GPT, and alike, -pvd_info: Inquiry. (line 138) * Image, _definition: Model. (line 9) * Input Character Set, _definition: Charset. (line 25) * Insert, enable overwriting, -overwrite: SetInsert. (line 131) * Insert, file exclusion absolute, -not_paths: SetInsert. (line 53) * Insert, file exclusion from file, -not_list: SetInsert. (line 63) * Insert, file exclusion pattern, -not_leaf: SetInsert. (line 59) * Insert, file exclusion, -not_mgt: SetInsert. (line 22) * Insert, file exclusion, -quoted_not_list: SetInsert. (line 66) * Insert, if different, -update: Insert. (line 100) * Insert, if different, -update_l: Insert. (line 120) * Insert, if different, -update_li: Insert. (line 124) * Insert, if different, -update_lxi: Insert. (line 128) * Insert, if different, -update_r: Insert. (line 110) * Insert, large file splitting, -split_size: SetInsert. (line 145) * Insert, limit data file size, -file_size_limit: SetInsert. (line 7) * Insert, links or mount points, -follow: SetInsert. (line 69) * Insert, meaning of = with -add, -pathspecs: SetInsert. (line 115) * Insert, non-dashed arguments, -add_plainly: Insert. (line 68) * Insert, path, -map: Insert. (line 89) * Insert, path, -map_single: Insert. (line 93) * Insert, paths from disk file, -map_l: Insert. (line 96) * Insert, paths from disk file, -path_list: Insert. (line 81) * Insert, paths from disk file, -quoted_path_list: Insert. (line 85) * Insert, paths, -cpr: Insert. (line 164) * Insert, pathspecs, -add: Insert. (line 44) * Insert, piece of data file, -cut_out: Insert. (line 139) * Interval reader for system area and partitions: Bootable. (line 32) * ISO 9660, _definition: Model. (line 6) * iso_rr_path, _definition: Insert. (line 7) * Jigdo Template Extraction, -jigdo: Jigdo. (line 37) * Jigdo Template Extraction, _definition: Jigdo. (line 6) * LBA, _definition: Drives. (line 17) * libisofs, fixed "now" time: Loading. (line 250) * Linux device type, -scsi_dev_family: AqDrive. (line 95) * List delimiter, _definition: Processing. (line 9) * Local Character Set, _definition: Charset. (line 11) * MBR bootable/active flag, enforce: Bootable. (line 351) * MBR, set, -boot_image system_area=: Bootable. (line 200) * MBR, _definition: Extras. (line 27) * MD5, control handling, -md5: Loading. (line 184) * Media, erase, -blank: Writing. (line 57) * Media, format, -format: Writing. (line 87) * Media, list formats, -list_formats: Writing. (line 128) * Media, list write speeds, -list_speeds: Writing. (line 139) * MIPS boot file, activation: Bootable. (line 362) * mkisofs, Emulation: Emulation. (line 17) * Modifying, _definition: Methods. (line 28) * Multi-session media, _definition: Media. (line 7) * Multi-session, _definition: Model. (line 18) * Navigate, directory size in ISO image, -du: Navigate. (line 78) * Navigate, directory size in ISO image, -dus: Navigate. (line 81) * Navigate, directory size in on disk, -dusx: Navigate. (line 88) * Navigate, directory size in on disk, -dux: Navigate. (line 84) * Navigate, list disk files, -lsdlx: Navigate. (line 57) * Navigate, list disk files, -lsdx: Navigate. (line 51) * Navigate, list disk files, -lslx: Navigate. (line 54) * Navigate, list disk files, -lsx: Navigate. (line 45) * Navigate, list ISO files, -ls: Navigate. (line 24) * Navigate, list ISO files, -lsd: Navigate. (line 31) * Navigate, list ISO files, -lsdl: Navigate. (line 42) * Navigate, list ISO files, -lsl: Navigate. (line 34) * Navigate, set disk working directory, -cdx: Navigate. (line 15) * Navigate, set ISO working directory, -cd: Navigate. (line 7) * Navigate, tell disk working directory, -pwdx: Navigate. (line 21) * Navigate, tell ISO working directory, -pwd: Navigate. (line 19) * Next writeable address, -grow_blindly: AqDrive. (line 112) * Older session, activate, -truncate_overwritable: Writing. (line 167) * Output Character Set, _definition: Charset. (line 26) * Overwritable media, _definition: Media. (line 14) * Ownership, global in ISO image, -uid: SetWrite. (line 290) * Ownership, in ISO image, -chown: Manip. (line 43) * Ownership, in ISO image, -chown_r: Manip. (line 47) * Partition offset, _definition: Bootable. (line 315) * Partition table, _definition: Bootable. (line 265) * Pathspec, _definition: SetInsert. (line 117) * Pattern expansion, for disk paths, -disk_pattern: Insert. (line 34) * Pattern expansion, for ISO paths, -iso_rr_pattern: Manip. (line 10) * Pattern expansion, _definition: Processing. (line 25) * Permissions, in ISO image, -chmod: Manip. (line 55) * Permissions, in ISO image, -chmod_r: Manip. (line 66) * PReP partition, _definition: Bootable. (line 300) * Problems, reporting: Bugreport. (line 6) * Process, consolidate text output, -pkt_output: Frontend. (line 7) * Process, control abort on error, -abort_on: Exception. (line 27) * Process, control exit value, -return_with: Exception. (line 38) * Process, control verbosity, -report_about: Exception. (line 53) * Process, disable startup files, -no_rc: Scripting. (line 7) * Process, end program and write, -end: Scripting. (line 151) * Process, end program, no writing, -rollback_end: Scripting. (line 154) * Process, error workarounds, -error_behavior: Exception. (line 92) * Process, log output channels to file, -logfile: Frontend. (line 19) * Process, read command file, -options_from_file: Scripting. (line 12) * Process, set synchronizing message, -mark: Frontend. (line 23) * Program messages, perform operations, -msg_op: Frontend. (line 27) * Program, backslash conversion, -backslash_codes: Scripting. (line 71) * Program, curb memory, -temp_mem_limit: Scripting. (line 96) * Program, end and write, -end: Scripting. (line 151) * Program, end without writing, -rollback_end: Scripting. (line 154) * Program, list extra features, -list_extras: Scripting. (line 24) * Program, print help text, -help: Scripting. (line 19) * Program, print help text, -prog_help: Frontend. (line 178) * Program, print message text line, -print_info: Scripting. (line 104) * Program, print result text line, -print: Scripting. (line 102) * Program, print synchronizing text line, -print_mark: Scripting. (line 106) * Program, print version, -version: Scripting. (line 22) * Program, prompt for enter key, -prompt: Scripting. (line 110) * Program, replace --, -list_delimiter: Scripting. (line 55) * Program, set name, -prog: Frontend. (line 176) * Program, show current settings, -status: Scripting. (line 44) * Program, status history, -status_history_max: Scripting. (line 52) * Program, wait a time span, -sleep: Scripting. (line 113) * Quoted input, _definition: Processing. (line 47) * Read, set speed, -read_speed: Loading. (line 11) * Recovery, retrieve blocks, -check_media: Verify. (line 21) * Relocation directory, set name, -rr_reloc_dir: SetWrite. (line 150) * Rename, in ISO image, -move: Manip. (line 31) * Rename, in ISO image, -mv: Manip. (line 37) * Restore, copy boot equipment to disk, -extract_boot_images: Restore. (line 167) * Restore, copy file into disk file, -paste_in: Restore. (line 135) * Restore, copy file piece to disk, -extract_cut: Restore. (line 101) * Restore, copy file to disk, -extract_single: Restore. (line 94) * Restore, copy file tree to disk, -extract: Restore. (line 83) * Restore, copy file trees to disk, -cp_rx: Restore. (line 124) * Restore, copy file trees to disk, -cp_rx <1>: Restore. (line 132) * Restore, copy files to disk, -cpax: Restore. (line 121) * Restore, copy files to disk, -cpx: Restore. (line 110) * Restore, copy files to disk, -extract_l: Restore. (line 97) * Restore, enable ISO-to-disk, -osirrox: Restore. (line 18) * Result layout, more shell-like, -sh_style_result: Scripting. (line 61) * Rock Ridge, _definition: Extras. (line 6) * Session, altered start address, -displacement: Loading. (line 78) * Session, info string, -session_string: Inquiry. (line 74) * Session, issue mount command, -mount: Restore. (line 195) * Session, log when written, -session_log: Scripting. (line 134) * Session, mount command line, -mount_cmd: Inquiry. (line 49) * Session, mount parameters, -mount_opts: Inquiry. (line 65) * Session, select as input, -load: Loading. (line 54) * Session, _definition: Model. (line 6) * Sorting order, for -x, -list_arg_sorting: ArgSort. (line 26) * SUN Disk Label, production: Bootable. (line 373) * SUN SPARC boot images, activation: Bootable. (line 454) * Symbolic link, create, -lns: Insert. (line 181) * System area, _definition: Bootable. (line 200) * Table-of-content, search sessions, -rom_toc_scan: Loading. (line 308) * Table-of-content, show, -toc: Inquiry. (line 27) * Timestamps, set in ISO image, -alter_date: Manip. (line 139) * Timestamps, set in ISO image, -alter_date_r: Manip. (line 174) * Tree, disk, traverse, -findx: Navigate. (line 91) * Tree, ISO, traverse and alter, -find: CmdFind. (line 7) * UTF-16, for Joliet paths, -compliance: SetWrite. (line 114) * Verify, check blocks, -check_media: Verify. (line 21) * Verify, compare ISO and disk file, -compare: Navigate. (line 131) * Verify, compare ISO and disk tree, -compare_r: Navigate. (line 143) * Verify, compare ISO and disk, -compare_l: Navigate. (line 147) * Verify, file checksum, -check_md5: Verify. (line 184) * Verify, file tree checksums, -check_md5_r: Verify. (line 198) * Verify, preset -check_media, -check_media_defaults: Verify. (line 40) * Write, block size, -dvd_obs: SetWrite. (line 400) * Write, bootability, -boot_image: Bootable. (line 75) * Write, buffer syncing, -stdio_sync: SetWrite. (line 456) * Write, close media, -close: SetWrite. (line 471) * Write, compliance to specs, -compliance: SetWrite. (line 62) * Write, defect management, -stream_recording: SetWrite. (line 389) * Write, disable Rock Ridge, -rockridge: SetWrite. (line 57) * Write, drive buffer, -modesty_on_drive: SetWrite. (line 406) * Write, enable HFS+, -hfsplus: SetWrite. (line 14) * Write, enable Joliet, -joliet: SetWrite. (line 10) * Write, fifo size, -fs: SetWrite. (line 466) * Write, free space, -tell_media_space: Inquiry. (line 98) * Write, log problematic disk files, -errfile_log: Scripting. (line 116) * Write, log written sessions, -session_log: Scripting. (line 134) * Write, padding image, -padding: SetWrite. (line 494) * Write, pending ISO image, -commit: Writing. (line 27) * Write, predict image size, -print_size: Inquiry. (line 86) * Write, set speed, -speed: SetWrite. (line 371) * Write, simulation, -dummy: SetWrite. (line 463) * Write, TAO or SAO/DAO, -write_type: SetWrite. (line 487) * xattr, control handling, -xattr: Loading. (line 172) * xattr, set in ISO image, -setfattr: Manip. (line 103) * xattr, set in ISO image, -setfattr_list: Manip. (line 120) * xattr, set in ISO image, -setfattr_r: Manip. (line 118) * xattr, show in ISO image, -getfattr: Navigate. (line 69) * xattr, show in ISO image, -getfattr_r: Navigate. (line 75) * xattr, _definition: Extras. (line 66)  Tag Table: Node: Top415 Node: Overview1405 Node: Model3441 Node: Media6344 Node: Methods9025 Node: Drives11611 Node: Extras15552 Node: Processing20264 Node: Dialog23899 Node: Commands25588 Node: ArgSort27265 Node: AqDrive28759 Node: Loading35916 Node: Insert57755 Node: SetInsert69258 Node: Manip78690 Node: CmdFind88790 Node: Filter107719 Node: Writing112341 Node: SetWrite124596 Node: Bootable153596 Node: Jigdo180804 Node: Charset185807 Node: Exception189136 Node: DialogCtl195265 Node: Inquiry197867 Node: Navigate206749 Node: Verify215456 Node: Restore226605 Node: Emulation238304 Node: Scripting248760 Node: Frontend256543 Node: Examples266169 Node: ExDevices267347 Node: ExCreate268008 Node: ExDialog269308 Node: ExGrowing270579 Node: ExModifying271388 Node: ExBootable271898 Node: ExCharset272453 Node: ExPseudo273349 Node: ExCdrecord274276 Node: ExMkisofs274596 Node: ExGrowisofs276493 Node: ExException277646 Node: ExTime278104 Node: ExIncBackup278562 Node: ExRestore282588 Node: ExRecovery283534 Node: Files284106 Node: Environ285440 Node: Seealso286188 Node: Bugreport286905 Node: Legal287496 Node: CommandIdx288508 Node: ConceptIdx306333  End Tag Table libisoburn-1.5.4/acinclude.m40000644000175700017510000002721213701321754013022 00000000000000dnl Copyright (C) 2008 - 2019 Thomas Schmitt 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 freebsd*) LDFLAGS="$LDFLAGS -L/usr/local/lib" CPPFLAGS="$CPPFLAGS -I/usr/local/include" ;; netbsd*) LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/pkg/lib" CPPFLAGS="$CPPFLAGS -I/usr/local/include -I/usr/pkg/include" ;; solaris*) LDFLAGS="$LDFLAGS -L/usr/local/lib" esac ]) AC_DEFUN([TARGET_SHIZZLE], [ ARCH="" LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig AC_MSG_CHECKING([target operating system]) LIBBURNIA_SUPP_ACL=none LIBBURNIA_SUPP_FATTR=none LIBBURNIA_LDCONFIG_CMD="echo 'No ldconfig run performed. If needed, configure manually for:'" case $target in *-*-linux*) ARCH=linux LIBBURN_ARCH_LIBS= LIBBURNIA_SUPP_ACL=libacl LIBBURNIA_SUPP_FATTR=xattr LIBBURNIA_LDCONFIG_CMD=ldconfig ;; *-*-freebsd*) ARCH=freebsd LIBBURN_ARCH_LIBS=-lcam LIBBURNIA_SUPP_ACL=libacl LIBBURNIA_SUPP_FATTR=extattr # This may later be overridden by configure --enable-libdir-pkgconfig LIBBURNIA_PKGCONFDIR=$(echo "$libdir" | sed 's/\/lib$/\/libdata/')/pkgconfig ;; *-kfreebsd*-gnu*) ARCH=freebsd LIBBURN_ARCH_LIBS=-lcam ;; *-solaris*) ARCH=solaris LIBBURN_ARCH_LIBS=-lvolmgt ;; *) ARCH= LIBBURN_ARCH_LIBS= # AC_ERROR([You are attempting to compile for an unsupported platform]) ;; esac AC_MSG_RESULT([$ARCH]) ]) dnl LIBBURNIA_CHECK_ICONV is by Thomas Schmitt, libburnia project dnl It is based on gestures from: dnl iconv.m4 serial AM7 (gettext-0.18) dnl Copyright (C) 2000-2002, 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_DEFUN([LIBBURNIA_CHECK_ICONV], [ dnl Check whether it is allowed to link with -liconv AC_MSG_CHECKING([for iconv() in separate -liconv ]) libburnia_liconv="no" libburnia_save_LIBS="$LIBS" LIBS="$LIBS -liconv" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], [libburnia_liconv="yes"], [LIBS="$libburnia_save_LIBS"] ) AC_MSG_RESULT([$libburnia_liconv]) if test x"$libburnia_save_LIBS" = x"$LIBS" then dnl GNU iconv has no function iconv() but libiconv() and a macro iconv() dnl It is not tested whether this is detected by above macro. AC_CHECK_LIB(iconv, libiconv, , ) fi dnl Check for iconv(..., const char **inbuf, ...) AC_MSG_CHECKING([for const qualifier with iconv() ]) AC_TRY_COMPILE([ #include #include size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); ], [], [libburnia_iconv_const=""], [libburnia_iconv_const="const"] ) if test x$libburnia_iconv_const = xconst then AC_DEFINE_UNQUOTED([ICONV_CONST], [const]) else AC_DEFINE_UNQUOTED([ICONV_CONST], []) fi test -z "$libburnia_iconv_const" && libburnia_iconv_const="no" AC_MSG_RESULT([$libburnia_iconv_const]) ]) dnl LIBBURNIA_ASSERT_ICONV is by Thomas Schmitt, libburnia project dnl AC_DEFUN([LIBBURNIA_ASSERT_ICONV], [ if test x$XORRISO_ASSUME_ICONV = x then dnl Check for the essential gestures of libisofs/util.c AC_MSG_CHECKING([for iconv() to be accessible now ]) AC_TRY_LINK([ #include #include #include #include #include #include #include #include #include #include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ], [iconv_test="yes"], [iconv_test="no"] ) AC_MSG_RESULT([$iconv_test]) if test x$iconv_test = xno then echo >&2 echo "Cannot get function iconv() to work. Configuration aborted." >&2 echo "Check whether your system needs a separate libiconv installed." >&2 echo "If it is installed but not found, try something like" >&2 echo ' export LDFLAGS="$LDFLAGS -L/usr/local/lib"' >&2 echo ' export CPPFLAGS="$CPPFLAGS -I/usr/local/include"' >&2 echo ' export LIBS="$LIBS -liconv"' >&2 echo "You may override this test by exporting variable" >&2 echo " XORRISO_ASSUME_ICONV=yes" >&2 echo >&2 (exit 1); exit 1; fi fi ]) dnl LIBBURNIA_TRY_EDITLINE is by Thomas Schmitt, libburnia project dnl It performs the actual test compilation for editline. dnl Variable LIBS has to be set by the caller. AC_DEFUN([LIBBURNIA_TRY_EDITLINE], [ AC_TRY_LINK([ #include #include #include #include #include #include #include ], [EditLine *editline_handle; History *editline_history; HistEvent ev; int count; editline_handle= el_init("dummy", stdin, stdout, stderr); el_set(editline_handle, EL_EDITOR, "emacs"); editline_history= history_init(); history(editline_history, &ev, H_SETSIZE, 1000); el_gets(editline_handle, &count); ], [editline_test="yes"], [editline_test="no"] ) ]) dnl LIBBURNIA_ASSERT_EDITLINE is by Thomas Schmitt, libburnia project dnl It disables xorriso editline if not all needed functions are present AC_DEFUN([LIBBURNIA_ASSERT_EDITLINE], [ if test x$XORRISO_ASSUME_EDITLINE = x then dnl Check for the essential gestures of xorriso/text_io.c AC_MSG_CHECKING([for desired functions in libedit]) libburnia_save_LIBS="$LIBS" LIBS="$LIBS -ledit" LIBBURNIA_TRY_EDITLINE if test x$editline_test = xno then LIBS="$libburnia_save_LIBS" LIBS="$LIBS -ledit" LIBBURNIA_TRY_EDITLINE fi if test x$editline_test = xno then READLINE_DEF= LIBS="$libburnia_save_LIBS" fi AC_MSG_RESULT([$editline_test $editline_msg]) fi ]) dnl LIBBURNIA_TRY_READLINE is by Thomas Schmitt, libburnia project dnl It performs the actual test compilation for readline. dnl Variable LIBS has to be set by the caller. AC_DEFUN([LIBBURNIA_TRY_READLINE], [ AC_TRY_LINK([ #include #include #include #include #include #include #include #include ], [HIST_ENTRY **hl; readline(""); add_history(""); hl= history_list(); ], [readline_test="yes"], [readline_test="no"] ) ]) dnl LIBBURNIA_ASSERT_READLINE is by Thomas Schmitt, libburnia project dnl It disables xorriso readline if not all needed functions are present AC_DEFUN([LIBBURNIA_ASSERT_READLINE], [ if test x$XORRISO_ASSUME_READLINE = x then dnl Check for the essential gestures of xorriso/text_io.c AC_MSG_CHECKING([for desired functions in libreadline]) readline_msg= libburnia_save_LIBS="$LIBS" LIBS="$LIBS -lreadline" LIBBURNIA_TRY_READLINE if test x$readline_test = xno then LIBS="$libburnia_save_LIBS" LIBS="$LIBS -lreadline -lcurses" LIBBURNIA_TRY_READLINE if test x$readline_test = xyes then readline_msg=", with -lcurses" fi fi if test x$readline_test = xno then READLINE_DEF= LIBS="$libburnia_save_LIBS" fi AC_MSG_RESULT([$readline_test $readline_msg]) fi ]) dnl LIBISOBURN_ASSERT_VERS_LIBS is by Thomas Schmitt, libburnia project dnl It tests whether -Wl,--version-script=... works with the compiler AC_DEFUN([LIBISOBURN_ASSERT_VERS_LIBS], [ libburnia_save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--version-script=$srcdir/libisoburn/libisoburn.ver" AC_TRY_LINK([#include ], [printf("Hello\n");], [vers_libs_test="yes"], [vers_libs_test="no"]) if test x$vers_libs_test = xyes then LIBLDFLAGS="-Wl,--version-script=$srcdir/libisoburn/libisoburn.ver" fi LDFLAGS="$libburnia_save_LDFLAGS" AC_SUBST(LIBLDFLAGS) ]) dnl LIBBURNIA_SET_PKGCONFIG is by Thomas Schmitt, libburnia project dnl It determines the install directory for the *.pc file. dnl Important: Must be performed _after_ TARGET_SHIZZLE dnl AC_DEFUN([LIBBURNIA_SET_PKGCONFIG], [ ### for testing --enable-libdir-pkgconfig on Linux ### LIBBURNIA_PKGCONFDIR="$libdir"data/pkgconfig if test "x$LIBBURNIA_PKGCONFDIR" = "x$libdir"/pkgconfig then dummy=dummy else AC_ARG_ENABLE(libdir-pkgconfig, [ --enable-libdir-pkgconfig Install to $libdir/pkgconfig on any OS, default=no], , enable_libdir_pkgconfig="no") AC_MSG_CHECKING([for --enable-libdir-pkgconfig]) if test "x$enable_libdir_pkgconfig" = xyes then LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig fi AC_MSG_RESULT([$enable_libdir_pkgconfig]) fi libburnia_pkgconfig_override="no" AC_ARG_ENABLE(pkgconfig-path, [ --enable-pkgconfig-path=DIR Absolute path of directory for libisofs-*.pc], libburnia_pkgconfig_override="yes" , enable_pkgconfig_path="none") AC_MSG_CHECKING([for overridden pkgconfig directory path]) if test "x$enable_pkgconfig_path" = xno then libburnia_pkgconfig_override="no" fi if test "x$enable_pkgconfig_path" = x -o "x$enable_pkgconfig_path" = xyes then libburnia_pkgconfig_override="invalid argument" fi if test "x$libburnia_pkgconfig_override" = xyes then LIBBURNIA_PKGCONFDIR="$enable_pkgconfig_path" AC_MSG_RESULT([$LIBBURNIA_PKGCONFDIR]) else AC_MSG_RESULT([$libburnia_pkgconfig_override]) fi AC_SUBST(LIBBURNIA_PKGCONFDIR) dnl For debugging only ### AC_MSG_RESULT([LIBBURNIA_PKGCONFDIR = $LIBBURNIA_PKGCONFDIR]) ]) dnl LIBBURNIA_TRY_TIMEZONE is by Thomas Schmitt, libburnia project dnl It tests whether the global variable exists and is suitable for dnl integer arithmetics. AC_DEFUN([LIBBURNIA_TRY_TIMEZONE], [ echo -n "checking for timezone variable ... " AC_TRY_LINK([ #include ], [long int i; i = 1 - timezone; ], [LIBBURNIA_TIMEZONE="timezone"], [LIBBURNIA_TIMEZONE="0"] ) echo "$LIBBURNIA_TIMEZONE" ]) dnl LIBBURNIA_CHECK_ARCH_LIBS is by Thomas Schmitt, libburnia project dnl It tests whether the OS dependent libraries are available. dnl With libisoburn they are needed only for the case that indirect linking dnl does not work. So it is worth a try to omit them. dnl $1 = "mandatory" or "optional" define the action if test linking fails. AC_DEFUN([LIBBURNIA_CHECK_ARCH_LIBS], [ libburnia_save_LIBS="$LIBS" if test "x$LIBBURN_ARCH_LIBS" = x then dummy=dummy else LIBS="$LIBS $LIBBURN_ARCH_LIBS" AC_TRY_LINK([#include ], [printf("Hello\n");], [archlibs_test="yes"], [archlibs_test="no"]) LIBS="$libburnia_save_LIBS" if test x$archlibs_test = xno then if test x"$1" = xmandatory then echo >&2 echo "FATAL: Test linking with mandatory library options failed: $LIBBURN_ARCH_LIBS" >&2 echo >&2 (exit 1); exit 1; else echo "disabled linking with $LIBBURN_ARCH_LIBS (because not found)" LIBBURN_ARCH_LIBS="" fi else echo "enabled linking with $LIBBURN_ARCH_LIBS" fi fi ]) 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 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 #endif ], [;], [AC_MSG_RESULT([no])], [AC_DEFINE([Libburn_use_sg_dummY], [yes]) AC_MSG_RESULT([yes])] ) ]) libisoburn-1.5.4/compile0000755000175700017510000001624514005267031012206 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libisoburn-1.5.4/doc/0000755000175700017510000000000014005267033011447 500000000000000libisoburn-1.5.4/doc/partition_offset.wiki0000644000175700017510000001722113701321754015641 00000000000000 The partition offset feature of libisofs can produce ISO 9660 images which bear a quite conventional partition table if copied onto a USB stick. The first partition marks the size of the ISO image but starts at a non-zero address. Thus it marks a small part of the device as unclaimed by partitions and available for storing boot loader code. Nevertheless the USB stick is mountable via its overall device file as well as via the partition device file. E.g. on GNU/Linux: `/dev/sdb` and `/dev/sdb1`. This is achieved by two distinct sets of meta-data which refer to the same file content. The dual-mount feature supports Rock Ridge and Joliet too. It is capable of multi-session. Currently only offset 32 kB seems to make sense. Smaller offsets are prohibited by fundamental assumptions of libisofs and libisoburn. Larger offsets would extend the unclaimed area into vital blocks of the ISO image. -------------------------------------------------------------------------- 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. Overview: The test image was derived from one year old RIPLinux-9.3-non-X.iso which has an isohybrid MBR. Syslinux version seems to be 3.82. That MBR and the file tree from the mounted RIPLinux image was used to build a new ISO image with 16 \* 2kB partition offset. Isohybrid MBR patching was done by xorriso. Details: The first 32 kB of an ISO 9660 image are called System Area and may host any byte pattern. The first 512 bytes of RIPLinux-9.3-non-X.iso contain the isohybrid capable MBR, which will be re-used in this example. ``` dd if=RIPLinux-9.3-non-X.iso bs=512 count=1 of=RIPLinux-9.3-non-X.mbr ``` Normally the isohybrid MBR is provided by the Syslinux installation under the name `isohdp[fp]x*.bin` . E.g. `/usr/lib/syslinux/isohdpfx.bin` The files of the image are made accessible for reading ``` mount -o loop RIPLinux-9.3-non-X.iso /mnt ``` A new ISO image gets composed. The first three lines of arguments are taken from the prescriptions of ISOLINUX wiki and adapted to the names used in RIPLinux-9.3-non-X.iso. Option `-isohybrid-mbr` imports the copied MBR and patches it according to rules published by hpa on Syslinux mailing list. Option `-partition_offset 16` causes the first partition to start at 2 kB block number 16. It also prepares the image to be mountable by this partition, too. ``` xorriso -as mkisofs \ -o new_image.iso \ -b boot/isolinux/isolinux.bin -c boot/boot.cat \ -no-emul-boot -boot-load-size 4 -boot-info-table \ -isohybrid-mbr RIPLinux-9.3-non-X.mbr \ -partition_offset 16 \ /mnt ``` The image was copied onto a USB stick ``` dd if=new_image.iso of=/dev/sdc ``` and plugged into a Debian system. ``` fdisk -lu /dev/sdb ``` yields ``` Device Boot Start End Blocks Id System /dev/sdb1 * 64 120831 60384 17 Hidden HPFS/NTFS ``` I can mount `/dev/sdb` and `/dev/sdb1` alike: ``` mount /dev/sdb1 /mnt1 mount -o loop /dev/sdb /mnt ``` `-o loop` avoids failure with "mount: /dev/sdb already mounted or /mnt busy". A comparison by ``` diff -r /mnt /mnt1 ``` reports no difference. Human readable files look ok. Test-reading all content by ``` tar cf - /mnt | wc ``` yields a reasonable byte count of 60743680 and no errors. The machine boots RIPLinux from this USB stick with no visible problems. It can then mount `/dev/sdb` as well as `/dev/sdb1`. The ISO image boots from CD too. Mounting the partition can be simulated with an image file on hard disk by cutting off the first partition_offset blocks of 2 KB: ``` dd if=new_image.iso of=partition_image.iso bs=2048 skip=16 mount -o loop partition_image.iso /mnt1 ``` -------------------------------------------------------------------------- Another test was made with GRUB 2 by downloading ``` bzr branch http://bzr.savannah.gnu.org/r/grub/trunk/grub ``` Before building GRUB 2, the file ``` util/grub-mkrescue.in ``` was edited to replace in the options of the xorriso command: ``` --protective-msdos-label ``` by ``` -partition_offset 16 -no-pad ``` Then GRUB 2 was built and installed. The resulting image from ``` ./grub-mkrescue -o image.iso ``` was put onto USB stick. It passed the same tests on Debian as above RIPLinux example. It boots to a GRUB prompt. Due to option `-no-pad` the image is about 250 kB smaller than the image produced by original `grub-mkrescue`. Else it would have grown by about 50 kB. Unpadded ISO images are safe except for burning on CD in TAO mode. In this case problems may occur with reading the last few data blocks. So when burning onto CD make sure to require SAO mode and/or to require padding by 300 kB. Burning on DVD or BD needs no such caution. Neither does copying on USB stick or hard disk. Program `fdisk` will complain about "different physical/logical" addresses. This can be silenced by adding option ``` -partition_cyl_align on ``` at the cost of image padding up to the next full MB. E.g. by 402 kB to 2 MB. -------------------------------------------------------------------------- Open questions: - Shall the partition of an isohybrid image be marked bootable ? Currently xorriso keeps the 0x80 mark of an imported MBR and the 0x80 mark which xorriso sets by its own MBR preparations. - If not to be marked bootable: What equipment would the partition need to justify having the mark ? ------------------------------------------------------------------------ Application: The partition offset feature can be controlled by libisofs API calls ``` int iso_write_opts_set_part_offset(IsoWriteOpts *opts, uint32_t block_offset_2k, int secs_512_per_head, int heads_per_cyl); int iso_write_opts_set_system_area(IsoWriteOpts *opts, char data[32768], int options, int flag); ``` or by libisoburn calls ``` int isoburn_igopt_set_part_offset(struct isoburn_imgen_opts *opts, uint32_t block_offset_2k, int secs_512_per_head, int heads_per_cyl); int isoburn_igopt_get_part_offset(struct isoburn_imgen_opts *opts, uint32_t *block_offset_2k, int *secs_512_per_head, int *heads_per_cyl); int isoburn_igopt_set_system_area(struct isoburn_imgen_opts *o, char data[32768], int options); int isoburn_igopt_get_system_area(struct isoburn_imgen_opts *o, char data[32768], int *options); ``` or by xorriso options ``` -boot_image any partition_offset=(2kb_block_adr) -boot_image any partition_sec_hd=(number) -boot_image any partition_hd_cyl=(number) -boot_image any partition_cyl_align(on|auto|off) -as mkisofs ... -partition_offset (2kb_block_adr) \ -partition_hd_cyl (number) \ -partition_sec_hd (number) \ -partition_cyl_align (on|auto|off) ... ``` As stated above, an offset larger than 16 would expose vital parts of the ISO image as unclaimed space. Values smaller than 16 are not accepted. So use either an offset of 16 blocks or keep the feature disabled by offset 0. libisoburn-1.5.4/doc/startup_file.txt0000644000175700017510000000137213701321754014637 00000000000000# 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] libisoburn-1.5.4/doc/comments0000644000175700017510000000610313701321754013142 00000000000000/** @author Mario Danic, Vreixo Formoso, Thomas Schmitt @mainpage Libisoburn Documentation Index @section intro Introduction Libburnia is an open-source project for reading, mastering and writing optical discs. This page is about its capability to read, manipulate, and write ISO 9660 filesystems with Rock Ridge extensions. Media can be optical media or filesystem objects. Our scope is currently Linux 2.4 and 2.6, FreeBSD, OpenSolaris, or NetBSD. libisoburn is an add-on to libburn and libisofs which coordinates both and also allows to grow ISO-9660 filesystem images on multi-session media as well as on overwriteable media via the same API. All media peculiarities are handled automatically. xorriso is an application of all three libraries which creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. Manipulation is not only adding or overwriting of files but also deletion, renaming, and attribute changing. An incremental backup feature is provided. The xorriso features are accessible via built-in command interpreters and via a C language API. SONAME: libisoburn.so.1 (since 0.1.0, February 2008). @section using Using the libraries Our build system is based on autotools. User experience tells us that you will need at least autotools version 1.7. To build libisoburn go into its toplevel directory and execute: - ./bootstrap (needed if you downloaded from SVN) - ./configure - make To make the library and the xorriso application accessible for running and software development: - make install For direct use as command line tool use the xorriso binary which among many other features provides a mkisofs emulation via command "-as mkisofs". See man page xorriso/xorriso.1 or GNU info document xorriso/xorriso.info. If you want to link an own application with libisoburn, you have two alternative APIs for choice: - libisoburn, together with libburn and libisofs. - xorriso, a complete representation of xorriso command line options. It encapsulates the three lower level libraries. Calls of both API families shall not be mixed. For a description of the lbisoburn API read libisoburn/libisoburn.h See file README for download and installation of a release tarball. You will also have to install and understand the two libraries of the Libburnia project which provide fundamental services: libburn is the library by which preformatted data get onto optical media. See libburn/libburn.h for its API description. libisofs is the library to handle ISO 9660 filesystems with Rock Ridge extensions. Its API is described in libisofs/libisofs.h . For xorriso features see its man page xorriso/xorriso.1 or its GNU info document xorriso/xorriso.info. For the corresponding C language API see libisoburn/xorriso.h (or xorriso/xorriso.h in the build directory). The implementation this API is part of libisoburn. The xorriso command line tool gets installed as dynamically linked binary together with libisoburn. There is also a statically linked release named GNU xorriso. See xorriso/README_gnu_xorriso for its download and installation. */ libisoburn-1.5.4/doc/doxygen.conf.in0000644000175700017510000015004713701321754014332 00000000000000# Doxyfile 1.5.3 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file that # follow. The default is UTF-8 which is also the encoding used for all text before # the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into # libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of # possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = @PACKAGE_NAME@ # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @PACKAGE_VERSION@ # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, # Italian, Japanese, Japanese-en (Japanese with English messages), Korean, # Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, # Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = @top_srcdir@ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = YES # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = YES # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for Java. # For instance, namespaces will be presented as packages, qualified scopes # will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to # include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = YES # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be extracted # and appear in the documentation as a namespace called 'anonymous_namespace{file}', # where file will be replaced with the base name of the file that contains the anonymous # namespace. By default anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # 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 # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text " # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = libisoburn \ doc \ test # This tag can be used to specify the character encoding of the source files that # doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default # input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. # See http://www.gnu.org/software/libiconv for the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py FILE_PATTERNS = libisoburn.h \ xorriso.h \ comments # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the output. # The symbol name can be a fully qualified name, a word, or if the wildcard * is used, # a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = test # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH # then you must also enable this option. If you don't then doxygen will produce # a warning and turn it on anyway SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = YES # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = NO # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. Otherwise they will link to the documentstion. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = OB \ OTK \ _ #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = doc/html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # 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) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 200 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = letter # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # 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 # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = DOXYGEN # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to # produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to # specify the directory where the mscgen tool resides. If left empty the tool is assumed to # be found in the default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # 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 # 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 # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will # generate a call dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected # functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will # generate a caller dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected # functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = NO # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the number # of direct children of the root node in a graph is already larger than # MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, which results in a white background. # Warning: Depending on the platform used, enabling this option may lead to # badly anti-aliased labels on the edges of a graph (i.e. they become hard to # read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO libisoburn-1.5.4/doc/qemu_xorriso.wiki0000644000175700017510000004221213701321754015014 00000000000000 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 ... ``` libisoburn-1.5.4/install-sh0000755000175700017510000003325514005267031012634 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libisoburn-1.5.4/frontend/0000755000175700017510000000000014005267033012521 500000000000000libisoburn-1.5.4/frontend/sh_on_named_pipes.sh0000755000175700017510000001746013701321754016465 00000000000000#!/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 , 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 libisoburn-1.5.4/frontend/README-tcltk0000644000175700017510000001141413701321754014444 00000000000000------------------------------------------------------------------------------ xorriso-tcltk ------------------------------------------------------------------------------ Copyright (C) 2012 - 2013 Thomas Schmitt , 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 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. ------------------------------------------------------------------------ libisoburn-1.5.4/frontend/xorriso-tcltk0000755000175700017510000055375014005265654015241 00000000000000#!/usr/bin/wish # # xorriso-tcltk # Copyright (C) 2012 - 2021 # Thomas Schmitt , libburnia project. # Provided under BSD license: Use, modify, and distribute as you like. # # This is mainly a proof of concept for xorriso serving under a frontend. # It exercises several fundamental gestures of communication: # - connecting via two named pipes # - sending commands # - receiving replies # - inquiring the xorriso message sieve # - using the xorriso parsing service # # It also may serve as educational frontend to xorriso which tells by # its message window how to operate xorriso by commands and what it will # reply. # 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. set own_version "1.5.4" # Minimum version of xorriso to be used as backend process. # Older versions of xorriso do not offer commands -msg_op and -launch_frontend set min_xorriso_version "1.2.6" proc print_usage {argv0} { puts stderr "Usage:" puts stderr " $argv0 \[options\]" puts stderr "Options:" puts stderr " All options must be given with two dashes (\"--option\") in" puts stderr " order to distinguish them from any options of the Tcl shell." puts stderr " --help" puts stderr " Print this text and exit." puts stderr " --stdio" puts stderr " Establish connection to xorriso via stdin and stdout." puts stderr " E.g. when letting xorriso start this frontend program:" puts stderr " xorriso -launch_frontend \$(which xorriso-tcltk) --stdio --" puts stderr " --named_pipes cmd_fifo reply_fifo" puts stderr " Establish connection to a xorriso process started by:" puts stderr " xorriso -dialog on reply_fifo" puts stderr " which is then ready for a run of:" puts stderr " xorriso-tcltk --named_pipes cmd_fifo reply_fifo" puts stderr " It is important that the parent of xorriso and of this" puts stderr " tcl/tk frontend opens the named pipe for commands before" puts stderr " it opens the named pipe for replies. This avoids deadlock." puts stderr " --silent_start" puts stderr " Do not issue the start message xorriso-tcltk-version." puts stderr " This works only if --silent_start is the first argument." puts stderr " --no_extract" puts stderr " Do not allow extraction of files from ISO filesystem to" puts stderr " hard disk. This is not revokable during the program run." puts stderr " --no_bwidget" puts stderr " Do not try to load the Tcl/Tk package BWidget which is" puts stderr " a prerequisite for the \"/\" file browser buttons." puts stderr " --geometry {+|-}X{+|-}Y" puts stderr " Sets the position of the main window." puts stderr " --click_to_focus" puts stderr " Chooses that input fields and list boxes get the keyboard" puts stderr " focus only when being clicked by the mouse. (Default)" puts stderr " --auto_focus" puts stderr " Chooses that the keyboard focus is where the mouse" puts stderr " pointer is." puts stderr " --pipe_log_file path" puts stderr " Set a file address for logging of xorriso commands and" puts stderr " reply messages and enable this logging." puts stderr " The log lines will be appended. Path \"-\" means stderr." puts stderr " --script_log_file path" puts stderr " Set a file address for logging of essential xorriso" puts stderr " commands and enable this logging." puts stderr " The log lines will be appended. Path \"-\" means stderr." puts stderr " --script_log_all_commands" puts stderr " With logging of commands log non-essential commands too." puts stderr " --use_command_move" puts stderr " Use xorriso command -move for the \"Move to:\" button" puts stderr " if xorriso version is >= 1.2.8" puts stderr " --use_command_mv" puts stderr " Use xorriso command -mv for the \"Move to:\" button." puts stderr "" puts stderr "If neither --stdio nor --named_pipes is given, then this script" puts stderr "will try to locate itself in the filesystem and start a xorriso" puts stderr "run that launches it again." puts stderr "" puts stderr "In the running GUI, click with the rightmost mouse button on" puts stderr "any GUI element to get its particular help text." puts stderr "" } # ------------------------------- the frontend ---------------------------- # # Connects to a xorriso process, sends commands, receives replies, # prepares replies for GUI # Connection to xorriso set cmd_conn "" set reply_conn "" # The addresses of the named pipes, if such are used (see option -named_pipe) set cmd_pipe_adr "" set reply_pipe_adr "" # The command to send (or the command most recently sent) set cmdline "" # Whether to clear the cmdline after sending set cmdline_clear true # Command counter set cmd_sent 0 # Current -mark synchronization text set mark_count 0 # Results of most recent await_all_replies set info_list "" set info_count 0 set emerging_info "" set result_list "" set result_count 0 set emerging_result "" # Highest severities encountered in total and with most recent command set highest_total_sev ALL set highest_total_sev_msg "" set highest_cmd_sev ALL set highest_cmd_sev_msg "" # This one registers like highest_cmd_sev with threshold ALL set highest_seen_cmd_sev ALL # State of last read_sieve command set sieve_ret 0 # How many texts to pass with one parse_bulk command set bulk_parse_max_chunk 200 # Parse parameters set bulk_parse_prefix "" set bulk_parse_separators "" set bulk_parse_max_words "" set bulk_parse_flag "" # The announced number of texts to parse set bulk_parse_num_texts "" # Whether to complain on stderr about broken pipes. # This may be expected when xorriso is being shut down by this frontend. set expect_broken_pipes "0" # Whether to use command -move rather than -mv. Possible since xorriso-1.2.8. set use_command_move 1 # Whether to enable -hardlinks mode "on". Too slow before xorriso-1.3.0. set use_command_hardlinks_on 1 # Local copies of xorriso state # Addresses of drives (or image files) as shown by their text fields in the GUI set outdev_adr "" set indev_adr "" # Addresses of drives (or image files) as set in xorriso (after inquire_dev) set eff_outdev_adr "" set eff_indev_adr "" # Whether the medium is blank, appendable, closed, missing set indev_medium_status "missing" set outdev_medium_status "missing" # What kind of medium is presented by the drive set indev_profile "" set outdev_profile "" # List of known drive addresses set devlist "" # Intermediate storage for messages until the GUI is up with .msglist box set pre_msglist "" # Whether overwriting of files in the ISO model is allowed set overwrite_iso_files 1 # If overwrite_iso_files is 1: Whether overwriting of ISO directories is allowed set overwrite_iso_dirs 0 # Whether overwriting of files on disk is allowed set overwrite_disk_files 0 # The file where to log commands and replies for debugging purposes set debug_log_file "" set debug_log_conn stderr # Whether to log all commands and replies to the debug_log_file set debug_logging 0 # The result of the most recent isofs_ls run set isofs_ls_result "" # The result of the most recent localfs_ls run set localfs_ls_result "" # The communication channel where to log files (if it is not the empty text) set cmd_log_conn "" # The address under which cmd_log_conn was opened set cmd_log_target "" # Whether to log essential commands: 0=off , 1=no extract , 2=with extract set cmd_logging_mode 0 # Whether to log all commands if cmd_logging_mode is 1: 0=off , 1=on set cmd_logging_all 0 # The last logged -cd path. Used to prevent redundant logging of -cd. set recent_cd_path "" # The file address and the channel for xorriso command script execution set execute_script_adr "" set execute_script_conn "" # Whether extraction to disk shall be allowed in scripts set script_with_osirrox 0 # Whether extraction to disk is allowed set osirrox_allowed 1 # xorriso specific constants # List of severities (gets later overridden by -msg_op list_sev -) set xorriso_severity_list { ALL DEBUG UPDATE NOTE HINT WARNING SORRY MISHAP FAILURE FATAL ABORT NEVER } set scan_event_threshold HINT # --------- Communication between frontend and xorriso ---------- # Open the connection to a pair of named pipes. Program option -named_pipes # proc init_frontend_named_pipes {cmd_pipe reply_pipe} { global cmd_conn global reply_conn set cmd_conn [open $cmd_pipe w] set reply_conn [open $reply_pipe r] # Note: dissuaded flags would be necessary for opening idle fifo # set reply_conn [open $reply_pipe {RDONLY NONBLOCK}] } # Send a command line to the xorriso process. Do not wait for reply. # proc send_async_cmd {cmd} { global cmd_sent cmd_conn debug_logging debug_log_conn display_busy 1 log_command $cmd 0 debug_log_puts \ " ==============================================================" debug_log_puts " $cmd" display_msg "======> $cmd" incr cmd_sent puts $cmd_conn $cmd flush $cmd_conn } # Send a command line and a -mark command to xorriso. Wait until the # mark message confirms that all command output has been received. # proc send_marked_cmd {cmd} { global cmd_conn mark_count send_async_cmd $cmd incr mark_count set mark_cmd "-mark $mark_count" debug_log_puts " $mark_cmd" puts $cmd_conn $mark_cmd flush $cmd_conn await_all_replies } # Send a command and make it a candidate for the log script # proc send_loggable_cmd {cmd} { log_command $cmd 1 send_marked_cmd $cmd } # Send a command that shall not be displayed in the message log # proc send_silent_cmd {cmd} { set disp_en_mem [set_display_msg 0] send_marked_cmd $cmd set_display_msg $disp_en_mem } # Wait for the currently pending mark message to arrive. # Buffer all received result lines and info messages. # proc await_all_replies {} { global reply_conn mark_count result_count result_list global info_count info_list expect_broken_pipes global .busy_text clear_reply_lists while {1} { set ret [gets $reply_conn line] if {$ret < 0} { if {$expect_broken_pipes != 1} { puts stderr "EOF at reply pipe" } break } debug_log_puts $line if {[string range $line 0 0] == "M"} { if {[string range $line 5 end] == $mark_count} { break } else { # outdated mark message continue } } de_pkt_line $line } display_busy 0 } # Decode -pkt_output format to complete lines and buffer them. # proc de_pkt_line {line} { global info_list global info_count global emerging_info global result_list global result_count global emerging_result # Distinguish R and I set ch [string range $line 0 0] set payload [string range $line 5 end] if {$ch == "R"} { set emerging_result "$emerging_result$payload" } else { if {$ch == "I"} { set emerging_info "$emerging_info$payload" } else { return "" }} # if line end : add to list if {[string range $line 2 2] == "1"} { if {$ch == "R"} { lappend result_list $emerging_result incr result_count display_msg $emerging_result set emerging_result "" } else { lappend info_list $emerging_info incr info_count display_msg $emerging_info scan_info_for_event $emerging_info set emerging_info "" } } } # Search in the decoded info messages for the most severe event reports. # proc scan_info_for_event {line} { global highest_total_sev highest_total_sev_msg global highest_cmd_sev highest_cmd_sev_msg highest_seen_cmd_sev global scan_event_threshold global display_msg_enabled # check for word : CAPS : text ... set ret [regexp {[a-z][a-z]*[ ]*: [A-Z][A-Z]* :} $line] if {$ret != 1} {return ""} # retrieve severity set pos [string first ":" $line] set sev [string range $line [expr $pos+2] end] set pos [string first ":" $sev] set sev [string range $sev 0 [expr $pos-2]]; if {[compare_sev $sev $highest_seen_cmd_sev] > 0} { set highest_seen_cmd_sev $sev } if {[compare_sev $sev $scan_event_threshold] < 0} {return ""} if {$display_msg_enabled == 0} { set display_msg_enabled 1 display_msg $line set display_msg_enabled 0 } if {[compare_sev $sev $highest_total_sev] >= 0} { set highest_total_sev $sev set highest_total_sev_msg [escape_newline $line 0] } if {[compare_sev $sev $highest_cmd_sev] >= 0} { set highest_cmd_sev $sev set highest_cmd_sev_msg [escape_newline $line 0] } } # Unpack the output format of -msg_op read_sieve into a result_list # of strings which each hold one parsed word. # proc de_sieve {} { global result_list global sieve_ret set sieve_ret [lindex $result_list 0] set sieve_result_count [lindex $result_list 1] set payload "" set sieve_result_count 0 for {set i 2} {$i < [llength $result_list]} {incr i} { set line "" set num_lines [lindex $result_list $i] for {set j 0} {$j < $num_lines} {incr j} { incr i set line "$line[lindex $result_list $i]" if {$j < $num_lines - 1} { set line "$line\n" } else { lappend payload $line incr sieve_result_count } } } set result_list $payload set result_count $sieve_result_count } # Alternative to proc await_all_replies. It waits for a line at one of the # three channels and displays all lines which it receives before that line. # Used before this frontend had the opportunity to set up xorriso by commands # like -pkt_output "on". # proc wait_for_msg {prefix channel} { global reply_conn if {$channel == "M"} { set channel_prefix "M:0: " } else { set channel_prefix "$channel:1: " } set prefix_l [string length $prefix] while {1} { # >>> Have a timeout set ret [gets $reply_conn line] if {$ret < 0} { break } debug_log_puts $line if {[string length $line] < $prefix_l} { display_msg $line continue } if {[string range $line 0 [expr $prefix_l-1]] == $prefix} { return [string range $line $prefix_l end] } if {[string length $line] >= [expr $prefix_l+5]} { if {[string range $line 0 4] == $channel_prefix} { if {[string range $line 5 [expr $prefix_l+4]] == $prefix} { return [string range $line [expr $prefix_l+5] end] } } } display_msg $line } } # Reset the buffer for result lines and info messages. # proc clear_reply_lists {} { global info_list global info_count global emerging_info global result_list global result_count global emerging_result set info_list "" set info_count 0 set emerging_info "" set result_list "" set result_count 0 set emerging_result "" } # Reset the register of the most severe event for command sequences. # Typically this is done before executing the commands of a procedure # that is triggered by the user interface. # proc reset_highest_cmd_sev {} { global highest_cmd_sev highest_cmd_sev_msg highest_seen_cmd_sev set highest_cmd_sev ALL set highest_cmd_sev_msg "" set highest_seen_cmd_sev ALL } # Clear the recordings of the xorriso message sieve. # proc clear_sieve {} { send_silent_cmd "-msg_op clear_sieve -" } # Obtain a recorded item from the xorriso message sieve. # proc read_sieve {name} { send_silent_cmd "-msg_op read_sieve '$name'" de_sieve } # ------- Inquiring xorriso status ------- # Get more information about drive that was inquired by recent -toc_of. # proc obtain_drive_info {dev} { global result_list global sieve_ret global indev_medium_status outdev_medium_status global indev_profile outdev_profile set line "" if {$dev == "in"} { set indev_medium_status "missing" set indev_profile "" } else { set outdev_medium_status "missing" set outdev_profile "" } read_sieve "Media status :" if {$sieve_ret > 0} { set reply [lindex $result_list 0] foreach i {blank appendable closed} { if {[string first $i $reply] != -1} { set line "$i " if {$dev == "in"} { set indev_medium_status $i } else { set outdev_medium_status $i } break } } } read_sieve "Media current:" if {$sieve_ret > 0} { set profile [lindex $result_list 0] if {$profile == "is not recognizable"} { set profile "no recognizable medium" set line "$line$profile" return $line } else { set line "$line$profile, " if {$dev == "in"} { set indev_profile $profile } else { set outdev_profile $profile } } } read_sieve "Media summary:" if {$sieve_ret > 0} { set line "$line[lindex $result_list 0] sessions, " if {$dev == "in"} { set line "$line[lindex $result_list 2] used" } else { set line "$line[lindex $result_list 3] free" } } return $line } # Inquire whether changes of the ISO image are pending. # This is a precondition for writing the session. Vice versa pending changes # block a change of the input drive or the program end. # proc changes_are_pending {} { global result_count result_list send_silent_cmd "-changes_pending show_status" if {$result_count >= 1} { if {[lindex $result_list 0] == "-changes_pending no"} { return "0" } return "1" } return "" } # Inquire whether an ISO image model has been created inside xorriso. # This is a precondition for inserting files into the ISO tree model. # proc assert_iso_image {with_msg} { global highest_seen_cmd_sev scan_event_threshold set highest_seen_cmd_sev "" set set_mem $scan_event_threshold set scan_event_threshold "FATAL" send_silent_cmd "-lsd / --" set scan_event_threshold $set_mem if {[compare_sev $highest_seen_cmd_sev "FAILURE"] >= 0} { if {$with_msg == 1} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : First you need to create or load an ISO image by selecting a drive or an image file" } return "0" } return "1" } # Obtain the list of possible event severity names, sorted in ascending order # proc inquire_severity_list {} { global xorriso_severity_list global result_list set disp_en_mem [set_display_msg 0] send_marked_cmd "-msg_op list_sev -" set_display_msg $disp_en_mem if {[lindex $result_list 0] != ""} { set xorriso_severity_list [split [lindex $result_list 0] " "] } } # Parse-by-xorriso handler function for proc inquire_dev # proc set_inquired_dev {} { global result_list eff_indev_adr eff_outdev_adr if {[llength $result_list] < 2} {return ""} set what [lindex $result_list 0] if {$what == "-dev" || $what == "-indev"} { set eff_indev_adr [lindex $result_list 1] } if {$what == "-dev" || $what == "-outdev"} { set eff_outdev_adr [lindex $result_list 1] } } # Inquire -indev and -outdev from xorriso and install in eff_indev_adr # and eff_outdev_adr. # (This could be done by -toc_of like in proc refresh_indev. But here # i demonstrate the use of command -status and parsing its result by # help of xorriso.) # proc inquire_dev {} { set disp_en_mem [set_display_msg 0] send_marked_cmd "-status -dev" handle_result_list set_inquired_dev "''" "''" 2 0 set_display_msg $disp_en_mem update idletasks return "" } # Inquire -indev and -outdev from xorriso and install in indev_adr # and outdev_adr. # proc update_dev_var {} { global result_list eff_indev_adr eff_outdev_adr indev_adr outdev_adr inquire_dev set indev_adr $eff_indev_adr set outdev_adr $eff_outdev_adr } # Parse-by-xorriso handler function for proc isofs_ls # proc isofs_ls_handler {} { global result_list isofs_ls_result if {[lindex $result_list 0] == "total"} {return ""} lappend isofs_ls_result \ "[string range [lindex $result_list 0] 0 0] [lindex $result_list 8]" } # Produce a list of all files in a directory of the ISO model # proc isofs_ls {dir} { global isofs_ls_result set isofs_ls_result "" set disp_en_mem [set_display_msg 0] send_marked_cmd "-lsl [make_text_shellsafe $dir]" handle_result_list isofs_ls_handler "''" "''" 0 0 set_display_msg $disp_en_mem return $isofs_ls_result } # Tells the file type of an absolute path in the ISO model. # Indicator characters like with ls -l. Empty text means non existing file. # proc isofs_filetype {path} { global result_list result_count scan_event_threshold set scan_event_mem $scan_event_threshold set scan_event_threshold "SORRY" send_silent_cmd "-lsdl [make_text_shellsafe $path]" set scan_event_threshold $scan_event_mem if {$result_count < 1} {return ""} return [string range [lindex $result_list 0] 0 0] } # Inspection of hard disk is done via xorriso. # The xorriso commands have the advantage to be always available and to # need no unescaping. On the other hand, shell and tcl lstat would be # faster with large directories. # Parse-by-xorriso handler function for proc localfs_ls # proc localfs_ls_handler {} { global result_list localfs_ls_result if {[lindex $result_list 0] == "total"} {return ""} lappend localfs_ls_result \ "[string range [lindex $result_list 0] 0 0] [lindex $result_list 8]" } # Return the list of files of a hard disk filesystem directory # proc localfs_ls {dir} { global localfs_ls_result set localfs_ls_result "" if {[localfs_filetype $dir] != "d"} {return ""} set disp_en_mem [set_display_msg 0] send_marked_cmd "-lslx [make_text_shellsafe $dir]" handle_result_list localfs_ls_handler "''" "''" 0 0 set_display_msg $disp_en_mem return $localfs_ls_result } # Tells the file type of an absolute path in the ISO model. # Indicator characters like with ls -l. Empty text means non existing file. # proc localfs_filetype {path} { global result_list result_count scan_event_threshold set scan_event_mem $scan_event_threshold set scan_event_threshold "SORRY" send_silent_cmd "-lsdlx [make_text_shellsafe $path]" set scan_event_threshold $scan_event_mem if {[llength $result_list] < 1} {return ""} return [string range [lindex $result_list 0] 0 0] } # Verify that the connected process runs a xorriso program that is modern # enough. This is done before sending xorriso the setup commands. # proc check_xorriso_version {} { global sieve_ret result_list pre_msglist xorriso_version min_xorriso_version global use_command_move use_command_hardlinks_on global reply_conn set version "0.0.0 (= unknown)" set disp_en_mem [set_display_msg 0] # In order to see the pre-frontend messages of xorriso # set an individual -mark and use send_async_cmd set mark_text "xorriso-tcltk-version-check-[clock seconds]" send_async_cmd "-mark [make_text_shellsafe $mark_text]" set_display_msg $disp_en_mem wait_for_msg $mark_text "M" set_display_msg 0 send_async_cmd "-version" set xorriso_version [wait_for_msg "xorriso version : " "R"] if {$xorriso_version < $min_xorriso_version} { puts stderr "xorriso-tcltk: xorriso-$xorriso_version is too old." puts stderr "xorriso-tcltk: Need at least version $min_xorriso_version" window_ack \ "xorriso-$xorriso_version is too old. Need at least version $min_xorriso_version" \ "red" "embedded" central_exit 2 } if {$xorriso_version < "1.2.8"} { set use_command_move 0 } if {$xorriso_version < "1.3.0"} { set use_command_hardlinks_on 0 } set_display_msg $disp_en_mem } # Commands which bring the connected xorriso process into the state that # is expected by this frontend. # proc setup_xorriso {} { global osirrox_allowed set cmd "" # Invalidate possible -mark 1 set cmd "$cmd -mark 0" # Make replies digestible for await_all_replies set cmd "$cmd -pkt_output on" # Report version early set cmd "$cmd -version" # This frontend relies heavily on the message sieve set cmd "$cmd -msg_op start_sieve -" # -reassure questions from xorriso would not be properly handled by # this frontend set cmd "$cmd -reassure off" set cmd "$cmd -abort_on NEVER" set cmd "$cmd -return_with ABORT 32" set cmd "$cmd -report_about UPDATE" set cmd "$cmd -iso_rr_pattern off" set cmd "$cmd -disk_pattern off" if {$osirrox_allowed == 0} { set cmd "$cmd -osirrox banned" } set cmd "$cmd [xorriso_loggable_init_cmds]" send_marked_cmd $cmd inquire_severity_list } # Commands which should also be at the start of a log script # proc xorriso_loggable_init_cmds {} { global use_command_hardlinks_on set cmd "-for_backup" # Before xorriso-1.3.0 there is a performance problem with -hardlinks "on" # and image manipulations before xorriso-1.3.0. if {$use_command_hardlinks_on == 0} { set cmd "$cmd -hardlinks off" } else { set cmd "$cmd -hardlinks on" } set cmd "$cmd -backslash_codes on" set cmd "$cmd -follow mount:limit=100" return $cmd } proc effectuate_permission_policy {} { global permission_policy if {$permission_policy == "readable"} { send_loggable_cmd \ "-find / -exec chmod a+r -- -find / -type d -exec chmod a+x --" } if {$permission_policy == "readonly"} { send_loggable_cmd \ "-find / -exec chmod a=r -- -find / -type d -exec chmod a+x --" } if {$permission_policy == "mkisofs_r"} { send_loggable_cmd \ "-find / -exec mkisofs_r" } } # ------ Parsing by help of xorriso ------ # Parsing by xorriso takes from the frontend the burden to understand # and implement the quoting rules of xorriso input and output. # Lines which are supposed to consist of several words get sent to # xorriso command -msg_op. The result lines of this command encode # the words unambiguously in one or more text lines. # This is supposed to be safe for even the weirdest file names. # Only NUL characters cannot be part of names. # Start a bulk parser job by which xorriso shall split the output of e.g. -lsl # into single words from which this frontend can pick information. # proc start_bulkparse {prefix separators max_words flag num_lines} { global bulk_parse_prefix bulk_parse_separators global bulk_parse_max_words bulk_parse_flag bulk_parse_num_texts if {$num_lines <= 0} {return ""} set bulk_parse_prefix $prefix set bulk_parse_separators $separators set bulk_parse_max_words $max_words set bulk_parse_flag $flag set bulk_parse_num_texts $num_lines set cmd "-msg_op parse_bulk \"$prefix $separators $max_words $flag $num_lines\"" send_async_cmd $cmd # Do not wait for mark } # Submit a new input line to the xorriso bulk parser job. # proc submit_bulkparse {text} { global cmd_conn reply_conn global result_list result_count global bulk_parse_prefix bulk_parse_separators global bulk_parse_max_words bulk_parse_flag set disp_en_mem [set_display_msg 0] set num_lines [expr [count_newlines $text] + 1] debug_log_puts ">>>>> $num_lines" puts $cmd_conn $num_lines debug_log_puts ">>>>> $text" puts $cmd_conn $text flush $cmd_conn set_display_msg $disp_en_mem } # Read the expected number of bulk parsing replies into the result buffer # and call handler_proc to inspect them. # Each input line of the parser yields one reply buffer full of parsed words. # proc read_bulkparse {handler_proc num_texts} { set disp_en_mem [set_display_msg 0] for {set i 0} {$i < $num_texts} {incr i} { clear_reply_lists read_parse_reply $handler_proc } set_display_msg $disp_en_mem } # Read and decode the xorriso parser reply for one input line. # proc read_parse_reply {} { global reply_conn global result_list result_count set sieve_result_count 0 set payload "" set num_lines 0 set acc "" set loop_limit 2 while {$result_count < $loop_limit} { set ret [gets $reply_conn line] if {$ret < 0} { return ""} debug_log_puts $line de_pkt_line $line set line [lindex $result_list [expr $result_count-1]] if {$result_count == 1} { set parse_ret $line } else { if {$result_count == 2} { set num_replies $line # The minimum number of lines set loop_limit [expr "$num_replies * 2 + 2"] } else { if {$num_lines <= 0} { set num_lines $line if {$num_lines > 1} { # Need to read extra lines incr loop_limit [expr $num_lines-1] } set acc "" } else { incr num_lines -1 if {$acc != ""} { set acc "$acc\n$line" } else { set acc $line } if {$num_lines <= 0} { lappend payload $acc incr sieve_result_count } } }} } set result_list $payload set result_count $sieve_result_count } # Let xorriso parse the lines in the result buffer and call handler_proc # with the parse result of each line. # This is used to split the result lines of -lsl into words from which # handler proc isolist_parse_handler picks the info which it displays # in .stbox isolist . # Note that all parameters must be xorriso words. E.g. empty prefix or # separator have to be submitted as tcl string "''" rather than "". # proc handle_result_list {handler_proc \ prefix separators max_words flag } { global result_list global bulk_parse_max_chunk set raw_list $result_list set raw_line_count [expr [llength $raw_list]] if {$raw_line_count > $bulk_parse_max_chunk} { set chunk_size $bulk_parse_max_chunk } else { set chunk_size $raw_line_count } start_bulkparse $prefix $separators $max_words $flag $chunk_size set submit_count 0 set submit_in_chunk_count 0 foreach i $raw_list { submit_bulkparse $i incr submit_count incr submit_in_chunk_count if {$submit_in_chunk_count == $chunk_size} { read_bulkparse $handler_proc $chunk_size set todo [expr "$raw_line_count - $submit_count"] if {$todo <= 0} { break } if {$todo > $bulk_parse_max_chunk} { set chunk_size $bulk_parse_max_chunk } else { set chunk_size $todo } start_bulkparse $prefix $separators $max_words $flag \ $chunk_size set submit_in_chunk_count 0 } } display_busy 0 } # ------------------------------- the GUI ---------------------------- # ------ State variables ------ # Whether to display messages in .msglist set display_msg_enabled 1 # Whether a device list is already displayed set devices_scanned 0 # Currently displayed ISO directory set isodir_adr "" set isodir_is_pwd 0 # The plain names and types matching listbox .isolist set isolist_names "" set isolist_types "" # The name which to select after isodir_return set isodir_return_name "" # The address where to move selected ISO files set isomanip_move_target "" # Memorized isolist selection set memorized_isolist_selection "" # Image file address for .burn_write_image set burn_write_image_adr "" # Whether to close medium after writing set burn_write_close 0 # Whether to force CD TAO, DVD-R Inremental, DVD+R/BD-R open ended track set burn_write_tao 0 # Whether to engage Defect Management on formatted BD media set burn_write_defect_mgt 0 # Answer of yes/no window set answer_of_yesno "" # Semi-persistent answers of yes/no window set yesno_to_all 0 # The hard disk filesystem address to be mapped into isodir_adr set insert_from_adr "" # Whether to insert with leafname of insert_from_adr underneath isodir_adr # (else: -map $insert_from_adr $isodir_adr) set insert_underneath 1 # Whether to insert at or under the selected .isolist item # rather than isodir_adr set insert_at_selected 0 # The hard disk filesystem address to which to extract from isodir_adr set extract_to_adr "" # Whether to insert with leafname of insert_from_adr underneath isodir_adr # (else: -map $insert_from_adr $isodir_adr) set extract_underneath 1 # Whether to insert at or under the selected .isolist item set extract_from_selected 1 # Whether to temporarily enforce rwx permissions for target directories on disk set extract_auto_chmod 0 # Whether the display label .busy_text is already usable set busy_text_exists 0 # Whether to demand a click before focus goes to entry or listbox set click_to_focus 1 # Whether .ack_window , .yesno_window , .help_window, .main_help_window # are already displayed. set ack_window_is_active 0 set yesno_window_is_active 0 set help_window_is_active 0 set main_help_window_is_active 0 # Positions of above windows when they were last closed set yesno_window_geometry "" set ack_window_geometry "" set help_window_geometry "" set main_help_window_geometry "" # Whether the help window already has a scroll bar set help_window_has_scroll 0 # Whether there is the BWidget package available: 0=unknown, 1=yes, -1=banned # set have_bwidget 0 set bwidget_version "" # Whether the .browse_disk_window is already displayed set browse_disk_window_is_active 0 set browse_disk_window_var "" # Position of window when it was last closed set browse_disk_window_geometry "" # Whether the window is grabbed set browse_disk_window_is_grabbed 0 # Whether the .browse_iso_window is already displayed set browse_iso_window_is_active 0 set browse_iso_window_var "" # Position of window when it was last closed set browse_iso_window_geometry "" # Whether the window is grabbed set browse_iso_window_is_grabbed 0 # Whether to modify the ISO file permissions before writing the ISO session # Policies: as_is , readable , readonly , mkisofs_r set permission_policy "as_is" # ------ GUI callback procedures ---- # Called when the Return key is hit in commandline. # proc cmdline_return {} { global cmdline cmdline_clear global .cmdline .cmdline_text .cmdline_entry global highest_cmd_sev global highest_cmd_sev_msg reset_highest_cmd_sev set_display_msg 1 send_loggable_cmd $cmdline set cmdline "" # To force display of GUI changes now and not some time later update idletasks } # Called when the input drive address shall be brought into effect with # xorriso. # proc indev_return {} { global indev_adr global .indev_entry global .outdev_entry if {[assert_no_changes] == 0} { update_dev_var return "0" } reset_highest_cmd_sev send_loggable_cmd "-indev [make_text_shellsafe $indev_adr]" set indev_mem_adr $indev_adr .indev_entry icursor 0 refresh_indev return "1" } # Called when the "Eject" button for the input drive is hit. # proc eject_indev {} { if {[assert_no_changes] == 0} {return ""} reset_highest_cmd_sev send_loggable_cmd "-eject indev" refresh_outdev refresh_indev } # Called when the output drive address shall be brought into effect with # xorriso. # proc outdev_return {} { global outdev_adr indev_adr global .outdev_entry reset_highest_cmd_sev send_loggable_cmd "-outdev [make_text_shellsafe $outdev_adr]" set outdev_mem_adr $outdev_adr .outdev_entry icursor 0 refresh_outdev return "1" } # Called when the "Eject" button for the output drive is hit. # proc eject_outdev {} { global outdev_adr indev_adr if {$outdev_adr == $indev_adr} { if {[assert_no_changes] == 0} {return ""} } reset_highest_cmd_sev send_loggable_cmd "-eject outdev" refresh_outdev refresh_indev } # Called when both drive addresses shall be brought into effect with xorriso. # proc dev_return {} { global outdev_adr indev_adr global .outdev_entry .indev_entry if {$outdev_adr != $indev_adr} { if {[indev_return] == 0} {return "0"} outdev_return } else { if {[assert_no_changes] == 0} { update_dev_var return "0" } reset_highest_cmd_sev send_loggable_cmd "-dev [make_text_shellsafe $outdev_adr]" .outdev_entry icursor 0 refresh_outdev .indev_entry icursor 0 refresh_indev } } # Obtain and display the input drive status. # Called after the input drive address may have changed. # proc refresh_indev {} { global result_list global indev_adr global sieve_ret global .indev_summary .indev_summary configure -text "" set indev_adr "" update idletasks set disp_en_mem [set_display_msg 0] clear_sieve send_marked_cmd "-toc_of in:short" read_sieve "Drive current:" set_display_msg $disp_en_mem if {$sieve_ret > 0} { set cmd [lindex $result_list 0] if {$cmd == "-indev" || $cmd == "-dev"} { set indev_adr [lindex $result_list 1] } set line [obtain_drive_info in] .indev_summary configure -text $line } .avail_label configure -text "" update idletasks isodir_return "refresh_indev" } # Obtain and display the output drive status. # Called after the output drive address may have changed. # proc refresh_outdev {} { global result_list global outdev_adr global sieve_ret .outdev_summary configure -text "" set outdev_adr "" update idletasks set disp_en_mem [set_display_msg 0] clear_sieve send_marked_cmd "-toc_of out:short" read_sieve "Drive current:" set_display_msg $disp_en_mem if {$sieve_ret > 0} { set cmd [lindex $result_list 0] if {$cmd == "-outdev" || $cmd == "-dev"} { set outdev_adr [lindex $result_list 1] } set line [obtain_drive_info out] .outdev_summary configure -text $line } .avail_label configure -text "" update idletasks } # Scan the system for optical drives with rw permission # Called when the "Scan for drives button" is hit. # proc scan_for_drives {} { global .drivelist .drive_drop_both .drive_scan global sieve_ret result_list devlist devices_scanned indev_adr outdev_adr if {[assert_no_changes] == 0} {return ""} if {$indev_adr != "" || $outdev_adr != ""} { if {[window_yesno \ "Really give up acquired drives for scanning a new drive list ?"] \ != 1} { return "" } } set max_idx [.drivelist index end] .drivelist delete 0 [expr $max_idx-1] set devlist "" reset_highest_cmd_sev clear_sieve send_loggable_cmd "-devices" set max_idx 0 while {1} { read_sieve "? -dev" if {$sieve_ret > 0} { .drivelist insert end "[lindex $result_list 0] : [lindex $result_list 2] [lindex $result_list 3]" lappend devlist [lindex $result_list 0] } else { break } } while {1} { read_sieve "?? -dev" if {$sieve_ret > 0} { .drivelist insert end "[lindex $result_list 0] : [lindex $result_list 2] [lindex $result_list 3]" lappend devlist [lindex $result_list 0] } else { break } } set devices_scanned 1 reset_to_normal_background .drive_scan # Command -devices drops all acquired drives refresh_outdev refresh_indev } # Refresh the display after some xorriso may have changed the status # Called by the "Refresh disp" button and others. # proc refresh_state {} { refresh_indev refresh_outdev } # Reset the recorded Worst problem message. # Called when the "Clear" button is hit. # proc clear_total_errmsg {} { global highest_total_sev global highest_total_sev_msg set highest_total_sev ALL set highest_total_sev_msg "" update idletasks } # Called when the "Pick input drive button" is hit. # proc pick_indev {} { pick_drive indev } # Called when the "Pick output drive button" is hit. # proc pick_outdev {} { pick_drive outdev } # Called when the "Pick drive for both roles" button is hit. # or when an item in the scanned drive list is double-clicked. # proc pick_dev {} { pick_drive dev } # Perform the actual work of pick_dev, pick_indev, and pick_outdev # proc pick_drive {role} { global .drivelist global devlist global highest_cmd_sev_msg outdev_adr indev_adr devices_scanned set selected [.drivelist curselection] if {[llength $selected] != 1} { set must_scan "" if {$devices_scanned == 0} { set must_scan " scan and"} xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : First you must$must_scan select a single drive" return "" } set drive_idx [lindex $selected 0] if {$role == "dev"} { set outdev_adr [lindex $devlist $drive_idx] set indev_adr [lindex $devlist $drive_idx] dev_return } if {$role == "outdev"} { set outdev_adr [lindex $devlist $drive_idx] outdev_return } if {$role == "indev"} { set indev_adr [lindex $devlist $drive_idx] indev_return } .drivelist selection clear 0 end } # Called when the "Give up drives" button is hit. # proc give_up_dev {} { global outdev_adr indev_adr if {[assert_no_changes] == 0} {return ""} set outdev_adr "" outdev_return set indev_adr "" indev_return } # Obtain and display the content of the current ISO directory. # Called when the Return key is hit in the .isodir_entry text field # and by many others which change variable isodir_adr or the # content of the directory in xorriso's tree model. # proc isodir_return {caller} { global isodir_adr result_list isolist_names isolist_types isodir_return_name global isodir_is_pwd highest_cmd_sev highest_cmd_sev_msg global indev_adr outdev_adr eff_indev_adr global .isolist global bulk_parse_max_chunk set chunk_size 0 set max_idx [.isolist index end] .isolist delete 0 [expr "$max_idx-1"] update idletasks set isolist_names "" set isolist_types "" inquire_dev if {$eff_indev_adr == "" && [changes_are_pending] == "0"} {return ""} normalize_isodir_adr set file_type [isofs_filetype $isodir_adr] if {$file_type != "d" && $file_type != ""} { .isolist insert end "@@@ exists but is not a directory @@@" set isodir_is_pwd 0 return "" } set disp_en_mem [set_display_msg 0] set highest_cmd_sev_mem $highest_cmd_sev set highest_cmd_sev_msg_mem $highest_cmd_sev_msg reset_highest_cmd_sev send_loggable_cmd "-cd [make_text_shellsafe $isodir_adr]" if {[compare_sev $highest_cmd_sev "WARNING"] < 0} { send_marked_cmd "-lsl --" set isodir_is_pwd 1 } else { send_marked_cmd "-lsl [make_text_shellsafe $isodir_adr] --" set isodir_is_pwd 0 } handle_result_list isolist_parse_handler "''" "''" 0 0 set_display_msg $disp_en_mem set highest_cmd_sev $highest_cmd_sev_mem set highest_cmd_sev_msg $highest_cmd_sev_msg_mem if {$isodir_return_name != ""} { set idx [lsearch -exact $isolist_names $isodir_return_name] if {$idx != -1} { .isolist see $idx .isolist selection set $idx } set isodir_return_name "" } update idletasks } # The handler procedure that is submitted to proc handle_result_list # and will be called for every parsed line. # It records file names and types in separate lists and displays them # in the .isolist box. # proc isolist_parse_handler {} { global result_list isolist_names isolist_types global .isolist if {[lindex $result_list 0] == "total"} {return ""} set name [lindex $result_list 8] set ftype [string range [lindex $result_list 0] 0 0] lappend isolist_names $name lappend isolist_types $ftype .isolist insert end "$ftype $name" } # Make current the ISO directory that was selected from the .isolist box. # Called when an item in the .isolist box is double-clicked. # proc pick_isodir {} { global isolist_names isolist_types isodir_adr isodir_return_name global .isolist set selected [.isolist curselection] if {[llength $selected] != 1} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : First you must select a single directory" return "" } set idx [lindex $selected 0] if {[lindex $isolist_types $idx] != "d"} { return "" } if {$isodir_adr == "/"} { set isodir_adr "" } set isodir_adr "$isodir_adr/[lindex $isolist_names $idx]" set isodir_return_name "" isodir_return "pick_isodir" } # Make current the parent directory of the current ISO directory. # Called when the "Up" button is hit. # proc isodir_up {} { global isodir_adr isodir_return_name set isodir_return_name "" set idx [string last "/" $isodir_adr] set l [string length $isodir_adr] if {$idx == -1} { set isodir_return_name $isodir_adr set isodir_adr "/" } else { if {$idx > 0} { if {$idx < [expr $l - 1]} { set isodir_return_name \ [string range $isodir_adr [expr $idx+1] end] } set isodir_adr [string range $isodir_adr 0 [expr $idx - 1]] } else { if {$l > 1} { set isodir_return_name [string range $isodir_adr 1 end] } set isodir_adr "/" } } isodir_return "isodir_up" } # Rename or move the files which are selected in the .isolist box. # The target is defined by the .isomanip_move_target text field. # Called when the "Move to:" button is hit. # proc isomanip_mv {} { global .isolist global isomanip_move_target isolist_names isodir_is_pwd isodir_adr global isodir_return_name use_command_move if {$isomanip_move_target == ""} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : First you must enter a target address" return "" } set selected [.isolist curselection] set num_selected [llength $selected] if {$num_selected < 1} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : First you must select one or more ISO files" return "" } set target $isomanip_move_target if {$isodir_is_pwd == 0 && [string range $target 0 0] != "/"} { set target [combine_dir_and_name $isodir_adr $target] } set target_ftype [isofs_filetype $target] # If more than one selected : target must be directory if {$num_selected > 1} { if {$target_ftype != "d" && $target_ftype != ""} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : If multiple files are selected then the target must be a directory" return "" } if {$target_ftype == ""} { set isomanip_move_target_mem $isomanip_move_target set isomanip_move_target $target isomanip_mkdir set isomanip_move_target $isomanip_move_target_mem } } enforce_overwrite_settings "isofs" reset_highest_cmd_sev reset_yesno_to_all set multi_source 0 if {[llength $selected] != 1} {set multi_source 1} foreach i $selected { set name [lindex $isolist_names $i] if {$isodir_is_pwd == 0} { set name [combine_dir_and_name $isodir_adr $name] } set name_ftype [isofs_filetype $name] # Ask for confirmation if overwriting is about to happen if {$target_ftype == "d" && $use_command_move == 0} { set eff_target [combine_dir_and_name $target $name] set eff_target_ftype [isofs_filetype $eff_target] } else { set eff_target $target set eff_target_ftype $target_ftype } if {[handle_overwriting "isofs" $eff_target $eff_target_ftype \ "isofs" $name $name_ftype $multi_source \ "" "" "replace"] == "0"} { if {$multi_source == 0} { return "" } continue } if {$use_command_move == 0} { send_loggable_cmd \ "-mv [make_text_shellsafe $name] [make_text_shellsafe $target] --" } else { send_loggable_cmd \ "-move [make_text_shellsafe $name] [make_text_shellsafe $target] --" } } if {[llength $selected] == 1} { set isodir_return_name [path_touches_isodir $target] } browse_iso_refresh isodir_return "isomanip_mv" } # Create an empty ISO directory with address given by variable # isomanip_move_target. # Called when the "Make dir" button is hit or by other functions. # proc isomanip_mkdir {} { global isomanip_move_target isodir_adr isodir_return_name if {$isomanip_move_target == ""} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : First you must enter a target address" return "" } if {[string range $isomanip_move_target 0 0] == "/"} { set abs_adr $isomanip_move_target } else { set abs_adr [combine_dir_and_name $isodir_adr $isomanip_move_target] } reset_highest_cmd_sev send_loggable_cmd "-mkdir [make_text_shellsafe $abs_adr] --" # Refresh only if new dir in isodir_adr # or if a parent directory of new dir is created in isodir_adr set touch_name [path_touches_isodir $abs_adr] if {$touch_name != ""} { if {[llength [.isolist curselection]] != 0} { memorize_isolist_selection set selection_memorized 1 } else { set isodir_return_name $touch_name set selection_memorized 0 } isodir_return "isomanip_mkdir" if {$selection_memorized != 0} { restore_isolist_selection } } browse_iso_refresh } # Remove a file or directory tree from the ISO image. # Called when the "Delete" button is hit. # proc isomanip_rm_r {} { global .isolist global isomanip_move_target isolist_names isodir_is_pwd isodir_adr set selected [.isolist curselection] if {[llength $selected] < 1} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : First you must select one or more ISO files" return "" } if {[window_yesno "Really delete the selected files from ISO image ?"] \ != 1} { return "" } reset_highest_cmd_sev foreach i $selected { set name [lindex $isolist_names $i] if {$isodir_is_pwd == 0} { set name [combine_dir_and_name $isodir_adr $name] } send_loggable_cmd "-rm_r [make_text_shellsafe $name] --" } browse_iso_refresh isodir_return "isomanip_rm_r" } # Perform a blanking run on the output drive. # Called when the "Blank" button is hit. # proc burn_blank {} { global outdev_profile eff_outdev_adr eff_indev_adr refresh_outdev if {[assert_outdev blanking] <= 0} {return ""} if {$eff_outdev_adr == $eff_indev_adr} { if {[assert_no_changes] <= 0} {return ""} } set victim "medium in" if {[string first "stdio" $outdev_profile] == 0} { set victim "image file" } if {[window_yesno \ "Really blank the $victim [make_text_shellsafe $eff_outdev_adr] ?"] \ != 1} { return "" } reset_highest_cmd_sev send_loggable_cmd "-blank as_needed" refresh_indev refresh_outdev } # Perform a formatting run on the output drive. # Called when the "Format" button is hit. # proc burn_format {} { global outdev_profile eff_outdev_adr eff_indev_adr refresh_outdev if {[assert_outdev formatting] <= 0} {return ""} if {$eff_outdev_adr == $eff_indev_adr} { if {[assert_no_changes] <= 0} {return ""} } if {[string first "stdio" $outdev_profile] == 0} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : Image files cannot be formatted" return "" } if {[window_yesno "Really format the medium in $eff_outdev_adr ?"] \ != 1} { return "" } reset_highest_cmd_sev send_loggable_cmd "-format as_needed" refresh_indev refresh_outdev } # Write pending changes in the xorriso ISO model as session to the output # drive. This will be an add-on session if the drive is output and input drive # and if its medium is not blank. # Else it will be a new independent ISO image. # proc burn_commit {} { global outdev_adr result_list result_count outdev_medium_status global burn_write_close burn_write_tao burn_write_defect_mgt global indev_adr outdev_adr permission_policy if {[assert_outdev "writing an ISO session"] <= 0} {return ""} if {$outdev_adr == $indev_adr} { if {$outdev_medium_status != "blank" && \ $outdev_medium_status != "appendable"} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : Medium in output drive is neither blank nor appendable" return "" } } else { if {$outdev_medium_status != "blank"} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : Medium in output drive is not blank" return "" } } if {[changes_are_pending] == "0"} { window_ack "No changes are pending. Will not write ISO session." \ "grey" "toplevel" return "" } if {$outdev_adr == $indev_adr} { if {[window_yesno "Really write ISO changes as session to $outdev_adr ?"] \ != 1} { return "" } } else { if {[window_yesno "Really write a new ISO filesystem to $outdev_adr ?"] \ != 1} { return "" } } reset_highest_cmd_sev effectuate_permission_policy set cmd "-close" if {$burn_write_close == 1} { set cmd "$cmd on" } else { set cmd "$cmd off" } set cmd "$cmd -write_type" if {$burn_write_tao == 1} { set cmd "$cmd tao" } else { set cmd "$cmd auto" } set cmd "$cmd -stream_recording" if {$burn_write_defect_mgt == 1} { set cmd "$cmd off" } else { set cmd "$cmd data" } set cmd "$cmd -commit" send_loggable_cmd $cmd refresh_indev refresh_outdev } # Verify the MD5 checksums of the data files in the tree underneath the # current ISO directory. # Called when the "Verify" in the "ISO directory:" line is hit. # proc isodir_verify {} { global isodir_adr reset_highest_cmd_sev send_loggable_cmd "-check_md5_r sorry [make_text_shellsafe $isodir_adr] --" # >>> select mismatching files or directories with mismatching files } # Verify the MD5 checksums of the data files orch are selected or which # sit in the trees underneath the selected items in the isolist box. # Called when the "Verify" in the "Selection:" line is hit. # proc isomanip_verify {} { global .isolist global isomanip_move_target isolist_names isodir_is_pwd isodir_adr set selected [.isolist curselection] if {[llength $selected] < 1} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : First you must select one or more ISO files" return "" } reset_highest_cmd_sev foreach i $selected { set name [combine_dir_and_name $isodir_adr \ [lindex $isolist_names $i]] send_loggable_cmd "-check_md5_r sorry [make_text_shellsafe $name] --" } # >>> select mismatching files or directories with mismatching files } # Slow down the spinning of the acquired optical drives. # Called when button "Calm drives" is hit. # proc calm_drives {} { reset_highest_cmd_sev send_loggable_cmd "-calm_drive all" } # Burn a data file from disk as session to the output drive. # Called when the "Burn image file:" button is hit. # proc burn_write_image {} { global burn_write_image_adr burn_write_close outdev_adr outdev_medium_status global outdev_profile burn_write_tao burn_write_defect_mgt indev_adr update_dev_var if {$indev_adr != ""} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : You may not have an input drive open when writing an image file" return "" } if {[assert_outdev "writing an image file"] <= 0} {return ""} if {$burn_write_image_adr == ""} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : You have to set an image file address in the hard disk filesystem first" return "" } if {$outdev_medium_status != "blank"} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : You must have a blank medium in the output drive for burning an image data file" return "" } if {[file readable $burn_write_image_adr] == 0 || \ [file isfile $burn_write_image_adr] == 0 || [file exists $burn_write_image_adr] == 0} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : Image file '$burn_write_image_adr' is not a readable data file" return "" } if {[window_yesno "Really write '$burn_write_image_adr' as image to $outdev_adr ?"] \ != 1} { return "" } set cmd "-as cdrecord -v" if {[regexp "^CD" $outdev_profile] == 1 && \ ( $outdev_medium_status == "appendable" || $burn_write_tao == 1 )} { set cmd "$cmd padsize=150s" } set cmd "$cmd dev=[make_text_shellsafe $outdev_adr]" set cmd "$cmd [make_text_shellsafe $burn_write_image_adr]" if {$burn_write_tao == 1} { set cmd "$cmd -tao" } if {$burn_write_close != 1} { set cmd "$cmd -multi" } if {$burn_write_defect_mgt == 1} { set cmd "$cmd stream_recording=off" } else { set cmd "$cmd stream_recording=32s" } reset_highest_cmd_sev send_loggable_cmd $cmd refresh_state } # Discard all image modifications and reload ISO image model from input drive. # Called when the "Rollback" button is hit. # proc iso_rollback {} { if {[window_yesno \ "Really discard all pending changes and reload from input drive ?"] \ != 1} { return "" } reset_highest_cmd_sev send_loggable_cmd "-rollback" .avail_label configure -text "" isodir_return "iso_rollback" } # Inquire an accurate prediction of free space after writing a session with # the pending changes of the ISO image. # Called when button "Refresh avail:" is hit. # proc refresh_avail {} { global result_list highest_cmd_sev global sieve_ret if {[assert_outdev "refreshing available space prediction"] <= 0} {return ""} set line "n.a." reset_highest_cmd_sev clear_sieve send_loggable_cmd "-tell_media_space" if {[compare_sev $highest_cmd_sev "FAILURE"] < 0} { set ac "" read_sieve "After commit :" if {$sieve_ret > 0} { set ac [lindex $result_list 0] set ac [string range $ac 0 [expr [string length $ac] - 2]] set line "[format "%7dm" [expr "$ac / 512"]]" } } .avail_label configure -text $line } # Warn and prompt the user for confirmation if there is the risk to overwrite # existing files on hard disk or in the ISO image model. # Called from several procedures which cause side effects on directory trees. # proc handle_overwriting {target_fs target target_ftype source_fs source source_ftype multi_source selected_adr selected_ftype dir_action} { global overwrite_iso_files overwrite_iso_dirs overwrite_disk_files if {$target_fs == "localfs"} { set to_fs "hard disk" set overwrite_fs "disk" set overwrite_dirs 0 set overwrite_files $overwrite_disk_files } else { set to_fs "ISO" set overwrite_fs "ISO" set overwrite_dirs $overwrite_iso_dirs set overwrite_files $overwrite_iso_files } if {$source_fs == "localfs"} { set from_fs "hard disk" } else { set from_fs "ISO" } if {$multi_source == 1} { set what_window window_yesno_ever } else { set what_window window_yesno } # >>> Nicer would be: # >>> Check if any file will get overwritten. Not only the direct target. # >>> Then silently allow directories to be merged if {$target_ftype != ""} { if {$target_ftype == "d"} { if {$source_ftype == "d"} { if {$dir_action == "replace"} { if {$overwrite_iso_dirs != 1} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You would have to enable \"Overwrite $overwrite_fs dirs\" for\n[make_text_shellsafe $target]" return "0" } if {[$what_window \ "Really replace existing $to_fs directory\n\n[make_text_shellsafe $target]\n\nby $from_fs directory\n[make_text_shellsafe $source]\n?"] \ != 1} { return "0" } return "1" } if {[$what_window \ "Really merge existing $to_fs directory\n\n[make_text_shellsafe $target]\n\nwith $from_fs directory\n[make_text_shellsafe $source]\n?"] \ != 1} { return "0" } } else { if {$target_fs != "isofs"} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : Will not replace directory on hard disk by file of other type\n[make_text_shellsafe $target]" return "0" } if {$overwrite_dirs == 1} { if {[$what_window \ "Really overwrite $to_fs directory\n\n[make_text_shellsafe $target]\n\nby $from_fs file\n[make_text_shellsafe $source]\n?"] \ != 1} { return "0" } } else { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You would have to enable \"Overwrite $overwrite_fs dirs\" for\n[make_text_shellsafe $target]" return "0" } } } else { if {$overwrite_files == 1} { if {[$what_window \ "Really overwrite $to_fs file\n\n[make_text_shellsafe $target]\n\nby $from_fs file\n[make_text_shellsafe $source]\n?"] != 1} { return "0" } } else { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You would have to enable \"Overwrite $overwrite_fs files\" for\n[make_text_shellsafe $target]" return "0" } } } if {$selected_adr != $target && $selected_adr != "" && \ $selected_ftype != "d" && $selected_ftype != ""} { if {[$what_window \ "Really replace existing $to_fs file\n\n[make_text_shellsafe $target]\n\nby $from_fs directory\n[make_text_shellsafe $source]\n?"] != 1} { return "0" } } return "1" } # Insert a file or directory tree into the ISO model tree and schedule it # for being copied when "Write ISO session" is hit. # Called when button "Insert from disk:" is hit. # proc insert_from {} { global insert_from_adr isodir_adr isolist_names isodir_return_name global insert_at_selected insert_underneath if {[assert_iso_image 1] == 0} {return ""} if {$insert_from_adr == ""} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : You have to set a source address in the hard disk filesystem first" return "" } set selected_ftype "" set selected_adr "" if {$insert_at_selected == 1} { set selected [.isolist curselection] if {[llength $selected] != 1} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You must select exactly one ISO file as insertion target" return "" } set target "[lindex $isolist_names [lindex $selected 0]]" set selected_ftype [isofs_filetype $target] set selected_adr $target } else { set target $isodir_adr } set source_ftype [localfs_filetype $insert_from_adr] set name [file tail $insert_from_adr] if {$insert_underneath == 1 || $source_ftype == "d"} { set target [combine_dir_and_name $target $name] } set target_ftype [isofs_filetype $target] reset_yesno_to_all if {[handle_overwriting "isofs" $target $target_ftype \ "localfs" $insert_from_adr $source_ftype 0 \ $selected_adr $selected_ftype "merge"] == "0"} { return "" } set preserve_selection 0 if {$insert_underneath + $insert_at_selected == 1} { set isodir_return_name $name } else { set preserve_selection 1 } reset_highest_cmd_sev enforce_overwrite_settings "isofs" send_loggable_cmd "-map [make_text_shellsafe $insert_from_adr] [make_text_shellsafe $target]" if {$preserve_selection == 1} { memorize_isolist_selection } isodir_return "insert_from" if {$preserve_selection == 1} { restore_isolist_selection } browse_iso_refresh } # Copy a file out of the ISO image model to the hard disk filesystem. # The meta data stem from the ISO model tree. The content data are usually # read from the input drive. # Called when button "Extract to disk:" is hit. # proc extract_to {} { global extract_to_adr extract_from_selected extract_underneath global extract_auto_chmod osirrox_allowed global isodir_adr isolist_names if {$osirrox_allowed != 1} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : Extraction from ISO to hard disk is already irrevocably banned." return "" } if {[assert_iso_image 1] == 0} {return ""} if {$extract_to_adr == ""} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : You have to set a target address in the hard disk filesystem first" return "" } set sources "" set selected_ftype "" set selected_adr "" if {$extract_from_selected == 1} { set selected [.isolist curselection] if {[llength $selected] < 1} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You must select at least one ISO file as extraction source" return "" } foreach i $selected { set path [combine_dir_and_name $isodir_adr \ [lindex $isolist_names $i]] lappend sources $path } } else { set sources [list $isodir_adr] } reset_highest_cmd_sev reset_yesno_to_all enforce_overwrite_settings "localfs" set disp_en_mem [set_display_msg 0] if {$extract_auto_chmod == 1} { send_loggable_cmd "-osirrox on:sort_lba_on:auto_chmod_on" } else { send_loggable_cmd "-osirrox on:sort_lba_off:auto_chmod_off" } set_display_msg $disp_en_mem set multi_source 0 if {[llength $sources] != 1} {set multi_source 1} foreach i $sources { if {$extract_underneath == 1} { set name [file tail $i] set target [combine_dir_and_name $extract_to_adr $name] } else { if {[llength $sources] != 1} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You must select exactly one ISO file as extraction source" return "" } set target $extract_to_adr } if {$i == ""} { set i "/" } set target_ftype [localfs_filetype $target] set from_is_dir 0 set source_ftype [isofs_filetype $i] if {[handle_overwriting "localfs" $target $target_ftype \ "isofs" $i $source_ftype $multi_source \ "" "" "merge"] == 0} { continue } send_loggable_cmd \ "-extract [make_text_shellsafe $i] [make_text_shellsafe $target]" } browse_tree_populate "localfs" } # Send the currently chosen -overwrite settings of the checkbuttons # "Overwrite ISO files", "Overwrite ISO dirs", "Overwrite hard disk files". # Called before operations which could overwrite files in ISO model # or in the hard disk filesystem. # I.e. any -overwrite command sent via the "Command:" text field will not # be able to override the checkbuttons. # proc enforce_overwrite_settings {which_fs} { global overwrite_iso_files overwrite_iso_dirs overwrite_disk_files if {$which_fs == "isofs"} { if {$overwrite_iso_files == 0} { set mode "off" } else { if {$overwrite_iso_dirs == 0} { set mode "nondir" } else { set mode "on" } } } else { if {$overwrite_disk_files == 1} { set mode "on" } else { set mode "off" } } set disp_en_mem [set_display_msg 0] send_loggable_cmd "-overwrite $mode" set_display_msg $disp_en_mem } # Send xorriso an appropriate end command and wait for the pipes to break. # Called when button "End" is hit. # proc end_xorriso {} { global expect_broken_pipes if {[window_yesno "Really end this program and its xorriso backend ?"] \ != 1} { return "" } if {[changes_are_pending] == 1} { if {[window_yesno \ "Changes of the ISO image are pending.\nReally discard them ?"] \ != 1} { return "" } set expect_broken_pipes "1" send_loggable_cmd "-rollback_end" } else { set expect_broken_pipes "1" send_loggable_cmd "-end" } central_exit 0 } # Check whether an output drive is acquired. Propose refusal if not. # Called by procedures which are about to use the output drive. # proc assert_outdev {purpose} { global eff_outdev_adr inquire_dev if {$eff_outdev_adr == ""} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : You must choose an output drive before $purpose" return "0" } return "1" } # Check whether changes to the ISO model are pending. If so, propose refusal. # Called by procedures which are about to discard the ISO model. # proc assert_no_changes {} { if {[changes_are_pending] == 1} { window_ack "ISO image changes are pending. You have to do \"Write ISO session\" or \"Rollback\"." "grey" "toplevel" return "0" } return "1" } # Set the text of the "Permissions:" menubutton # Called by the radiobuttons in the menu. # proc show_permission_policy {} { global permission_policy set text $permission_policy if {$permission_policy == "as_is"} { set text "as is" } if {$permission_policy == "mkisofs_r"} { set text "mkisofs -r" } .perm_policy configure -text "Permissions: $text" } # Set the target address of command logging. # Called by the "Script/Log" menu. # proc set_log_script_address {} { browse_tree cmd_log_target "localfs" set w .browse_disk_window tkwait window $w effectuate_command_logging 0 } # Bring into effect the settings for command script logging. # Called by the "Accept" button or the Return key of the # "Set log script address" file browser. # proc effectuate_command_logging {close_window} { global cmd_log_target cmd_logging_mode browse_disk_window_is_active if {$close_window == 1 && $browse_disk_window_is_active == 1} { destroy_browse_disk .browse_disk_window } if {$close_window == 1 || $cmd_logging_mode > 0} { start_command_logging $cmd_log_target $cmd_logging_mode } } # Set the target address of communication pipe logging. # Called by the "Script/Log" menu. # proc set_debug_log_address {} { browse_tree debug_log_file "localfs" set w .browse_disk_window tkwait window $w effectuate_debug_logging 0 } # Bring into effect the settings for communication pipe logging. # Called by the "Accept" button or the Return key of the # "Set pipe log address" file browser. # proc effectuate_debug_logging {close_window} { global debug_log_file debug_logging browse_disk_window_is_active if {$close_window == 1 && $browse_disk_window_is_active == 1} { destroy_browse_disk .browse_disk_window } if {$close_window == 1 || $debug_logging > 0} { start_debug_logging $debug_log_file $debug_logging } } # Trigger execution of a script of xorriso commands. # Called by the "Script/Log" menu. # proc start_script_execution {} { browse_tree execute_script_adr "localfs" # actual script start is done by browse_tree_accept -> execute_script } # Permanently ban any extraction from ISO to hard disk # proc osirrox_banned {} { global osirrox_allowed reset_yesno_to_all if {[window_yesno \ "Really irrevocably ban any extraction from ISO to hard disk ?"] \ != 1} { return "" } send_loggable_cmd "-osirrox banned" set osirrox_allowed 0 set m ".script_log.menu" $m entryconfigure "Allow extract to disk" -state "disabled" $m entryconfigure "Permanently ban extraction" -state "disabled" .extract_button configure -state "disabled" } # ------ A primitive file tree browser for hard disk filesystem and ISO model # Write a directory content list into a Tree widget # proc browse_tree_fill_dir {tr parent children} { if {$parent == "/"} { set parent_name root set parent_dir / } else { set parent_name [escape_to_tree $parent] set parent_dir $parent_name } if {[$tr exists $parent_name] == 0} {return ""} $tr delete [$tr nodes $parent_name] foreach i $children { set name [string range $i 2 end] set escpd [escape_to_tree $name] set adr [combine_dir_and_name $parent_dir $escpd] $tr insert end $parent_name $adr -text $name if {[string range $i 0 0] == "d"} { set dir_dummy [combine_dir_and_name $adr "_"] $tr insert end $adr $dir_dummy -text " " } } } # The command to be executed when the user double-clicks a node. # proc browse_tree_accept {adr_var_name do_return tr value} { global have_bwidget global extract_to_adr insert_from_adr burn_write_image_adr isodir_adr global isomanip_move_target indev_adr outdev_adr cmd_log_target global debug_log_file execute_script_adr # Caution: Before using $tr, check for $have_bwidget if {$adr_var_name == "burn_write_image_adr"} { set burn_write_image_adr $value if {$do_return == 1} {burn_write_image} } if {$adr_var_name == "extract_to_adr"} { set extract_to_adr $value if {$do_return == 1} {extract_to} } if {$adr_var_name == "insert_from_adr"} { set insert_from_adr $value if {$do_return == 1} {insert_from} } if {$adr_var_name == "isodir_adr"} { set isodir_adr $value if {$do_return == 1} {isodir_return "browse_tree_accept"} } if {$adr_var_name == "isomanip_move_target"} { set isomanip_move_target $value if {$do_return == 1} {isomanip_mv} } if {$adr_var_name == "indev_adr"} { set indev_adr $value if {$do_return == 1} {indev_return} } if {$adr_var_name == "outdev_adr"} { set outdev_adr $value if {$do_return == 1} {outdev_return} } if {$adr_var_name == "cmd_log_target"} { set cmd_log_target $value if {$do_return == 1} {effectuate_command_logging 1} } if {$adr_var_name == "debug_log_file"} { set debug_log_file $value if {$do_return == 1} {effectuate_debug_logging 1} } if {$adr_var_name == "execute_script_adr"} { set execute_script_adr $value if {$do_return == 1} {execute_script 1} } } # Translate a browser tree variable in a human readable topic text # proc browse_tree_topic {adr_var_name} { if {$adr_var_name == "burn_write_image_adr"} { return "Burn image file:" } if {$adr_var_name == "extract_to_adr"} { return "Extract to disk:" } if {$adr_var_name == "insert_from_adr"} { return "Insert from disk:" } if {$adr_var_name == "isodir_adr"} { return "ISO directory:" } if {$adr_var_name == "isomanip_move_target"} { return "Move to:" } if {$adr_var_name == "indev_adr"} { return "Input drive/image" } if {$adr_var_name == "outdev_adr"} { return "Output drive/image" } if {$adr_var_name == "cmd_log_target"} { return "Set log script address" } if {$adr_var_name == "debug_log_file"} { return "Set pipe log address" } if {$adr_var_name == "execute_script_adr"} { return "Execute command script" } return $adr_var_name } # Unescape &|^! from Bwidget tree browser # proc unescape_from_tree {text} { return [string map [list "\{\{\}" "\{" "\{+\}" "&" "\{I\}" "|" \ "\{A\}" "^" "\{.\}" "!"] \ $text] # <<< alternative encoding # set escpd [string map [list "\\\\" "\\" "\\+" "&" "\\I" "|" \ # "\\A" "^" "\\." "!"] \ } # Escape &|^! which are special to BWidget Tree # proc escape_to_tree {text} { return [string map [list "\{" "\{\{\}" "&" "\{+\}" "|" "\{I\}" \ "^" "\{A\}" "!" "\{.\}"] \ $text] } # Accept the single selected item of the tree browser # Called by the \"Accept\" button in the browser window. # proc browse_tree_accept_sel {adr_var_name do_return tr} { set selected [$tr selection get] if {[llength $selected] != 1} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You must select a single tree item before clicking the \"Accept\" button." return "" } browse_tree_accept $adr_var_name $do_return $tr \ [unescape_from_tree [lindex $selected 0]] } # Hit the Return key on the text entry of the browser # proc browse_tree_accept_entry {adr_var_name do_return tr} { global extract_to_adr insert_from_adr burn_write_image_adr isodir_adr global isomanip_move_target indev_adr outdev_adr cmd_log_target global debug_log_file execute_script_adr eval set text $$adr_var_name browse_tree_accept $adr_var_name $do_return $tr $text } # Submit a Tree-escaped path to browse_tree_accept. # Called by Double-click in browser. # proc browse_tree_accept_escd {adr_var_name do_return tr escd_path} { browse_tree_accept $adr_var_name $do_return $tr \ [unescape_from_tree $escd_path] } # Move up one directory level of the file browser selection # proc browse_tree_up {adr_var_name tr which_fs} { global extract_to_adr insert_from_adr burn_write_image_adr isodir_adr global isomanip_move_target indev_adr outdev_adr set selected [$tr selection get] if {[llength $selected] != 1} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You must select a single tree item before clicking the \"Up\" button." return "" } set old_adr [lindex $selected 0] set adr [file dirname $old_adr] catch { $tr see $adr if {[$tr nodes $old_adr 0] != ""} { $tr closetree $old_adr } } if {$adr != "/" && $adr != ""} { $tr selection clear $tr selection set $adr } } # Move down one directory level of the file browser selection # proc browse_tree_down {adr_var_name tr which_fs} { global extract_to_adr insert_from_adr burn_write_image_adr isodir_adr global isomanip_move_target indev_adr outdev_adr set selected [$tr selection get] if {[llength $selected] != 1} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You must select a single tree item before clicking the \"Down\" button." return "" } set adr [lindex $selected 0] if {$which_fs == "isofs"} { browse_iso_open_dir $tr $adr } else { browse_disk_open_dir $tr $adr } catch { $tr opentree $adr 0 $tr see $adr } } # The command to be executed when the user closes a directory node. # It replaces the directory content list by a single dummy item. # proc browse_tree_close_dir {tr name} { browse_tree_fill_dir $tr $name [list "? "] } # Delete the old content of the browse window and display the freshly # obtained current state down to the current address in the field variable. # proc browse_tree_populate {which_fs} { global have_bwidget global browse_disk_window_var browse_iso_window_var global browse_iso_window_is_active browse_disk_window_is_active global extract_to_adr insert_from_adr burn_write_image_adr isodir_adr global isomanip_move_target indev_adr outdev_adr cmd_log_target global debug_log_file execute_script_adr if {$have_bwidget != 1} {return ""} if {$which_fs == "isofs"} { if {$browse_iso_window_is_active == 0} {return ""} set w {.browse_iso_window} set open_dir_cmd "browse_iso_open_dir" set adr_var $browse_iso_window_var } else { if {$browse_disk_window_is_active == 0} {return ""} set w {.browse_disk_window} set open_dir_cmd "browse_disk_open_dir" set adr_var $browse_disk_window_var } # Variable indirection eval set adr $$adr_var # Install root level $open_dir_cmd $w.tree "/" # Set $adr as current address set comps [split $adr "/"] # Install the stack of directories above current address set path "/" foreach i $comps { if {$i == ""} { continue } set path [combine_dir_and_name $path [escape_to_tree $i]] $open_dir_cmd $w.tree $path catch { $w.tree opentree $path 0 $w.tree see $path } } } # The procedure to be run by mouse button 3 in the file browser. # It has to strip off the surplus parameter added by the Tree widget. # proc browse_tree_help {about_what button_color from_item} { window_help $about_what $button_color } # Destroy the hard disk browser pop-up window. # proc destroy_browse_disk {w} { global browse_disk_window_is_active browse_disk_window_geometry global browse_disk_window_is_grabbed if {$w != "" && $browse_disk_window_is_active == 1} { if {$browse_disk_window_is_grabbed == 1} { grab release $w } set browse_disk_window_is_grabbed 0 set browse_disk_window_geometry [wm geometry $w] destroy $w } set browse_disk_window_is_active 0 } # The command to be executed when the user opens a directory node in # the hard disk filesystem. # proc browse_disk_open_dir {tr name} { set escpd [unescape_from_tree $name] if {[localfs_filetype $escpd] != "d"} {return ""} set lslist [localfs_ls $escpd] browse_tree_fill_dir $tr $escpd $lslist } # Refresh the content of a possibly displayed tree browser for hard disk # proc browse_disk_refresh {} { browse_tree_populate "localfs" } # The command to be executed when the user opens a directory node in # the ISO model. # proc browse_iso_open_dir {tr name} { set escpd [unescape_from_tree $name] if {[isofs_filetype $escpd] != "d"} {return ""} set lslist [isofs_ls $escpd] browse_tree_fill_dir $tr $escpd $lslist } # Destroy the ISO browser pop-up window. # proc destroy_browse_iso {w} { global browse_iso_window_is_active browse_iso_window_geometry global browse_iso_window_is_grabbed if {$w != "" && $browse_iso_window_is_active == 1} { set browse_iso_window_geometry [wm geometry $w] if {$browse_iso_window_is_grabbed == 1} { grab release $w } set browse_iso_window_is_grabbed 0 destroy $w } set browse_iso_window_is_active 0 } # Refresh the content of a possibly displayed tree browser for ISO model # proc browse_iso_refresh {} { browse_tree_populate "isofs" } # Multiplexer for updating both vertical scrollbars # proc browse_tree_yscrollcommand {w arg1 arg2} { $w.treescroll_y_l set $arg1 $arg2 $w.treescroll_y_r set $arg1 $arg2 } # Open a file browser window for hard disk filesystem or ISO model # proc browse_tree {adr_var which_fs} { upvar $adr_var adr global have_bwidget browse_disk_window_is_active browse_iso_window_is_active global browse_disk_window_var browse_iso_window_var global tree_window_lines tree_window_width tree_window_button_width global browse_disk_window_geometry browse_iso_window_geometry set button_color "grey" if {$which_fs == "isofs"} { set w {.browse_iso_window} set window_is_active $browse_iso_window_is_active set title_name "xorriso-tcltk ISO model browser" set open_dir_cmd "browse_iso_open_dir" set destroy_cmd "destroy_browse_iso" if {$browse_iso_window_var != $adr_var && $window_is_active == 1} { destroy_browse_iso $w set window_is_active 0 } set browse_iso_window_var $adr_var set old_geometry $browse_iso_window_geometry set browse_iso_window_is_active 1 } else { set w {.browse_disk_window} set window_is_active $browse_disk_window_is_active set title_name "xorriso-tcltk hard disk filesystem browser" set open_dir_cmd "browse_disk_open_dir" set destroy_cmd "destroy_browse_disk" if {$browse_disk_window_var != $adr_var && $window_is_active == 1} { destroy_browse_disk $w set window_is_active 0 } set browse_disk_window_var $adr_var set old_geometry $browse_disk_window_geometry set browse_disk_window_is_active 1 } set re_use_widgets 0 if {$window_is_active == 0} { toplevel $w -borderwidth 10 -class Browser wm title $w $title_name set_window_position $w $old_geometry } else { set re_use_widgets 1 } if {$re_use_widgets == 0} { if {$have_bwidget == 1} { # BWidget Tree frame $w.tree_frame frame $w.tree_frame_x Tree $w.tree -width $tree_window_width -height $tree_window_lines \ -opencmd "$open_dir_cmd $w.tree" \ -closecmd "browse_tree_close_dir $w.tree" \ -selectfill 1 \ -yscrollcommand "browse_tree_yscrollcommand $w" \ -xscrollcommand "$w.treescroll_x set" # ??? why doesn't work ? # $w.tree bindText \ # "browse_tree_accept_bindtext $adr_var 1 $w.tree" # At least double-click does work $w.tree bindText \ "browse_tree_accept_escd $adr_var 1 $w.tree" $w.tree bindText {browse_tree_help "Browse tree" grey} scrollbar $w.treescroll_y_l -command "$w.tree yview" scrollbar $w.treescroll_y_r -command "$w.tree yview" scrollbar $w.treescroll_x -orient horizontal -command "$w.tree xview " pack $w.tree -in $w.tree_frame_x -side top -expand 1 -fill both pack $w.treescroll_x -in $w.tree_frame_x -side top -expand 1 -fill x pack $w.treescroll_y_l -in $w.tree_frame -side left -expand 1 -fill y pack $w.tree_frame_x -in $w.tree_frame -side left -expand 1 -fill both pack $w.treescroll_y_r -in $w.tree_frame -side left -expand 1 -fill y frame $w.button_line button $w.accept -text "Accept" -width $tree_window_button_width \ -command "browse_tree_accept_sel $adr_var 1 $w.tree" bind_help $w.accept "Accept (browse tree)" button $w.to_field -text "Edit" -width $tree_window_button_width \ -command "browse_tree_accept_sel $adr_var 0 $w.tree" bind_help $w.to_field "Edit (browse tree)" button $w.up -text "Up" -width $tree_window_button_width \ -command "browse_tree_up $adr_var $w.tree $which_fs" bind_help $w.up "Up (browse tree)" button $w.down -text "Down" -width $tree_window_button_width \ -command "browse_tree_down $adr_var $w.tree $which_fs" bind_help $w.down "Down (browse tree)" pack $w.up $w.down $w.accept $w.to_field \ -in $w.button_line -side left -expand 0 pack $w.tree_frame -side top -anchor w -expand 1 -fill both } else { frame $w.button_line button $w.accept -text "Accept" -width $tree_window_button_width \ -command "browse_tree_accept_entry $adr_var 1 $w.tree" bind_help $w.accept "Accept (browse tree)" pack $w.accept -in $w.button_line -side left -expand 0 } button $w.help -text "Help" -width $tree_window_button_width \ -command {window_help "Browse tree" grey} bind_help $w.help "Browse tree" button $w.close -text "Close" -width $tree_window_button_width \ -command "$destroy_cmd $w" \ -background $button_color bind_help $w.close "Close (browse tree)" pack $w.help $w.close \ -in $w.button_line -side left -expand 0 pack $w.button_line -side top -anchor center frame $w.text_frame label $w.topic -text "[browse_tree_topic $adr_var]" bind_help $w.topic "Browse tree" entry $w.text_entry -relief sunken -bd 1 -width 40 \ -textvariable $adr_var bind_entry_keys $w.text_entry \ "browse_tree_accept_entry $adr_var 1 $w.tree" bind_help $w.text_entry "Browse tree" pack $w.topic -in $w.text_frame -side left pack $w.text_entry -in $w.text_frame -side left -expand 1 -fill both pack $w.text_frame -side top -expand 1 -fill both } raise $w if {$have_bwidget == 1} { browse_tree_populate $which_fs focus $w.tree } update idletasks } # ------ GUI display procedures ---- # Display a message of xorriso or of this frontend in the .msglist box # proc display_msg {msg} { global .msglist global msglist_max_fill msglist_running pre_msglist display_msg_enabled if {$display_msg_enabled == 0} {return ""} if {$msg == "============================" || \ $msg == "==============================================================" || \ $msg == "enter option and arguments :"} {return ""} if {$msglist_running == 0} { lappend pre_msglist $msg } else { if {[.msglist index end] > $msglist_max_fill} { .msglist delete 0 0 } .msglist insert end [escape_newline $msg 0] .msglist see [expr "[.msglist index end]-1"] update idletasks } } # Set whether messages submitted to proc display_message shall really show up # This is used by callback procedures to hide auxiliary commands and lengthy # reply messages from the user display. # proc set_display_msg {mode} { global display_msg_enabled set old $display_msg_enabled if {$mode == "0"} { set display_msg_enabled 0 } else { set display_msg_enabled "1" } return $old } # Display a frontend error message in the .msglist box and by a pop-up window. # proc xorriso_tcltk_errmsg {msg} { global highest_cmd_sev_msg set highest_cmd_sev_msg [escape_newline $msg 0] display_msg $msg window_ack $msg "grey" "toplevel" update idletasks } # Memorize the current selection in the .isolist box. # proc memorize_isolist_selection {} { global memorized_isolist_selection isolist_names global .isolist set memorized_isolist_selection "" set selected [.isolist curselection] foreach i $selected { lappend memorized_isolist_selection [lindex $isolist_names $i] } } # Restore the memorized selection in the .isolist box as far as the # names have survived in the meantime. # proc restore_isolist_selection {} { global memorized_isolist_selection isolist_names global .isolist .isolist selection clear 0 end foreach i $memorized_isolist_selection { set idx [lsearch -exact $isolist_names $i] if {$idx > -1} { .isolist selection set $idx $idx } } set memorized_isolist_selection "" } # Receive the answer of the yes/no window and destroy it. # proc destroy_yesno {w answer} { global yesno_window_is_active answer_of_yesno yesno_window_geometry global yesno_to_all if {$w != ""} { set yesno_window_geometry [wm geometry $w] grab release $w destroy $w update idletasks } set yesno_window_is_active 0 set answer_of_yesno $answer if {$answer == 2} { set yesno_to_all 1 set answer_of_yesno 1 } if {$answer == -1} { set yesno_to_all -1 set answer_of_yesno 0 } } # Pop-up a window which asks for yes or no. Return 1 if answer is yes. # proc window_yesno {question} { global answer_of_yesno yesno_window_is_active yesno_window_geometry set w {.yesno_window} if {$yesno_window_is_active == 1} { set yesno_window_is_active [window_exists $w] } if {$yesno_window_is_active == 1} { raise $w xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You still need to answer an older yes/no question" return "0" } set yesno_window_is_active 1 set answer_of_yesno "" toplevel $w -borderwidth 20 -class Dialog wm title $w "xorriso-tcltk yes/no" set_window_position $w $yesno_window_geometry label $w.question -text $question button $w.yes -text "yes" -command "destroy_yesno $w 1" \ -borderwidth 4 -padx 20 -pady 20 bind_help $w.yes "yes/no" button $w.no -text "no" -command "destroy_yesno $w 0" \ -borderwidth 4 -padx 20 -pady 20 bind_help $w.no "yes/no" pack $w.yes $w.question $w.no -side left update idletasks grab set $w tkwait variable answer_of_yesno return $answer_of_yesno } # Pop-up a window which asks for yes, yes-to-all, no, or no-to-all. # Return 1 if answer is yes. # proc window_yesno_ever {question} { global answer_of_yesno yesno_window_is_active yesno_window_geometry global yesno_to_all set w {.yesno_window} if {$yesno_window_is_active == 1} { set yesno_window_is_active [window_exists $w] } if {$yesno_window_is_active == 1} { raise $w xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You still need to answer an older yes/no question" return "0" } if {$yesno_to_all == 1} { return "1" } if {$yesno_to_all == -1} { return "0" } set yesno_window_is_active 1 set answer_of_yesno "" toplevel $w -borderwidth 20 -class Dialog wm title $w "xorriso-tcltk yes/no" set_window_position $w $yesno_window_geometry frame $w.yes_frame frame $w.no_frame label $w.question -text $question button $w.yes -text "yes" -command "destroy_yesno $w 1" \ -borderwidth 4 -padx 20 -pady 20 -relief raised button $w.no -text "no" -command "destroy_yesno $w 0" \ -borderwidth 4 -padx 20 -pady 20 -relief raised button $w.yes_to_all -text "yes to all" -command "destroy_yesno $w 2" bind_help $w.yes_to_all "yes to all" button $w.no_to_all -text "no to all" -command "destroy_yesno $w -1" bind_help $w.no_to_all "no to all" pack $w.yes $w.yes_to_all -in $w.yes_frame -side top -expand 1 -fill both pack $w.no $w.no_to_all -in $w.no_frame -side top -expand 1 -fill both pack $w.yes_frame $w.question $w.no_frame \ -in $w -side left -expand 1 -fill both raise $w update idletasks grab set $w tkwait variable answer_of_yesno return $answer_of_yesno } proc reset_yesno_to_all {} { global yesno_to_all set yesno_to_all 0 } # Destroy the notification pop-up window. # proc destroy_ack {w had_focus} { global ack_window_is_active ack_window_geometry if {$w != ""} { set ack_window_geometry [wm geometry $w] grab release $w if {$had_focus != "-"} { focus $had_focus } destroy $w update idletasks } set ack_window_is_active 0 } # Pop-up a window which notifies of a problem and asks for a button click. # proc window_ack {question button_color where} { global answer_of_yesno ack_window_is_active ack_window_geometry global continue_from_ack set had_focus [focus] if {$had_focus == ""} {set had_focus "-"} set re_use_widgets 0 if {$where == "embedded"} { set w "" set destroy_cmd "" } else { set w {.ack_window} if {$ack_window_is_active == 1} { set ack_window_is_active [window_exists $w] } if {$ack_window_is_active == 0} { toplevel $w -borderwidth 20 -class Dialog wm title $w "xorriso-tcltk acknowledge" set ack_window_is_active 1 } else { set re_use_widgets 1 } set_window_position $w $ack_window_geometry set destroy_cmd "destroy_ack $w $had_focus" } if {$re_use_widgets == 1} { $w.question configure -text $question } else { label $w.question -text $question button $w.ok -text "Continue" -command $destroy_cmd \ -background $button_color bind $w.ok $destroy_cmd bind_help $w.ok "Continue" pack $w.question -side top -expand 1 -fill both pack $w.ok -side top } raise $w update idletasks focus $w.ok grab set $w tkwait variable ack_window_is_active } # Destroy the help pop-up window. # proc destroy_help {w help_main} { global help_window_is_active help_window_has_scroll help_window_geometry global main_help_window_is_active main_help_window_geometry if {$w != ""} { if {$help_main == 1} { set main_help_window_geometry [wm geometry $w] } else { set help_window_geometry [wm geometry $w] } destroy $w } if {$help_main == 1} { set main_help_window_is_active 0 } else { set help_window_is_active 0 set help_window_has_scroll 0 } } proc surround_text {text} { return "\n\n [string map {\n "\n "} $text]\n" } # Pop-up a window which shows a help text and a Close button. # proc window_help {about_what button_color} { global help_window_is_active help_window_lines help_window_has_scroll global help_window_border_width help_window_geometry global main_help_window_is_active global main_help_window_lines main_help_window_geometry global .help_window .main_help_window # The main help window is independent of the GUI element help window if {$about_what == "Help"} { set help_main 1 set w {.main_help_window} set window_is_active $main_help_window_is_active set window_has_scroll 1 set old_geometry $main_help_window_geometry set window_lines $main_help_window_lines } else { set help_main 0 set w {.help_window} set window_is_active $help_window_is_active set window_has_scroll $help_window_has_scroll set old_geometry $help_window_geometry set window_lines $help_window_lines } if {$window_is_active == 1} { set window_is_active [window_exists $w] } # Giving the help text some distance from the border decorations set line_width 82 set helptext "\n\n [string map {\n "\n "} [tell_helptext $about_what]]\n" if {[count_newlines $helptext] >= $window_lines} { if {$window_is_active == 1 && $window_has_scroll == 0} { destroy_help $w $help_main set window_is_active 0 } if {$help_main == 1} { set old_geometry $main_help_window_geometry } else { set help_window_has_scroll 1 set window_has_scroll 1 set old_geometry $help_window_geometry } } # Dealing with initiating windows that are grabbed set grabbed [grab current] if {$grabbed == ""} {set grabbed "-"} if {$grabbed != "-" && $window_is_active == 1} { destroy_help $w $help_main set window_is_active 0 } if {$grabbed != "-"} { # Set old_geometry to position underneath grabbed window set value [wm geometry $grabbed] set idx [string first "+" $value] set height_idx [string first "x" $value] if {$idx != -1 && $height_idx != -1 && $idx > $height_idx} { set width [string range $value 0 [expr $height_idx-1]] set height [string range $value [expr $height_idx+1] [expr $idx-1]] set x [string range $value [expr $idx+1] end] set idx [string first "+" $x] if {$idx != -1} { set y [string range $x [expr $idx+1] end] set x [string range $x 0 [expr $idx-1]] set y [expr $y+$height] set old_geometry "${width}x${height}+${x}+${y}" } } } set re_use_widgets 0 if {$window_is_active == 0} { toplevel $w -borderwidth $help_window_border_width -class Help set_window_position $w $old_geometry if {$help_main == 1} { wm title $w "xorriso-tcltk main help text" set main_help_window_is_active 1 reset_to_normal_background .help update idletasks } else { wm title $w "xorriso-tcltk GUI element help text" set help_window_is_active 1 } } else { set re_use_widgets 1 } if {$re_use_widgets == 1} { $w.text configure -state normal $w.text delete 1.0 end $w.text insert end $helptext raise $w } else { set destroy_cmd "destroy_help $w $help_main" frame $w.text_frame text $w.text -width $line_width -height $window_lines \ -relief flat -borderwidth 0 $w.text insert end $helptext pack $w.text -in $w.text_frame -side left -expand 1 -fill both if {$window_has_scroll == 1} { scrollbar $w.scroll_y -command "$w.text yview" $w.text configure -yscrollcommand "$w.scroll_y set" bind_listbox_keys $w.text $window_lines "text" pack $w.scroll_y -in $w.text_frame -side left -fill y } button $w.close -text "Close" -command $destroy_cmd \ -background $button_color pack $w.text_frame -side top -expand 1 -fill both frame $w.middle_spacer -height 6 frame $w.bottom_spacer -height 6 pack $w.middle_spacer $w.close $w.bottom_spacer -side top } $w.text configure -state disabled } # Display the busy/ready state of xorriso. # Called with 1 by sender of commands and with 0 by receivers of replies . # proc display_busy {state} { global busy_text_exists global .busy_text if {$busy_text_exists == 0} {return ""} if {$state == 0} { .busy_text configure -text "ready" .busy_text configure -background "#D0D0D0" } else { .busy_text configure -text "busy" .busy_text configure -background "#808080" } update idletasks } # Tries to make use of the BWidget package for getting its Tree widget # proc check_for_bwidget {} { global have_bwidget bwidget_version if {$have_bwidget == 0} { catch { set bwidget_version [package require BWidget] set have_bwidget 1 } } } # A window to display if no file browser is available # proc browser_dummy {} { window_ack \ "The file browser cannot be used because Tcl/Tk package \"BWidget\" is not loaded" "grey" "toplevel" } # Obtain the geometry string of a window # proc get_window_geometry {w} { wm geometry $w } # Set the position of a window from a geometry string # proc set_window_position {w geometry} { set value $geometry set idx [string first "+" $value] if {$idx == -1} { set value [wm geometry .] set idx [string first "+" $value] } if {$idx == -1} { return "" } set pos [string range $value $idx end] wm geometry $w $pos } # Reset button appearance from startup color to normal color # proc reset_to_normal_background {w} { set normal_color [.drive_drop_both cget -background] $w configure -background $normal_color } # Checks whether a window is really there # proc window_exists {w} { set window_exists 0 catch { $w cget -background set window_exists 1 } return $window_exists } # ------ Building GUI components ------ # ------ GUI layout parameters ------ # The default position of the main window set main_window_geometry "" # How to mark the borders of the main grouping frames set main_framerelief ridge set main_borderwidth 4 # How to mark the borders of the second level grouping frames set borderwidth 1 # Number of lines in msglist display set msglist_lines 8 set msglist_max_fill 1000 set msglist_running 0 # Number of lines in drivelist display set drivelist_lines 2 # Number of lines in ISO directory content display set isolist_lines 8 # Whether the message box shall export its selection to the whole X display set export_msg_selection true # Whether the item lists shall export their selection set export_selection false # The number of lines in the display of the help texts set main_help_window_lines 24 set help_window_lines 16 # The distance of the help text from the help window border set help_window_border_width 0 # The number of items to display in a tree browser window set tree_window_lines 12 # The number of visible characters in a tree browser line set tree_window_width 50 # The width in characters of the six buttons under the tree browser set tree_window_button_width 6 # -------- GUI definition procedures # Overall definition of the GUI # proc init_gui {} { global .input .cmdline_entry .msgbox .errmsg .dev .drivebox global .isobox .localfs global main_framerelief main_borderwidth click_to_focus check_for_bwidget # Main grouping frames frame .connection_block \ -relief $main_framerelief -borderwidth $main_borderwidth frame .drive_block \ -relief $main_framerelief -borderwidth $main_borderwidth frame .iso_block \ -relief $main_framerelief -borderwidth $main_borderwidth init_input init_msgbox init_errmsg init_dev init_drivebox init_isobox init_isomanip init_burn init_localfs pack .input .msgbox .errmsg -in .connection_block \ -side top -expand 1 -fill both pack .drivebox .dev .burn -in .drive_block \ -side top -expand 1 -fill both pack .localfs .isobox .isomanip -in .iso_block \ -side top -expand 1 -fill both pack .connection_block .drive_block .iso_block \ -side top -expand 1 -fill both if {$click_to_focus == 1} { focus .msglist } } # The xorriso headline with End button, xorriso version, busy/ready indicator, # command line, and "Refresh disp" button. # proc init_input {} { global borderwidth busy_text_exists xorriso_version debug_logging global cmd_logging_mode cmd_log_target osirrox_allowed cmd_logging_all global .input .input_line1 .xorriso_version .busy .busy_text global .refresh_state .end_button .cmdline .log_pipes_switch set extract_state "normal" if {$osirrox_allowed == 0} {set extract_state "disabled"} frame .input -borderwidth $borderwidth frame .input_line1 -borderwidth 0 pack .input_line1 -in .input \ -side top -anchor w -expand 1 -fill both button .end_button -text "End" -command "end_xorriso" bind_help .end_button "End" if {[string length $xorriso_version] > 10} { set xorriso_version [string range $xorriso_version 0 9] } label .xorriso_version -text "xorriso-$xorriso_version" bind_help .xorriso_version "version" frame .busy -relief ridge -borderwidth 2 label .busy_text -width 5 -text "busy" bind_help .busy_text "ready/busy" set busy_text_exists 1 pack .busy_text -in .busy button .refresh_state -text "Refresh disp" \ -command "refresh_state" bind_help .refresh_state "Refresh disp" menubutton .script_log -text "Script/Log" -anchor w \ -direction below -relief ridge -indicatoron 1 \ -menu .script_log.menu bind_help .script_log "Script/Log" set m ".script_log.menu" menu $m $m add checkbutton -label "Log command script" \ -indicatoron 1 -selectcolor "" \ -command "effectuate_command_logging 0" \ -variable cmd_logging_mode \ -onvalue 1 -offvalue 0 $m add checkbutton -label "Log non-essential commands" \ -indicatoron 1 -selectcolor "" \ -variable cmd_logging_all \ -onvalue 1 -offvalue 0 $m add command -label "Set log script address" \ -command "set_log_script_address" $m add separator $m add checkbutton -label "Log pipes" \ -indicatoron 1 -selectcolor "" \ -variable debug_logging \ -onvalue 1 -offvalue 0 $m add command -label "Set pipe log address" \ -command "set_debug_log_address" $m add separator $m add separator $m add command -label "Execute command script" \ -command "start_script_execution" $m add checkbutton -label "Allow extract to disk" \ -state $extract_state \ -indicatoron 1 -selectcolor "" \ -variable script_with_osirrox \ -onvalue 1 -offvalue 0 $m add separator $m add command -label "Permanently ban extraction" \ -state $extract_state \ -command "osirrox_banned" button .help -text "Help" -command {window_help "Help" "grey"} \ -background "grey" bind_help .help "Help" init_cmdline pack .end_button .xorriso_version .busy -in .input_line1 -side left pack .cmdline \ -in .input_line1 -side left -expand 1 -fill both pack .refresh_state .script_log .help -in .input_line1 -side left } # The combination of "Command:" label and command line # proc init_cmdline {} { global cmdline borderwidth global .cmdline .cmdline_text .cmdline_entry frame .cmdline -borderwidth 0 label .cmdline_text -width 10 -text "Command:" bind_help .cmdline_text "Command:" entry .cmdline_entry -width 56 -relief sunken -bd 1 \ -textvariable cmdline bind_entry_keys .cmdline_entry {cmdline_return} bind_help .cmdline_entry "Command:" # >>> is there a chance to get a history on an entry ? pack .cmdline_text -in .cmdline -side left pack .cmdline_entry -in .cmdline -side left -expand 1 -fill both } # The listbox where to display commands and reply messages unless this is # disabled for auxiliary commands which shall not clutter the display. # proc init_msgbox {} { global borderwidth global msglist_lines export_msg_selection msglist_running pre_msglist global .msgbox .msglist .msgscroll frame .msgbox -borderwidth $borderwidth listbox .msglist -height $msglist_lines -selectmode extended \ -yscrollcommand ".msgscroll set" \ -exportselection $export_msg_selection bind_listbox_keys ".msglist" $msglist_lines "listbox" bind_help .msglist "message box" set msglist_running 1 foreach i $pre_msglist { display_msg [escape_newline $i 0] } scrollbar .msgscroll -command ".msglist yview" pack .msglist -in .msgbox -side left -expand 1 -fill both pack .msgscroll -in .msgbox -side right -fill y set pre_msglist "" } # Two display lines for most severe event messages. One gets reset with # each important command. The other one stays until the user clears it. # proc init_errmsg {} { global borderwidth global .errmsg .total_errmsg .cmd_errmsg frame .errmsg -borderwidth $borderwidth init_total_errmsg init_cmd_errmsg pack .cmd_errmsg .total_errmsg -in .errmsg \ -side top -anchor w -expand 1 -fill both } # The most severe message display which gets reset automatically. # proc init_cmd_errmsg {} { global borderwidth global .cmd_errmsg .cmd_errmsg_label .cmd_errmsg_msg frame .cmd_errmsg -borderwidth $borderwidth label .cmd_errmsg_label -width 14 -text "Recent problem:" -anchor w bind_help .cmd_errmsg_label "Recent problem:" label .cmd_errmsg_msg -width 80 -relief ridge -bd 2 \ -anchor w \ -textvariable highest_cmd_sev_msg # (no keys, no focus) bind_help .cmd_errmsg_msg "Recent problem:" pack .cmd_errmsg_label -in .cmd_errmsg -side left pack .cmd_errmsg_msg -in .cmd_errmsg -side left -expand 1 -fill both } # The persistent most severe message display that is to be reset by the user. # proc init_total_errmsg {} { global borderwidth global .total_errmsg .total_errmsg_label .total_errmsg_msg global .total_errmsg_clear frame .total_errmsg -borderwidth $borderwidth label .total_errmsg_label -text "Worst problem:" -width 14 -anchor w bind_help .total_errmsg_label "Worst problem:" button .total_errmsg_clear -text "Clear" \ -width 5 \ -command "clear_total_errmsg" bind_help .total_errmsg_clear "Clear" label .total_errmsg_msg -width 80 -relief ridge -bd 2 \ -anchor w \ -textvariable highest_total_sev_msg # (no keys, no focus) bind_help .total_errmsg_msg "Worst problem:" pack .total_errmsg_label -in .total_errmsg -side left pack .total_errmsg_msg -in .total_errmsg -side left -expand 1 -fill both pack .total_errmsg_clear -in .total_errmsg -side left } # The list of drives which were found by scanning, the Scan button, and # buttons for picking a drive from the list, for giving them up, for # calming them down, and for reloading the ISO image from the input drive. # proc init_drivebox {} { global borderwidth drivelist_lines export_selection global .drivebox .drivelistbox .drivelist .drivescroll .drive_scan global .drive_picker .drive_scan .drive_pick_in .drive_pick_out global .drive_pick_both .drive_drop_both .drive_calm .iso_rollback_button frame .drivebox -borderwidth $borderwidth frame .drivelistbox -borderwidth $borderwidth listbox .drivelist -height $drivelist_lines -selectmode extended \ -yscrollcommand ".drivescroll set" \ -exportselection $export_selection bind_listbox_keys ".drivelist" $drivelist_lines "listbox" bind_help .drivelist "drivelist" scrollbar .drivescroll -command ".drivelist yview" pack .drivelist -in .drivelistbox -side left -expand 1 -fill both pack .drivescroll -in .drivelistbox -side right -fill y frame .drive_picker -borderwidth $borderwidth frame .drive_picker_line_1 -borderwidth 0 frame .drive_picker_line_2 -borderwidth 0 frame .drive_aux_buttons_line_1 -borderwidth 0 frame .drive_aux_buttons_line_2 -borderwidth 0 frame .drive_aux_buttons -borderwidth 0 button .drive_scan -text "Scan for drives" \ -background "grey" \ -command "scan_for_drives" bind_help .drive_scan "Scan for drives" button .drive_pick_in -text "Pick input drive" \ -command "pick_indev" bind_help .drive_pick_in "Pick input drive" button .drive_pick_out -text "Pick output drive" \ -command "pick_outdev" bind_help .drive_pick_out "Pick output drive" button .drive_pick_both -text "Pick drive for both roles" \ -command "pick_dev" bind_help .drive_pick_both "Pick drive for both roles" button .drive_drop_both -text "Give up drives" \ -command "give_up_dev" bind_help .drive_drop_both "Give up drives" button .drive_calm -text "Calm drives" \ -command "calm_drives" bind_help .drive_calm "Calm drives" button .iso_rollback_button -text "Rollback" -width 9 \ -command {iso_rollback} bind_help .iso_rollback_button "Rollback" # One button block left, one right pack .drive_pick_in .drive_pick_out \ -in .drive_picker_line_1 -side left -expand 1 -fill none pack .drive_pick_both \ -in .drive_picker_line_2 -side left -expand 1 -fill x pack .drive_picker_line_1 .drive_picker_line_2 \ -in .drive_picker -side top -expand 1 -fill x -anchor w pack .drive_scan .drive_calm \ -in .drive_aux_buttons_line_1 -side left -expand 1 -fill none pack .drive_drop_both .iso_rollback_button \ -in .drive_aux_buttons_line_2 -side left -expand 1 -fill x pack .drive_aux_buttons_line_1 .drive_aux_buttons_line_2 \ -in .drive_aux_buttons -side top -expand 1 -fill x -anchor w pack .drive_picker -in .drivebox -side left -expand 0 -fill none pack .drivelistbox -in .drivebox -side left -expand 1 -fill both pack .drive_aux_buttons -in .drivebox -side left -expand 0 -fill none bind .drivelist { pick_dev } } # The text fields for setting and display of the current input and output # drives. With Eject button and a short text description of the medium status. # proc init_dev {} { global borderwidth global .dev .indev .outdev frame .dev -borderwidth $borderwidth init_indev init_outdev pack .indev .outdev -in .dev \ -side top -anchor w -expand 1 -fill both } # Set and display the current input drive. # proc init_indev {} { global borderwidth indev_adr global .indev .indev_eject .indev_label .indev_entry .indev_summary frame .indev -borderwidth $borderwidth button .indev_eject -text "Eject" -command {eject_indev} bind_help .indev_eject "Eject (indev)" button .indev_label -width 16 -text "Input drive/image " \ -command {indev_return} bind_help .indev_label "Input drive/image" entry .indev_entry -width 34 -relief sunken -bd 1 \ -textvariable indev_adr bind_entry_keys .indev_entry {indev_return} bind_help .indev_entry "Input drive/image" label .indev_summary -width 60 -text "" -relief ridge -borderwidth 2 bind_help .indev_summary "input drive info" create_browser_button .indev_browse_button \ "indev_adr" "localfs" "Browse disk (indev)" pack .indev_eject .indev_label .indev_entry \ -in .indev -side left -expand 1 -fill both pack .indev_browse_button -in .indev -side left pack .indev_summary \ -in .indev -side left -expand 1 -fill both } # Set and display the current output drive. # proc init_outdev {} { global .outdev .outdev_eject .outdev_label .outdev_entry .outdev_summary global borderwidth outdev_adr frame .outdev -borderwidth $borderwidth button .outdev_eject -text "Eject" -command {eject_outdev} bind_help .outdev_eject "Eject (outdev)" button .outdev_label -width 16 -text "Output drive/image" \ -command {outdev_return} bind_help .outdev_label "Output drive/image" entry .outdev_entry -width 34 -relief sunken -bd 1 \ -textvariable outdev_adr bind_entry_keys .outdev_entry {outdev_return} bind_help .outdev_entry "Output drive/image" create_browser_button .outdev_browse_button \ "outdev_adr" "localfs" "Browse disk (outdev)" label .outdev_summary -width 60 -text "" -relief ridge -borderwidth 2 bind_help .outdev_summary "output drive info" pack .outdev_eject .outdev_label .outdev_entry \ -in .outdev -side left -expand 1 -fill both pack .outdev_browse_button -in .outdev -side left pack .outdev_summary \ -in .outdev -side left -expand 1 -fill both } # The button panel for blanking, formatting, and writing to the output drive. # proc init_burn {} { global borderwidth burn_write_image_adr burn_write_close burn_write_tao global burn_write_defect_mgt global .burn .burn_blank_button .burn_format_button .burn_commit_button global .burn_write_image .burn_write_image_entry .burn_write_close global .burn_write_tao .burn_write_defect_mgt frame .burn -borderwidth $borderwidth button .burn_blank_button -text "Blank" \ -command {burn_blank} bind_help .burn_blank_button "Blank" button .burn_format_button -text "Format" \ -command {burn_format} bind_help .burn_format_button "Format" button .burn_commit_button -text "Write ISO session" \ -command {burn_commit} bind_help .burn_commit_button "Write ISO session" button .burn_write_image -text "Burn image file:" \ -command {burn_write_image} bind_help .burn_write_image "Burn image file:" entry .burn_write_image_entry -width 40 -relief sunken -bd 1 \ -textvariable burn_write_image_adr bind_entry_keys .burn_write_image_entry {burn_write_image} bind_help .burn_write_image_entry "Burn image file:" create_browser_button .burn_image_browse_button \ "burn_write_image_adr" "localfs" "Browse disk (burn image)" checkbutton .burn_write_close -text "Close" \ -indicatoron 1 -selectcolor "" \ -relief ridge -borderwidth 2 \ -variable burn_write_close \ -onvalue 1 -offvalue 0 bind_help .burn_write_close "Close" checkbutton .burn_write_tao -text "TAO" \ -indicatoron 1 -selectcolor "" \ -relief ridge -borderwidth 2 \ -variable burn_write_tao \ -onvalue 1 -offvalue 0 bind_help .burn_write_tao "TAO" checkbutton .burn_write_defect_mgt -text "Defect Mgt" \ -indicatoron 1 -selectcolor "" \ -relief ridge -borderwidth 2 \ -variable burn_write_defect_mgt \ -onvalue 1 -offvalue 0 bind_help .burn_write_defect_mgt "Defect Mgt" pack .burn_blank_button .burn_format_button \ .burn_commit_button .burn_write_close .burn_write_tao \ .burn_write_defect_mgt \ .burn_write_image .burn_write_image_entry \ -in .burn -side left -expand 1 -fill both pack .burn_image_browse_button -in .burn -side left } # Set and display the current ISO directory and its content. # proc init_isobox {} { global borderwidth isolist_lines export_selection global .isobox .isodir .isolist .isodir_entry .isodir_up .isodir_up2 global .isodir_label .isodir_verify .isolistbox .isoscroll_y .isoscroll_x frame .isobox -borderwidth $borderwidth frame .isodir -borderwidth 0 label .isodir_label -text "ISO directory:" \ -width 14 bind_help .isodir_label "ISO directory:" entry .isodir_entry -width 60 -relief sunken -bd 1 \ -textvariable isodir_adr bind_entry_keys .isodir_entry {isodir_return "isodir_entry"} bind_help .isodir_entry "ISO directory:" create_browser_button .isodir_browse_button \ "isodir_adr" "isofs" "Browse ISO (isodir)" button .isodir_verify -text "Verify" -command {isodir_verify} bind_help .isodir_verify "Verify" button .isodir_up -text "Up" -command {isodir_up} bind_help .isodir_up "Up" button .isodir_up2 -text "Up" -command {isodir_up} bind_help .isodir_up2 "Up" pack .isodir_label .isodir_up \ -in .isodir -side left pack .isodir_entry \ -in .isodir -side left -expand 1 -fill both pack .isodir_browse_button .isodir_up2 .isodir_verify \ -in .isodir -side left frame .isolistbox -borderwidth 0 listbox .isolist -height $isolist_lines -selectmode extended \ -yscrollcommand ".isoscroll_y set" \ -xscrollcommand ".isoscroll_x set" \ -exportselection $export_selection bind_listbox_keys ".isolist" $isolist_lines "listbox" bind_help .isolist "isolist" scrollbar .isoscroll_y -command ".isolist yview" scrollbar .isoscroll_x -orient horizontal -command ".isolist xview" pack .isolist -in .isolistbox -side left -expand 1 -fill both bind .isolist { pick_isodir } pack .isoscroll_y -in .isolistbox -side right -fill y pack .isodir .isolistbox .isoscroll_x \ -in .isobox -side top -expand 1 -fill both } # The ISO-internal manipulation buttons for the ISO directory or its content. # Plus a text field where to set an ISO path as target for renaming or # directory making. # proc init_isomanip {} { global borderwidth isomanip_move_target global .isomanip .isomanip_move .isomanip_prefix .isomanip_verify_button global .isomanip_move_target .isomanip_rm_r_button .isomanip_move_button global .isomanip_mkdir_button .isomanip_move_target global .avail_label .avail_label_frame .avail_button frame .isomanip -borderwidth $borderwidth frame .isomanip_move -borderwidth 0 label .isomanip_prefix -text "Selection:" bind_help .isomanip_prefix "Selection:" button .isomanip_verify_button -text "Verify" \ -command {isomanip_verify} bind_help .isomanip_verify_button "Verify (selection)" button .isomanip_rm_r_button -text "Delete" \ -command {isomanip_rm_r} bind_help .isomanip_rm_r_button "Delete" button .isomanip_move_button -text "Move to:" \ -command {isomanip_mv} bind_help .isomanip_move_button "Move to:" button .isomanip_mkdir_button -text "Make dir" \ -command {isomanip_mkdir} bind_help .isomanip_mkdir_button "Make dir" entry .isomanip_move_target -width 60 -relief sunken -bd 1 \ -textvariable isomanip_move_target bind_entry_keys .isomanip_move_target {isomanip_mv} bind_help .isomanip_move_target "rename and mkdir target" create_browser_button .isomanip_move_target_button \ "isomanip_move_target" "isofs" "Browse ISO (move target)" pack .isomanip_prefix .isomanip_verify_button .isomanip_rm_r_button \ .isomanip_move_button \ -in .isomanip_move -side left pack .isomanip_move_target \ -in .isomanip_move -side left -expand 1 -fill both pack .isomanip_move_target_button -in .isomanip_move -side left pack .isomanip_mkdir_button \ -in .isomanip_move -side left -expand 1 -fill both pack .isomanip_move \ -in .isomanip -side top -expand 1 -fill both } # The means for interaction of ISO image and hard disk filesystem. # proc init_localfs {} { global borderwidth global .localfs .extract_frame .aux_control_frame .insert_frame frame .localfs -borderwidth $borderwidth init_extract init_aux_control init_insert pack .extract_frame .aux_control_frame .insert_frame \ -in .localfs -side top -expand 1 -fill both } # The means for extracting files from ISO image to disk # proc init_extract {} { global borderwidth extract_to_adr extract_from_selected extract_underneath global osirrox_allowed global .extract_button .extract_frame .extract_entry .extract_from_selected global .extract_underneath set extract_state "normal" if {$osirrox_allowed == 0} {set extract_state "disabled"} frame .extract_frame -borderwidth 0 button .extract_button -text "Extract to disk:" \ -state $extract_state \ -width 17 \ -command {extract_to} bind_help .extract_button "Extract to disk:" entry .extract_entry -width 40 -relief sunken -bd 1 \ -textvariable "extract_to_adr" bind_entry_keys .extract_entry {extract_to} bind_help .extract_entry "Extract to disk:" create_browser_button .extract_browse_button \ "extract_to_adr" "localfs" "Browse disk (extract)" checkbutton .extract_underneath -text "Underneath" \ -indicatoron 1 -selectcolor "" \ -relief ridge -borderwidth 2 \ -variable extract_underneath \ -onvalue 1 -offvalue 0 bind_help .extract_underneath "Underneath (extract)" checkbutton .extract_from_selected -text "Selected" \ -indicatoron 1 -selectcolor "" \ -relief ridge -borderwidth 2 \ -variable extract_from_selected \ -onvalue 1 -offvalue 0 bind_help .extract_from_selected "Selected (extract)" pack .extract_button -in .extract_frame -side left pack .extract_entry \ -in .extract_frame -side left -expand 1 -fill both pack .extract_from_selected .extract_underneath \ -in .extract_frame -side right pack .extract_browse_button -in .extract_frame -side right } # Some controls which apply to insertion, extraction, or both. # proc init_aux_control {} { global borderwidth have_bwidget permission_policy global .aux_control_frame global .overwrite_iso_files_button .overwrite_dir_button .extract_auto_chmod frame .aux_control_frame -borderwidth 0 menubutton .overwriting -text "Overwriting:" -width 16 -anchor w \ -direction above -relief ridge -indicatoron 1 \ -menu .overwriting.menu bind_help .overwriting "Overwriting:" set_overwriting_label set m ".overwriting.menu" menu $m $m add checkbutton -label "Overwrite ISO files" \ -indicatoron 1 -selectcolor "" \ -command set_overwriting_label \ -variable overwrite_iso_files \ -onvalue 1 -offvalue 0 $m add checkbutton -label "Overwrite ISO dirs" \ -indicatoron 1 -selectcolor "" \ -command set_overwriting_label \ -variable overwrite_iso_dirs \ -onvalue 1 -offvalue 0 $m add checkbutton -label "Overwrite hard disk files" \ -indicatoron 1 -selectcolor "" \ -command set_overwriting_label \ -variable overwrite_disk_files \ -onvalue 1 -offvalue 0 $m add checkbutton -label "Enforce disk dir write access" \ -indicatoron 1 -selectcolor "" \ -command set_overwriting_label \ -variable extract_auto_chmod \ -onvalue 1 -offvalue 0 pack .overwriting -in .aux_control_frame -side left menubutton .perm_policy -text "Permissions: as is" -width 22 -anchor w \ -direction above -relief ridge -indicatoron 1 \ -menu .perm_policy.menu set m ".perm_policy.menu" menu $m -tearoff 0 $m add radiobutton -label "as is" -value "as_is" \ -variable permission_policy -command show_permission_policy $m add radiobutton -label "readable" -value "readable" \ -variable permission_policy -command show_permission_policy $m add radiobutton -label "readonly" -value "readonly" \ -variable permission_policy -command show_permission_policy $m add radiobutton -label "mkisofs -r" -value "mkisofs_r" \ -variable permission_policy -command show_permission_policy show_permission_policy bind_help .perm_policy "Permissions:" button .avail_button -text "Refresh avail:" \ -command {refresh_avail} bind_help .avail_button "Refresh avail:" frame .avail_label_frame -relief ridge -borderwidth 2 label .avail_label -width 12 -text "" bind_help .avail_label "Refresh avail:" pack .avail_label -in .avail_label_frame pack .avail_label_frame .avail_button .perm_policy \ -in .aux_control_frame -side right } # The means for inserting files from disk into the ISO image # proc init_insert {} { global borderwidth insert_from_adr insert_at_selected insert_underneath global .insert_button .insert_from_frame .insert_entry .insert_at_selected global .insert_underneath .insert_frame frame .insert_frame -borderwidth 0 frame .insert_from_frame -borderwidth 0 button .insert_button -text "Insert from disk:" \ -width 17 \ -command {insert_from} bind_help .insert_button "Insert from disk:" entry .insert_entry -width 40 -relief sunken -bd 1 \ -textvariable "insert_from_adr" bind_entry_keys .insert_entry {insert_from} bind_help .insert_entry "Insert from disk:" create_browser_button .insert_browse_button \ "insert_from_adr" "localfs" "Browse disk (insert)" checkbutton .insert_underneath -text "Underneath" \ -indicatoron 1 -selectcolor "" \ -relief ridge -borderwidth 2 \ -variable insert_underneath \ -onvalue 1 -offvalue 0 bind_help .insert_underneath "Underneath (insert)" checkbutton .insert_at_selected -text "Selected" \ -indicatoron 1 -selectcolor "" \ -relief ridge -borderwidth 2 \ -variable insert_at_selected \ -onvalue 1 -offvalue 0 bind_help .insert_at_selected "Selected (insert)" pack .insert_button -in .insert_from_frame -side left pack .insert_entry \ -in .insert_from_frame -side left -expand 1 -fill both pack .insert_browse_button -in .insert_from_frame -side left pack .insert_at_selected .insert_underneath \ -in .insert_from_frame -side right pack .insert_from_frame -in .insert_frame -side left -expand 1 -fill both } # Set common behavior of listboxes in respect to focus and navigation keys. # proc bind_listbox_keys {box height what_widget} { global click_to_focus if {$click_to_focus == 1} { bind $box <1> "focus \"$box\"" bind $box <2> "focus \"$box\"" bind $box <3> "focus \"$box\"" } else { bind $box "focus \"$box\"" } # No underlining if {$what_widget == "listbox"} { $box configure -activestyle "none" } # Need to evaluate all $box and $height at bind-time. Thus "-quotes. bind $box " if {\"%K\" == \"Up\"} { $box yview scroll \"-1\" units } if {\"%K\" == \"Down\"} { $box yview scroll 1 units } if {\"%K\" == \"Prior\"} { $box yview scroll -[expr \"$height\" - 1] units # $box yview scroll -1 pages } if {\"%K\" == \"Next\"} { $box yview scroll [expr \"$height\" - 1] units # $box yview scroll 1 pages } if {\"%K\" == \"Home\"} { $box yview 0 } if {\"%K\" == \"End\"} { $box yview end } # >>> Do i need this ? # >>> For now: yes. It prevents double scrolling by PgUp PgDown # Prevent other bindings from being performed break " } # Set common behavior of entries in respect to focus and Return key. # proc bind_entry_keys {entry return_cmd} { global click_to_focus if {$click_to_focus != 1} { bind $entry "focus \"$entry\"" } if {$return_cmd != ""} { bind $entry $return_cmd } } # Bind a help text to a widget. # proc bind_help {to_what help_name} { bind $to_what "window_help \"$help_name\" grey" } # Create a "/" button and wire it with variable, filesystem type,and help text. # proc create_browser_button {button_name var_name which_fs help_name} { global have_bwidget button $button_name -text "/" -command "browse_tree $var_name $which_fs" bind_help $button_name $help_name } proc set_overwriting_label {} { global overwrite_iso_files overwrite_iso_dirs overwrite_disk_files global extract_auto_chmod global .overwriting # Determine text suffix for menubutton from overwrite variables set oif "-" if {$overwrite_iso_files == 1} {set oif "f"} set oid "-" if {$overwrite_iso_dirs == 1} {set oid "d"} set ohf "-" if {$overwrite_disk_files == 1} {set ohf "h"} set fdw "-" if {$extract_auto_chmod == 1} {set fdw "w"} set otext "Overwriting: ${oif}${oid}${ohf}${fdw}" .overwriting configure -text $otext } # The central storage for help texts. # proc tell_helptext {what} { global own_version argv0 bwidget_version use_command_move if {$what == "Help"} { return \ "For getting particular help texts: Click the rightmost mouse button on any button, list box, or text field. For a help text about startup options of this frontend, execute in a shell: $argv0 --help For background info about xorriso and its commands, execute in a shell: man xorriso ----------------------------------------------------------------------------- The GUI window is separated into three main areas: - The area for connection to xorriso - shows xorriso messages, - offers some general activities, - displays the \"ready/busy\" state of the connection, - and allows to toggle xorriso commands into the \"Command:\" field. - The area for management of drives and ISO image data files - allows to scan for optical drives, - to acquire them and load their ISO directory tree, - to acquire ISO image files from hard disk as pseudo drives like DVD+RW, - to blank CD-RW, DVD-RW DVD+RW, BD-RE and format DVD-RW, BD-R, - to trigger writing of ISO sessions (which get defined in the third area), - and to burn image data files from hard disk to optical media. - The area for inspection, manipulation, and exploitation of the ISO model - allows to insert directories and files from hard disk into the ISO model, - to delete and rename file objects in the ISO model, - to verify data files of loaded ISO directory trees by MD5, - to extract directories and files from ISO filesystem to hard disk. ----------------------------------------------------------------------------- Some Use Cases ----------------------------------------------------------------------------- - Burn a directory as only content onto a CD, DVD or BD - Write a directory as only content to an ISO image data file on hard disk - Burn an image data file from hard disk onto CD, DVD or BD - Add more data to an appendable medium or to an ISO image data file - Extract a directory tree from an ISO filesystem to hard disk ----------------------------------------------------------------------------- Burn a directory as only content onto a CD, DVD or BD - Click the \"Scan for drives\" button in the middle area. - Select a drive and click the \"Pick output drive\" button. - If the information field in the \"Output drive/image\" line begins by \"appendable\" or \"closed\" and if the medium is CD-RW, DVD-RW, DVD+RW, or BD-RE then click the \"Blank\" button to erase the old data. (Blanking of \"DVD-RW sequential recording\" will last very long.) - Go to the \"Insert from disk:\" line in the lower area. Either toggle in the address of the hard disk directory, or click on the \"/\" button to the right of the text field to get a file browser. - Hit the Return key in the text field or double click on a name in the browser to schedule the disk directory for writing to the medium. You may of course insert several directories or files that way. - Close the browser and click the \"Write ISO session\" button in the middle area. Confirm in the \"yes/no\" window that pops up. Burning will begin (or refuse on unsuitable medium status). - When the \"busy\" field displays \"ready\" again, you may click \"Eject\". Desktop drives should then put out the tray with the medium. ----------------------------------------------------------------------------- Write a directory as only content to an ISO image data file on hard disk - Go to the text field beside the \"Output drive/image\" button and toggle the address of the image file. Click the button or hit the Return key when the address is complete. Or click on the \"/\" button to the right of the field to get a file browser. - You may click on a name in the browser and bring it into the text field by button \"Edit\". - When the intended file address is composed, hit the Return key in the text field or click the \"Output drive/image\" button. - If the information field in the \"Output drive/image\" line begins by \"appendable\" or \"closed\" then you addressed an existing data file. Warning: Applying the \"Blank\" button to it would damage its content ! You probably do not want this in this special use case. - Go to the \"Insert from disk:\" line in the lower area. Continue like in the above description for CD, DVD, and BD media. ----------------------------------------------------------------------------- Burn an image data file from hard disk onto CD, DVD or BD - Click the \"Scan for drives\" button in the middle area. - Select a drive and click the \"Pick output drive\" button. - If the information field in the \"Output drive/image\" line begins by \"appendable\" or \"closed\" and if the medium is CD-RW, DVD-RW, DVD+RW, or BD-RE then click the \"Blank\" button to erase the old data. (Blanking of \"DVD-RW sequential recording\" will last very long.) - Go to the text field beside the \"Burn image file:\" button and toggle the address of the image file. Or click on the \"/\" button to the right of the field to get a file browser. - Hit the Return key in the text field or double click on a name in the browser to initiate the burn run. Confirm in the \"yes/no\" window that pops up. - When the \"busy\" field displays \"ready\" again, you may click \"Eject\". Desktop drives should then put out the tray with the medium. ----------------------------------------------------------------------------- Add more data to an appendable medium or to an ISO image data file - Like above, \"Scan for drives\" but click button \"Pick drive for both roles\" in order to load the directory tree of the existing ISO filesystem. For an ISO image data file, bring its name into the input fields of both lines \"Input drive/image\" and \"Output drive/image\" and activate it by clicking both buttons or hitting the Return key in both fields. You should now see in both info fields texts which begin by \"appendable\". - Go to the \"Insert from disk:\" line in the lower area. Use the means described in the first use case to add more directories or data files. - If you are interested in \"Delete\" or \"Move to:\" buttons in the bottom line of the GUI: Click them by the rightmost mouse button to see their help texts. - When all intended changes are done: Click \"Write ISO session\" and confirm in the \"yes/no\" window. ----------------------------------------------------------------------------- Extract a directory tree from an ISO filesystem to hard disk - Like above, \"Scan for drives\" but click button \"Pick input drive\" in order to load the directory tree of the existing ISO filesystem. For an ISO image data file, bring its name into the input field of the line \"Input drive/image\". You should now see in its info field a text which begins by \"appendable\" or \"closed\". - Go to the \"ISO directory:\" line and list box in the lower area and select the directory or file you want to copy to hard disk. - To get to see the desired file items, either toggle the address of their parent directory into the text field and hit Return, or double click items to open them as directories, or click the \"/\" button to get a file browser. Select the item in the list box of the main window by a single click. - Go to the \"Extract to disk:\" line and choose the target address on disk. Either toggle in the address of the hard disk directory, or click on the \"/\" button to the right of the text field to get a file browser. - Hit the Return key in the text field or double click on a name in the browser to initiate the extraction run. If a \"yes/no\" window pops up, consider well whether you are up to shooting your own foot right now. Enable the \"Overwrite hard disk files\" switch only if you are really sure that the files from ISO are better than the ones on hard disk. ----------------------------------------------------------------------------- xorriso-tcltk is mainly a proof of concept for a frontend that operates xorriso in dialog mode. It demonstrates some of xorriso's multi-session features with ISO 9660 filesystems on optical media (CD, DVD, BD) or in disk files. Dependencies: xorriso, Tcl language, Tk GUI toolkit, optionally Tcl/Tk package BWidget Copyright (C) 2012 - 2016 Thomas Schmitt , libburnia-project.org Provided under BSD license: Use, modify, and distribute as you like." } if {$what == "End"} { return \ "The \"End\" button leads to the end of frontend and xorriso process." } if {$what == "version"} { return \ "The field between \"End\" button and ready/busy field displays the version of the serving xorriso program. xorriso is a program which copies file objects from POSIX compliant filesystems into Rock Ridge enhanced ISO 9660 filesystems and allows session-wise manipulation of such filesystems. It can load the management information of existing ISO images and it writes the session results to optical media or to filesystem objects. Vice versa xorriso is able to restore file objects from ISO 9660 filesystems. xorriso-tcltk-$own_version is mainly a proof of concept for a frontend that operates xorriso in dialog mode. 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." } if {$what == "Refresh disp"} { return \ "The \"Refresh disp\" button causes several text fields and list boxes to update their display after manually transmitted commands may have changed the state of drives or ISO model." } if {$what == "ready/busy"} { return \ "The ready/busy field indicates whether a xorriso command is being executed and the frontend is still waiting for its reply messages." } if {$what == "Command:"} { return \ "The \"Command:\" field can be used to send commands to xorriso. See the manual page of xorriso for its concepts and commands. Normally the other GUI elements will emit xorriso commands for you. This input field is presented only to make accessible those features of xorriso which are not covered by the GUI. Use the \"Refresh disp\" button to update the display after you have manually transmitted commands." } if {$what == "Script/Log"} { return \ "The \"Script/Log\" menu controls logging of xorriso commands and replies. The \"Log command script\" switch controls whether the essential xorriso commands of the GUI session shall be written to the end of a script file on hard disk. Not written will be the commands by which the GUI inspects the xorriso state, but only those which set up that state and those which get sent via the \"Command:\" field. Commands -osirrox and -extract will be logged only as comments. The \"Log non-essential commands\" switch controls whether all commands shall be logged if \"Log command script\" is enabled. Commands -msg_op \"parse\" and -msg_op \"parse_bulk\" will be logged only as comments. The item \"Set log script address\" pops up a file tree browser window which asks for the target of appending to script. Address \"-\" means standard error. Else it must not yet exist or be a writable data file. The \"Log pipes\" switch controls whether all xorriso commands and replies shall be logged to standard error or to the file that has been given with program argument --pipe_log_file. Caution: This log is verbose. The item \"Set pipe log address\" pops up a file tree browser window which asks for the target of pipe logging . Address \"-\" means standard error. Else it must not yet exist or be a writable data file. The item \"Execute command script\" executes the commands in a script file that should stem from \"Log command script\". At least it must begin by this line: # xorriso-tcltk command log script Be aware that xorriso will slavishly execute those commands. Better check in advance whether the content of the script file is what you expect. See man xorriso for the meaning of the commands. The \"Allow extract to disk\" switch controls whether commands like -extract are allowed in command scripts. If disabled, then command -osirrox is used to temporarily block those commands (unless the script unblocks itself, which would be nasty behavior). The item \"Permanently ban extraction\" disables -extract irrevocably for scripts and GUI alike." } if {$what == "message box"} { return \ "The message box displays commands sent to xorriso and messages received from xorriso. Many commands which are emitted by the GUI will hide themselves and their replies from this display. All event messages with severity WARNING or higher will show up, nevertheless." } if {$what == "Recent problem:"} { return \ "The \"Recent problem:\" field shows the most severe event message that occurred during the execution of the most recent command. It also displays the most recent problem message from the frontend program itself. Several commands emitted by the GUI will not clear this display. But any manually transmitted command and the major GUI gestures will do. " } if {$what == "Worst problem:"} { return \ "The \"Worst problem:\" field shows the most severe event message that occurred since last time the \"Clear\" button was hit. It will not clear automatically." } if {$what == "Clear"} { return \ "The \"Clear\" button removes the message from the \"Worst problem:\" field." } if {$what == "Scan for drives"} { return \ "The \"Scan for drives\" button executes command -devices and puts the list of found optical drives into the box beside the button. Scanning should be done before any ISO image manipulations because xorriso has to give up its acquired drives in order to perform the scan run. To become visible and to be usable, the drives have to offer rw-permission to the user of this program. If drives do not show up, then consider to become superuser and to execute xorriso -devices Then apply chmod a+rw to the listed device files. (Consider to use finer means of permission granting for a permanent solution.)" } if {$what == "Pick input drive"} { return \ "The \"Pick input drive\" button executes command -indev and obtains some information about the medium status. This info is displayed in the \"Input drive/image\" line. Further it causes the display of the ISO image model to be updated. The medium in the input drive must be blank or contain a valid ISO 9660 filesystem. Choosing an input drive causes a root directory to be created in the ISO model of xorriso. If there is a valid ISO filesystem in the input drive then its directory tree gets loaded underneath that model root directory. The input drive may also be a data file on hard disk if that file contains an ISO 9660 filesystem image. See the \"Input drive/image\" button." } if {$what == "Pick output drive"} { return \ "The \"Pick output drive\" button executes command -outdev and obtains some information about the medium status. This info is displayed in the \"Output drive/image\" line. The output drive may be empty or loaded with a medium, that may be blank, appendable or closed. It is usable for writing only if there is a medium inserted which is either blank or appendable. Button \"Blank\" can bring appendable or closed media into blank state. The output drive may also be a data file on hard disk. See field \"Output drive/image\"." It is considered appendable if it contains an ISO 9660 filesystem image. It is considered blank if it is empty or marked as blank by button \"Blank\". It is considered closed if it contains other data." } if {$what == "Pick drive for both roles"} { return \ "The \"Pick drive for both roles\" button executes command -dev and obtains some information about the medium status. This info is displayed in the \"Input drive/image\" line and in the \"Output drive/image\" line. Further it causes the display of the ISO image model to be updated. The medium in the drive must be blank or contain a valid ISO 9660 filesystem. Else the drive will only be acquired as output drive. This drive configuration is the most usual one with xorriso. It loads an eventual ISO image, allows to manipulate it by insertion, deletion, and renaming. When this is done, the changes get written to the drive via button \"Write ISO session\". The drive may also be a data file on hard disk. See the fields beside the \"Input drive/image\" and \"Output drive/image\" buttons. A file is considered appendable if it contains an ISO 9660 filesystem image. It is considered blank if it is empty or marked as blank by button \"Blank\". It is considered closed if it contains other data." } if {$what == "Give up drives"} { return \ "The \"Give up drives\" button executes commands -indev \"\" -outdev \"\" and clears both \"... drive/image\" lines, as well as the ISO model." } if {$what == "Calm drives"} { return \ "The \"Calm drives\" button executes command -calm_drives which tells the acquired optical drives to stop spinning until the next drive activity gets triggered." } if {$what == "Rollback"} { return \ "The \"Rollback\" button executes command -rollback which drops all pending changes of the ISO model and reloads it from the input drive, if one is acquired." } if {$what == "drivelist"} { return \ "The box beside the \"Scan for drives\" button shows the optical drives which were found by the most recent scan run. A double-click on a drive item has the same effect as button \"Pick drive for both roles\". " } if {$what == "Input drive/image"} { return \ "The field beside the \"Input drive/image\" button displays the address of the input drive. You may edit this field. Clicking the button or pressing the Return key causes the execution of command -indev with the field content as drive address. Use this to load the model from an ISO image data file on hard disk. It is of course permissible that input image and output image are the same file. " } if {$what == "input drive info"} { return \ "The text beside the \"Input drive/image\" field displays the medium status of the input drive. It tells about the writability, the medium type, the number of ISO sessions, and the amount of readable data." } if {$what == "Eject (indev)"} { return \ "The \"Eject\" button beside the \"Input drive/image\" button executes command -eject \"in\"." } if {$what == "Output drive/image"} { return \ "The field beside the \"Output drive/image\" button displays the address of the output drive. You may edit this field. Clicking the button or pressing the Return key causes the execution of command -outdev with the field content as drive address. Use this to direct writing to an ISO image data file on hard disk. It is of course permissible that input image and output image are the same file. " } if {$what == "output drive info"} { return \ "The text beside the \"Output drive/image\" field displays the medium status of the output drive. It tells about the writability, the medium type, the number of ISO sessions, and the amount of free space." } if {$what == "Eject (outdev)"} { return \ "The \"Eject\" button beside the \"Output drive/image\" button executes command -eject \"out\"." } if {$what == "Blank"} { return \ "The \"Blank\" button executes command -blank \"as_needed\" on the output drive in order to make a re-usable medium or an ISO image data file writable from scratch. Genuine blanking applies only to CD-RW and DVD-RW. But xorriso emulates ISO 9660 multi-session on DVD+RW, DVD-RAM, formatted DVD-RW, BD-RE, as well as in ISO image data files on hard disk. On those media and pseudo media, blanking will be performed by a small write operation which invalidates their existing ISO filesystem. One-time writable media CD-R, DVD-R, DVD+R, and BD-R cannot be blanked." } if {$what == "Format"} { return \ "The \"Format\" button executes -format \"as_needed\". This only applies to real optical drives and is of interest only with DVD-RW or BD-R media, which both can be used formatted and unformatted. Other media types which mandatorily need formatting will be formatted by the write commands. Formatted DVD-RW media have the advantage of being overwritable and thus being quickly blankable while maintaining the capability for multi-session. Formatted BD-R can perform Defect Management, which is of questionable value." } if {$what == "Write ISO session"} { return \ "The \"Write ISO session\" executes command -commit, which writes a session with all pending changes to the output drive. The output drive must be either blank or it must be the same as the input drive. Writing the session is the last step in the course of creating a new ISO filesystem or an add-on session that expands or changes the ISO filesystem on the medium of the output drive. So first choose a drive, then insert files from hard disk or do other manipulations, and then click \"Write ISO session\" to let xorriso write the data to medium or ISO image file. " } if {$what == "Close"} { return \ "The \"Close\" switch controls whether command -close \"on\" is emitted with \"Write ISO session\" or whether -as cdrecord option -multi is omitted with \"Burn image file:\". Closed optical media cannot be written any more unless they get blanked, which is not possible with CD-R, DVD-R, DVD+R, and BD-R. " } if {$what == "TAO"} { return \ "The \"TAO\" switch controls whether an incremental MMC write type shall be enforced with write commands. See xorriso command -write_type. Normally xorriso will decide by medium status and job parameters which MMC write type to choose. Some drives at the edge of failure might work with the one write type while already failing with the other." } if {$what == "Defect Mgt"} { return \ "The \"Defect Mgt\" switch controls whether slow and error-prone drive internal check-reading shall be enabled when writing to formatted BD-R or BD-RE. See xorriso command -stream_recording." } if {$what == "Burn image file:"} { return \ "The \"Burn image file:\" button executes command -as \"cdrecord\" to burn a data file from hard disk onto the output drive. The address of the disk file is taken from the neighboring text field. If you do not plan to append further data to the medium, then consider to enable the \"Close\" switch. No input drive may be acquired. (Delete all characters from the field \"Input drive/image\" and hit Return to give up the input drive.) The medium in the drive must be blank. (It is well possible to burn image files to appendable media. But the image needs to be prepared for the address offset. Who can do that can as well use one of the command line tools for burning the result. E.g. xorriso -as cdrecord -v dev=/dev/sr0 -multi stream_recording=32s image.iso )" } if {$what == "Extract to disk:"} { return \ "The \"Extract to disk:\" button executes command -extract with the whole tree of the current ISO directory or with the selected items of the box underneath \"ISO directory:\". This copies the selected files or directory trees from the input drive to the address on hard disk which is given by the text field right of the button." } if {$what == "Browse tree"} { return "[tell_file_browser_help 0]" } if {$what == "Close (browse tree)"} { return \ "The \"Close\" button in the file browser closes the browser window without performing other actions." } if {$what == "Up (browse tree)"} { return \ "The \"Up\" button in the file browser brings you to the parent directory of the currently selected file tree item. The parent directory will be opened and become the selected item. All opened directory trees underneath the parent will be closed." } if {$what == "Down (browse tree)"} { return \ "The \"Down\" button in the file browser opens the directory underneath the currently selected file tree item. It has the same effect as clicking the \"+\" node of the selected item." } if {$what == "Accept (browse tree)"} { return \ "The \"Accept\" button in the file browser brings the single selected item from the file browser tree into effect with the associated text field. I.e. it hits the Return key of the field. It works as if the item had been double clicked." } if {$what == "Edit (browse tree)"} { return \ "The \"Edit\" button in the file browser brings the single selected item from the file browser tree into the associated text field. It does not hit the Return key of the field, but gives you the opportunity to edit the file address." } if {$what == "Browse disk (extract)"} { return \ "The \"/\" button in the \"Extract to disk:\" line pops up a file tree browser to select a target address in the hard disk filesystem. [tell_file_browser_help 1]" } if {$what == "Browse disk (burn image)"} { return \ "The \"/\" button beside the \"Burn image file\" field pops up a file tree browser to select a source address in the hard disk filesystem. [tell_file_browser_help 1]" } if {$what == "Browse disk (insert)"} { return \ "The \"/\" button beside the \"Insert from disk\" field pops up a file tree browser to select a source address in the hard disk filesystem. [tell_file_browser_help 1]" } if {$what == "Browse disk (indev)"} { return \ "The \"/\" button in the \"Input drive/image\" line pops up a file tree browser to select a source address in the hard disk filesystem. [tell_file_browser_help 1]" } if {$what == "Browse disk (outdev)"} { return \ "The \"/\" button in the \"Output drive/image\" line pops up a file tree browser to select a source address in the hard disk filesystem. [tell_file_browser_help 1]" } if {$what == "Browse ISO (isodir)"} { return \ "The \"/\" button in the \"ISO directory\" line pops up a file tree browser to select the current directory in the ISO filesystem model. [tell_file_browser_help 1]" } if {$what == "Browse ISO (move target)"} { return \ "The \"/\" button in the \"Selection:\" line pops up a file tree browser to select the current directory in the ISO filesystem model. [tell_file_browser_help 1]" } if {$what == "Browse disk (dummy)"} { return \ "Normally this button would start a file browser to select a file or directory on hard disk. But the browser cannot be displayed because Tcl/Tk package \"BWidget\" is not loaded." } if {$what == "Browse ISO (dummy)"} { return \ "Normally this button would start a file browser to select a file or directory in the ISO model. But the browser cannot be displayed because Tcl/Tk package \"BWidget\" is not loaded." } if {$what == "Underneath (extract)"} { return \ "The \"Underneath\" switch controls the effective hard disk target address of an item if the address in the \"Extract to disk:\" field points to a directory. If \"Underneath\" is enabled, then the file object from the ISO filesystem will be copied to its name underneath the hard disk directory. If \"Underneath\" is disabled then an ISO directory tree item will be merged with the disk directory tree at the given address. Example: Selected are \"/iso_dir\" and \"/iso_file\". Address for hard disk is \"/tmp/from_iso\". Switch \"Selected\" is enabled. \"Underneath\" enabled causes commands: -extract /iso_dir /tmp/from_iso/iso_dir -extract /iso_file /tmp/from_iso/iso_file \"Underneath\" disabled: -extract /iso_dir /tmp/from_iso -extract /iso_file /tmp/from_iso The last command will fail because /tmp/from_iso already exists as directory." } if {$what == "Selected (extract)"} { return \ "The \"Selected\" switch controls whether the whole current ISO directory, or only the selected items shall be copied to hard disk. " } if {$what == "Overwriting:"} { return \ "The \"Overwriting\" menu bundles several switches which control whether existing files or directories may be overwritten. The frontend program will only detect the most obvious name collisions, but xorriso will reliably refuse to overwrite files if this is banned. ---------------------------------------------------------------------------- The \"Overwrite ISO files\" switch controls whether existing files may be overwritten in the ISO image. See xorriso command -overwrite \"nondir\". ---------------------------------------------------------------------------- The \"Overwrite ISO dirs\" switch controls whether it is allowed to replace an ISO directory by a another file. See xorriso command -overwrite \"on\". ---------------------------------------------------------------------------- The \"Overwrite hard disk files\" switch controls whether existing files may be overwritten by extraction to hard disk. See xorriso command -overwrite \"on\". This is DANGEROUS, of course, but comes in handy with restoring of backups. ---------------------------------------------------------------------------- The \"Enforce disk dir write access\" switch enables the -osirrox options \"auto_chmod_on\" and \"sort_lba_on\" which influence file extraction. \"auto_chmod_on\" allows xorriso to give itself temporariy w-permission to all disk directories which are owned by the xorriso user. This is DANGEROUS, of course, but comes in handy with restoring of backups. Option \"sort_lba_on\" reduces head-moves of optical drives and thus can speed up extraction substantially. It is bound to \"auto_chmod_on\" because else it might get into trouble when restoring ISO directories which offer no w-permission." } if {$what == "Permissions:"} { return \ "The \"Permissions\" menu allows to choose a global policy to adjust the access permissions of the files when an ISO session gets written. The default policy \"as is\" leaves the permissions as they are. Usually they have been imported from hard disk or from a loaded ISO image. xorriso commands -chmod , -chmod_r, and -find ... -exec chmod -- may be used to perform permission manipulations. Policy \"readable\" adds read permission to all kinds of files and search permission to all directories. Policy \"readonly\" sets the permissions of all kinds of files to read-only. Directories get added search permission. Policy \"mkisofs -r\" does what option -r of program mkisofs does: User id and group id become 0, all r-permissions get granted, all w denied. If there is any x-permission, then all three x get granted. s- and t-bits get removed. " } if {$what == "Refresh avail:"} { return \ "The \"Refresh avail:\" button triggers command -tell_media_space. It makes a time consuming exact prediction of the free space on the medium in the output drive. For this purpose, the size of an ISO session with the pending changes is computed. With image files rather than real optical drives, the free space of the hosting filesystem is displayed." } if {$what == "Insert from disk:"} { return \ "The \"Insert from disk:\" button executes command -map with the disk file address that is given by the text field right to the button. This inserts files or directory trees into the ISO image model and schedules them for being copied with the next \"Write ISO session\" run. The switches \"Underneath\" and \"Selected\" control what ISO address the inserted files shall have. You may use buttons \"Delete\" and \"Move to:\" for further adjustments. " } if {$what == "Underneath (insert)"} { return \ "The \"Underneath\" switch controls the effective ISO target address if the address in the \"Insert from disk:\" field points to a hard disk directory. If \"Underneath\" is enabled, a directory from disk will not be unpacked to its single files but be put underneath the target address by its own leaf name." If \"Underneath\" is disabled then the directory itself will not show up in the ISO image but only its files and sub directories will do." } if {$what == "Selected (insert)"} { return \ "If the switch \"Selected\" is enabled, then the given disk file or tree will be inserted at or underneath the only selected item in the box underneath \"ISO directory:\"." } if {$what == "ISO directory:"} { return \ "The current ISO directory shall be used to navigate in the ISO image model of xorriso. By default it is the target of file insertions and the source of file extractions. The text field in the \"ISO directory:\" line displays the current ISO directory and can be used to toggle its path directly. Hitting the Return key causes the current directory to change and the display in the box underneath to be refreshed. It is possible to choose the ISO directory by double-clicking an item in the box underneath the \"ISO directory:\" line. " } if {$what == "Up"} { return \ "The \"Up\" buttons move the current ISO directory one directory level up." } if {$what == "Verify"} { return \ "The \"Verify\" button executes -md5_check_r \"SORRY\" with the current ISO directory. This reads the content of all data files which are underneath the current ISO directory and which have MD5 checksums in the ISO image. ISO images bear MD5 checksums for each data file if they were produced by xorriso with -md5 \"on\" or -for_backup. This frontend enables this feature on startup." } if {$what == "isolist"} { return \ "The list box underneath the \"ISO directory:\" line displays the files in the current ISO directory. One or more item can be selected and play a role with extraction or insertion of files. Most of the buttons underneath the box operate on the selected items unconditionally." } if {$what == "Selection:"} { return \ "The ISO selection consists of the items which are selected in the list box above the \"Selection:\" line. If the respective \"Selected\" switches are enabled, then the ISO selection is source of file extraction and target of file insertion. In any case it is the old name of the \"Move to:\" button, the victim of the \"Delete\" button, and the subject of the \"Verify\" button." } if {$what == "Verify (selection)"} { return \ "The \"Verify\" button in the \"Selection:\" line executes command -md5_check_r \"SORRY\" with each of the selected items. This reads the content of all data files which are selected or underneath selected directories and which have MD5 checksums in the ISO image. ISO images bear MD5 checksums for each data file if they were produced by xorriso with -md5 \"on\" or -for_backup. This frontend enables this feature on startup." } if {$what == "Delete"} { return \ "The \"Delete\" button executes command -rm_r with each of the selected items. This removes the affected files and directory trees from the ISO model. They will not show up in the directory tree of the next session that is written via \"Write ISO session\". Nevertheless they will stay present in earlier sessions beginning from the session where they were inserted." } if {$what == "Move to:"} { if {$use_command_move == 0} { return \ "The \"Move to:\" button uses command -mv to move each of the selected items to the address that is given by the text field right to the button. If this address points to an existing ISO directory, then the items will be moved underneath that directory and keep their leaf names. Else there may be only one selected item which will be renamed to the given address." } else { return \ "The \"Move to:\" button uses command -move to rename each of the selected items to the address that is given by the text field right to the button." } } if {$what == "Make dir"} { return \ "The \"Make dir\" button executes command -mkdir with the address in the text field to its left (the same as used by \"Move to:\"). Useful to create a target directory before moving the selection." } if {$what == "rename and mkdir target"} { return \ "The text field between the \"Move to:\" button and the \"Make dir\" button serves both buttons by providing the target address for renaming or directory creation, respectively. If you hit the Return key in this field, it will trigger \"Mode to:\"." } if {$what == "yes to all"} { return \ "The \"yes to all\" button appears in the yes/no window if a GUI action is about to overwrite a file object and more such overwrite situations are to be expected. If the button is clicked, then all further yes/no questions of that GUI action will be answered automatically with yes. [about_help_for_yesno]" } if {$what == "no to all"} { return \ "The \"no to all\" button appears in the yes/no window if a GUI action is about to overwrite a file object and more such overwrite situations are to be expected. If the button is clicked, then all further yes/no questions of that GUI action will be answered automatically with no. [about_help_for_yesno]" } if {$what == "Continue"} { return \ "The \"Continue\" button appears in the notification windows which tell about a failed or rejected GUI action. --------------------------------------------------------------------------- It is impossible to trigger any further GUI action while the notification window is displayed. You either have to click the \"Continue\" button or hit the Return key. You cannot even close this help window before you did that." } if {$what == "yes/no"} { return \ "The \"yes\" and \"no\" buttons appear in the confirmation window which tells about a potentially dangerous GUI action and demands a user decision whether to really perform this action. [about_help_for_yesno]" } return "--- No help text found for topic '$what'" } # Tell the general help text of the file browser. # proc tell_file_browser_help {with_separator} { global have_bwidget set text "" if {$with_separator == 1} { set text \ "-------------------------------------------------------------------------\n\n" } if {$have_bwidget == 1} { set text \ "${text}The file tree browser presents to you a directory tree and lets you bring into effect one of the file addresses in that tree.\n" } else { set text \ "${text}Normally the file tree browser would present to you a directory tree and let you bring into effect one of the file addresses in that tree. But the tree view cannot be displayed because Tcl/Tk package \"BWidget\" is not loaded. -------------------------------------------------------------------------\n" } set text "${text} The bottom line of the browser window tells the associated text field in the GUI. E.g. \"ISO directory:\". Left of this label is a copy of that associated text field. You may edit its content and bring it into effect by hitting the Return key.\n" if {$have_bwidget == 1} { set text "${text} In the tree display click on the \"+\" or \"-\" nodes to open or close directories, respectively. Double click on an item to bring it into effect with the associated text field. I.e. double clicking also hits the Return key in that field.\n" } set text "${text} The \"Accept\" button does the same with the selected item.\n" if {$have_bwidget == 1} { set text "${text} The \"Edit\" button brings the selected item into the text field without hitting the Return key. So you may edit the name before hitting Return yourself. The \"Up\" button brings you to the parent directory of the selected item. The \"Down\" button works like clicking the \"+\" node of the selected item.\n" } set text "${text} The \"Help\" button displays this help text window. The \"Close\" button closes the browser window.\n" } # Tell about pecliarity of help window triggered by yes/no window proc about_help_for_yesno {} { return \ "--------------------------------------------------------------------------- It is impossible to trigger any further GUI action while the confirmation window is displayed. You have to click one of the buttons in that window. You cannot even close this help window before you clicked one of the buttons." } # ------- Misc helper procedures ------- # Equip a text with quotation marks so that xorriso will consider it as # a single word. # proc make_text_shellsafe {text} { set result "'" set rest $text while {[string length $rest]} { set idx [string first "'" $rest] if {$idx == -1} { set result "$result$rest" break } else { if {$idx > 0} { set result "$result[string range $rest 0 [expr $idx - 1]]" } set result "$result'\"'\"'" if {$idx == [expr [string length $rest] - 1]} { break } set rest [string range $rest [expr $idx + 1] end] } } set result "$result'" } # Count the number of newline characters in text. # proc count_newlines {text} { set rest $text set count 0 while {[string length $rest]} { set idx [string first "\n" $rest] if {$idx == -1} { break } else { set count [expr $count + 1] if {$idx == [expr [string length $rest] - 1]} { break } set rest [string range $rest [expr $idx + 1] end] } } return $count } # Append name to dir so that the result is a path to name under dir. # proc combine_dir_and_name {dir name} { set has_slash 0 if {$name == ""} { return $dir } if {[string range $name 0 0] == "/"} { incr has_slash } if {[string last "/" $dir] == [expr [string length $dir] - 1] && $dir != ""} { incr has_slash 1 } if {$has_slash == 2} { return "$dir[string range $name" 1 end]" } if {$has_slash == 1} { return "$dir$name" } return "$dir/$name" } # Force the content of variable isodir_adr to be an absolute address # proc normalize_isodir_adr {} { global isodir_adr if {$isodir_adr == ""} { set isodir_adr "/" } if {[string range $isodir_adr 0 0] != "/"} { set isodir_adr "/$isodir_adr" } } # Inspect path whether one of its components is in isodir_adr # proc path_touches_isodir {path} { global isodir_adr normalize_isodir_adr set cmp_start 0 if {$isodir_adr == "/"} { set cmp_start 1 } if {[string range $path 0 0] != "/"} { if {[string first "/" $path] == -1} { return $path } else { return [file dirname $path] } } set l [expr {[string length $isodir_adr] - $cmp_start}] if {[string length $path] < [expr {$l + 2}]} { return "" } if {$l > 0} { if {[string range $path $cmp_start [expr {$l - 1}]] != \ [string range $isodir_adr $cmp_start end]} { return "" } } if {[string range $path $l $l] != "/"} { return "" } set subpath [string range $path [expr {$l + 1}] end] set slash [string first "/" $subpath] if {$slash == -1} { return $subpath } if {$slash == 0} { return "" } return [string range $subpath 0 [expr {$slash - 1}]] } # Compare two severity names by help of the severity list that was obtained # from xorriso via proc inquire_severity_list. # proc compare_sev {sev1 sev2} { global xorriso_severity_list set idx1 [lsearch -exact $xorriso_severity_list $sev1] set idx2 [lsearch -exact $xorriso_severity_list $sev2] if {$idx1 < $idx2} {return -1} if {$idx1 > $idx2} {return 1} return 0 } # Write a text to the pipe log # proc debug_log_puts {text} { global debug_logging debug_log_conn if {$debug_logging == 1} { puts $debug_log_conn $text flush $debug_log_conn } } # End program and return the given exit value. # proc central_exit {value} { exit $value } # Start a xorriso process which will in return launch another frontend # process. This is necessary until i learned how to create a pair of pipes # and to fork in Tcl. # proc start_xorriso {} { global argv0 argv set self "" if {[string first "/" $argv0] != -1} { set self $argv0 } if {$self == ""} { set self "/usr/bin/xorriso-tcltk" if {[file executable $self] == 0} {set self ""} } if {$self == ""} { set self "/usr/local/bin/xorriso-tcltk" if {[file executable $self] == 0} {set self ""} } if {$self == ""} { catch { set conn [open "|which xorriso-tcltk" r] set self [gets $conn] close $conn } } if {$self == ""} { catch { set conn [open "|sh -c \"type -p xorriso-tcltk\"" r] set self [gets $conn] close $conn } } if {$self == ""} { puts stderr "$argv0 :\n Cannot locate address of script xorriso-tcltk in filesystem.\n" puts stderr "You will have to use --stdio or --named_pipes." puts stderr "See $argv0 --help\n" central_exit 1 } # eval is used to split $argv into single words eval exec xorriso -launch_frontend "\"$self\"" --silent_start --stdio $argv -- 2>@stderr central_exit 0 } # Print a startup message to stderr if not the first argument is --silent_start # proc yell_xorriso_tcltk {} { global argv own_version if {[llength $argv] > 0} { if {[lindex $argv 0] == "--silent_start"} {return ""} } puts stderr "xorriso-tcltk $own_version : Proof of concept for GUI frontends of xorriso\n" } # Log a command (if enabled) # proc log_command {cmd essential} { global cmd_log_conn cmd_logging_mode cmd_logging_all recent_cd_path if {$cmd_logging_mode < 1} {return ""} if {$essential <= 0} { if {$cmd_logging_all <= 0} {return ""} } else { # Leave logging to non-essential call which will come soon after if {$cmd_logging_all > 0} {return ""} } if {[string first "-cd " $cmd] == 0} { set path [string range $cmd 4 end] if {$path == $recent_cd_path && $cmd_logging_all <= 0} {return ""} set recent_cd_path $path } if {$cmd_log_conn == ""} { effectuate_command_logging 0 if {$cmd_logging_mode < 1} {return ""} } set prefix "" if {$cmd_logging_mode == 1} { if {[string first "-osirrox" $cmd] != -1 || \ [string first "-extract" $cmd] != -1} { set prefix "# " } } if {[string first "-msg_op parse" $cmd] != -1} { set prefix "# " } puts $cmd_log_conn $prefix$cmd flush $cmd_log_conn } # Start command logging # Called by setup_by_args and by the "Script/Log" menu. # (target == "." and mode == -1 preserve the current state.) # proc start_command_logging {target mode} { global cmd_log_conn cmd_logging_mode msglist_running cmd_log_target set is_stderr 0 if {$cmd_log_target == "" || $cmd_log_target == "-" || \ $cmd_log_conn == "stderr"} {set is_stderr 1} set errmsg "" if {$target != "." && $cmd_log_conn != "" && $target != $cmd_log_target && \ $is_stderr == 0} { catch "close $cmd_log_conn" set cmd_log_conn "" } set ret 0 if {$cmd_log_conn == "" || $is_stderr == 1} { if {$target == "-" || $target == "" || $target == "."} { set cmd_log_conn stderr } else { set ret [catch {set cmd_log_conn [open $target a]} errmsg] } if {$target != "."} { set cmd_log_target $target } } if {$ret == 0 && $mode >= 0} { set cmd_logging_mode $mode } if {$ret == 1} { set msg "xorriso-tcltk : SORRY : Failed to open command log script [make_text_shellsafe $target] :\n$errmsg" if {$msglist_running == 1} { xorriso_tcltk_errmsg $msg } else { puts stderr $msg } set cmd_logging_mode 0 return 0 } if {$mode > 0} { puts $cmd_log_conn "# xorriso-tcltk command log script" puts $cmd_log_conn [xorriso_loggable_init_cmds] flush $cmd_log_conn } return 1 } # Start communications pipe logging # Called by setup_by_args and by the "Script/Log" menu. # (target == "." and mode == -1 preserve the current state.) # proc start_debug_logging {target mode} { global debug_log_conn debug_log_file debug_logging msglist_running set is_stderr 0 if {$debug_log_file == "" || $debug_log_file == "-" || \ $debug_log_conn == "stderr"} {set is_stderr 1} set errmsg "" if {$target != "." && $debug_log_conn != "" && \ $target != $debug_log_file && $is_stderr == 0} { catch "close $debug_log_conn" set debug_log_conn "" } set ret 0 if {$debug_log_conn == "" || $is_stderr == 1} { if {$target == "-" || $target == "" || $target == "."} { set debug_log_conn stderr } else { set ret [catch {set debug_log_conn [open $target a]} errmsg] } if {$target != "."} { set debug_log_file $target } } if {$ret == 0 && $mode >= 0} { set debug_logging $mode } if {$ret == 1} { set msg "xorriso-tcltk : SORRY : Failed to open pipe log [make_text_shellsafe $target] :\n$errmsg" if {$msglist_running == 1} { xorriso_tcltk_errmsg $msg } else { puts stderr $msg } return 0 } return 1 } proc execute_script {close_window} { global execute_script_conn execute_script_adr browse_disk_window_is_active global osirrox_allowed script_with_osirrox cmd_logging_mode cmd_log_target global highest_cmd_sev if {$close_window == 1 && $browse_disk_window_is_active == 1} { destroy_browse_disk .browse_disk_window } set n1 [file normalize $execute_script_adr] set n2 [file normalize $cmd_log_target] if {$n1 == $n2 && $cmd_logging_mode > 0} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You first have to disable command script logging before using the log script" return "" } set errmsg "" set ret [catch {set execute_script_conn [open $execute_script_adr r]} errmsg] if {$ret != 0} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : Failed to open command script [make_text_shellsafe $execute_script_adr] :\n$errmsg" return "" } set line "" set ret [gets $execute_script_conn line] if {$ret < 0 || $line != "# xorriso-tcltk command log script"} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : Given file does not look like a xorriso command log script" close $execute_script_conn return "" } # >>> ??? Show script if {[window_yesno "Really perform the xorriso commands in file\n\n[make_text_shellsafe $execute_script_adr]\n\n?"] != 1} { close $execute_script_conn return "" } if {$script_with_osirrox != 1} { send_silent_cmd "-osirrox blocked" } while {1} { set ret [gets $execute_script_conn line] if {$ret < 0} { break } if {$line == "" || [string first "#" $line] == 0} { continue } reset_highest_cmd_sev send_loggable_cmd $line if {[compare_sev $highest_cmd_sev "FAILURE"] >= 0} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : Encountered problem event of severity '$highest_cmd_sev'.\nScript execution aborted." break } } close $execute_script_conn if {$script_with_osirrox != 1} { send_silent_cmd "-osirrox unblock" } } # Convert newline into \n # proc escape_newline {text backslash_too} { if {$backslash_too == 0} { return [string map [list "\n" "\\n"] $text] } return [string map [list "\n" "\\n" "\\" "\\\\"] $text] } # -------- start living proc setup_by_args {argv0 argv} { global cmd_pipe_adr reply_pipe_adr main_window_geometry click_to_focus global have_bwidget cmd_conn reply_conn geometry stdout stdin global osirrox_allowed cmd_logging_all use_command_move # wish normally eats the -geometry option and puts the result into $geometry catch {set main_window_geometry $geometry} set connection_defined 0 set pipe_logging 0 set script_logging 0 set loop_limit [llength $argv] for {set i 0} {$i < $loop_limit} {incr i} { set ok "0" set opt [lrange $argv $i $i] if {$opt == "--help"} { set ok "1" print_usage $argv0 central_exit 0 } if {$opt == "--silent_start"} { set ok "1" } if {$opt == "--stdio"} { set ok "1" set connection_defined 1 } if {$opt == "--named_pipes"} { set ok "1" incr i set cmd_pipe_adr [lrange $argv $i $i] incr i set reply_pipe_adr [lrange $argv $i $i] if {$cmd_pipe_adr != "" && $reply_pipe_adr != "" && $cmd_pipe_adr != "-" && $reply_pipe_adr != "-"} { init_frontend_named_pipes $cmd_pipe_adr $reply_pipe_adr } set connection_defined 1 } if {$opt == "--geometry" || $opt == "-geometry"} { set ok "1" # Just in case -geometry does not get eaten by wish incr i set main_window_geometry [lrange $argv $i $i] set give_geometry [lrange $argv $i $i] } if {$opt == "--click_to_focus"} { set ok "1" set click_to_focus "1" } if {$opt == "--auto_focus"} { set ok "1" set click_to_focus "0" } if {$opt == "--pipe_log_file"} { set ok "1" incr i set pipe_log_name [lrange $argv $i $i] # postpone actual log start until start_xorriso has been passed set pipe_logging 1 } if {$opt == "--script_log_file"} { set ok "1" incr i set script_log_name [lrange $argv $i $i] # postpone actual log start until start_xorriso has been passed set script_logging 1 } if {$opt == "--script_log_all_commands"} { set ok "1" set cmd_logging_all 1 } if {$opt == "--no_extract"} { set ok "1" set osirrox_allowed 0 } if {$opt == "--no_bwidget"} { set ok "1" set have_bwidget "-1" } if {$opt == "--use_command_move"} { set ok "1" set use_command_move 1 } if {$opt == "--use_command_mv"} { set ok "1" set use_command_move 0 } if {$ok == 0} { puts stderr "$argv0 : Unknown option '$opt'" print_usage $argv0 central_exit 1 } } if {$connection_defined == 0} { start_xorriso } if {$cmd_pipe_adr == "" || $reply_pipe_adr == "" || $cmd_pipe_adr == "-" || $reply_pipe_adr == "-"} { set cmd_conn stdout set reply_conn stdin } if {$pipe_logging == 1} { set ret [start_debug_logging $pipe_log_name 1] if {$ret <= 0} { puts stderr \ "$argv0 : Cannot open --pipe_log_file '$pipe_log_name' for writing" central_exit 2 } } if {$script_logging == 1} { set ret [start_command_logging $script_log_name 1] if {$ret <= 0} { puts stderr \ "$argv0 : Cannot open --script_log_file '$script_log_name' for writing" central_exit 2 } } if {$main_window_geometry != ""} { wm geometry . $main_window_geometry } } yell_xorriso_tcltk setup_by_args $argv0 $argv check_xorriso_version setup_xorriso init_gui display_busy 0 refresh_state libisoburn-1.5.4/frontend/grub-mkrescue-sed.sh0000755000175700017510000002550513701321754016336 00000000000000#!/bin/sh # Copyright (C) 2015 - 2019 # Thomas Schmitt , 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" 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 # # 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" fi if test "$efi_zero_inner_pt" = yes -o "$efi_zero_inner_pt" = extra 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_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-efi-img.$$ if test -e "$dir"/efi.img then mv "$dir"/efi.img /tmp/$efi_tmp_name 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 test x"$debug" = xyes -o x"$debug" = xextra then echo "+ converted xorriso arguments:" >&2 echo " $x" >&2 echo >&2 fi # Run xorriso binary with the converted arguments use_gdb=no if test "$use_gdb" = yes then gdb_file=/tmp/grub-mkrescue-sed-gdb echo b assess_appended_gpt >$gdb_file echo run $MKRESCUE_SED_XORRISO_ARGS $x >>$gdb_file gdb -x $gdb_file "$xorriso" ret=0 else "$xorriso" $MKRESCUE_SED_XORRISO_ARGS $x ret=$? fi # Move back the ESP if it was separated if test -n "$efi_tmp_name" -a -e /tmp/$efi_tmp_name then mv /tmp/$efi_tmp_name "$dir"/efi.img fi exit $ret libisoburn-1.5.4/frontend/frontend_pipes_xorriso.c0000644000175700017510000007026713701321754017430 00000000000000 /* 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, 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 #include #include #include #include #include #include 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); } libisoburn-1.5.4/frontend/xorriso_broker.sh0000755000175700017510000001234313701321754016057 00000000000000#!/bin/sh # Copyright (C) 2015 # Thomas Schmitt , 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 libisoburn-1.5.4/depcomp0000755000175700017510000005601614005267031012205 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libisoburn-1.5.4/bootstrap0000755000175700017510000000023313701321754012566 00000000000000#!/bin/sh -x aclocal -I . libtoolize --copy --force autoconf # Not with libisoburn # autoheader automake --foreign --add-missing --copy --include-deps libisoburn-1.5.4/ltmain.sh0000644000175700017510000105235614005267030012453 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.11 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1.11" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=.`expr $current - $age` versuffix="$major" ;; defunct_by_ts_B51007_freebsd-elf) major=".$current" versuffix=".$current"; ;; netbsd) # ts B51007 : to get library.so.N.nn major=.`expr $current - $age` versuffix="$major.$age" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 libisoburn-1.5.4/releng/0000755000175700017510000000000014005267033012156 500000000000000libisoburn-1.5.4/releng/template_new0000755000175700017510000000744013701321754014520 00000000000000#!/bin/bash # Copyright 2011 George Danchev # Copyright 2011 Thomas Schmitt # === 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 libisoburn-1.5.4/releng/README0000644000175700017510000003073113701321754012765 00000000000000------------------------------------------------------------------------------ http:libburnia-project.org ------------------------------------------------------------------------------ libisoburn/releng. By George Danchev and Thomas Schmitt 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 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. libisoburn-1.5.4/releng/inc/0000755000175700017510000000000014005267033012727 500000000000000libisoburn-1.5.4/releng/inc/releng_getopts.inc0000644000175700017510000001240013701321754016363 00000000000000# Copyright 2011 George Danchev # Copyright 2011 Thomas Schmitt # 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 libisoburn-1.5.4/releng/codesamples/0000755000175700017510000000000014005267033014455 500000000000000libisoburn-1.5.4/releng/codesamples/api_3lib.cpp0000644000175700017510000000137713701321754016576 00000000000000// Just to ensure we are C++-clean. This should not spit too much noise /* Copyright 2011 George Danchev * Released into the public domain */ #if __WORDSIZE == 32 #define _LARGEFILE_SOURCE 1 #define _FILE_OFFSET_BITS 64 #endif #include #include //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; } libisoburn-1.5.4/releng/codesamples/api_xorriso.cpp0000644000175700017510000000120313701321754017436 00000000000000// Just to ensure we are C++-clean. This should not spit too much noise /* Copyright 2011 George Danchev * Released into the public domain */ #if __WORDSIZE == 32 #define _LARGEFILE_SOURCE 1 #define _FILE_OFFSET_BITS 64 #endif #include #include //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; } libisoburn-1.5.4/releng/run_all_auto0000755000175700017510000001567713701321754014533 00000000000000#!/bin/bash # Copyright 2011 George Danchev # Copyright 2011 - 2014 Thomas Schmitt # 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="$?" case ${RET_GREP} in 0) # found ;; 1) # not found echo "${SELF}: Log file looks clear." # | tee -a ${CLOG} ;; *) # echo "${SELF}: grep returned EXIT CODE: ${RET_GREP}." # | tee -a ${CLOG} ;; esac 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 exit $exit_value libisoburn-1.5.4/releng/jigdo-gen-md5-list0000755000175700017510000001233713701321754015334 00000000000000#!/bin/sh # Copyright (c) 2010, 2011 George Danchev # Copyright (c) 2010, 2011, 2019 Thomas Schmitt # 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 libisoburn-1.5.4/releng/manual_isojigdo0000755000175700017510000002063213701321754015176 00000000000000#!/bin/bash # Copyright 2011, 2019 Thomas Schmitt # Copyright 2011 George Danchev # 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 libisoburn-1.5.4/releng/auto_printsize0000755000175700017510000000656413701321754015121 00000000000000#!/bin/bash # Copyright 2011 George Danchev # 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 libisoburn-1.5.4/releng/manual_devices0000755000175700017510000001124513701321754015011 00000000000000#!/bin/bash # Copyright 2011 George Danchev # Copyright 2011 Thomas Schmitt # 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 libisoburn-1.5.4/releng/change_shell_to_use0000755000175700017510000000172113701321754016022 00000000000000 # 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 libisoburn-1.5.4/releng/manual_burn0000755000175700017510000001343413701321754014337 00000000000000#!/bin/bash # Copyright 2011 George Danchev # Copyright 2011 Thomas Schmitt # # 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 libisoburn-1.5.4/releng/auto_isocontent0000755000175700017510000003043213701321754015246 00000000000000#!/bin/bash # Copyright 2011 Thomas Schmitt # Copyright 2011 George Danchev # 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 libisoburn-1.5.4/releng/jigdo-gen-md5-list.10000644000175700017510000000155713701321754015472 00000000000000.\" 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 and Thomas Schmitt libisoburn-1.5.4/releng/auto_cxx0000755000175700017510000000372213701321754013665 00000000000000#!/bin/bash # Copyright 2011 George Danchev # 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=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 libisoburn-1.5.4/releng/releng_generated_data/0000755000175700017510000000000014005267033016441 500000000000000libisoburn-1.5.4/releng/releng_generated_data/placeholder0000644000175700017510000000000013701321754020557 00000000000000libisoburn-1.5.4/aclocal.m40000644000175700017510000127532014005267030012471 00000000000000# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) # ts B51007 : changed version_type for lt_main.sh from "sunos" to "netbsd" version_type=netbsd need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) # ts B60722 : changed version_type for lt_main.sh from "sunos" to "netbsd" # http://www.openbsd.org/faq/ports/specialtopics.html # "Understanding shared libraries number rules" version_type=netbsd sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # PKG_INSTALLDIR(DIRECTORY) # ------------------------- # Substitutes the variable pkgconfigdir as the location where a module # should install pkg-config .pc files. By default the directory is # $libdir/pkgconfig, but the default can be changed by passing # DIRECTORY. The user can override through the --with-pkgconfigdir # parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_INSTALLDIR # PKG_NOARCH_INSTALLDIR(DIRECTORY) # ------------------------- # Substitutes the variable noarch_pkgconfigdir as the location where a # module should install arch-independent pkg-config .pc files. By # default the directory is $datadir/pkgconfig, but the default can be # changed by passing DIRECTORY. The user can override through the # --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_NOARCH_INSTALLDIR # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # ------------------------------------------- # Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])# PKG_CHECK_VAR # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([acinclude.m4]) libisoburn-1.5.4/CONTRIBUTORS0000644000175700017510000000000013701321754012473 00000000000000libisoburn-1.5.4/xorriso-dd-target/0000755000175700017510000000000014005267033014260 500000000000000libisoburn-1.5.4/xorriso-dd-target/xorriso-dd-target.texi0000644000175700017510000006076514005266233020470 00000000000000\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename xorriso-dd-target.info @settitle GNU xorriso-dd-target 1.5.4 @c %**end of header @c @c man-ignore-lines begin @dircategory Archiving @direntry * Xorriso-dd-target: (xorriso-dd-target). Device evaluator and disk image copier for GNU/Linux @end direntry @c man-ignore-lines end @c @c Notes about embedded man page: @c This texinfo code contains the necessary info to produce a man page. @c One can produce it by applying the following rules: @c The first line gets discarded. @c Line start "@c man " will become "", the remainder is put out unaltered. @c Lines "@*" will be converted to ".br" @c "@c man-ignore-lines N" will discard N following lines. @c "@c man-ignore-lines begin" discards all following lines @c up to "@c man-ignore-lines end". @c Line blocks of "@menu" "@end menu" will be discarded. @c "@item word words" becomes "\fBword\fR words". @c @b{...}, @command{...}, @dfn{...}, @emph{...}, @strong{...} @c get mapped to \fB...\fR . @c @abbr{...}, @code{...}, @file{...}, @i{...}, @option{...}, @r{...}, @c @ref{...}, @samp{...},@var{...}, get mapped to ... . @c @ref{...}, @xref{...} get mapped to empty text. @c @email{...} gets mapped to <...> . @c Mapped {...} content is subject to the rules except {...} mapping. @c @minus{} will become "-". @c @@ , @{, @} will get stripped of their first @. @c Other lines which begin by "@" will be discarded. @c In lines not stemming from "@c man", "\" becomes "\\" @c "-" which are not preceded by an uneven number of "\" will get @c prepended one "\". @c @c @c man .\" Hey, EMACS: -*- nroff -*- @c man .\" @c man .\" IMPORTANT NOTE: @c man .\" @c man .\" The original of this file is kept in xorriso/xorriso-dd-target.texi @c man .\" This here was generated by program xorriso/make_xorriso_1 @c man .\" @c man .\" @c man .\" First parameter, NAME, should be all caps @c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection @c man .\" other parameters are allowed: see man(7), man(1) @c man .TH XORRISO-DD-TARGET 1 "Version 1.5.4, Jan 30, 2021" @c man .\" Please adjust this date whenever revising the manpage. @c man .\" @c man .\" Some roff macros, for reference: @c man .\" .nh disable hyphenation @c man .\" .hy enable hyphenation @c man .\" .ad l left justify @c man .\" .ad b justify to both left and right margins @c man .\" .nf disable filling @c man .\" .fi enable filling @c man .\" .br insert line break @c man .\" .sp insert n+1 empty lines @c man .\" for manpage-specific macros, see man(7) @c man .nh @c man-ignore-lines begin @copying xorriso-dd-target - Device evaluator and disk image copier for GNU/Linux Copyright @copyright{} 2021 Thomas Schmitt @quotation Permission is granted to distribute this text freely. @end quotation @end copying @c man-ignore-lines end @titlepage @title Manual of GNU xorriso companion xorriso-dd-target 1.5.4 @author Thomas Schmitt @page @vskip 0pt plus 1filll @insertcopying @end titlepage @contents @ifnottex @node Top @top xorriso-dd-target 1.5.4 @c man-ignore-lines 1 @c man .SH NAME xorriso-dd-target - Device evaluator and disk image copier for GNU/Linux @end ifnottex @menu * Overview:: Overview * Options:: Options * Examples:: Examples * Files:: Files * Seealso:: See also * Bugreport:: Reporting bugs * Legal:: Author, Copyright, Credits * CommandIdx:: Alphabetic Option List * ConceptIdx:: Alphabetic List of Concepts and Objects @end menu @node Overview, Options, Top, Top @chapter Overview @c man .SH SYNOPSIS @c man .B xorriso-dd-target @c man [ options ] [ device_names ] @c man .br @c man .SH DESCRIPTION @c man .PP @command{xorriso-dd-target} evaluates block devices of the Linux kernel whether they are suitable targets for a disk image file and optionally copies the image file to one of them. @* It is specialized on the device names of the @strong{Linux kernel} and uses the capabilities of util-linux program @strong{lsblk}. Therefore it refuses to run on non-Linux kernels. @* @sp 1 @c man .PP The main purpose of xorriso-dd-target is to inspect the device files of disk-like storage media and to judge whether they look like removable devices with disposable content. @* If a single plausible candidate is detected, then the program is willing to copy a disk image file onto it. This will overwrite or make inaccessible the previous partition table and all previous data content of the target device. @* @strong{Superuser power} is often needed for filesystem type identification, for possible unmounting, and for possible image writing. Option @strong{-with_sudo} offers a way to gain this power only for those tasks and to run the program elsewise with a normal user's power. @* If a particular disk image file is intended as copy source, then its path should be given by option -image_file, so that its size can be used as decision criterion. @sp 1 @c man .PP Following are use case descriptions with examples: @c man .br @c man - List plain device names @c man .br @c man - List all devices with reasoning @c man .br @c man - Evaluate particular given devices @c man .br @c man - Detect intended device by plugging @c man .br @c man - Write image to an advised device @c man .br @c man - Show commands for writing to a not advised device @c man .br @menu * Simplenames:: List plain device names * Listall:: List all devices with reasoning * Givendevices:: Evaluate particular given devices * Plugtest:: Detect intended device by plugging * Dowrite:: Write image to an advised device * Unwise:: Show commands for writing to a not advised device * Reasons:: Alphabetical list of positive and negative reasons @end menu @c man .SS @node Simplenames, Listall, Overview, Overview @chapter List plain device names @c man \fBList plain device names:\fR @c man .br @cindex Use case, list advisable device names The most simple and most boring use case is a program run without device names and without options -list_all, -plug_test, -DO_WRITE, -dummy_force. It prints on standard output (stdout) only the names of advisable devices without "/dev/" prefix. One name per line and without any reasoning text. @* The possible sudo password prompt, the message line about sudo, and the empty line after it do not go to stdout. @* Example: @* $ xorriso-dd-target -with_sudo @* Testing sudo to possibly get password prompting done now: @* [sudo] password for thomas: @* sudo /bin/lsblk seems ok. sde @c man .SS @node Listall, Givendevices, Simplenames, Overview @chapter List all devices with reasoning @c man \fBList all devices with reasoning:\fR @c man .br @cindex Use case, list all devices with reasoning For the more curious user, there is option @strong{-list_all} which prints the evaluation of each disk-like device that is listed by program lsblk. Optical drives, floppy disks, RAM block devices, loop devices are excluded, though. @* Each device is shown by one line of the form @* name : advice : reasoning : info @* @strong{name} is the device name without "/dev/" prefix. @* @strong{advice} is either "YES" or "NO". "YES" indicates that the device appears to be pluggable disk-like, not used as system disk or sincere data storage, and - if tested - of sufficient or plausible size. @* @strong{reasoning} is a blank separated list of words with either suffix '+' for an inviting device property or '-' for a prohibitive property. Normally a single '-' reason disqualifies the device from being advisable. Only if option -look_for_iso is given, a reason "has_XYZ-" can be overridden by the presence of an ISO 9660 filesystem on the device. @* @strong{info} is composed from VENDOR and MODEL as told by lsblk. @* Option @strong{-list_long} causes with each line an additional listing of the information provided by lsblk which led to the shown reasons. @* Example: @* $ xorriso-dd-target -with_sudo -list_all @* ... @* sda : NO : not_usb- has_vfat+ has_ext4- : ATA Samsung SSD 850 @* sdb : NO : not_usb- has_swap- has_ext4- : ATA WDC WD20EFRX-68A @* sdc : YES : usb+ has_iso9660+ has_vfat+ : Intenso Ultra Line @* sdd : NO : usb+ has_iso9660+ has_vfat+ has_ext2- : SanDisk Cruzer @c man .SS @node Givendevices, Plugtest, Listall, Overview @chapter Evaluate particular given devices @c man \fBEvaluate particular given devices:\fR @c man .br @cindex Use case, evaluate particular given devices If @strong{device names} are given instead of option -list_all, then only these devices are inspected. Their result gets listed without the ": info" part, unless option @strong{-with_vendor_model} is given. @* Device names must not begin by '-' and must be single words composed of the characters [A-za-z0-9_/-]. They should not contain '/'. E.g. 'sdc' is valid, '/dev/sdc' is not valid. @* If one of the given device names gets not advised, the exit value is 1. @* It makes few sense to give device names which are not listed by -list_all. @* Examples: @* $ xorriso-dd-target -with_sudo sdc @* ... @* sdc : YES : usb+ has_iso9660+ has_vfat+ @* $ xorriso-dd-target -with_sudo -with_vendor_model sdc @* ... @* sdc : YES : usb+ has_iso9660+ has_vfat+ : Intenso Ultra Line @* $ xorriso-dd-target sdc @* sdc : NO : usb+ no_fs_while_not_su- @c man .SS @node Plugtest, Dowrite, Givendevices, Overview @chapter Detect intended device by plugging @c man \fBDetect intended device by plugging:\fR @c man .br @cindex Use case, detect intended device by plugging Option @strong{-plug_test} triggers an interactive method to unambiguously determine the intended target device candidate. It consists of 2 or 3 steps. @* @strong{Step 1} is to have the intended storage device @strong{unplugged} and to confirm this by pressing the Enter key at the program's prompt. The program will then assess the list of not wanted devices. @* @strong{Step 2} is to @strong{plug in} the intended storage device and to confirm this by pressing the Enter key a second time. The program will wait up to 10 seconds for a disk-like storage device which is not in the list of not wanted devices. The user may wait with key pressing until the device blinking looks like it is ready. @* Only if a single new device is found, the program will go on as if a single device name was given. Option -list_all and any device names given as arguments will be ignored. @* @strong{Step 3} happens only if options -DO_WRITE or -dummy_force are given. The program asks for a final input of the word 'yes' before real or simulated writing begins. @* Example: @* $ xorriso-dd-target -with_sudo -plug_test @* ... @* Caused by option -plug_test: Attempt to find the desired device by watching it appear after being plugged in. @* Step 1: @* Please make sure that the desired target device is plugged _out_ now. @* If it is currently plugged in, make sure to unmount all its fileystems @* and then unplug it. @* Press the Enter key when ready. @* @* Found and noted as _not_ desired: sda sdb sdc @* Step 2: @* Please plug in the desired target device and then press the Enter key. @* @* Waiting up to 10 seconds for a new device to be listed ... found: sdd @* Now waiting 5 seconds to let it settle ......... @* Found and noted as desired device: sdd @* @* sdd : NO : usb+ has_iso9660+ has_vfat+ has_ext2- : SanDisk Cruzer @c man .SS @node Dowrite, Unwise, Plugtest, Overview @chapter Write image to an advised device @c man \fBWrite image to an advised device:\fR @c man .br @cindex Use case, write image to an advised device Only if option @strong{-DO_WRITE} is given and -list_all is not, and if exactly one advisable device is listed, it really gets overwritten by the file content of the given -image_file. In this case the exit value is zero if writing succeeded, non-zero else. @* Option @strong{-dummy} prevents this kind of real action and rather shows the planned umount and dd commands on stdout. @* Example: @* $ xorriso-dd-target -with_sudo -plug_test -DO_WRITE \ @* -image_file debian-live-10.0.0-amd64-xfce.iso @* ... sudo messages and above plug test steps 1 and 2 ... @* @* sde : YES : usb+ has_iso9660+ has_vfat+ @* Step 3: @* Last chance to abort. Enter the word 'yes' to start REAL WRITING. @* yes @* Looking for mount points of sde: @* /dev/sde1 on /mnt/iso type iso9660 (ro,relatime) @* /dev/sde2 on /mnt/fat type vfat (rw,...,errors=remount-ro) @* Unmounted: /dev/sde1 @* Unmounted: /dev/sde2 @* Performing: @* sudo /bin/dd if=/dev/zero of=/dev/'sde' bs=512 seek='245759999' @* count=1 status=none @* sudo /bin/dd if='debian-live-10.0.0-amd64-xfce.iso' of=/dev/'sde' @* bs=1M status=progress oflag=dsync ; sync @* ... dd messages ... @* The first dd run shall erase a possible GPT backup header. It is performed only if the local program "expr" can deal with the byte size of the device. @c man .SS @node Unwise, Reasons, Dowrite, Overview @chapter Show commands for writing to a not advised device @c man \fBShow commands for writing to a not advised device:\fR @c man .br @cindex Use case, show commands for writing to a not advised device There should be no way to convince xorriso-dd-target of writing to a target device which it does not deem advisable. Please report any set of arguments that can be misused for that. @* The outmost complicity to potentially unwise actions is offered by option @strong{-dummy_force}. If given together with a single device name or with option -plug_test it will act like -dummy -DO_WRITE with this device, even if it looks not advisable. I.e. it will show the shell commands which the program does not dare to perform. @* Example: @* $ xorriso-dd-target -with_sudo -list_long -dummy_force sdd \ @* -image_file debian-live-10.0.0-amd64-xfce.iso @* ... @* sdd : NO : usb+ has_iso9660+ has_vfat+ has_ext2- @* NAME SIZE FSTYPE TRAN LABEL @* sdd 3.8G iso9660 usb d-live 9.5.0 xf i386 @* |-sdd1 1.9G iso9660 d-live 9.5.0 xf i386 @* |-sdd2 320K vfat @* `-sdd3 512M ext2 @* @* Overriding any advice because of -dummy_force @* Looking for mount points of sdd: @* /dev/sdd1 on /mnt/iso type iso9660 (ro,relatime) @* /dev/sdd2 on /mnt/fat type vfat (rw,...,errors=remount-ro) @* /dev/sdd3 on /mnt/ext type ext2 (rw,relatime) @* AGAINST THE ADVICE BY THIS PROGRAM, a daring user could do: @* sudo /bin/umount /dev/sdd1 @* sudo /bin/umount /dev/sdd2 @* sudo /bin/umount /dev/sdd3 @* sudo /bin/dd if=/dev/zero of=/dev/'sdd' bs=512 seek='7864318' @* count=1 status=none @* sudo /bin/dd if='debian-live-10.0.0-amd64-xfce.iso' of=/dev/sdd @* bs=1M status=progress oflag=dsync ; sync @* BE SMART. BE CAUTIOUS. BEWARE. @c man .SS @node Reasons, Options, Unwise, Overview @chapter Alphabetical list of positive and negative reasons @c man \fBAlphabetical List of positive and negative reasons:\fR @c man .br @cindex Reasons, list of As stated with use case "List all devices", @strong{reasons} are words with either suffix '+' for an inviting device property or '-' for a prohibitive property. @* Normally a single '-' reason disqualifies the device from being advisable. @c man .br @c man .PP @section Reasons @strong{has_XYZ-} @* A filesystem of type XYZ is detected on base device or partition and is spoiling the impression of a device with disposable content. @* @strong{has_iso9660+} @* An ISO 9660 filesystem is detected. @* @strong{has_vfat+} @* A FAT (MS-DOS-like) filesystem is detected. @* @strong{look_for_iso++} @* Option -look_for_iso is given and an ISO 9660 filesystem is detected. This reason overrides any "has_XYZ-" reason. @* @strong{looks_like_cd_drive-} @* A given device name looks like the name of an optical drive: sr[0-9]*. Use program @strong{xorrecord} for this kind of devices. @* @strong{looks_like_disk_partition-} @* A given device name looks like the name of a partition. Expected are names of base devices, like "sde", not of their partitions, like "sde1". @* @strong{looks_like_floppy-} @* A given device name looks like the name of a floppy disk drive: fd[0-9]*. @* @strong{looks_like_loopdev-} @* A given device name looks like the name of a loop device: loop[0-9]*. @* @strong{looks_like_ramdev-} @* A given device name looks like the name of a RAM block device: zram[0-9]*. @* @strong{lsblk_no_size-} @* A size test is given by -max_size, -min_size, or -image_file but the size of the device cannot be inquired by lsblk. This is supposed to happen only with given inappropriate device names. @* @strong{mmcblk+} @* The device name looks like a directly connected memory card. @* @strong{name_with_slash-} @* A given device name contains '/' characters. @* @strong{no_bus_info-} @* The device is not a memory card and lsblk reports nothing about the way how it is connected to the computer. @* @strong{no_fs_while_not_su-} @* No filesystem is reported by lsblk and the program does not believe to have run it with superuser powers. There is the risk that lsblk silently failed to detect existing filesystems. @* @strong{no_iso9660-} @* Option -look_for_iso is given but no ISO 9660 filesystem is detected. @* @strong{not_usb-} @* The device is not a memory card and lsblk reports that it is connected by something other than USB. @* @strong{size_too_large-} @* Option -max_size is given with a size smaller than the size of the device. @* @strong{size_too_small-} @* Option -min_size or -image_file is given with size or file size larger than the size of the device. @* @strong{usb+} @* The device is reported by lsblk to be connected via USB. @* @c man .SS @node Options, Examples, Overview, Top @chapter Options @cindex xorriso-dd-target, options @c man .br @c man .SH OPTIONS @c man .br @c man .PP @c man .TP @table @asis @item -plug_test @kindex -plug_test detect target device plugging @cindex Target device, detect by plugging, @minus{}plug_test Find the target device by asking the user to press the Enter key when the desired target is _not_ plugged in, to then plug it in, and to press Enter again. @* This overrides device names and option -list_all. The found device is then shown with advice, vendor, and model. @* Option -DO_WRITE is obeyed if given. In this case, the word 'yes' has to be entered to let unmounting and writing begin. @c man .TP @item -list_all @kindex -list_all print list of disk devices @cindex Disk devices, print list, -list_all Print list of all found devices with advice, vendor and model. One per line. Ignore any device names. Ignore -DO_WRITE. @c man .TP @item -list_long @kindex -list_long print extra device info @cindex Device info, print extra, -list_long After each result line, which shows reasons, add an additional listing of the information provided by lsblk which led to the reasons and add an empty line. @c man .TP @item -with_vendor_model @kindex -with_vendor_model add drive info to advice @cindex Drive info, add to advice, -with_vendor_model Print vendor and model with each submitted device name. @c man .TP @item -max_size n[M|G|T] @kindex -max_size set size limit for device @cindex Device size, set limit, -max_size Set the upper byte size limit for advisable devices. Plain numbers get rounded down to full millions. As suffix are recognized: M = million, G = billion, T = trillion. @* Be generous to avoid problems with GB < GiB. @c man .TP @item -min_size n[M|G|T] @kindex -min_size set size limit for device @cindex Device size, set limit, -min_size Set the lower byte size limit for advisable devices. After processing like with -max_size, one million gets added to the size limit. @c man .TP @item -look_for_iso @kindex -look_for_iso demand presence of ISO 9660 @cindex ISO 9660, demand presence on target, @minus{}look_for_iso Demand presence of an ISO 9660 filesystem. If so, then any further filesystem type is acceptable on that device. @* If this option is missing, only ISO 9660 and VFAT filesystems are accepted. @c man .TP @item -with_sudo @kindex -with_sudo run lsblk, umount, dd by sudo @cindex lsblk, umount, dd, run by sudo, -with_sudo Run 'lsblk -o FSTYPE' by sudo. If no filesystems are detected on a device while the program has no superuser power, then the device is not advised. Option -with_sudo avoids this refusal without the need to run the whole program as superuser. @* If -DO_WRITE -with_sudo is given, then the programs umount and dd will be run by sudo, too. @c man .TP @item -trust_lsblk_udev @kindex -trust_lsblk_udev suppress no_fs_while_not_su- @cindex suppress no_fs_while_not_su-, -trust_lsblk_udev Suppress the reason no_fs_while_not_su- if lsblk is linked with libudev.so. In this case it is likely that lsblk can retrieve FSTYPE even if run by a non-priviledged user. @* This option is intended for use by frontend programs which are certain that they do not encounter a udev-using version of lsblk which nevertheless fails to detect existing filesystems. Human users should better acquire superuser powers if reason no_fs_while_not_su- is reported. @c man .TP @item -image_file PATH @kindex -image_file set path of disk image file @cindex disk image file, set path, -image_file Set the path of the image file which shall be written to a device. Its size will be set as -min_size. @c man .TP @item -DO_WRITE @kindex -DO_WRITE write image file to device @cindex disk image file, write to device, -DO_WRITE Write the given -image_file to the one advisable device that is found. If more than one such device is found, then they get listed but no writing happens. @* In this case, to get a real write run, consider unplugging unneeded devices, or using option -plug_test, or a re-run with one of the advised device names as additional argument. @c man .TP @item -no_pacifier @kindex -no_pacifier do not show dd progress @cindex dd progress, do not show, -no_pacifier Do not use dd options to print progress messages and to perform synchronized output. These options are used by default if program dd offers progress messages. @c man .TP @item -dummy @kindex -dummy report but do not perform @cindex only report, do not perform, -dummy Report the -DO_WRITE actions but do not perform them. @c man .TP @item -dummy_force @kindex -dummy_force show raw copy commands @cindex raw copy commands, show, -dummy_force If a single device name is given, do a run of -dummy -DO_WRITE even against the advice of this program. This probably shows you ways to shoot your own foot. @c man .TP @item -version @kindex -version print version text to stdout @cindex version text, print to stdout, -version Print the program name, version text, and timestamp to stdout and then end the program. @c man .TP @item -help @kindex -help print help text to stdout @cindex help text, print to stdout, -help Print the help text to stdout and then end the program. @end table @node Examples, Files, Options, Top @chapter Examples @c man .SH EXAMPLES Examples are given in the above description of use cases. @node Files, Seealso, Examples, Top @chapter Files @c man .SH FILES For now, no files are defined for configuration. @c man .SH SEE ALSO @c man .BR lsblk(8), @c man .BR umount(8), @c man .BR dd(1), @c man .BR xorrecord(1) @c man-ignore-lines begin @node Seealso, Bugreport, Files, Top @chapter See also lsblk(8), sudo(8), umount(8), dd(1), xorrecord(1) @c man-ignore-lines end @c man .SH BUGS @node Bugreport, Legal, Seealso, Top @chapter Reporting bugs @cindex Bugs, reporting @cindex Problems, reporting To report bugs, request help, or suggest enhancements for @command{xorriso-dd-target}, please send electronic mail to the public list @email{bug-xorriso@@gnu.org}. If more privacy is desired, mail to @email{scdbackup@@gmx.net}. @* @sp 1 Please describe what you expect the program to do, the program arguments which you used, the messages of @command{xorriso-dd-target}, and the undesirable outcome of your program run. @* @sp 1 Expect to get asked more questions before solutions can be proposed. @c man .SH AUTHOR @node Legal, CommandIdx, Bugreport, Top @chapter Author, Copyright, Credits @section Author Thomas Schmitt @* for libburnia-project.org @c man .SH COPYRIGHT @section Copyright Copyright (c) 2019 - 2021 Thomas Schmitt @* Permission is granted to distribute this text freely. It shall only be modified in sync with the technical properties of xorriso-dd-target. If you make use of the license to derive modified versions of xorriso-dd-target then you are entitled to modify this text under that same license. @c man .SH CREDITS @section Credits @command{xorriso-dd-target} is developed in cooperation with Nio Wiklund alias sudodus. @c man-ignore-lines begin @node CommandIdx, ConceptIdx, Legal, Top @chapter Alphabetic Options List @printindex ky @node ConceptIdx, Top, CommandIdx, Top @chapter Alphabetic List of Concepts and Objects @printindex cp @c man-ignore-lines end @bye libisoburn-1.5.4/xorriso-dd-target/xorriso-dd-target.info0000644000175700017510000005444614005266267020460 00000000000000This is xorriso-dd-target.info, produced by makeinfo version 5.2 from xorriso-dd-target.texi. xorriso-dd-target - Device evaluator and disk image copier for GNU/Linux Copyright (C) 2021 Thomas Schmitt Permission is granted to distribute this text freely. INFO-DIR-SECTION Archiving START-INFO-DIR-ENTRY * Xorriso-dd-target: (xorriso-dd-target). Device evaluator and disk image copier for GNU/Linux END-INFO-DIR-ENTRY  File: xorriso-dd-target.info, Node: Top, Next: Overview, Up: (dir) xorriso-dd-target 1.5.4 *********************** xorriso-dd-target - Device evaluator and disk image copier for GNU/Linux * Menu: * Overview:: Overview * Options:: Options * Examples:: Examples * Files:: Files * Seealso:: See also * Bugreport:: Reporting bugs * Legal:: Author, Copyright, Credits * CommandIdx:: Alphabetic Option List * ConceptIdx:: Alphabetic List of Concepts and Objects  File: xorriso-dd-target.info, Node: Overview, Next: Options, Prev: Top, Up: Top 1 Overview ********** 'xorriso-dd-target' evaluates block devices of the Linux kernel whether they are suitable targets for a disk image file and optionally copies the image file to one of them. It is specialized on the device names of the *Linux kernel* and uses the capabilities of util-linux program *lsblk*. Therefore it refuses to run on non-Linux kernels. The main purpose of xorriso-dd-target is to inspect the device files of disk-like storage media and to judge whether they look like removable devices with disposable content. If a single plausible candidate is detected, then the program is willing to copy a disk image file onto it. This will overwrite or make inaccessible the previous partition table and all previous data content of the target device. *Superuser power* is often needed for filesystem type identification, for possible unmounting, and for possible image writing. Option *-with_sudo* offers a way to gain this power only for those tasks and to run the program elsewise with a normal user's power. If a particular disk image file is intended as copy source, then its path should be given by option -image_file, so that its size can be used as decision criterion. Following are use case descriptions with examples: * Menu: * Simplenames:: List plain device names * Listall:: List all devices with reasoning * Givendevices:: Evaluate particular given devices * Plugtest:: Detect intended device by plugging * Dowrite:: Write image to an advised device * Unwise:: Show commands for writing to a not advised device * Reasons:: Alphabetical list of positive and negative reasons  File: xorriso-dd-target.info, Node: Simplenames, Next: Listall, Prev: Overview, Up: Overview 2 List plain device names ************************* The most simple and most boring use case is a program run without device names and without options -list_all, -plug_test, -DO_WRITE, -dummy_force. It prints on standard output (stdout) only the names of advisable devices without "/dev/" prefix. One name per line and without any reasoning text. The possible sudo password prompt, the message line about sudo, and the empty line after it do not go to stdout. Example: $ xorriso-dd-target -with_sudo Testing sudo to possibly get password prompting done now: [sudo] password for thomas: sudo /bin/lsblk seems ok. sde  File: xorriso-dd-target.info, Node: Listall, Next: Givendevices, Prev: Simplenames, Up: Overview 3 List all devices with reasoning ********************************* For the more curious user, there is option *-list_all* which prints the evaluation of each disk-like device that is listed by program lsblk. Optical drives, floppy disks, RAM block devices, loop devices are excluded, though. Each device is shown by one line of the form name : advice : reasoning : info *name* is the device name without "/dev/" prefix. *advice* is either "YES" or "NO". "YES" indicates that the device appears to be pluggable disk-like, not used as system disk or sincere data storage, and - if tested - of sufficient or plausible size. *reasoning* is a blank separated list of words with either suffix '+' for an inviting device property or '-' for a prohibitive property. Normally a single '-' reason disqualifies the device from being advisable. Only if option -look_for_iso is given, a reason "has_XYZ-" can be overridden by the presence of an ISO 9660 filesystem on the device. *info* is composed from VENDOR and MODEL as told by lsblk. Option *-list_long* causes with each line an additional listing of the information provided by lsblk which led to the shown reasons. Example: $ xorriso-dd-target -with_sudo -list_all ... sda : NO : not_usb- has_vfat+ has_ext4- : ATA Samsung SSD 850 sdb : NO : not_usb- has_swap- has_ext4- : ATA WDC WD20EFRX-68A sdc : YES : usb+ has_iso9660+ has_vfat+ : Intenso Ultra Line sdd : NO : usb+ has_iso9660+ has_vfat+ has_ext2- : SanDisk Cruzer  File: xorriso-dd-target.info, Node: Givendevices, Next: Plugtest, Prev: Listall, Up: Overview 4 Evaluate particular given devices *********************************** If *device names* are given instead of option -list_all, then only these devices are inspected. Their result gets listed without the ": info" part, unless option *-with_vendor_model* is given. Device names must not begin by '-' and must be single words composed of the characters [A-za-z0-9_/-]. They should not contain '/'. E.g. 'sdc' is valid, '/dev/sdc' is not valid. If one of the given device names gets not advised, the exit value is 1. It makes few sense to give device names which are not listed by -list_all. Examples: $ xorriso-dd-target -with_sudo sdc ... sdc : YES : usb+ has_iso9660+ has_vfat+ $ xorriso-dd-target -with_sudo -with_vendor_model sdc ... sdc : YES : usb+ has_iso9660+ has_vfat+ : Intenso Ultra Line $ xorriso-dd-target sdc sdc : NO : usb+ no_fs_while_not_su-  File: xorriso-dd-target.info, Node: Plugtest, Next: Dowrite, Prev: Givendevices, Up: Overview 5 Detect intended device by plugging ************************************ Option *-plug_test* triggers an interactive method to unambiguously determine the intended target device candidate. It consists of 2 or 3 steps. *Step 1* is to have the intended storage device *unplugged* and to confirm this by pressing the Enter key at the program's prompt. The program will then assess the list of not wanted devices. *Step 2* is to *plug in* the intended storage device and to confirm this by pressing the Enter key a second time. The program will wait up to 10 seconds for a disk-like storage device which is not in the list of not wanted devices. The user may wait with key pressing until the device blinking looks like it is ready. Only if a single new device is found, the program will go on as if a single device name was given. Option -list_all and any device names given as arguments will be ignored. *Step 3* happens only if options -DO_WRITE or -dummy_force are given. The program asks for a final input of the word 'yes' before real or simulated writing begins. Example: $ xorriso-dd-target -with_sudo -plug_test ... Caused by option -plug_test: Attempt to find the desired device by watching it appear after being plugged in. Step 1: Please make sure that the desired target device is plugged _out_ now. If it is currently plugged in, make sure to unmount all its fileystems and then unplug it. Press the Enter key when ready. Found and noted as _not_ desired: sda sdb sdc Step 2: Please plug in the desired target device and then press the Enter key. Waiting up to 10 seconds for a new device to be listed ... found: sdd Now waiting 5 seconds to let it settle ......... Found and noted as desired device: sdd sdd : NO : usb+ has_iso9660+ has_vfat+ has_ext2- : SanDisk Cruzer  File: xorriso-dd-target.info, Node: Dowrite, Next: Unwise, Prev: Plugtest, Up: Overview 6 Write image to an advised device ********************************** Only if option *-DO_WRITE* is given and -list_all is not, and if exactly one advisable device is listed, it really gets overwritten by the file content of the given -image_file. In this case the exit value is zero if writing succeeded, non-zero else. Option *-dummy* prevents this kind of real action and rather shows the planned umount and dd commands on stdout. Example: $ xorriso-dd-target -with_sudo -plug_test -DO_WRITE \ -image_file debian-live-10.0.0-amd64-xfce.iso ... sudo messages and above plug test steps 1 and 2 ... sde : YES : usb+ has_iso9660+ has_vfat+ Step 3: Last chance to abort. Enter the word 'yes' to start REAL WRITING. yes Looking for mount points of sde: /dev/sde1 on /mnt/iso type iso9660 (ro,relatime) /dev/sde2 on /mnt/fat type vfat (rw,...,errors=remount-ro) Unmounted: /dev/sde1 Unmounted: /dev/sde2 Performing: sudo /bin/dd if=/dev/zero of=/dev/'sde' bs=512 seek='245759999' count=1 status=none sudo /bin/dd if='debian-live-10.0.0-amd64-xfce.iso' of=/dev/'sde' bs=1M status=progress oflag=dsync ; sync ... dd messages ... The first dd run shall erase a possible GPT backup header. It is performed only if the local program "expr" can deal with the byte size of the device.  File: xorriso-dd-target.info, Node: Unwise, Next: Reasons, Prev: Dowrite, Up: Overview 7 Show commands for writing to a not advised device *************************************************** There should be no way to convince xorriso-dd-target of writing to a target device which it does not deem advisable. Please report any set of arguments that can be misused for that. The outmost complicity to potentially unwise actions is offered by option *-dummy_force*. If given together with a single device name or with option -plug_test it will act like -dummy -DO_WRITE with this device, even if it looks not advisable. I.e. it will show the shell commands which the program does not dare to perform. Example: $ xorriso-dd-target -with_sudo -list_long -dummy_force sdd \ -image_file debian-live-10.0.0-amd64-xfce.iso ... sdd : NO : usb+ has_iso9660+ has_vfat+ has_ext2- NAME SIZE FSTYPE TRAN LABEL sdd 3.8G iso9660 usb d-live 9.5.0 xf i386 |-sdd1 1.9G iso9660 d-live 9.5.0 xf i386 |-sdd2 320K vfat '-sdd3 512M ext2 Overriding any advice because of -dummy_force Looking for mount points of sdd: /dev/sdd1 on /mnt/iso type iso9660 (ro,relatime) /dev/sdd2 on /mnt/fat type vfat (rw,...,errors=remount-ro) /dev/sdd3 on /mnt/ext type ext2 (rw,relatime) AGAINST THE ADVICE BY THIS PROGRAM, a daring user could do: sudo /bin/umount /dev/sdd1 sudo /bin/umount /dev/sdd2 sudo /bin/umount /dev/sdd3 sudo /bin/dd if=/dev/zero of=/dev/'sdd' bs=512 seek='7864318' count=1 status=none sudo /bin/dd if='debian-live-10.0.0-amd64-xfce.iso' of=/dev/sdd bs=1M status=progress oflag=dsync ; sync BE SMART. BE CAUTIOUS. BEWARE.  File: xorriso-dd-target.info, Node: Reasons, Next: Options, Prev: Unwise, Up: Overview 8 Alphabetical list of positive and negative reasons **************************************************** As stated with use case "List all devices", *reasons* are words with either suffix '+' for an inviting device property or '-' for a prohibitive property. Normally a single '-' reason disqualifies the device from being advisable. 8.1 Reasons =========== *has_XYZ-* A filesystem of type XYZ is detected on base device or partition and is spoiling the impression of a device with disposable content. *has_iso9660+* An ISO 9660 filesystem is detected. *has_vfat+* A FAT (MS-DOS-like) filesystem is detected. *look_for_iso++* Option -look_for_iso is given and an ISO 9660 filesystem is detected. This reason overrides any "has_XYZ-" reason. *looks_like_cd_drive-* A given device name looks like the name of an optical drive: sr[0-9]*. Use program *xorrecord* for this kind of devices. *looks_like_disk_partition-* A given device name looks like the name of a partition. Expected are names of base devices, like "sde", not of their partitions, like "sde1". *looks_like_floppy-* A given device name looks like the name of a floppy disk drive: fd[0-9]*. *looks_like_loopdev-* A given device name looks like the name of a loop device: loop[0-9]*. *looks_like_ramdev-* A given device name looks like the name of a RAM block device: zram[0-9]*. *lsblk_no_size-* A size test is given by -max_size, -min_size, or -image_file but the size of the device cannot be inquired by lsblk. This is supposed to happen only with given inappropriate device names. *mmcblk+* The device name looks like a directly connected memory card. *name_with_slash-* A given device name contains '/' characters. *no_bus_info-* The device is not a memory card and lsblk reports nothing about the way how it is connected to the computer. *no_fs_while_not_su-* No filesystem is reported by lsblk and the program does not believe to have run it with superuser powers. There is the risk that lsblk silently failed to detect existing filesystems. *no_iso9660-* Option -look_for_iso is given but no ISO 9660 filesystem is detected. *not_usb-* The device is not a memory card and lsblk reports that it is connected by something other than USB. *size_too_large-* Option -max_size is given with a size smaller than the size of the device. *size_too_small-* Option -min_size or -image_file is given with size or file size larger than the size of the device. *usb+* The device is reported by lsblk to be connected via USB.  File: xorriso-dd-target.info, Node: Options, Next: Examples, Prev: Overview, Up: Top 9 Options ********* -plug_test Find the target device by asking the user to press the Enter key when the desired target is _not_ plugged in, to then plug it in, and to press Enter again. This overrides device names and option -list_all. The found device is then shown with advice, vendor, and model. Option -DO_WRITE is obeyed if given. In this case, the word 'yes' has to be entered to let unmounting and writing begin. -list_all Print list of all found devices with advice, vendor and model. One per line. Ignore any device names. Ignore -DO_WRITE. -list_long After each result line, which shows reasons, add an additional listing of the information provided by lsblk which led to the reasons and add an empty line. -with_vendor_model Print vendor and model with each submitted device name. -max_size n[M|G|T] Set the upper byte size limit for advisable devices. Plain numbers get rounded down to full millions. As suffix are recognized: M = million, G = billion, T = trillion. Be generous to avoid problems with GB < GiB. -min_size n[M|G|T] Set the lower byte size limit for advisable devices. After processing like with -max_size, one million gets added to the size limit. -look_for_iso Demand presence of an ISO 9660 filesystem. If so, then any further filesystem type is acceptable on that device. If this option is missing, only ISO 9660 and VFAT filesystems are accepted. -with_sudo Run 'lsblk -o FSTYPE' by sudo. If no filesystems are detected on a device while the program has no superuser power, then the device is not advised. Option -with_sudo avoids this refusal without the need to run the whole program as superuser. If -DO_WRITE -with_sudo is given, then the programs umount and dd will be run by sudo, too. -trust_lsblk_udev Suppress the reason no_fs_while_not_su- if lsblk is linked with libudev.so. In this case it is likely that lsblk can retrieve FSTYPE even if run by a non-priviledged user. This option is intended for use by frontend programs which are certain that they do not encounter a udev-using version of lsblk which nevertheless fails to detect existing filesystems. Human users should better acquire superuser powers if reason no_fs_while_not_su- is reported. -image_file PATH Set the path of the image file which shall be written to a device. Its size will be set as -min_size. -DO_WRITE Write the given -image_file to the one advisable device that is found. If more than one such device is found, then they get listed but no writing happens. In this case, to get a real write run, consider unplugging unneeded devices, or using option -plug_test, or a re-run with one of the advised device names as additional argument. -no_pacifier Do not use dd options to print progress messages and to perform synchronized output. These options are used by default if program dd offers progress messages. -dummy Report the -DO_WRITE actions but do not perform them. -dummy_force If a single device name is given, do a run of -dummy -DO_WRITE even against the advice of this program. This probably shows you ways to shoot your own foot. -version Print the program name, version text, and timestamp to stdout and then end the program. -help Print the help text to stdout and then end the program.  File: xorriso-dd-target.info, Node: Examples, Next: Files, Prev: Options, Up: Top 10 Examples *********** Examples are given in the above description of use cases.  File: xorriso-dd-target.info, Node: Files, Next: Seealso, Prev: Examples, Up: Top 11 Files ******** For now, no files are defined for configuration.  File: xorriso-dd-target.info, Node: Seealso, Next: Bugreport, Prev: Files, Up: Top 12 See also *********** lsblk(8), sudo(8), umount(8), dd(1), xorrecord(1)  File: xorriso-dd-target.info, Node: Bugreport, Next: Legal, Prev: Seealso, Up: Top 13 Reporting bugs ***************** To report bugs, request help, or suggest enhancements for 'xorriso-dd-target', please send electronic mail to the public list . If more privacy is desired, mail to . Please describe what you expect the program to do, the program arguments which you used, the messages of 'xorriso-dd-target', and the undesirable outcome of your program run. Expect to get asked more questions before solutions can be proposed.  File: xorriso-dd-target.info, Node: Legal, Next: CommandIdx, Prev: Bugreport, Up: Top 14 Author, Copyright, Credits ***************************** 14.1 Author =========== Thomas Schmitt for libburnia-project.org 14.2 Copyright ============== Copyright (c) 2019 - 2021 Thomas Schmitt Permission is granted to distribute this text freely. It shall only be modified in sync with the technical properties of xorriso-dd-target. If you make use of the license to derive modified versions of xorriso-dd-target then you are entitled to modify this text under that same license. 14.3 Credits ============ 'xorriso-dd-target' is developed in cooperation with Nio Wiklund alias sudodus.  File: xorriso-dd-target.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top 15 Alphabetic Options List ************************** [index] * Menu: * -DO_WRITE write image file to device: Options. (line 57) * -dummy report but do not perform: Options. (line 68) * -dummy_force show raw copy commands: Options. (line 70) * -help print help text to stdout: Options. (line 77) * -image_file set path of disk image file: Options. (line 54) * -list_all print list of disk devices: Options. (line 15) * -list_long print extra device info: Options. (line 18) * -look_for_iso demand presence of ISO 9660: Options. (line 33) * -max_size set size limit for device: Options. (line 24) * -min_size set size limit for device: Options. (line 29) * -no_pacifier do not show dd progress: Options. (line 64) * -plug_test detect target device plugging: Options. (line 7) * -trust_lsblk_udev suppress no_fs_while_not_su-: Options. (line 45) * -version print version text to stdout: Options. (line 74) * -with_sudo run lsblk, umount, dd by sudo: Options. (line 38) * -with_vendor_model add drive info to advice: Options. (line 22)  File: xorriso-dd-target.info, Node: ConceptIdx, Next: Top, Prev: CommandIdx, Up: Top 16 Alphabetic List of Concepts and Objects ****************************************** [index] * Menu: * Bugs, reporting: Bugreport. (line 6) * dd progress, do not show, -no_pacifier: Options. (line 64) * Device info, print extra, -list_long: Options. (line 18) * Device size, set limit, -max_size: Options. (line 24) * Device size, set limit, -min_size: Options. (line 29) * Disk devices, print list, -list_all: Options. (line 15) * disk image file, set path, -image_file: Options. (line 54) * disk image file, write to device, -DO_WRITE: Options. (line 57) * Drive info, add to advice, -with_vendor_model: Options. (line 22) * help text, print to stdout, -help: Options. (line 77) * ISO 9660, demand presence on target, -look_for_iso: Options. (line 33) * lsblk, umount, dd, run by sudo, -with_sudo: Options. (line 38) * only report, do not perform, -dummy: Options. (line 68) * Problems, reporting: Bugreport. (line 6) * raw copy commands, show, -dummy_force: Options. (line 70) * Reasons, list of: Reasons. (line 6) * suppress no_fs_while_not_su-, -trust_lsblk_udev: Options. (line 45) * Target device, detect by plugging, -plug_test: Options. (line 7) * Use case, detect intended device by plugging: Plugtest. (line 6) * Use case, evaluate particular given devices: Givendevices. (line 6) * Use case, list advisable device names: Simplenames. (line 6) * Use case, list all devices with reasoning: Listall. (line 6) * Use case, show commands for writing to a not advised device: Unwise. (line 6) * Use case, write image to an advised device: Dowrite. (line 6) * version text, print to stdout, -version: Options. (line 74) * xorriso-dd-target, options: Options. (line 6)  Tag Table: Node: Top429 Node: Overview996 Node: Simplenames2789 Node: Listall3513 Node: Givendevices5086 Node: Plugtest6050 Node: Dowrite7955 Node: Unwise9336 Node: Reasons10958 Node: Options13539 Node: Examples17147 Node: Files17320 Node: Seealso17478 Node: Bugreport17644 Node: Legal18231 Node: CommandIdx18942 Node: ConceptIdx20281  End Tag Table libisoburn-1.5.4/xorriso-dd-target/xorriso-dd-target0000755000175700017510000007161514005265700017515 00000000000000#!/bin/sh # Copyright (c) 2019 - 2021 # Nio Wiklund alias sudodus # Thomas Schmitt # Provided under GPL version 2 or later. # All names of variables and functions begin by "xdt_" in order to facilitate # the re-use of this code by inclusion or forking and expansion. # Before using most of the functions it is necessary to run # xdt_init ; xdt_reset_job # The only function which may be run earlier is xdt_set_lang_c . # The function xtd_main gets run by the code at the end of this file # if $no_xorriso_dd_target_run is empty. It implements what xdt_print_usage # announces. xdt_print_version() { echo "xorriso-dd-target , version 1.5.4 , 2021.01.30.150001" } ## This obtrusive setting shall make the script safe against exotic locales. ## Supposed to stabilize grep expression interpretation and error messages. ## It is optional but highly advisable. xdt_set_lang_c() { export LANG=C export LC_ALL=C return 0 } ## This function has to be called before any real work can be done. xdt_init() { # Check whether we are on GNU/Linux if uname -s | grep -v '^Linux' >/dev/null then echo "This program is entirely specialized on Linux kernel device names." >&2 echo "Found to be on: '$(uname -s)'" >&2 return 2 fi # Accept sudo-executable commands only in well known directories. # (Listed with increasing priority.) xdt_lsblk_cmd= xdt_dd_cmd= xdt_umount_cmd= if test "$(whoami)" = "root" then xdt_sudo_x_dir_list="/usr/bin /bin /usr/sbin /sbin" else xdt_sudo_x_dir_list="/usr/sbin /sbin /usr/bin /bin" fi for xdt_i in $xdt_sudo_x_dir_list do if test -x "$xdt_i"/lsblk then xdt_lsblk_cmd="$xdt_i"/lsblk fi if test -x "$xdt_i"/dd then xdt_dd_cmd="$xdt_i"/dd fi if test -x "$xdt_i"/umount then xdt_umount_cmd="$xdt_i"/umount fi done if test -z "$xdt_lsblk_cmd" then echo "No executable program lsblk found in: $xdt_sudo_x_dir_list" >&2 return 5 fi return 0 } xdt_print_usage() { echo "usage: $0 [options] [device_name [device_name ...]]" echo echo "Looks on GNU/Linux for USB and Memory Card devices and evaluates" echo "whether the found devices are plausible targets for image copying." echo "If no device names and no -list_all are given, then a plain list of" echo "advisable device names is printed to stdout. One per line." echo "Device names must not begin by '-' and must be single words. They must" echo "not begin by '/dev/'. E.g. 'sdc' is valid, '/dev/sdc' is not valid." echo "If device names are given, then they get listed with advice shown." echo "If one of the given device names gets not advised, the exit value is 1." echo echo "The option -plug_test can determine the desired target device by" echo "inquiring the system with unplugged device and then with plugged one." echo echo "Only if option -DO_WRITE is given and -list_all is not, and if exactly" echo "one advisable device is listed, it really gets overwritten by the" echo "file content of the given -image_file. In this case the exit value" echo "is zero if writing succeeded, non-zero else." echo "Option -dummy prevents this kind of real action and rather shows the" echo "unmount and write commands on stdout." echo echo "Options:" echo " -plug_test Find the target device by asking the user to press" echo " Enter when the desired target is _not_ plugged in," echo " to then plug it in, and to press Enter again." echo " This overrides device names and option -list_all." echo " The found device is then shown with advice, vendor," echo " and model. Option -DO_WRITE is obeyed if given." echo " -list_all Print list of all found devices with advice, vendor" echo " and model. One per line. Ignore any device names." echo " Ignore -DO_WRITE." echo " -list_long With each line printed by -list_all or a submitted" echo " device name, let lsblk print info which led to the" echo " shown reasons." echo " -with_vendor_model Print vendor and model with each submitted device" echo " name." echo " -max_size n[M|G|T] Set upper byte size limit for advisable devices." echo " Plain numbers get rounded down to full millions." echo " Suffix: M = million, G = billion, T = trillion." echo " Be generous to avoid problems with GB < GiB." echo " -min_size n[M|G|T] Set lower byte size limit for advisable devices." echo " After processing like with -max_size, one million" echo " gets added to the size limit." echo " -look_for_iso Demand presence of an ISO 9660 filesystem. If so," echo " any further filesystem type is acceptable on that" echo " device. Else only ISO 9660 and VFAT are accepted." echo " -with_sudo Run '$xdt_lsblk_cmd -o FSTYPE' by sudo." echo " If no filesystems are detected and the program" echo " has no superuser power, the device is not advised." echo " If -DO_WRITE is given, run umount and dd by sudo." echo " -trust_lsblk_udev Suppress the reason no_fs_while_not_su- if lsblk" echo " is linked with libudev.so. In this case it is" echo " likely that lsblk can retrieve FSTYPE even if" echo " run by a non-priviledged user." echo " -image_file PATH Set the path of the image file which shall be" echo " written to a device. Its size will be set as" echo " -min_size." echo " -DO_WRITE Write the given -image_file to the one advisable" echo " device that is found. If more than one such device" echo " is found, then they get listed but no writing" echo " happens. In this case, re-run with one of the" echo " advised device names to get a real write run." echo " -no_pacifier Do not use dd options to print progress messages" echo " and to perform synchronized output." echo " -dummy Report the -DO_WRITE actions but do not perform" echo " them." echo " -dummy_force If a single device name is given, do a run of" echo " -dummy -DO_WRITE even against the advice of" echo " this program. This probably shows you ways to" echo " shoot your own foot." echo " -version Print version text and then end the program." echo " -help Print this text to stdout and then end the program." echo "Examples:" echo " $0 -with_sudo -list_all" echo " $0 sdc" echo " $0 -with_sudo -image_file debian-live-10.0.0-amd64-xfce.iso -DO_WRITE -dummy" echo " $0 -with_sudo -image_file debian-live-10.0.0-amd64-xfce.iso -DO_WRITE -plug_test" echo return 0 } # Roughly convert human readable sizes and plain numbers to 1 / million xdt_round_down_div_million() { sed \ -e 's/^[0-9][0-9][0-9][0-9][0-9][0-9]$/0/' \ -e 's/^[0-9][0-9][0-9][0-9][0-9]$/0/' \ -e 's/^[0-9][0-9][0-9][0-9]$/0/' \ -e 's/^[0-9][0-9][0-9]$/0/' \ -e 's/^[0-9][0-9]$/0/' \ -e 's/^[0-9]$/0/' \ -e 's/\.[0-9]*//' \ -e 's/[0-9][0-9][0-9][0-9][0-9][0-9]$//' \ -e 's/[Mm]$//' \ -e 's/[Gg]$/000/' \ -e 's/[Tt]$/000000/' return 0 } ## Check for harmless name or number in program argument xdt_check_parameter() { if test "X$2" = "Xdevice_name" then if echo "X$1" | grep '[^A-Za-z0-9_/-]' >/dev/null then echo "SORRY: Given device name contains unexpected character. Ok: [A-za-z0-9_/-]" >&2 return 12 elif echo "X$1" | grep '^X-' >/dev/null then echo "SORRY: Given device name begins by '-' character." >&2 return 15 fi elif test "X$2" = "Ximage_file" then if echo "X$1" | grep '[$`[*?<>|&!{\]' >/dev/null then echo "SORRY: Given image file name contains unexpected character. Not ok: "'[$`[*?<>|&!{\]' >&2 return 15 elif echo "X$1" | grep '^X[-(]' >/dev/null then echo "SORRY: Given image file name begins by problematic character. Not ok: "'[-(]' >&2 return 15 fi else if echo "X$1" | grep -v '^X[0-9][0-9]*[0-9MGTmgt]$' >/dev/null then echo "SORRY: Number for $2 too short or bad character. Ok: [0-9][0-9MGTmgt]" >&2 return 14 fi fi return 0 } ### Assessing arguments and setting up the job # Settings xdt_reset_job() { xdt_list_all= xdt_do_list_long= xdt_show_reasons= xdt_look_for_iso= xdt_devs= xdt_devs_named= xdt_max_size= xdt_with_vendor_model= xdt_with_sudo= xdt_image_file= xdt_do_write= xdt_dummy_run= xdt_dummy_force= xdt_no_pacifier= xdt_do_plug_test= xdt_trust_lsblk_udev= # Status xdt_sudo_cmd= xdt_have_su_power= xdt_end_after_setup= xdt_dev_end= xdt_dd_bs="bs=1M" xdt_dd_silent= return 0 } ## Predict superuser power. Possibly enable sudo with lsblk -o FSTYPE and dd. ## Also predict whether lsblk -o FSTYPE will bring results as non-root. xdt_predict_su_power() { if test "$(whoami)" = "root" then xdt_have_su_power=y elif test -n "$xdt_with_sudo" then echo "Testing sudo to possibly get password prompting done now:" >&2 if sudo "$xdt_lsblk_cmd" -h >/dev/null then echo "sudo $xdt_lsblk_cmd seems ok." >&2 echo >&2 xdt_sudo_cmd=sudo xdt_have_su_power=y else echo "FAILURE: Cannot execute program $xdt_lsblk_cmd by sudo" >&2 return 11 fi fi # lsblk linked with libudev.so usually can obtain filesystem info # without superuser powers. if test -n "$xdt_trust_lsblk_udev" then if ldd "$xdt_lsblk_cmd" | grep '\blibudev\.so' >/dev/null then xdt_lsblk_fs_wo_su=y fi fi return 0 } ## Sets xdt_variables according to its arguments xdt_arg_interpreter() { xdt_next_is= for xdt_i in "$@" do # The next_is option parameter readers get programmed by the -options if test "$xdt_next_is" = "max_size" then xdt_check_parameter "$xdt_i" -max_size || return "$?" xdt_max_size="$(echo "$xdt_i" | xdt_round_down_div_million)" xdt_next_is= elif test "$xdt_next_is" = "min_size" then xdt_check_parameter "$xdt_i" -min_size || return "$?" xdt_min_size="$(echo "$xdt_i" | xdt_round_down_div_million)" xdt_min_size="$(expr $xdt_min_size + 1)" xdt_next_is= elif test "$xdt_next_is" = "image_file" then xdt_check_parameter "$xdt_i" image_file || return "$?" xdt_image_file="$xdt_i" xdt_min_size="$(stat -c '%s' "$xdt_i" \ | xdt_round_down_div_million)" if test -z "$xdt_min_size" then echo "FAILURE: Cannot obtain size of -image_file '$xdt_i'" >&2 return 13 else xdt_min_size="$(expr $xdt_min_size + 1)" fi xdt_next_is= elif test "X$xdt_i" = "X-list_all" then xdt_list_all=y xdt_with_vendor_model=y xdt_show_reasons=y elif test "X$xdt_i" = "X-list_long" then xdt_do_list_long=y elif test "X$xdt_i" = "X-plug_test" then xdt_do_plug_test=y elif test "X$xdt_i" = "X-max_size" then xdt_next_is="max_size" elif test "X$xdt_i" = "X-min_size" then xdt_next_is="min_size" elif test "X$xdt_i" = "X-with_vendor_model" then xdt_with_vendor_model=y elif test "X$xdt_i" = "X-look_for_iso" then xdt_look_for_iso=y elif test "X$xdt_i" = "X-trust_lsblk_udev" then xdt_trust_lsblk_udev=y elif test "X$xdt_i" = "X-with_sudo" then xdt_with_sudo=y elif test "X$xdt_i" = "X-image_file" then xdt_next_is="image_file" elif test "X$xdt_i" = "X-dummy" then xdt_dummy_run=y elif test "X$xdt_i" = "X-dummy_force" then xdt_dummy_run=y xdt_do_write=y xdt_dummy_force=y elif test "X$xdt_i" = "X-DO_WRITE" then xdt_do_write=y elif test "X$xdt_i" = "X-no_pacifier" then xdt_no_pacifier=y elif test "X$xdt_i" = "X-version" then xdt_print_version xdt_end_after_setup=y return 0 elif test "X$xdt_i" = "X-help" then xdt_print_usage xdt_end_after_setup=y return 0 elif echo "X$xdt_i" | grep -v '^X-' >/dev/null then xdt_check_parameter "$xdt_i" device_name || return "$?" xdt_devs_named=y xdt_devs="$xdt_devs $xdt_i" xdt_show_reasons=y else echo "$0 : Unknown option: '$xdt_i'" >&2 echo >&2 echo "For a help text run: $0 -help" >&2 return 16 fi done xdt_predict_su_power || return "$?" # Prepare for using dd pacifier if desired and available # Prepare for using silent dd with GPT backup erasure if available xdt_dd_bs="bs=1M" xdt_dd_silent= if test -n "$xdt_dd_cmd" then if test -z "$xdt_no_pacifier" && \ "$xdt_dd_cmd" if=/dev/zero of=/dev/null count=1 \ bs=1M status=progress oflag=dsync 2>/dev/null then xdt_dd_bs="bs=1M status=progress oflag=dsync" fi if "$xdt_dd_cmd" if=/dev/zero of=/dev/null count=1 bs=512 status=none \ 2>/dev/null then xdt_dd_silent="status=none" fi fi return 0 } ## Obtain a blank separated list of top-level names which do not look like ## CD, floppy, RAM dev, or loop device. xdt_collect_devices() { "$xdt_lsblk_cmd" -d -n -o NAME \ | grep -v '^sr[0-9]' \ | grep -v '^fd[0-9]' \ | grep -v '^zram[0-9]' \ | grep -v '^loop[0-9]' \ | tr '\n\r' ' ' return 0 } ## Let lsblk print extra info for the given devices xdt_list_long() { if test -z "$xdt_do_list_long" then return 0 fi $xdt_sudo_cmd "$xdt_lsblk_cmd" -o NAME,SIZE,FSTYPE,TRAN,LABEL \ /dev/"$1" echo return 0 } ## Trying to find the desired device by watching plug-in effects xdt_plug_in_watcher() { # How long to wait for a first device to appear, how long to wait for more xdt_wait_span_0=10 xdt_wait_span_1=5 xdt_found_devices= echo >&2 echo "Caused by option -plug_test: Attempt to find the desired device" >&2 echo "by watching it appear after being plugged in." >&2 echo >&2 echo "Step 1:" >&2 echo "Please make sure that the desired target device is plugged _out_ now." >&2 echo "If it is currently plugged in, make sure to unmount all its fileystems" >&2 echo "and then unplug it." >&2 echo "Press the Enter key when ready." >&2 read xdt_dummy xdt_old_device_list=' '$(xdt_collect_devices)' ' # <<< Mock-up to save USB socket wear-off by erasing items from old_device_list # <<< Their presence in new_device_list will let them appear as fresh plugs # xdt_old_device_list=' '$(echo -n $xdt_old_device_list | sed -e 's/sdc//')' ' echo "Found and noted as _not_ desired: $xdt_old_device_list" >&2 echo >&2 echo "Step 2:" >&2 echo "Please plug in the desired target device and then press the Enter key." >&2 read xdt_dummy echo -n "Waiting up to $xdt_wait_span_0 seconds for a new device to be listed ..." >&2 xdt_end_time="$(expr $(date +'%s') + "$xdt_wait_span_0")" while test $(date +'%s') -le "$xdt_end_time" do xdt_new_device_list=' '$(xdt_collect_devices)' ' for xdt_i in $xdt_new_device_list do if echo "$xdt_old_device_list $xdt_found_devices " \ | grep -F -v ' '"$xdt_i"' ' >/dev/null then echo " found: $xdt_i" >&2 xdt_found_devices="$xdt_found_devices $xdt_i" xdt_end_time=$(expr $(date +'%s') + "$xdt_wait_span_1") echo -n "Now waiting $xdt_wait_span_1 seconds to let it settle ..." >&2 fi done sleep 1 echo -n '.' >&2 done echo >&2 if test -z "$xdt_found_devices" then echo "SORRY: No new candidate device was found." >&2 return 8 fi xdt_num=$(echo $xdt_found_devices | wc -w) if test "$xdt_num" -gt 1 then echo "SORRY: More than one new candidate device appeared: $xdt_found_devices" >&2 return 9 fi echo "Found and noted as desired device: $xdt_found_devices" >&2 if test -n "$xdt_devs" then echo "(-plug_test is overriding device list given by arguments: $xdt_devs )" >&2 fi if test -n "$xdt_list_all" then echo "(-plug_test is overriding -list_all)" >&2 xdt_list_all= fi xdt_devs_named=y xdt_with_vendor_model=y xdt_show_reasons=y xdt_devs=$(echo -n $xdt_found_devices) echo >&2 return 0 } ## Evaluation of available devices and suitability xdt_list_devices() { if test -n "$xdt_list_all" then xdt_devs= fi if test -z "$xdt_devs" then # Obtain list of top-level names which do not look like CD, floppy, RAM dev xdt_devs=$(xdt_collect_devices) fi xdt_not_advised=0 for xdt_name in $xdt_devs do # Collect reasons xdt_yucky= xdt_reasons= xdt_good_trans= xdt_good_fs= xdt_bad_trans= xdt_bad_fs= # Unwanted device name patterns if (echo "$xdt_name" | grep '^sd[a-z][1-9]' >/dev/null) \ || (echo "$xdt_name" | grep '^mmcblk.*p[0-9]' >/dev/null) \ || (echo "$xdt_name" | grep '^nvme.*p[0-9]' >/dev/null) then xdt_yucky=y xdt_reasons="${xdt_reasons}looks_like_disk_partition- " elif echo "$xdt_name" | grep '^sr[0-9]' >/dev/null then xdt_yucky=y xdt_reasons="${xdt_reasons}looks_like_cd_drive- " elif echo "$xdt_name" | grep '^fd[0-9]' >/dev/null then xdt_yucky=y xdt_reasons="${xdt_reasons}looks_like_floppy- " elif echo "$xdt_name" | grep '^loop[0-9]' >/dev/null then xdt_yucky=y xdt_reasons="${xdt_reasons}looks_like_loopdev- " elif echo "$xdt_name" | grep '^zram[0-9]' >/dev/null then xdt_yucky=y xdt_reasons="${xdt_reasons}looks_like_ramdev- " fi # >>> recognize the device from which Debian Live booted # Connection type. Normally by lsblk TRAN, but in case of mmcblk artificial. if echo "$xdt_name" | grep '^mmcblk[0-9]' >/dev/null then xdt_transports="mmcblk" elif echo "$xdt_name" | grep -F "/" >/dev/null then xdt_transports=not_an_expected_name xdt_reasons="${xdt_reasons}name_with_slash- " else xdt_transports=$("$xdt_lsblk_cmd" -n -o TRAN /dev/"$xdt_name") fi for xdt_trans in $xdt_transports do if test "$xdt_trans" = "usb" || test "$xdt_trans" = "mmcblk" then xdt_good_trans="${xdt_trans}+" elif test -n "$xdt_trans" then xdt_bad_trans="$xdt_trans" xdt_yucky=y if test "$xdt_transports" = "not_an_expected_name" then xdt_dummy=dummy else if echo "$xdt_reasons" | grep -F -v "not_usb" >/dev/null then xdt_reasons="${xdt_reasons}not_usb- " fi fi fi done if test -z "$xdt_good_trans" && test -z "$xdt_bad_trans" then xdt_yucky=y xdt_reasons="${xdt_reasons}no_bus_info- " elif test -z "$xdt_bad_trans" then xdt_reasons="${xdt_reasons}$xdt_good_trans " fi # Wanted or unwanted filesystem types xdt_fstypes=$($xdt_sudo_cmd "$xdt_lsblk_cmd" -n -o FSTYPE \ /dev/"$xdt_name") if test "$?" -gt 0 then xdt_fstypes="lsblk_fstype_error" fi # Get overview of filesystems xdt_has_iso= xdt_has_vfat= xdt_has_other= for xdt_fstype in $xdt_fstypes do if test "$xdt_fstype" = "iso9660" then xdt_has_iso=y if echo "$xdt_good_fs" | grep -F -v "has_$xdt_fstype" >/dev/null then xdt_good_fs="${xdt_good_fs}has_${xdt_fstype}+ " fi elif test "$xdt_fstype" = "vfat" then xdt_has_vfat=y if echo "$xdt_good_fs" | grep -F -v "has_$xdt_fstype" >/dev/null then xdt_good_fs="${xdt_good_fs}has_${xdt_fstype}+ " fi elif test -n "$xdt_fstype" then xdt_has_other=y if echo "$xdt_bad_fs" | grep -F -v "has_$xdt_fstype" >/dev/null then xdt_bad_fs="${xdt_bad_fs}has_${xdt_fstype}- " fi fi done # Decide whether the found filesystems look dispensible enough xdt_reasons="${xdt_reasons}${xdt_good_fs}${xdt_bad_fs}" if test "${xdt_bad_fs}${xdt_good_fs}" = "" \ && test -z "$xdt_have_su_power" && test -z "$xdt_lsblk_fs_wo_su" then xdt_yucky=y xdt_reasons="${xdt_reasons}no_fs_while_not_su- " elif test -n "$xdt_look_for_iso" then if test -n "$xdt_has_iso" then xdt_reasons="${xdt_reasons}look_for_iso++ " else xdt_yucky=y xdt_reasons="${xdt_reasons}no_iso9660- " fi elif test -n "$xdt_has_other" then xdt_yucky=y fi # Optional tests for size if test -n "$xdt_max_size" || test -n "$xdt_min_size" then xdt_dev_bytes=$("$xdt_lsblk_cmd" -n -b -o SIZE /dev/"$xdt_name" | head -1) xdt_size=$(echo "$xdt_dev_bytes" | xdt_round_down_div_million) if test -z "$xdt_size" then xdt_yucky=y xdt_reasons="${xdt_reasons}lsblk_no_size- " fi fi if test -n "$xdt_max_size" && test -n "$xdt_size" then if test "$xdt_size" -gt "$xdt_max_size" then xdt_yucky=y xdt_reasons="${xdt_reasons}size_too_large- " fi fi if test -n "$xdt_min_size" && test -n "$xdt_size" then if test "$xdt_size" -lt "$xdt_min_size" then xdt_yucky=y xdt_reasons="${xdt_reasons}size_too_small- " fi fi # Now decide overall and report xdt_descr= if test -n "$xdt_with_vendor_model" then xdt_descr=": "$("$xdt_lsblk_cmd" -n -o VENDOR,MODEL \ /dev/"$xdt_name" | tr '\n\r' ' ' | tr -s ' ') fi if test -n "$xdt_yucky" then if test -n "$xdt_show_reasons" then echo "$xdt_name : NO : $xdt_reasons$xdt_descr" xdt_list_long "$xdt_name" fi xdt_not_advised=1 else if test -n "$xdt_show_reasons" then echo "$xdt_name : YES : $xdt_reasons$xdt_descr" xdt_list_long "$xdt_name" else echo "$xdt_name" fi fi done return 0; } ## Puts list of mounted (sub-)devices of $1 into $mounted_devs xdt_list_mounted_of() { xdt_partitions=$("$xdt_lsblk_cmd" -l -n -p -o NAME /dev/"$1" \ | grep -v '^'/dev/"$1"'$' \ | tr '\n\r' ' ') xdt_mounted_devs= for xdt_i in /dev/"$1" $xdt_partitions do # Show the found mount lines and add their device paths to list xdt_mount_line=$(mount | grep '^'"$xdt_i"' ') if test -n "$xdt_mount_line" then echo " $xdt_mount_line" xdt_mounted_devs="$xdt_mounted_devs $xdt_i" fi done return 0 } ## Unmount xdt_mounted_devs (maybe filled by xdt_list_mounted_of) ## $1 : base device name xdt_unmount() { if test -z "$xdt_mounted_devs" then return 0 fi for xdt_i in $xdt_mounted_devs do if test -n "$xdt_dummy_run" then echo " $xdt_sudo_cmd $xdt_umount_cmd $xdt_i" elif $xdt_sudo_cmd "$xdt_umount_cmd" "$xdt_i" then echo "Unmounted: $xdt_i" else echo "FAILURE: Non-zero exit value with: $xdt_sudo_cmd $xdt_umount_cmd $xdt_i" >&2 return 7 fi done # Check again if any mount points still exist if test -z "$xdt_dummy_run" then xdt_list_mounted_of "$1" if test -n "$xdt_mounted_devs" then echo "FAILURE: $xdt_sudo_cmd $xdt_umount_cmd could not remove all mounts: $xdt_mounted_devs" >&2 return 7 fi fi return 0 } ## Does the work of unmounting and dd-ing ## $1 : image file path ## $2 : base device name xdt_write_image() { if test -z "$xdt_umount_cmd" then echo "No executable program umount found in: $xdt_sudo_x_dir_list" >&2 return 6 fi echo "Looking for mount points of $2:" xdt_mounted_devs= xdt_list_mounted_of "$2" if test -n "$xdt_dummy_force" then echo "AGAINST THE ADVICE BY THIS PROGRAM, a daring user could do:" xdt_dummy_run=y elif test -n "$xdt_dummy_run" then echo "Would do if not -dummy:" fi xdt_unmount "$2" || return "$?" if test -z "$xdt_dd_cmd" then echo "No executable program dd found in: $xdt_sudo_x_dir_list" >&2 return 6 fi # Erase possible GPT backup table at end of device # if expr can properly divide device size by 512 xdt_dev_bytes=$("$xdt_lsblk_cmd" -n -b -o SIZE /dev/"${2}" | head -1) if test -n "$xdt_dev_bytes" then xdt_dev_end=$(expr "$xdt_dev_bytes" / 512 2>/dev/null) if test "$(expr "$xdt_dev_end" '*' 512 2>/dev/null)" = "$xdt_dev_bytes" then xdt_dev_end=$(expr "$xdt_dev_end" - 1) else xdt_dev_end= fi fi xdt_gpt_erase_line="$xdt_sudo_cmd $xdt_dd_cmd if=/dev/zero of=/dev/'${2}' bs=512 seek='$xdt_dev_end' count=1 $xdt_dd_silent" xdt_copy_line="$xdt_sudo_cmd $xdt_dd_cmd if='${1}' of=/dev/'${2}' $xdt_dd_bs ; sync" if test -n "$xdt_dummy_run" then if test -n "$xdt_dev_end" then echo " $xdt_gpt_erase_line" fi echo " $xdt_copy_line" else echo "Performing:" if test -n "$xdt_dev_end" then echo " $xdt_gpt_erase_line" $xdt_sudo_cmd "$xdt_dd_cmd" if=/dev/zero of=/dev/"${2}" bs=512 seek="$xdt_dev_end" count=1 $xdt_dd_silent fi echo " $xdt_copy_line" $xdt_sudo_cmd "$xdt_dd_cmd" if="${1}" of=/dev/"${2}" $xdt_dd_bs xdt_ret="$?" sync if test "$xdt_ret" -ne 0 then echo "FAILURE: $xdt_sudo_cmd $xdt_dd_cmd was not successful" >&2 return 18 fi fi if test -n "$xdt_dummy_force" then echo "BE SMART. BE CAUTIOUS. BEWARE." fi return 0 } ## Inspects the result of listing, decides whether writing is advisable, ## and starts the write run xdt_decide_writing() { xdt_with_vendor_model= xdt_show_reasons= xdt_candidates=$(xdt_list_devices | tr '\n\r' ' ') xdt_num_cand=$(echo $xdt_candidates | wc -w) xdt_num_devs=$(echo $xdt_devs| wc -w) if test -n "$xdt_dummy_force" && test "$xdt_num_devs" -ne 1 then echo "SORRY: Refusing -dummy_force with not exactly one device given." >&2 return 10 fi if test -n "$xdt_dummy_force" && test -n "$xdt_dummy_run" \ && test "$xdt_num_cand" -ne 1 then # -dummy_force in a situation where the program would normally refuse echo echo "Overriding any advice because of -dummy_force" xdt_candidates="$xdt_devs" xdt_num_cand=1 elif test -n "$xdt_dummy_force" then # Downgrade -dummy_force to -dummy in order to avoid the ugly warning xdt_dummy_force= xdt_dummy_run=y fi if test "$xdt_num_cand" -eq 1 then if test -n "$xdt_image_file" then if test -n "$xdt_do_plug_test" then echo >&2 echo "Step 3:" >&2 if test -n "$xdt_dummy_run" then echo "This would be the last chance to abort. Enter the word 'yes' to see -dummy report." >&2 else echo "Last chance to abort. Enter the word 'yes' to start REAL WRITING." >&2 fi read xdt_dummy if test "X$xdt_dummy" = "Xyes" || test "X$xdt_dummy" = "X'yes'" \ || test "X$xdt_dummy" = 'X"yes"' then xdt_dummy=dummy else echo "WRITE RUN PREVENTED by user input '$xdt_dummy'." >&2 return 17 fi fi xdt_write_image "$xdt_image_file" $xdt_candidates || return "$?" else xdt_candidates=$(echo $xdt_candidates) if test -n "$xdt_dummy_run" then echo "Would simulate writing to /dev/$xdt_candidates if an -image_file were given." else echo "Would write to /dev/$xdt_candidates if an -image_file were given." fi return 0 fi elif test "$xdt_num_cand" -gt 1 then echo "WILL NOT WRITE ! More than one candidate found for target device:" >&2 xdt_show_reasons=y xdt_with_vendor_model=y xdt_devs="$xdt_candidates" xdt_list_devices >&2 echo "HINT: Unplug the unwanted devices from the machine," >&2 echo " or work with option -plug_test," >&2 echo " or add the desired name out of {$(echo $xdt_candidates | sed -e 's/ /,/g')} as additional argument." >&2 return 3 else if test -n "$xdt_devs_named" then echo "NO CANDIDATE FOR TARGET DEVICE AMONG THE GIVEN NAMES !" >&2 else echo "NO CANDIDATE FOR TARGET DEVICE FOUND !" >&2 fi echo "Overall available devices:" >&2 xdt_list_all=y xdt_list_long= xdt_show_reasons=y xdt_with_vendor_model=y xdt_list_devices >&2 return 4 fi return 0 } ## The main function which runs the others in standalone mode xdt_main() { xdt_set_lang_c xdt_init || return "$?" xdt_reset_job xdt_arg_interpreter "$@" || return "$?" if test -n "$xdt_end_after_setup" then return 0 fi if test -n "$xdt_do_plug_test" then xdt_plug_in_watcher || return "$?" fi xdt_list_devices || return "$?" if test -z "$xdt_list_all" && test -n "$xdt_do_write" then xdt_decide_writing || return "$?" fi if test -n "$xdt_devs_named" then return $xdt_not_advised fi return 0 } if test -z "$no_xorriso_dd_target_run" then xdt_main "$@" || exit "$?" fi libisoburn-1.5.4/xorriso-dd-target/xorriso-dd-target.10000644000175700017510000004322714005266245017654 00000000000000.\" Hey, EMACS: -*- nroff -*- .\" .\" IMPORTANT NOTE: .\" .\" The original of this file is kept in xorriso/xorriso-dd-target.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 XORRISO-DD-TARGET 1 "Version 1.5.4, Jan 30, 2021" .\" 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 insert n+1 empty lines .\" for manpage-specific macros, see man(7) .nh .SH NAME xorriso\-dd\-target \- Device evaluator and disk image copier for GNU/Linux .SH SYNOPSIS .B xorriso-dd-target [ options ] [ device_names ] .br .SH DESCRIPTION .PP \fBxorriso\-dd\-target\fR evaluates block devices of the Linux kernel whether they are suitable targets for a disk image file and optionally copies the image file to one of them. .br It is specialized on the device names of the \fBLinux kernel\fR and uses the capabilities of util\-linux program \fBlsblk\fR. Therefore it refuses to run on non\-Linux kernels. .br .PP The main purpose of xorriso\-dd\-target is to inspect the device files of disk\-like storage media and to judge whether they look like removable devices with disposable content. .br If a single plausible candidate is detected, then the program is willing to copy a disk image file onto it. This will overwrite or make inaccessible the previous partition table and all previous data content of the target device. .br \fBSuperuser power\fR is often needed for filesystem type identification, for possible unmounting, and for possible image writing. Option \fB\-with_sudo\fR offers a way to gain this power only for those tasks and to run the program elsewise with a normal user's power. .br If a particular disk image file is intended as copy source, then its path should be given by option \-image_file, so that its size can be used as decision criterion. .PP Following are use case descriptions with examples: .br - List plain device names .br - List all devices with reasoning .br - Evaluate particular given devices .br - Detect intended device by plugging .br - Write image to an advised device .br - Show commands for writing to a not advised device .br .SS \fBList plain device names:\fR .br The most simple and most boring use case is a program run without device names and without options \-list_all, \-plug_test, \-DO_WRITE, \-dummy_force. It prints on standard output (stdout) only the names of advisable devices without "/dev/" prefix. One name per line and without any reasoning text. .br The possible sudo password prompt, the message line about sudo, and the empty line after it do not go to stdout. .br Example: .br $ xorriso\-dd\-target \-with_sudo .br Testing sudo to possibly get password prompting done now: .br [sudo] password for thomas: .br sudo /bin/lsblk seems ok. sde .SS \fBList all devices with reasoning:\fR .br For the more curious user, there is option \fB\-list_all\fR which prints the evaluation of each disk\-like device that is listed by program lsblk. Optical drives, floppy disks, RAM block devices, loop devices are excluded, though. .br Each device is shown by one line of the form .br name : advice : reasoning : info .br \fBname\fR is the device name without "/dev/" prefix. .br \fBadvice\fR is either "YES" or "NO". "YES" indicates that the device appears to be pluggable disk\-like, not used as system disk or sincere data storage, and \- if tested \- of sufficient or plausible size. .br \fBreasoning\fR is a blank separated list of words with either suffix '+' for an inviting device property or '\-' for a prohibitive property. Normally a single '\-' reason disqualifies the device from being advisable. Only if option \-look_for_iso is given, a reason "has_XYZ\-" can be overridden by the presence of an ISO 9660 filesystem on the device. .br \fBinfo\fR is composed from VENDOR and MODEL as told by lsblk. .br Option \fB\-list_long\fR causes with each line an additional listing of the information provided by lsblk which led to the shown reasons. .br Example: .br $ xorriso\-dd\-target \-with_sudo \-list_all .br ... .br sda : NO : not_usb\- has_vfat+ has_ext4\- : ATA Samsung SSD 850 .br sdb : NO : not_usb\- has_swap\- has_ext4\- : ATA WDC WD20EFRX\-68A .br sdc : YES : usb+ has_iso9660+ has_vfat+ : Intenso Ultra Line .br sdd : NO : usb+ has_iso9660+ has_vfat+ has_ext2\- : SanDisk Cruzer .SS \fBEvaluate particular given devices:\fR .br If \fBdevice names\fR are given instead of option \-list_all, then only these devices are inspected. Their result gets listed without the ": info" part, unless option \fB\-with_vendor_model\fR is given. .br Device names must not begin by '\-' and must be single words composed of the characters [A\-za\-z0\-9_/\-]. They should not contain '/'. E.g. 'sdc' is valid, '/dev/sdc' is not valid. .br If one of the given device names gets not advised, the exit value is 1. .br It makes few sense to give device names which are not listed by \-list_all. .br Examples: .br $ xorriso\-dd\-target \-with_sudo sdc .br ... .br sdc : YES : usb+ has_iso9660+ has_vfat+ .br $ xorriso\-dd\-target \-with_sudo \-with_vendor_model sdc .br ... .br sdc : YES : usb+ has_iso9660+ has_vfat+ : Intenso Ultra Line .br $ xorriso\-dd\-target sdc .br sdc : NO : usb+ no_fs_while_not_su\- .SS \fBDetect intended device by plugging:\fR .br Option \fB\-plug_test\fR triggers an interactive method to unambiguously determine the intended target device candidate. It consists of 2 or 3 steps. .br \fBStep 1\fR is to have the intended storage device \fBunplugged\fR and to confirm this by pressing the Enter key at the program's prompt. The program will then assess the list of not wanted devices. .br \fBStep 2\fR is to \fBplug in\fR the intended storage device and to confirm this by pressing the Enter key a second time. The program will wait up to 10 seconds for a disk\-like storage device which is not in the list of not wanted devices. The user may wait with key pressing until the device blinking looks like it is ready. .br Only if a single new device is found, the program will go on as if a single device name was given. Option \-list_all and any device names given as arguments will be ignored. .br \fBStep 3\fR happens only if options \-DO_WRITE or \-dummy_force are given. The program asks for a final input of the word 'yes' before real or simulated writing begins. .br Example: .br $ xorriso\-dd\-target \-with_sudo \-plug_test .br ... .br Caused by option \-plug_test: Attempt to find the desired device by watching it appear after being plugged in. .br Step 1: .br Please make sure that the desired target device is plugged _out_ now. .br If it is currently plugged in, make sure to unmount all its fileystems .br and then unplug it. .br Press the Enter key when ready. .br .br Found and noted as _not_ desired: sda sdb sdc .br Step 2: .br Please plug in the desired target device and then press the Enter key. .br .br Waiting up to 10 seconds for a new device to be listed ... found: sdd .br Now waiting 5 seconds to let it settle ......... .br Found and noted as desired device: sdd .br .br sdd : NO : usb+ has_iso9660+ has_vfat+ has_ext2\- : SanDisk Cruzer .SS \fBWrite image to an advised device:\fR .br Only if option \fB\-DO_WRITE\fR is given and \-list_all is not, and if exactly one advisable device is listed, it really gets overwritten by the file content of the given \-image_file. In this case the exit value is zero if writing succeeded, non\-zero else. .br Option \fB\-dummy\fR prevents this kind of real action and rather shows the planned umount and dd commands on stdout. .br Example: .br $ xorriso\-dd\-target \-with_sudo \-plug_test \-DO_WRITE \\ .br \-image_file debian\-live\-10.0.0\-amd64\-xfce.iso .br ... sudo messages and above plug test steps 1 and 2 ... .br .br sde : YES : usb+ has_iso9660+ has_vfat+ .br Step 3: .br Last chance to abort. Enter the word 'yes' to start REAL WRITING. .br yes .br Looking for mount points of sde: .br /dev/sde1 on /mnt/iso type iso9660 (ro,relatime) .br /dev/sde2 on /mnt/fat type vfat (rw,...,errors=remount\-ro) .br Unmounted: /dev/sde1 .br Unmounted: /dev/sde2 .br Performing: .br sudo /bin/dd if=/dev/zero of=/dev/'sde' bs=512 seek='245759999' .br count=1 status=none .br sudo /bin/dd if='debian\-live\-10.0.0\-amd64\-xfce.iso' of=/dev/'sde' .br bs=1M status=progress oflag=dsync ; sync .br ... dd messages ... .br The first dd run shall erase a possible GPT backup header. It is performed only if the local program "expr" can deal with the byte size of the device. .SS \fBShow commands for writing to a not advised device:\fR .br There should be no way to convince xorriso\-dd\-target of writing to a target device which it does not deem advisable. Please report any set of arguments that can be misused for that. .br The outmost complicity to potentially unwise actions is offered by option \fB\-dummy_force\fR. If given together with a single device name or with option \-plug_test it will act like \-dummy \-DO_WRITE with this device, even if it looks not advisable. I.e. it will show the shell commands which the program does not dare to perform. .br Example: .br $ xorriso\-dd\-target \-with_sudo \-list_long \-dummy_force sdd \\ .br \-image_file debian\-live\-10.0.0\-amd64\-xfce.iso .br ... .br sdd : NO : usb+ has_iso9660+ has_vfat+ has_ext2\- .br NAME SIZE FSTYPE TRAN LABEL .br sdd 3.8G iso9660 usb d\-live 9.5.0 xf i386 .br |\-sdd1 1.9G iso9660 d\-live 9.5.0 xf i386 .br |\-sdd2 320K vfat .br `\-sdd3 512M ext2 .br .br Overriding any advice because of \-dummy_force .br Looking for mount points of sdd: .br /dev/sdd1 on /mnt/iso type iso9660 (ro,relatime) .br /dev/sdd2 on /mnt/fat type vfat (rw,...,errors=remount\-ro) .br /dev/sdd3 on /mnt/ext type ext2 (rw,relatime) .br AGAINST THE ADVICE BY THIS PROGRAM, a daring user could do: .br sudo /bin/umount /dev/sdd1 .br sudo /bin/umount /dev/sdd2 .br sudo /bin/umount /dev/sdd3 .br sudo /bin/dd if=/dev/zero of=/dev/'sdd' bs=512 seek='7864318' .br count=1 status=none .br sudo /bin/dd if='debian\-live\-10.0.0\-amd64\-xfce.iso' of=/dev/sdd .br bs=1M status=progress oflag=dsync ; sync .br BE SMART. BE CAUTIOUS. BEWARE. .SS \fBAlphabetical List of positive and negative reasons:\fR .br As stated with use case "List all devices", \fBreasons\fR are words with either suffix '+' for an inviting device property or '\-' for a prohibitive property. .br Normally a single '\-' reason disqualifies the device from being advisable. .br .PP \fBhas_XYZ\-\fR .br A filesystem of type XYZ is detected on base device or partition and is spoiling the impression of a device with disposable content. .br \fBhas_iso9660+\fR .br An ISO 9660 filesystem is detected. .br \fBhas_vfat+\fR .br A FAT (MS\-DOS\-like) filesystem is detected. .br \fBlook_for_iso++\fR .br Option \-look_for_iso is given and an ISO 9660 filesystem is detected. This reason overrides any "has_XYZ\-" reason. .br \fBlooks_like_cd_drive\-\fR .br A given device name looks like the name of an optical drive: sr[0\-9]*. Use program \fBxorrecord\fR for this kind of devices. .br \fBlooks_like_disk_partition\-\fR .br A given device name looks like the name of a partition. Expected are names of base devices, like "sde", not of their partitions, like "sde1". .br \fBlooks_like_floppy\-\fR .br A given device name looks like the name of a floppy disk drive: fd[0\-9]*. .br \fBlooks_like_loopdev\-\fR .br A given device name looks like the name of a loop device: loop[0\-9]*. .br \fBlooks_like_ramdev\-\fR .br A given device name looks like the name of a RAM block device: zram[0\-9]*. .br \fBlsblk_no_size\-\fR .br A size test is given by \-max_size, \-min_size, or \-image_file but the size of the device cannot be inquired by lsblk. This is supposed to happen only with given inappropriate device names. .br \fBmmcblk+\fR .br The device name looks like a directly connected memory card. .br \fBname_with_slash\-\fR .br A given device name contains '/' characters. .br \fBno_bus_info\-\fR .br The device is not a memory card and lsblk reports nothing about the way how it is connected to the computer. .br \fBno_fs_while_not_su\-\fR .br No filesystem is reported by lsblk and the program does not believe to have run it with superuser powers. There is the risk that lsblk silently failed to detect existing filesystems. .br \fBno_iso9660\-\fR .br Option \-look_for_iso is given but no ISO 9660 filesystem is detected. .br \fBnot_usb\-\fR .br The device is not a memory card and lsblk reports that it is connected by something other than USB. .br \fBsize_too_large\-\fR .br Option \-max_size is given with a size smaller than the size of the device. .br \fBsize_too_small\-\fR .br Option \-min_size or \-image_file is given with size or file size larger than the size of the device. .br \fBusb+\fR .br The device is reported by lsblk to be connected via USB. .br .SS .br .SH OPTIONS .br .PP .TP \fB\-plug_test\fR Find the target device by asking the user to press the Enter key when the desired target is _not_ plugged in, to then plug it in, and to press Enter again. .br This overrides device names and option \-list_all. The found device is then shown with advice, vendor, and model. .br Option \-DO_WRITE is obeyed if given. In this case, the word 'yes' has to be entered to let unmounting and writing begin. .TP \fB\-list_all\fR Print list of all found devices with advice, vendor and model. One per line. Ignore any device names. Ignore \-DO_WRITE. .TP \fB\-list_long\fR After each result line, which shows reasons, add an additional listing of the information provided by lsblk which led to the reasons and add an empty line. .TP \fB\-with_vendor_model\fR Print vendor and model with each submitted device name. .TP \fB\-max_size\fR n[M|G|T] Set the upper byte size limit for advisable devices. Plain numbers get rounded down to full millions. As suffix are recognized: M = million, G = billion, T = trillion. .br Be generous to avoid problems with GB < GiB. .TP \fB\-min_size\fR n[M|G|T] Set the lower byte size limit for advisable devices. After processing like with \-max_size, one million gets added to the size limit. .TP \fB\-look_for_iso\fR Demand presence of an ISO 9660 filesystem. If so, then any further filesystem type is acceptable on that device. .br If this option is missing, only ISO 9660 and VFAT filesystems are accepted. .TP \fB\-with_sudo\fR Run 'lsblk \-o FSTYPE' by sudo. If no filesystems are detected on a device while the program has no superuser power, then the device is not advised. Option \-with_sudo avoids this refusal without the need to run the whole program as superuser. .br If \-DO_WRITE \-with_sudo is given, then the programs umount and dd will be run by sudo, too. .TP \fB\-trust_lsblk_udev\fR Suppress the reason no_fs_while_not_su\- if lsblk is linked with libudev.so. In this case it is likely that lsblk can retrieve FSTYPE even if run by a non\-priviledged user. .br This option is intended for use by frontend programs which are certain that they do not encounter a udev\-using version of lsblk which nevertheless fails to detect existing filesystems. Human users should better acquire superuser powers if reason no_fs_while_not_su\- is reported. .TP \fB\-image_file\fR PATH Set the path of the image file which shall be written to a device. Its size will be set as \-min_size. .TP \fB\-DO_WRITE\fR Write the given \-image_file to the one advisable device that is found. If more than one such device is found, then they get listed but no writing happens. .br In this case, to get a real write run, consider unplugging unneeded devices, or using option \-plug_test, or a re\-run with one of the advised device names as additional argument. .TP \fB\-no_pacifier\fR Do not use dd options to print progress messages and to perform synchronized output. These options are used by default if program dd offers progress messages. .TP \fB\-dummy\fR Report the \-DO_WRITE actions but do not perform them. .TP \fB\-dummy_force\fR If a single device name is given, do a run of \-dummy \-DO_WRITE even against the advice of this program. This probably shows you ways to shoot your own foot. .TP \fB\-version\fR Print the program name, version text, and timestamp to stdout and then end the program. .TP \fB\-help\fR Print the help text to stdout and then end the program. .SH EXAMPLES Examples are given in the above description of use cases. .SH FILES For now, no files are defined for configuration. .SH SEE ALSO .BR lsblk(8), .BR umount(8), .BR dd(1), .BR xorrecord(1) .SH BUGS To report bugs, request help, or suggest enhancements for \fBxorriso\-dd\-target\fR, please send electronic mail to the public list . If more privacy is desired, mail to . .br Please describe what you expect the program to do, the program arguments which you used, the messages of \fBxorriso\-dd\-target\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 .br for libburnia\-project.org .SH COPYRIGHT Copyright (c) 2019 \- 2021 Thomas Schmitt .br Permission is granted to distribute this text freely. It shall only be modified in sync with the technical properties of xorriso\-dd\-target. If you make use of the license to derive modified versions of xorriso\-dd\-target then you are entitled to modify this text under that same license. .SH CREDITS \fBxorriso\-dd\-target\fR is developed in cooperation with Nio Wiklund alias sudodus. libisoburn-1.5.4/NEWS0000644000175700017510000000006313753552373011335 00000000000000Please see ChangeLog for bug fixes and novelties. libisoburn-1.5.4/INSTALL0000644000175700017510000002255513701321754011667 00000000000000 See file README for libisoburn and xorriso specific installation instructions. This file here is rather a manual for advanced usage of ./configure ------------------------------------------------------------------- Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. libisoburn-1.5.4/configure0000755000175700017510000165641714005267031012553 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for libisoburn 1.5.4. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: http://libburnia-project.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libisoburn' PACKAGE_TARNAME='libisoburn' PACKAGE_VERSION='1.5.4' PACKAGE_STRING='libisoburn 1.5.4' PACKAGE_BUGREPORT='http://libburnia-project.org' PACKAGE_URL='' ac_default_prefix=/usr/local # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS LIBCDIO_LIBS LIBCDIO_CFLAGS LIBISOFS_LIBS LIBISOFS_CFLAGS LIBBURN_LIBS LIBBURN_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG LIBBURNIA_LDCONFIG_CMD LIBLDFLAGS XORRISO_DVD_OBS_64K LFRONT_SUID_DEF LFRONT_DEF EXTF_SUID_DEF EXTF_DEF LIBCDIO_DEF LIBJTE_DEF ZLIB_DEF XATTR_DEF LIBACL_DEF READLINE_DEF XORRISO_DD_TARGET_TEXI XORRISO_DD_TARGET_MAN XORRISO_DD_TARGET LIBBURN_ARCH_LIBS LIBBURNIA_PKGCONFDIR ARCH THREAD_LIBS LIBTOOL_DEPS OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC LT_CURRENT_MINUS_AGE LT_AGE LT_REVISION LT_CURRENT LT_RELEASE ISOBURN_MICRO_VERSION ISOBURN_MINOR_VERSION ISOBURN_MAJOR_VERSION AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_largefile enable_shared enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock enable_libdir_pkgconfig enable_pkgconfig_path enable_libreadline enable_libedit enable_libacl enable_xattr enable_zlib enable_libjte enable_libcdio enable_external_filters enable_external_filters_setuid enable_launch_frontend enable_launch_frontend_setuid enable_dvd_obs_64k enable_versioned_libs enable_ldconfig_at_install enable_pkg_check_modules enable_debug ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR LIBBURN_CFLAGS LIBBURN_LIBS LIBISOFS_CFLAGS LIBISOFS_LIBS LIBCDIO_CFLAGS LIBCDIO_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures libisoburn 1.5.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/libisoburn] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of libisoburn 1.5.4:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-largefile omit support for large files --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-libdir-pkgconfig Install to $libdir/pkgconfig on any OS, default=no --enable-pkgconfig-path=DIR Absolute path of directory for libisofs-*.pc --enable-libreadline Enable use of libreadline by xorriso, default=yes --enable-libedit Enable use of libedit by xorriso if not libreadline, default= setting of --enable-libreadline --enable-libacl Enable use of libacl by libisofs, default=yes --enable-xattr Enable use of extended file attributes by libisofs, default=yes --enable-zlib Enable use of zlib by libisofs, default=yes --enable-libjte Enable use of libjte >= 2.0 by xorriso, default=yes --enable-libcdio Enable use of libcdio as system adapter, default=no (except on MSWindows) --enable-external-filters Enable use of external filter programs by xorriso, default=yes --enable-external-filters-setuid Enable xorriso external filter programs under setuid, default=no --enable-launch-frontend Enable start of piped frontend program by xorriso, default=yes --enable-launch-frontend-setuid Enable start of piped frontend program under setuid, default=no --enable-dvd-obs-64k 64 KB default size for xorriso DVD writing, default=no --enable-versioned-libs Enable strict symbol encapsulation , default=yes --enable-ldconfig-at-install On GNU/Linux run ldconfig, default=yes --enable-pkg-check-modules Enable pkg-config check for libburn and libisofs , default=no --enable-debug Disable aggressive optimizations default=yes Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path LIBBURN_CFLAGS C compiler flags for LIBBURN, overriding pkg-config LIBBURN_LIBS linker flags for LIBBURN, overriding pkg-config LIBISOFS_CFLAGS C compiler flags for LIBISOFS, overriding pkg-config LIBISOFS_LIBS linker flags for LIBISOFS, overriding pkg-config LIBCDIO_CFLAGS C compiler flags for LIBCDIO, overriding pkg-config LIBCDIO_LIBS linker flags for LIBCDIO, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF libisoburn configure 1.5.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------------- ## ## Report this to http://libburnia-project.org ## ## ------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libisoburn $as_me 1.5.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- case $target_os in freebsd*) LDFLAGS="$LDFLAGS -L/usr/local/lib" CPPFLAGS="$CPPFLAGS -I/usr/local/include" ;; netbsd*) LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/pkg/lib" CPPFLAGS="$CPPFLAGS -I/usr/local/include -I/usr/pkg/include" ;; solaris*) LDFLAGS="$LDFLAGS -L/usr/local/lib" esac am__api_version='1.14' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='libisoburn' VERSION='1.5.4' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ISOBURN_MAJOR_VERSION=1 ISOBURN_MINOR_VERSION=5 ISOBURN_MICRO_VERSION=4 LT_RELEASE=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION LT_CURRENT=112 LT_AGE=111 LT_REVISION=0 LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE` test "$prefix" = "NONE" && prefix=$ac_default_prefix DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } if ${ac_cv_sys_largefile_source+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_sys_largefile_source=no; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE_SOURCE 1 #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_sys_largefile_source=1; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_cv_sys_largefile_source=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 $as_echo "$ac_cv_sys_largefile_source" >&6; } case $ac_cv_sys_largefile_source in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source _ACEOF ;; esac rm -rf conftest* # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug # in glibc 2.1.3, but that breaks too many other things. # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. if test $ac_cv_sys_largefile_source != unknown; then $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "fseeko" "ac_cv_func_fseeko" if test "x$ac_cv_func_fseeko" = xyes; then : fi if test ! $ac_cv_func_fseeko; then as_fn_error $? "Libburn requires largefile support." "$LINENO" 5 fi if test x$LIBISOBURN_OLD_ICONV_CONFIGURE = x then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv() in separate -liconv " >&5 $as_echo_n "checking for iconv() in separate -liconv ... " >&6; } libburnia_liconv="no" libburnia_save_LIBS="$LIBS" LIBS="$LIBS -liconv" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : libburnia_liconv="yes" else LIBS="$libburnia_save_LIBS" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libburnia_liconv" >&5 $as_echo "$libburnia_liconv" >&6; } if test x"$libburnia_save_LIBS" = x"$LIBS" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv in -liconv" >&5 $as_echo_n "checking for libiconv in -liconv... " >&6; } if ${ac_cv_lib_iconv_libiconv+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libiconv (); int main () { return libiconv (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iconv_libiconv=yes else ac_cv_lib_iconv_libiconv=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv" >&5 $as_echo "$ac_cv_lib_iconv_libiconv" >&6; } if test "x$ac_cv_lib_iconv_libiconv" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBICONV 1 _ACEOF LIBS="-liconv $LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for const qualifier with iconv() " >&5 $as_echo_n "checking for const qualifier with iconv() ... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : libburnia_iconv_const="" else libburnia_iconv_const="const" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test x$libburnia_iconv_const = xconst then cat >>confdefs.h <<_ACEOF #define ICONV_CONST const _ACEOF else cat >>confdefs.h <<_ACEOF #define ICONV_CONST /**/ _ACEOF fi test -z "$libburnia_iconv_const" && libburnia_iconv_const="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libburnia_iconv_const" >&5 $as_echo "$libburnia_iconv_const" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv in -liconv" >&5 $as_echo_n "checking for iconv in -liconv... " >&6; } if ${ac_cv_lib_iconv_iconv+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char iconv (); int main () { return iconv (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iconv_iconv=yes else ac_cv_lib_iconv_iconv=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv" >&5 $as_echo "$ac_cv_lib_iconv_iconv" >&6; } if test "x$ac_cv_lib_iconv_iconv" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBICONV 1 _ACEOF LIBS="-liconv $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv in -liconv" >&5 $as_echo_n "checking for libiconv in -liconv... " >&6; } if ${ac_cv_lib_iconv_libiconv+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libiconv (); int main () { return libiconv (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iconv_libiconv=yes else ac_cv_lib_iconv_libiconv=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv" >&5 $as_echo "$ac_cv_lib_iconv_libiconv" >&6; } if test "x$ac_cv_lib_iconv_libiconv" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBICONV 1 _ACEOF LIBS="-liconv $LIBS" fi fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) # ts B51007 : changed version_type for lt_main.sh from "sunos" to "netbsd" version_type=netbsd need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) # ts B60722 : changed version_type for lt_main.sh from "sunos" to "netbsd" # http://www.openbsd.org/faq/ports/specialtopics.html # "Understanding shared libraries number rules" version_type=netbsd sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: # LIBTOOL="$LIBTOOL --silent" for ac_header do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include " if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes; then : $as_echo "#define HAVE_TM_GMTOFF 1" >>confdefs.h fi echo -n "checking for timezone variable ... " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { long int i; i = 1 - timezone; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBBURNIA_TIMEZONE="timezone" else LIBBURNIA_TIMEZONE="0" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext echo "$LIBBURNIA_TIMEZONE" if test x$LIBBURNIA_TIMEZONE = xtimezone then $as_echo "#define Libburnia_timezonE timezone" >>confdefs.h else $as_echo "#define Libburnia_timezonE 0" >>confdefs.h fi THREAD_LIBS=-lpthread ARCH="" LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig { $as_echo "$as_me:${as_lineno-$LINENO}: checking target operating system" >&5 $as_echo_n "checking target operating system... " >&6; } LIBBURNIA_SUPP_ACL=none LIBBURNIA_SUPP_FATTR=none LIBBURNIA_LDCONFIG_CMD="echo 'No ldconfig run performed. If needed, configure manually for:'" case $target in *-*-linux*) ARCH=linux LIBBURN_ARCH_LIBS= LIBBURNIA_SUPP_ACL=libacl LIBBURNIA_SUPP_FATTR=xattr LIBBURNIA_LDCONFIG_CMD=ldconfig ;; *-*-freebsd*) ARCH=freebsd LIBBURN_ARCH_LIBS=-lcam LIBBURNIA_SUPP_ACL=libacl LIBBURNIA_SUPP_FATTR=extattr # This may later be overridden by configure --enable-libdir-pkgconfig LIBBURNIA_PKGCONFDIR=$(echo "$libdir" | sed 's/\/lib$/\/libdata/')/pkgconfig ;; *-kfreebsd*-gnu*) ARCH=freebsd LIBBURN_ARCH_LIBS=-lcam ;; *-solaris*) ARCH=solaris LIBBURN_ARCH_LIBS=-lvolmgt ;; *) ARCH= LIBBURN_ARCH_LIBS= # AC_ERROR([You are attempting to compile for an unsupported platform]) ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ARCH" >&5 $as_echo "$ARCH" >&6; } # Do not link libcam or libvolmgt if not available. # (They are indirect dependency on FreeBSD or Solaris.) libburnia_save_LIBS="$LIBS" if test "x$LIBBURN_ARCH_LIBS" = x then dummy=dummy else LIBS="$LIBS $LIBBURN_ARCH_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { printf("Hello\n"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : archlibs_test="yes" else archlibs_test="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$libburnia_save_LIBS" if test x$archlibs_test = xno then if test x"optional" = xmandatory then echo >&2 echo "FATAL: Test linking with mandatory library options failed: $LIBBURN_ARCH_LIBS" >&2 echo >&2 (exit 1); exit 1; else echo "disabled linking with $LIBBURN_ARCH_LIBS (because not found)" LIBBURN_ARCH_LIBS="" fi else echo "enabled linking with $LIBBURN_ARCH_LIBS" fi fi ### for testing --enable-libdir-pkgconfig on Linux ### LIBBURNIA_PKGCONFDIR="$libdir"data/pkgconfig if test "x$LIBBURNIA_PKGCONFDIR" = "x$libdir"/pkgconfig then dummy=dummy else # Check whether --enable-libdir-pkgconfig was given. if test "${enable_libdir_pkgconfig+set}" = set; then : enableval=$enable_libdir_pkgconfig; else enable_libdir_pkgconfig="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-libdir-pkgconfig" >&5 $as_echo_n "checking for --enable-libdir-pkgconfig... " >&6; } if test "x$enable_libdir_pkgconfig" = xyes then LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_libdir_pkgconfig" >&5 $as_echo "$enable_libdir_pkgconfig" >&6; } fi libburnia_pkgconfig_override="no" # Check whether --enable-pkgconfig-path was given. if test "${enable_pkgconfig_path+set}" = set; then : enableval=$enable_pkgconfig_path; libburnia_pkgconfig_override="yes" else enable_pkgconfig_path="none" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for overridden pkgconfig directory path" >&5 $as_echo_n "checking for overridden pkgconfig directory path... " >&6; } if test "x$enable_pkgconfig_path" = xno then libburnia_pkgconfig_override="no" fi if test "x$enable_pkgconfig_path" = x -o "x$enable_pkgconfig_path" = xyes then libburnia_pkgconfig_override="invalid argument" fi if test "x$libburnia_pkgconfig_override" = xyes then LIBBURNIA_PKGCONFDIR="$enable_pkgconfig_path" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBBURNIA_PKGCONFDIR" >&5 $as_echo "$LIBBURNIA_PKGCONFDIR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libburnia_pkgconfig_override" >&5 $as_echo "$libburnia_pkgconfig_override" >&6; } fi ### AC_MSG_RESULT([LIBBURNIA_PKGCONFDIR = $LIBBURNIA_PKGCONFDIR]) 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 # Check whether --enable-libreadline was given. if test "${enable_libreadline+set}" = set; then : enableval=$enable_libreadline; else enable_libreadline=yes fi if test x$enable_libreadline = xyes; then READLINE_DEF="-DXorriso_with_readlinE" if test x$XORRISO_OLD_READLINE_CONFIGURE = x then if test x$XORRISO_ASSUME_READLINE = x then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for desired functions in libreadline" >&5 $as_echo_n "checking for desired functions in libreadline... " >&6; } readline_msg= libburnia_save_LIBS="$LIBS" LIBS="$LIBS -lreadline" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include #include #include #include int main () { HIST_ENTRY **hl; readline(""); add_history(""); hl= history_list(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : readline_test="yes" else readline_test="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test x$readline_test = xno then LIBS="$libburnia_save_LIBS" LIBS="$LIBS -lreadline -lcurses" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include #include #include #include int main () { HIST_ENTRY **hl; readline(""); add_history(""); hl= history_list(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : readline_test="yes" else readline_test="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test x$readline_test = xyes then readline_msg=", with -lcurses" fi fi if test x$readline_test = xno then READLINE_DEF= LIBS="$libburnia_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $readline_test $readline_msg" >&5 $as_echo "$readline_test $readline_msg" >&6; } fi else ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" if test "x$ac_cv_header_readline_readline_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } if test "x$ac_cv_lib_readline_readline" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBREADLINE 1 _ACEOF LIBS="-lreadline $LIBS" else READLINE_DEF= fi else READLINE_DEF= fi ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default" if test "x$ac_cv_header_readline_history_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for add_history in -lreadline" >&5 $as_echo_n "checking for add_history in -lreadline... " >&6; } if ${ac_cv_lib_readline_add_history+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char add_history (); int main () { return add_history (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_readline_add_history=yes else ac_cv_lib_readline_add_history=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_add_history" >&5 $as_echo "$ac_cv_lib_readline_add_history" >&6; } if test "x$ac_cv_lib_readline_add_history" = xyes; then : X= else READLINE_DEF= fi else READLINE_DEF= fi 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 # Check whether --enable-libedit was given. if test "${enable_libedit+set}" = set; then : enableval=$enable_libedit; else enable_libedit=$libedit_deflt fi if test x$enable_libedit = xyes; then READLINE_DEF="-DXorriso_with_editlinE" if test x$XORRISO_ASSUME_EDITLINE = x then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for desired functions in libedit" >&5 $as_echo_n "checking for desired functions in libedit... " >&6; } libburnia_save_LIBS="$LIBS" LIBS="$LIBS -ledit" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include #include #include int main () { 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); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : editline_test="yes" else editline_test="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test x$editline_test = xno then LIBS="$libburnia_save_LIBS" LIBS="$LIBS -ledit" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include #include #include int main () { 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); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : editline_test="yes" else editline_test="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test x$editline_test = xno then READLINE_DEF= LIBS="$libburnia_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $editline_test $editline_msg" >&5 $as_echo "$editline_test $editline_msg" >&6; } fi else READLINE_DEF= echo "disabled libedit" fi fi # Check whether --enable-libacl was given. if test "${enable_libacl+set}" = set; then : enableval=$enable_libacl; else enable_libacl=yes fi LIBACL_DEF= if test x$LIBBURNIA_SUPP_ACL = xlibacl then if test x$enable_libacl = xyes; then LIBACL_DEF="-DLibisofs_with_aaip_acL" has_acl_h_but_no_func=0 ac_fn_c_check_header_mongrel "$LINENO" "sys/acl.h" "ac_cv_header_sys_acl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_acl_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_to_text in -lacl" >&5 $as_echo_n "checking for acl_to_text in -lacl... " >&6; } if ${ac_cv_lib_acl_acl_to_text+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lacl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char acl_to_text (); int main () { return acl_to_text (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_acl_acl_to_text=yes else ac_cv_lib_acl_acl_to_text=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_acl_acl_to_text" >&5 $as_echo "$ac_cv_lib_acl_acl_to_text" >&6; } if test "x$ac_cv_lib_acl_acl_to_text" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBACL 1 _ACEOF LIBS="-lacl $LIBS" else has_acl_h_but_no_libacl=1 fi else LIBACL_DEF= fi if test "$has_acl_h_but_no_libacl" = 1 then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_to_text in -lc" >&5 $as_echo_n "checking for acl_to_text in -lc... " >&6; } if ${ac_cv_lib_c_acl_to_text+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char acl_to_text (); int main () { return acl_to_text (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_acl_to_text=yes else ac_cv_lib_c_acl_to_text=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_acl_to_text" >&5 $as_echo "$ac_cv_lib_c_acl_to_text" >&6; } if test "x$ac_cv_lib_c_acl_to_text" = xyes; then : X= else LIBACL_DEF= fi fi fi fi if test x$LIBACL_DEF = x-DLibisofs_with_aaip_acL then if test x$has_acl_h_but_no_libacl = x1 then echo "enabled local processing of ACL" else echo "enabled libacl, local processing of ACL" fi else echo "disabled local processing of ACL" fi # Check whether --enable-xattr was given. if test "${enable_xattr+set}" = set; then : enableval=$enable_xattr; else enable_xattr=yes fi XATTR_DEF= if test x"$LIBBURNIA_SUPP_FATTR" = xxattr then if test "x$enable_xattr" = xyes; then XATTR_DEF="-DLibisofs_with_aaip_xattR" ac_fn_c_check_header_mongrel "$LINENO" "attr/xattr.h" "ac_cv_header_attr_xattr_h" "$ac_includes_default" if test "x$ac_cv_header_attr_xattr_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for listxattr in -lc" >&5 $as_echo_n "checking for listxattr in -lc... " >&6; } if ${ac_cv_lib_c_listxattr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char listxattr (); int main () { return listxattr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_listxattr=yes else ac_cv_lib_c_listxattr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_listxattr" >&5 $as_echo "$ac_cv_lib_c_listxattr" >&6; } if test "x$ac_cv_lib_c_listxattr" = xyes; then : X= else XATTR_DEF= fi else XATTR_DEF= fi fi elif test x"$LIBBURNIA_SUPP_FATTR" = xextattr then if test "x$enable_xattr" = xyes; then XATTR_DEF="-DLibisofs_with_freebsd_extattR" ac_fn_c_check_header_mongrel "$LINENO" "sys/extattr.h" "ac_cv_header_sys_extattr_h" "$ac_includes_default" if test "x$ac_cv_header_sys_extattr_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extattr_list_file in -lc" >&5 $as_echo_n "checking for extattr_list_file in -lc... " >&6; } if ${ac_cv_lib_c_extattr_list_file+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char extattr_list_file (); int main () { return extattr_list_file (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_extattr_list_file=yes else ac_cv_lib_c_extattr_list_file=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_extattr_list_file" >&5 $as_echo "$ac_cv_lib_c_extattr_list_file" >&6; } if test "x$ac_cv_lib_c_extattr_list_file" = xyes; then : X= else XATTR_DEF= fi else XATTR_DEF= fi fi fi if test x$XATTR_DEF = x-DLibisofs_with_aaip_xattR then echo "enabled xattr, local processing of extended file attributes Linux style" elif test x$XATTR_DEF = x-DLibisofs_with_freebsd_extattR then echo "enabled extattr, local processing of extended file attributes FreeBSD style" else echo "disabled local processing of extended file attributes" fi # Check whether --enable-zlib was given. if test "${enable_zlib+set}" = set; then : enableval=$enable_zlib; else enable_zlib=yes fi if test x$enable_zlib = xyes; then ZLIB_DEF="-DLibisofs_with_zliB" ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compressBound in -lz" >&5 $as_echo_n "checking for compressBound in -lz... " >&6; } if ${ac_cv_lib_z_compressBound+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char compressBound (); int main () { return compressBound (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_compressBound=yes else ac_cv_lib_z_compressBound=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compressBound" >&5 $as_echo "$ac_cv_lib_z_compressBound" >&6; } if test "x$ac_cv_lib_z_compressBound" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" else ZLIB_DEF= fi else ZLIB_DEF= fi else ZLIB_DEF= fi # Check whether --enable-libjte was given. if test "${enable_libjte+set}" = set; then : enableval=$enable_libjte; else enable_libjte=yes fi if test "x$enable_libjte" = xyes; then LIBJTE_DEF="-DXorriso_with_libjtE" ac_fn_c_check_header_mongrel "$LINENO" "libjte/libjte.h" "ac_cv_header_libjte_libjte_h" "$ac_includes_default" if test "x$ac_cv_header_libjte_libjte_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libjte_set_checksum_algorithm in -ljte" >&5 $as_echo_n "checking for libjte_set_checksum_algorithm in -ljte... " >&6; } if ${ac_cv_lib_jte_libjte_set_checksum_algorithm+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljte $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libjte_set_checksum_algorithm (); int main () { return libjte_set_checksum_algorithm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_jte_libjte_set_checksum_algorithm=yes else ac_cv_lib_jte_libjte_set_checksum_algorithm=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jte_libjte_set_checksum_algorithm" >&5 $as_echo "$ac_cv_lib_jte_libjte_set_checksum_algorithm" >&6; } if test "x$ac_cv_lib_jte_libjte_set_checksum_algorithm" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBJTE 1 _ACEOF LIBS="-ljte $LIBS" else LIBJTE_DEF= fi else LIBJTE_DEF= fi else LIBJTE_DEF= fi case $host_os in cygwin*|mingw*) default_libcdio=yes ;; *) default_libcdio=no ;; esac # Check whether --enable-libcdio was given. if test "${enable_libcdio+set}" = set; then : enableval=$enable_libcdio; else enable_libcdio=$default_libcdio fi if test x$enable_libcdio = xyes; then LIBCDIO_DEF="-DLibburn_use_libcdiO" ac_fn_c_check_header_mongrel "$LINENO" "cdio/cdio.h" "ac_cv_header_cdio_cdio_h" "$ac_includes_default" if test "x$ac_cv_header_cdio_cdio_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmc_last_cmd_sense in -lcdio" >&5 $as_echo_n "checking for mmc_last_cmd_sense in -lcdio... " >&6; } if ${ac_cv_lib_cdio_mmc_last_cmd_sense+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char mmc_last_cmd_sense (); int main () { return mmc_last_cmd_sense (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdio_mmc_last_cmd_sense=yes else ac_cv_lib_cdio_mmc_last_cmd_sense=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdio_mmc_last_cmd_sense" >&5 $as_echo "$ac_cv_lib_cdio_mmc_last_cmd_sense" >&6; } if test "x$ac_cv_lib_cdio_mmc_last_cmd_sense" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCDIO 1 _ACEOF LIBS="-lcdio $LIBS" else LIBCDIO_DEF= fi else LIBCDIO_DEF= fi 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 # Check whether --enable-external-filters was given. if test "${enable_external_filters+set}" = set; then : enableval=$enable_external_filters; else enable_external_filters=yes fi if test x"$enable_external_filters" = xyes; then EXTF_DEF="-DXorriso_allow_external_filterS" echo "enabled xorriso external filter programs" else EXTF_DEF= echo "disabled xorriso external filter programs" fi # Check whether --enable-external-filters-setuid was given. if test "${enable_external_filters_setuid+set}" = set; then : enableval=$enable_external_filters_setuid; else enable_external_filters_setuid=no fi if test x$enable_external_filters_setuid = xyes; then EXTF_SUID_DEF="-DXorriso_allow_extf_suiD" echo "enabled xorriso external filter programs under setuid" else EXTF_SUID_DEF= echo "disabled xorriso external filter programs under setuid" fi # Check whether --enable-launch-frontend was given. if test "${enable_launch_frontend+set}" = set; then : enableval=$enable_launch_frontend; else enable_launch_frontend=yes fi 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 # Check whether --enable-launch-frontend-setuid was given. if test "${enable_launch_frontend_setuid+set}" = set; then : enableval=$enable_launch_frontend_setuid; else enable_launch_frontend_setuid=no fi 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 # Check whether --enable-dvd-obs-64k was given. if test "${enable_dvd_obs_64k+set}" = set; then : enableval=$enable_dvd_obs_64k; else enable_dvd_obs_64=no fi if test x$enable_dvd_obs_64k = xyes; then XORRISO_DVD_OBS_64K="-DXorriso_dvd_obs_default_64K" echo "enabled xorriso write size default 64 KB on DVD" else XORRISO_DVD_OBS_64K= echo "disabled xorriso write size default 64 KB on DVD" fi # Library versioning normally serves a complex purpose. # Since libisoburn obeys strict ABI backward compatibility, it needs only the # simple feature to declare function names "global:" or "local:". Only the # global ones are visible to applications at library load time. # Check whether --enable-versioned-libs was given. if test "${enable_versioned_libs+set}" = set; then : enableval=$enable_versioned_libs; else enable_versioned_libs=yes fi if test x$enable_versioned_libs = xyes; then vers_libs_test=no libburnia_save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--version-script=$srcdir/libisoburn/libisoburn.ver" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { printf("Hello\n"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : vers_libs_test="yes" else vers_libs_test="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test x$vers_libs_test = xyes then LIBLDFLAGS="-Wl,--version-script=$srcdir/libisoburn/libisoburn.ver" fi LDFLAGS="$libburnia_save_LDFLAGS" if test x$vers_libs_test = xno then echo "disabled strict symbol encapsulation (test failed)" else echo "enabled strict symbol encapsulation" fi else echo "disabled strict symbol encapsulation" fi # Check whether --enable-ldconfig-at-install was given. if test "${enable_ldconfig_at_install+set}" = set; then : enableval=$enable_ldconfig_at_install; else ldconfig_at_install=yes fi if test x$ldconfig_at_install = xyes; then dummy=dummy else LIBBURNIA_LDCONFIG_CMD="echo 'NOTE: ldconfig is disabled. If needed, configure manually for:'" echo "disabled run of ldconfig during installation on GNU/Linux" fi ac_fn_c_check_header_mongrel "$LINENO" "libburn/libburn.h" "ac_cv_header_libburn_libburn_h" "$ac_includes_default" if test "x$ac_cv_header_libburn_libburn_h" = xyes; then : LIBBURNIA_HAVE_LIBBURN=1 else LIBBURNIA_HAVE_LIBBURN=0 fi ac_fn_c_check_header_mongrel "$LINENO" "libisofs/libisofs.h" "ac_cv_header_libisofs_libisofs_h" "$ac_includes_default" if test "x$ac_cv_header_libisofs_libisofs_h" = xyes; then : LIBBURNIA_HAVE_LIBISOFS=1 else LIBBURNIA_HAVE_LIBISOFS=0 fi if test x$LIBBURNIA_HAVE_LIBBURN = x0; then echo "FATAL: Lacking libburn development header file " 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 " 2>&1 echo "HINT: You first have to install libisofs before you can build libisoburn" 2>&1 fi if test x$LIBBURNIA_HAVE_LIBBURN = x0 -o x$LIBBURNIA_HAVE_LIBISOFS = x0; then echo "ABORT: Lacking mandatory prerequisites" 2>&1 exit 1 fi # ------- Visible mark in configure : Start of library check # Check for proper library versions if this is desired. # (It fails too often on too many systems.) # Check whether --enable-pkg-check-modules was given. if test "${enable_pkg_check_modules+set}" = set; then : enableval=$enable_pkg_check_modules; else enable_pkg_check_modules=no fi if test x$enable_pkg_check_modules = xyes; then LIBBURN_REQUIRED=1.5.4 LIBISOFS_REQUIRED=1.5.4 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBBURN" >&5 $as_echo_n "checking for LIBBURN... " >&6; } if test -n "$LIBBURN_CFLAGS"; then pkg_cv_LIBBURN_CFLAGS="$LIBBURN_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libburn-1 >= \$LIBBURN_REQUIRED\""; } >&5 ($PKG_CONFIG --exists --print-errors "libburn-1 >= $LIBBURN_REQUIRED") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBBURN_CFLAGS=`$PKG_CONFIG --cflags "libburn-1 >= $LIBBURN_REQUIRED" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBBURN_LIBS"; then pkg_cv_LIBBURN_LIBS="$LIBBURN_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libburn-1 >= \$LIBBURN_REQUIRED\""; } >&5 ($PKG_CONFIG --exists --print-errors "libburn-1 >= $LIBBURN_REQUIRED") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBBURN_LIBS=`$PKG_CONFIG --libs "libburn-1 >= $LIBBURN_REQUIRED" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBBURN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libburn-1 >= $LIBBURN_REQUIRED" 2>&1` else LIBBURN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libburn-1 >= $LIBBURN_REQUIRED" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBBURN_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libburn-1 >= $LIBBURN_REQUIRED) were not met: $LIBBURN_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBBURN_CFLAGS and LIBBURN_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables LIBBURN_CFLAGS and LIBBURN_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else LIBBURN_CFLAGS=$pkg_cv_LIBBURN_CFLAGS LIBBURN_LIBS=$pkg_cv_LIBBURN_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBISOFS" >&5 $as_echo_n "checking for LIBISOFS... " >&6; } if test -n "$LIBISOFS_CFLAGS"; then pkg_cv_LIBISOFS_CFLAGS="$LIBISOFS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libisofs-1 >= \$LIBISOFS_REQUIRED\""; } >&5 ($PKG_CONFIG --exists --print-errors "libisofs-1 >= $LIBISOFS_REQUIRED") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBISOFS_CFLAGS=`$PKG_CONFIG --cflags "libisofs-1 >= $LIBISOFS_REQUIRED" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBISOFS_LIBS"; then pkg_cv_LIBISOFS_LIBS="$LIBISOFS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libisofs-1 >= \$LIBISOFS_REQUIRED\""; } >&5 ($PKG_CONFIG --exists --print-errors "libisofs-1 >= $LIBISOFS_REQUIRED") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBISOFS_LIBS=`$PKG_CONFIG --libs "libisofs-1 >= $LIBISOFS_REQUIRED" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBISOFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libisofs-1 >= $LIBISOFS_REQUIRED" 2>&1` else LIBISOFS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libisofs-1 >= $LIBISOFS_REQUIRED" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBISOFS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libisofs-1 >= $LIBISOFS_REQUIRED) were not met: $LIBISOFS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBISOFS_CFLAGS and LIBISOFS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables LIBISOFS_CFLAGS and LIBISOFS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else LIBISOFS_CFLAGS=$pkg_cv_LIBISOFS_CFLAGS LIBISOFS_LIBS=$pkg_cv_LIBISOFS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi if test x$LIBCDIO_DEF = x; then dummy=dummy else LIBCDIO_REQUIRED=0.83 pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBCDIO" >&5 $as_echo_n "checking for LIBCDIO... " >&6; } if test -n "$LIBCDIO_CFLAGS"; then pkg_cv_LIBCDIO_CFLAGS="$LIBCDIO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcdio >= \$LIBCDIO_REQUIRED\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcdio >= $LIBCDIO_REQUIRED") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBCDIO_CFLAGS=`$PKG_CONFIG --cflags "libcdio >= $LIBCDIO_REQUIRED" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBCDIO_LIBS"; then pkg_cv_LIBCDIO_LIBS="$LIBCDIO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcdio >= \$LIBCDIO_REQUIRED\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcdio >= $LIBCDIO_REQUIRED") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBCDIO_LIBS=`$PKG_CONFIG --libs "libcdio >= $LIBCDIO_REQUIRED" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBCDIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcdio >= $LIBCDIO_REQUIRED" 2>&1` else LIBCDIO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcdio >= $LIBCDIO_REQUIRED" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBCDIO_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libcdio >= $LIBCDIO_REQUIRED) were not met: $LIBCDIO_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBCDIO_CFLAGS and LIBCDIO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables LIBCDIO_CFLAGS and LIBCDIO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else LIBCDIO_CFLAGS=$pkg_cv_LIBCDIO_CFLAGS LIBCDIO_LIBS=$pkg_cv_LIBCDIO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi else echo "checking for LIBBURN... skipped, no --enable-pkg-check-modules" echo "checking for LIBISOFS... skipped, no --enable-pkg-check-modules" if test x$LIBCDIO_DEF = x; then dummy=dummy else echo "checking for LIBCDIO... skipped, no --enable-pkg-check-modules" fi fi # ------- Visible mark in configure : End of library check # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; else enable_debug=yes fi if test x$enable_debug != xyes; then if test x$GCC = xyes; then CFLAGS="-O3 $CFLAGS" CFLAGS="-fexpensive-optimizations $CFLAGS" fi CFLAGS="-DNDEBUG $CFLAGS" else if test x$GCC = xyes; then CFLAGS="-g -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-char-subscripts $CFLAGS" fi CFLAGS="-DDEBUG $CFLAGS" fi CFLAGS="$READLINE_DEF $LIBACL_DEF $XATTR_DEF $EXTF_DEF $EXTF_SUID_DEF $LFRONT_DEF $LFRONT_SUID_DEF $ZLIB_DEF $LIBJTE_DEF $XORRISO_DVD_OBS_64K $CFLAGS" ac_config_files="$ac_config_files Makefile doc/doxygen.conf version.h libisoburn-1.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by libisoburn $as_me 1.5.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ libisoburn config.status 1.5.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/doxygen.conf") CONFIG_FILES="$CONFIG_FILES doc/doxygen.conf" ;; "version.h") CONFIG_FILES="$CONFIG_FILES version.h" ;; "libisoburn-1.pc") CONFIG_FILES="$CONFIG_FILES libisoburn-1.pc" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi libisoburn-1.5.4/missing0000755000175700017510000001533014005267031012221 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libisoburn-1.5.4/Makefile.am0000644000175700017510000002115413701321754012664 00000000000000 # Copyright (C) 2006 - 2008 Vreixo Formoso # Copyright (C) 2008 - 2019 Thomas Schmitt # 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) libincludedir=$(includedir)/libisoburn lib_LTLIBRARIES = libisoburn/libisoburn.la ACLOCAL_AMFLAGS = -I ./ ## ========================================================================= ## # Build libraries libisoburn_libisoburn_la_LDFLAGS = \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) $(LIBLDFLAGS) libisoburn_libisoburn_la_SOURCES = \ libisoburn/isoburn.h \ libisoburn/libisoburn.h \ libisoburn/burn_wrap.c \ libisoburn/data_source.c \ libisoburn/isoburn.c \ libisoburn/isofs_wrap.c \ \ xorriso/xorriso.h \ xorriso/xorriso_private.h \ xorriso/sfile.h \ xorriso/sfile.c \ xorriso/aux_objects.h \ xorriso/aux_objects.c \ xorriso/findjob.h \ xorriso/findjob.c \ xorriso/check_media.h \ xorriso/check_media.c \ xorriso/misc_funct.h \ xorriso/misc_funct.c \ xorriso/text_io.h \ xorriso/text_io.c \ xorriso/match.h \ xorriso/match.c \ xorriso/emulators.h \ xorriso/emulators.c \ xorriso/disk_ops.h \ xorriso/disk_ops.c \ xorriso/cmp_update.h \ xorriso/cmp_update.c \ xorriso/parse_exec.h \ xorriso/parse_exec.c \ xorriso/opts_a_c.c \ xorriso/opts_d_h.c \ xorriso/opts_i_o.c \ xorriso/opts_p_z.c \ \ xorriso/xorrisoburn.h \ xorriso/base_obj.h \ xorriso/base_obj.c \ xorriso/lib_mgt.h \ xorriso/lib_mgt.c \ xorriso/sort_cmp.h \ xorriso/sort_cmp.c \ xorriso/drive_mgt.h \ xorriso/drive_mgt.c \ xorriso/iso_img.h \ xorriso/iso_img.c \ xorriso/iso_tree.h \ xorriso/iso_tree.c \ xorriso/iso_manip.h \ xorriso/iso_manip.c \ xorriso/write_run.h \ xorriso/write_run.c \ xorriso/read_run.h \ xorriso/read_run.c \ xorriso/filters.h \ xorriso/filters.c \ xorriso/xorriso_timestamp.h \ xorriso/xorriso_buildstamp.h libisoburn_libisoburn_la_LIBADD = \ $(THREAD_LIBS) \ -lisofs \ -lburn libinclude_HEADERS = \ libisoburn/libisoburn.h \ xorriso/xorriso.h # libisoburn_libisoburn_la_CFLAGS = $(READLINE_DEF) $(LIBACL_DEF) $(XATTR_DEF) \ # $(EXTF_DEF) $(EXTF_SUID_DEF) $(ZLIB_DEF) \ # $(XORRISO_DVD_OBS_64K) ## ========================================================================= ## # This is the reference application of libisoburn. See man xorriso/xorriso.1 # bin_PROGRAMS = \ xorriso/xorriso # This looks quite ugly with make install: xorriso.c is compiled twice again # # Trying to create a build timestamp file # # BUILT_SOURCES = xorriso/xorriso_buildstamp.h # # phony targets get rebuilt every time # # .PHONY: xorriso/xorriso_buildstamp.h # xorriso/xorriso_buildstamp.h: # date -u '+#define Xorriso_build_timestamP "%Y.%m.%d.%H%M%S"' >xorriso/xorriso_buildstamp.h # cat xorriso/xorriso_buildstamp.h xorriso_xorriso_CPPFLAGS = -Ilibisoburn # xorriso_xorriso_CFLAGS = $(READLINE_DEF) $(LIBACL_DEF) $(XATTR_DEF) \ # $(EXTF_DEF) $(EXTF_SUID_DEF) $(ZLIB_DEF) \ # $(XORRISO_DVD_OBS_64K) xorriso_xorriso_LDADD = libisoburn/libisoburn.la -lisofs -lburn \ $(THREAD_LIBS) $(LIBBURN_ARCH_LIBS) xorriso_xorriso_SOURCES = \ xorriso/xorriso.h \ xorriso/xorriso_main.c # Install symbolic links to the xorriso binary # install-exec-hook: if test -e "$(DESTDIR)$(bindir)"/xorrisofs ; then rm "$(DESTDIR)$(bindir)"/xorrisofs ; else echo ; fi ln -s xorriso "$(DESTDIR)$(bindir)"/xorrisofs if test -e "$(DESTDIR)$(bindir)"/osirrox ; then rm "$(DESTDIR)$(bindir)"/osirrox ; else echo ; fi ln -s xorriso "$(DESTDIR)$(bindir)"/osirrox if test -e "$(DESTDIR)$(bindir)"/xorrecord ; then rm "$(DESTDIR)$(bindir)"/xorrecord ; else echo ; fi ln -s xorriso "$(DESTDIR)$(bindir)"/xorrecord $(LIBBURNIA_LDCONFIG_CMD) "$(DESTDIR)$(libdir)" || echo 'NOTE: Explicit dynamic library configuration failed. If needed, configure manually for:' "$(DESTDIR)$(libdir)" # Alternative to the disabled .PHONY above. # Trying to create a build timestamp file semi-manually: make buildstamped # buildstamp: date -u '+#define Xorriso_build_timestamP "%Y.%m.%d.%H%M%S"' >xorriso/xorriso_buildstamp.h cat xorriso/xorriso_buildstamp.h # For now make buildstamped has to be performed explicitly. buildstamped: buildstamp make # "make clean" shall remove a few stubborn .libs directories # which George Danchev reported Dec 03 2011. # Learned from: http://www.gnu.org/software/automake/manual/automake.html#Clean clean-local: -rm -rf test/.libs # Will be executed by "make check" check-local: xorriso/xorriso -no_rc -version -list_extras all ## Build companion applications noinst_PROGRAMS = \ test/compare_file \ xorriso/make_xorriso_1 # A program to compare two files in mirrored trees in mounted filesystems # To compare tree /media/dvd and /original/dir : # find /media/dvd -exec test/compare_file '{}' /media/dvd /original/dir ';' # test_compare_file_CPPFLAGS = test_compare_file_CFLAGS = test_compare_file_LDADD = test_compare_file_SOURCES = test/compare_file.c # Specialized converter from xorriso/xorriso.texi to xorriso/xorriso.1 # xorriso_make_xorriso_1_CPPFLAGS = xorriso_make_xorriso_1_CFLAGS = xorriso_make_xorriso_1_LDADD = xorriso_make_xorriso_1_SOURCES = xorriso/make_xorriso_1.c # A Proof-of-concept for frontends, 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) webhost = http://libburn-api.pykix.org webpath = / docdir = $(DESTDIR)$(prefix)/share/doc/$(PACKAGE)-$(VERSION) doc: doc/html doc/html: doc/doxygen.conf if [ -f ./doc/doc.lock ]; then \ $(RM) -r doc/html; \ doxygen doc/doxygen.conf; \ fi doc-upload: doc/html scp -r $. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libisoburn-1.5.4/ChangeLog0000644000175700017510000012426514005266452012412 00000000000000libisoburn-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 =============================================================================== libisoburn novelties: * New isoburn_ropt_set_extensions() option isoburn_ropt_nomd5tag xorriso novelties: * Bug fix: xorrisofs did not work under growisofs -M (version 1.0.0 was ok) * Bug fix: -as mkisofs -C attempted to read volume header of blank media * Bug fix: -as mkisofs -old-root did not work with -graft-points * Bug fix: -as mkisofs -partition_hd_cyl had no effect * Bug fix: -as mkisofs did not properly unescape target part of pathspecs * Bug fix: isohybrid image size was not aligned to cylinder boundary * Bug fix: Compilation without zlib failed * New -padding modes "included" and "appended" * New bootspec partition_cyl_align=, new -as mkisofs option -partition_cyl_align * New -as mkisofs and -as cdrecord option --no_rc * Own man page and info document for xorrisofs libisoburn-1.0.2.pl00.tar.gz Mon Feb 23 2011 =============================================================================== libisoburn novelties: * Removed compiler obstacles of GNU xorriso on Solaris 9 * New isoburn_igopt_set_extensions() option isoburn_igopt_old_empty xorriso novelties: * Bug fix: Images produced with -for_backup might be unreadable and also fail -check_md5 verification. * Bug fix: mkisofs emulation options -l , -full-iso9660-filenames did not work. * Bug fix: Option -mkdir yielded SIGSEGV due to a NULL pointer * Bug fix: ECMA-119 standards violation with Volume Descriptor Set Terminator * New options -clone and -cp_clone * New -find actions update_merge, rm_merge, clear_merge * New -as mkisofs option -max-iso9660-filenames * New -as mkisofs option --old-empty * New -as mkisofs options -root , -old-root * New -as mkisofs options --old-root-no-md5, --old-root-no-ino, --old-root-dev libisoburn-1.0.0.pl00.tar.gz Mon Jan 17 2011 =============================================================================== libisoburn novelties: * New API call isoburn_igopt_set_untranslated_name_len() xorriso novelties: * Bug fix: -as mkisofs -print-size did not account for -partition_offset * Default -abort_on value is now "FAILURE" with batch and "NEVER" with dialog * New -compliance options untranslated_names , untranslated_name_len= * New -as mkisofs option -untranslated_name_len * New -compliance option iso_9660_1999, -as mkisofs option -iso-level 4 * New -compliance option iso_9660_level=number * New -compliance option allow_dir_id_ext, -as mkisofs -disallow_dir_id_ext * Disabled TOC emulation with -as mkisofs. May be re-enabled by --emul-toc. libisoburn-0.6.6.pl00.tar.gz Sun Dec 12 2010 =============================================================================== libisoburn novelties: * New API calls isoburn_igopt_set_disc_label(), isoburn_igopt_get_disc_label() * New API calls isoburn_ropt_set_displacement(), isoburn_ropt_get_displacement() xorriso novelties: * Bug fix: -as mkisofs -print-size printed the size but also produced ISO image * Build problem fix on Linux 2.4 in GNU xorriso libjte/checksum.c * New -as mkisofs option -joliet-long * New bootspec sparc_label=, new -as mkisofs options -sparc-boot , -sparc-label * New option -displacement libisoburn-0.6.4.pl00.tar.gz Tue Oct 26 2010 =============================================================================== libisoburn novelties: * New API call isoburn_libjte_req() * New API calls isoburn_igopt_attach_jte() and isoburn_igopt_detach_jte() * New API call isoburn_igopt_set_tail_blocks() * New API call isoburn_libjte_req() xorriso novelties: * New option -jigdo * New -as mkisofs options -jigdo-* and -md5-list as of genisoimage * New -as mkisofs options -checksum_algorithm_iso, -checksum_algorithm_template * New bootspecs mips_path= and mipsel_path= for Debian MIPS releases * New -as mkisofs options -mips-boot and -mipsel-boot * New option -append_partition, -as mkisofs -append_partition libisoburn-0.6.2.pl00.tar.gz Sat Sep 18 2010 =============================================================================== libisoburn novelties: * New API function isoburn_igopt_set_part_offset() * Hiding all non-API symbols from the linker by use of --version-script * Now with history of release notes in ./ChangeLog file. xorriso novelties: * Bug fix: Regression with -hardlinks and -compliance old_rr, 0.4.2, Aug 2009 * New option -preparer_id, -as mkisofs options -p and -preparer * New -boot_image specifier emul_type=none|hard_disk|floppy * New boot_image boot specs partition_offset,partition_hd_cyl,partition_sec_hd * Made behavior of -as mkisofs with unknown options more similar to original * New -as mkisofs option -hard-disk-boot, enabled -b without -no-emul-boot * New -as mkisofs option -e from Fedora genisoimage * New -as mkisofs options -partition_offset,-partition_hd_cyl,-partition_sec_hd libisoburn-0.6.0.pl00.tar.gz Fri Jul 02 2010 =============================================================================== libisoburn novelties: xorriso novelties: * New option -read_mkisofsrc interprets .mkisofsrc To be performed before -as mkisofs. Performed automatically with program alias name "xorrisofs". * Implemented -as mkisofs options -dir-mode, -file-mode, -abstract, -biblio, -copyright * Implemented -as mkisofs options -hide, -hide-joliet, -hide-list, -hide-joliet-list * New -as mkisofs option --boot-catalog-hide * New option -hide, -find action -hide, -find test -hidden * New -boot_image bootspec cat_hidden=on * New options -copyright_file , -biblio_file , -abstract_file * New find test -disk_name * Enabled use of libreadline on Solaris * Bug fix: -check_media patch_lba0= could install wrong image size * Bug fix: -as mkisofs option -volset was wrongly interpreted like -volid libisoburn-0.5.8.pl00.tar.gz Mon Jun 14 2010 =============================================================================== libisoburn novelties: * xorriso source split into more modules, object code moved into libisoburn xorriso novelties: * New write extension option isoburn_igopt_no_emul_toc * New -compliance rule no_emul_toc, new -as mkisofs --no-emul-toc * Implemented -as cdrecord -V * Implemented -as mkisofs options -U, -N, -l, -d, -allow-lowercase libisoburn-0.5.6.pl00.tar.gz Tue May 04 2010 =============================================================================== libisoburn novelties: xorriso novelties: * Allowing up to 32 boot images * New -boot_image bootspecs efi_path=, platform_id=, sel_crit=, id_string=, next * New -as mkisofs options --efi-boot, -eltorito-alt-boot libisoburn-0.5.4.pl00.tar.gz Mon Apr 19 2010 =============================================================================== libisoburn novelties: * New API call isoburn_igopt_set_system_area() * New API call isoburn_igopt_set_pvd_times() * New isoburn_igopt_set_relaxed() options: only_iso_versions, no_j_force_dots xorriso novelties: * New -boot_image any system_area=, -as mkisofs option -G * New -boot_image grub partition_table=on, -as mkisofs --protective-msdos-label * New -boot_image isolinux partition_table=on, -as mkisofs -isohybrid-mbr * New option -volume_date, -as mkisofs --modification-date= * New -find action mkisofs_r,-as mkisofs -r * New -find action sort_weight, -as mkisofs --sort-weight * New -compliance options only_iso_version, no_j_force_dots avoid a bug in GRUB 1.96. They are default now. libisoburn-0.5.2.pl00.tar.gz Tue Mar 30 2010 =============================================================================== xorriso novelties: * xorriso documentation is now based on a hybrid format of Texinfo and man- page. Copies included: .texi, .info, .1 (man page) libisoburn-0.5.0.pl00.tar.gz Tue Feb 22 2010 =============================================================================== xorriso novelties: * The former xorriso-standalone project is now GNU xorriso under GPLv3+. This affects some documentation and the generator script, but not the license of libisoburn or its program xorriso. * Bug fix: xorriso -update_r could lead to SIGSEGV if applied to a data file rather than a directory. * Bug fix on FreeBSD: xorriso could leave the drive tray locked. * New option -scsi_log libisoburn-0.4.8.pl00.tar.gz Tue Jan 26 2010 =============================================================================== xorriso novelties: * Bug fix: xorriso did not blank CD-RW with images that were prepared on hard disk. * New configure option --enable-libcdio for system adapter to libcdio-0.83git libisoburn-0.4.6.pl00.tar.gz Wed Dec 09 2009 =============================================================================== xorriso novelties: * New options -dvd_obs and -stdio_sync * New configure option --enable-dvd-obs-64k libisoburn-0.4.4.pl00.tar.gz Wed Oct 28 2009 =============================================================================== xorriso novelties: * Bug fix: With -as cdrecord : -xa1 and -xamix were ignored although they do matter. * Option -toc now reports the individual media type. E.g. with a DVD+RW: "Media product: RICOHJPN/W11/49 , Ricoh Company Limited" * New option -pvd_info displays image id strings. New options -system_id , - volset_id allow to set such image id strings. * New option -mount_opts tries to circumvent an eventual ban to mount the same device twice. Some Linux systems allow to mount two sessions of the same media only if they get fooled via the loop device. * New option -scdbackup_tag performs the task of the scdbackup MD5 checksum filter inside xorriso. Already fixed by patch releases of xorriso-0.4.2: * Bug fix: -cut_out deleted previously cut-out pieces of the same file * Bug fix libisofs: Filenames could lose blanks during a multi-session cycle * Bug fix: -for_backup did not enable -xattr and -md5 if no drive was chosen yet * Bug fix: xorrisofs -help, xorrecord -help displayed original xorriso -help libisoburn-0.4.2.pl02.tar.gz Thu Oct 08 2009 =============================================================================== * Bug fix: -for_backup did not enable -xattr and -md5 if no drive was chosen yet * Bug fix: xorrisofs -help, xorrecord -help displayed original xorriso -help Libisoburn 0.4.2.pl01 =============================================================================== * Bug fix: xorriso option -cut_out deleted previously cut-out pieces of the same file. The bug was introduced with release 0.1.4 in March 2008. Libisoburn 0.4.2 =============================================================================== * New write options isoburn_igopt_session_md5, isoburn_igopt_file_md5, isoburn_igopt_file_stability allow to record MD5 checksums of session and single data files. * New read option isoburn_ropt_nomd5 allows to read those MD5 sums when importing an ISO image. xorriso novelties: * New option -md5, new -as mkisofs option --md5 allow to record in the image MD5 checksums for the whole session and for each single data file. * New options -check_md5, -check_md5_r allow to verify the whole session or single files by comparing their image data with their MD5 sums. * Options -compare, -compare_r, -update, update_r now can use recorded MD5. * New -find actions check_md5, get_md5, make_md5 allow to check, to display or to recompute MD5 checksums of data files. New find test -has_md5 distinguishes data files which have recorded MD5 from files which have none. * New -find test -has_any_xattr and action get_any_xattr allow to inspect the libisofs specific attributes of namespace "isofs". * Options -lsl and lsdl now display correct link counts if -hardlinks is on. * New option -calm_drive allows to reduce drive noise if no data reading is intended for a while. * New option -list_profiles allows to inquire and process the list of supported media types. * Bug fix: xorriso -as mkisofs did not understand the -C option of growisofs any more. (Already fixed by release 0.4.0.pl01, 20 Jul 2009) libisoburn-0.4.0.pl01.tar.gz Mon Jul 20 2009 =============================================================================== xorriso novelties: * New option -hardlinks enables recording and restoring of hard link relations. * Improved reading performance with -update_r and -extract. * New option -for_backup as shortcut for -acl -xattr -hardlinks * Operators with option -find : -not, -or, -and, (, ), -if, -then, -else * New -find tests -wholename, -prune * Bug fix: SIGSEGV with option -status and no search string * Bug fix: -load volid did not perform pattern search * Bug fix: Copies of overwriteable media on sequential were mistaken in ROM drives Libisoburn 0.4.0.pl01 release notes: * Bug fix: xorriso -as mkisofs did not understand the -C option of growisofs any more libisoburn-0.3.8.pl00.tar.gz Sun Apr 19 2009 =============================================================================== libisoburn novelties: * New API calls isoburn_ropt_set_auto_incharset() and isoburn_ropt_get_auto_incharset() xorriso novelties: * New options -set_filter, -set_filter_r, -find -exec set_filter allow to manipulate the content of data files on the fly. * New option -zisofs, built-in filters --zisofs , --gzip , --gunzip enable compression and decompression of data file content. * New options -external_filter , -unregister_filter, -close_filter_list allow arbitrary external processes to do content filtering. * New options -show_stream, -show_stream_r allow to inspect the origin and the filters of data files in an emerging image. * New option -auto_charset based on xattr "isofs.cs" allows to tag an ISO filesystem image with the character set name that is in use on the current terminal. libisoburn-0.3.6.pl00.tar.gz Mon Mar 16 2009 =============================================================================== xorriso novelties: * Dummy MMC adapter of libburn allows compilation on systems other than Linux, FreeBSD * Default of -compliance has been changed to "old_rr", new rule "new_rr" * New -stream_recording modes with start address or "data". "on" is now 32s. libisoburn-0.3.4.pl00.tar.gz Sun Mar 01 2009 =============================================================================== * New isoburn_read_opts values: isoburn_ropt_noaaip, isoburn_ropt_noacl, isoburn_ropt_noea xorriso novelties: * New option -acl enables ACL import and export * New options -getfacl, -getfacl_r, -setfacl, -setfacl_r, -setfacl_list * New find tests -has_acl, -has_no_acl , new find actions getfacl, setfacl * New option -xattr enables import and export of Extended Attributes * New options -getfattr, -getfattr_r, -setfattr, -setfattr_r, -setfattr_list * New find tests -has_xattr, -has_aaip, new find actions getfattr, setfattr * New -as mkisofs options --acl and --xattr * New option -disk_dev_ino accelerates incremental backups libisoburn-0.3.2.pl00.tar.gz Tue Jan 06 2009 =============================================================================== * New API function isoburn_get_mount_params() * Now depending on libburn-0.6.0 which supports BD-R media xorriso novelties: * Bug fix: Options -extract and -extract_single were enabled with -osirrox off * New options -mount , -mount_cmd , -session_string * New -format modes by_size_ and fast_by_size_ * New option -assert_volid * New option -drive_class for safety management of pseudo-drive access libisoburn-0.3.0.pl00.tar.gz Tue Dec 2 2008 =============================================================================== * Now depending on libisofs-0.6.12 and libburn-0.5.6 to ensure use of their recent bug fixes xorriso novelties: * New options -quoted_path_list, -quoted_not_list * New option -backslash_codes for weird file names and terminal safety * New options -charset, -in_charset, -out_charset * New option -local_charset allows to override locale * New option -application_id * New option -compliance allows certain deviations from standards * Suitable ISOLINUX boot images are made alternatively bootable via an MBR * Bug fix: Forgot exit value registration to -return_with. Thanks to Steve Dodd. * Bug fix: -format as_needed did not recognize unformatted BD-RE * Bug fix: disk patterns with relative addresses were not properly resolved libisoburn-0.2.8.pl00.tar.gz Wed Oct 15 2008 =============================================================================== * Now depending on libisofs-0.6.10 and libburn-0.5.4 to ensure use of their recent bug fixes xorriso novelties: * Ability to write and maintain bootable ISO images based on ISOLINUX * New ./configure option --disable-libreadline to make binary more portable * Bug fix: -as mkisofs -iso-level was accused to be an unknown option * Bug fix: -follow link attributed random target filenames to looping links libisoburn-0.2.6.pl00.tar.gz Sat Sep 20 2008 =============================================================================== xorriso novelties: * Capability to insert and extract files far larger than 4 GB * New option -file_size_limit, -as mkisofs now supports -iso-level 1 to 3 * New option -extract_cut * New -error_behavior "file_extraction" behavior "best_effort" * New option -check_media_defaults * New option -list_delimiter * Bug fix: -format full did not re-format already formatted DVD+RW libisoburn-0.2.4.pl00.tar.gz Mo Aug 25 2008 =============================================================================== xorriso novelties: * New option -check_media * New -find test -damaged, new -find actions "report_damage", "report_lba" * New -error_behavior occasion "file_extraction" libisoburn-0.2.2.pl01.tar.gz Fr Jul 25 2008 =============================================================================== Libisoburn 0.2.2 release notes (Jul 19 2008) * New API function isoburn_prepare_blind_grow() * New flag bits with isoburn_set_msc1(), isoburn_read_iso_head() xorriso novelties: * New option -grow_blindly * Options -C and -M for -as mkisofs emulation * Options for -as cdrecord emulation: -multi, -msinfo, -isosize, tsize, -- grow_overwriteable_iso, write_start_address, * New option -pacifier, more compatible pacifier with -as mkisofs * make install creates aliases as symbolic links: osirrox, xorrisofs, xorrecord * Can serve growisofs if started as xorrisofs, genisofs, mkisofs, genisoimage pl01 changes (Jul 25 2008): * Bug fix: Variable DESTDIR was not properly respected during make install libisoburn-0.2.0.pl00.tar.gz Mon Jun 23 2008 =============================================================================== Libisoburn 0.2.0 release notes: * New API functions isoburn_set_msgs_submit(), isoburn_drive_set_msgs_submit() xorriso novelties: * Bug fix: -chmod unintentionally performed o-x as first operation * New options -cpax, -cp_rx, -cp_rax, -extract to restore files and trees from ISO image to disk filesystem. * New option -paste_in to copy ISO files into parts of disk files * New options -map_l, -compare_l, -update_l, -extract_l libisoburn-0.1.8.pl00.tar.gz Tue Jun 3 2008 =============================================================================== * Bug fix: Major,minor numbers of device files appeared as 0,1 in next session * Bug fix: modifying to overwriteable target yielded unmountable results xorriso novelties: * New option -stream_recording for full speed with DVD-RAM and BD-RE * New options -osirrox and -cpx allow to extract single files from ISO image libisoburn-0.1.6.pl00.tar.gz Mon May 19 2008 =============================================================================== * Support for BD-RE (by depending on libburn-0.4.8) * New API wrapper calls isoburn_toc_*() around libburn TOC inquiry calls * New API call isoburn_read_iso_head() identifies ISO 9660 filesystems * New API call isoburn_set_msc1() (like mount -o sbsector=) xorriso novelties: * Bug fix: -update_r and others did not work properly with relative paths * New options -map and -map_single * New options -not_paths, -not_leaf, -not_list, -not_mgt, -as mkisofs -m * Emulated -toc on overwriteable media, new -toc layout with volume id * New option -load makes alternative sessions accessible * New -blank and -format modes 'as_needed' * New option -list_formats and -format mode 'by_index_' libisoburn-0.1.4.pl00.tar.gz Wed Apr 30 2008 =============================================================================== * Improved performance with reading directory trees * xorriso: Improved attribute transfer from disk for target * xorriso: Incremental backup functionality by new option -update_r * xorriso: Options -cut_out and split_size map byte intervals of oversized files into ISO files * xorriso: Emulation of some basic mkisofs and cdrecord options * Dynamically linkable with release version 0.6.4 of libisofs Version 0.1.2 was not released as libisoburn but only as xorriso standalone version. Wed Mar 12 2008 =============================================================================== * Bug fix: -report_about HINT or higher did not report at all * Bug fix: speed=number without unit or media type letter was always CD speed * Bug fix: it was possible to write to appendable media which was not -indev * Bug fix: -follow param did not work for adding non-directory symbolic links * Bug fix: It was not possible to -add /THIS=a /b=THIS * Improved attribute transfer from disk for implicit target directories * New option -as "cdrecord" emulates a narrow set of cdrecord gestures * New option -as "mkisofs" emulates a narrow set of mkisofs gestures * New option -publisher * New option -errfile_log * Support for DVD+R/DL media * New options -compare, -compare_r and according -find -exec action * New options -update, -update_r and according -find -exec action * New -find actions "rm", "rm_r", new -findx -type "m" -exec "empty_iso_dir" * New option -cut_out libisoburn-0.1.0.pl01.tar.gz Fri Feb 15 2008 =============================================================================== * Initial release of libisoburn/xorriso * libisoburn connects libisofs and libburn * libisoburn emulates multi-session on media without session history * xorriso is an integrated multi-session tool for ISO 9660 Rock Ridge images * due to a subtle mistake in ABI usage with libisofs this release had to be restricted to dynamic linking with exactly libisofs-0.6.2 where the mistake does no harm. A version of libisoburn which is open to all future libisofs versions will be released shortly after libisofs.0.6.4. libisoburn-1.5.4/COPYRIGHT0000644000175700017510000000160013701321754012115 00000000000000Mario Danic , Vreixo Formoso Thomas Schmitt libisoburn is Copyright (C) 2007-2017 Vreixo Formoso, Thomas Schmitt xorriso is Copyright (C) 2007-2017 Thomas Schmitt This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 or later as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA libisoburn-1.5.4/texinfo.tex0000644000175700017510000116703614005267031013034 00000000000000% texinfo.tex -- TeX macros to handle Texinfo files. % % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % \def\texinfoversion{2013-02-01.11} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, % 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as % published by the Free Software Foundation, either version 3 of the % License, or (at your option) any later version. % % This texinfo.tex file is distributed in the hope that it will be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU % General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program. If not, see . % % As a special exception, when this file is read by TeX when processing % a Texinfo source document, you may use the result without % restriction. This Exception is an additional permission under section 7 % of the GNU General Public License, version 3 ("GPLv3"). % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: % http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or % http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or % http://www.gnu.org/software/texinfo/ (the Texinfo home page) % The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. % % Send bug reports to bug-texinfo@gnu.org. Please include including a % complete document in each bug report with which we can reproduce the % problem. Patches are, of course, greatly appreciated. % % To process a Texinfo manual with TeX, it's most reliable to use the % texi2dvi shell script that comes with the distribution. For a simple % manual foo.texi, however, you can get away with this: % tex foo.texi % texindex foo.?? % tex foo.texi % tex foo.texi % dvips foo.dvi -o # or whatever; this makes foo.ps. % The extra TeX runs get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. % % It is possible to adapt texinfo.tex for other languages, to some % extent. You can get the existing language-specific files from the % full Texinfo distribution. % % The GNU Texinfo home page is http://www.gnu.org/software/texinfo. \message{Loading texinfo [version \texinfoversion]:} % If in a .fmt file, print the version number % and turn on active characters that we couldn't do earlier because % they might have appeared in the input file name. \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} \chardef\other=12 % We never want plain's \outer definition of \+ in Texinfo. % For @tex, we can use \tabalign. \let\+ = \relax % Save some plain tex macros whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c \let\ptexcomma=\, \let\ptexdot=\. \let\ptexdots=\dots \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! \let\ptexfootnote=\footnote \let\ptexgtr=> \let\ptexhat=^ \let\ptexi=\i \let\ptexindent=\indent \let\ptexinsert=\insert \let\ptexlbrace=\{ \let\ptexless=< \let\ptexnewwrite\newwrite \let\ptexnoindent=\noindent \let\ptexplus=+ \let\ptexraggedright=\raggedright \let\ptexrbrace=\} \let\ptexslash=\/ \let\ptexstar=\* \let\ptext=\t \let\ptextop=\top {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode % If this character appears in an error message or help string, it % starts a new line in the output. \newlinechar = `^^J % Use TeX 3.0's \inputlineno to get the line number, for better error % messages, but if we're using an old version of TeX, don't do anything. % \ifx\inputlineno\thisisundefined \let\linenumber = \empty % Pre-3.0. \else \def\linenumber{l.\the\inputlineno:\space} \fi % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi \ifx\putworderror\undefined \gdef\putworderror{error}\fi \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi \ifx\putwordin\undefined \gdef\putwordin{in}\fi \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi \ifx\putwordof\undefined \gdef\putwordof{of}\fi \ifx\putwordon\undefined \gdef\putwordon{on}\fi \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi % \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi % \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi % Since the category of space is not known, we have to be careful. \chardef\spacecat = 10 \def\spaceisspace{\catcode`\ =\spacecat} % sometimes characters are active, so we need control sequences. \chardef\ampChar = `\& \chardef\colonChar = `\: \chardef\commaChar = `\, \chardef\dashChar = `\- \chardef\dotChar = `\. \chardef\exclamChar= `\! \chardef\hashChar = `\# \chardef\lquoteChar= `\` \chardef\questChar = `\? \chardef\rquoteChar= `\' \chardef\semiChar = `\; \chardef\slashChar = `\/ \chardef\underChar = `\_ % Ignore a token. % \def\gobble#1{} % The following is used inside several \edef's. \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} % Hyphenation fixes. \hyphenation{ Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script ap-pen-dix bit-map bit-maps data-base data-bases eshell fall-ing half-way long-est man-u-script man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces spell-ing spell-ings stand-alone strong-est time-stamp time-stamps which-ever white-space wide-spread wrap-around } % Margin to add to right of even pages, to left of odd pages. \newdimen\bindingoffset \newdimen\normaloffset \newdimen\pagewidth \newdimen\pageheight % For a final copy, take out the rectangles % that mark overfull boxes (in case you have decided % that the text looks ok even though it passes the margin). % \def\finalout{\overfullrule=0pt } % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. We also make % some effort to order the tracing commands to reduce output in the log % file; cf. trace.sty in LaTeX. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% \def\loggingall{% \tracingstats2 \tracingpages1 \tracinglostchars2 % 2 gives us more in etex \tracingparagraphs1 \tracingoutput1 \tracingmacros2 \tracingrestores1 \showboxbreadth\maxdimen \showboxdepth\maxdimen \ifx\eTeXversion\thisisundefined\else % etex gives us more logging \tracingscantokens1 \tracingifs1 \tracinggroups1 \tracingnesting2 \tracingassigns1 \fi \tracingcommands3 % 3 gives us more in etex \errorcontextlines16 }% % @errormsg{MSG}. Do the index-like expansions on MSG, but if things % aren't perfect, it's not the end of the world, being an error message, % after all. % \def\errormsg{\begingroup \indexnofonts \doerrormsg} \def\doerrormsg#1{\errmessage{#1}} % add check for \lastpenalty to plain's definitions. If the last thing % we did was a \nobreak, we don't want to insert more space. % \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount \removelastskip\penalty-50\smallskip\fi\fi} \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount \removelastskip\penalty-100\medskip\fi\fi} \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount \removelastskip\penalty-200\bigskip\fi\fi} % Do @cropmarks to get crop marks. % \newif\ifcropmarks \let\cropmarks = \cropmarkstrue % % Dimensions to add cropmarks at corners. % Added by P. A. MacKay, 12 Nov. 1986 % \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines \newdimen\cornerlong \cornerlong=1pc \newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in % Output a mark which sets \thischapter, \thissection and \thiscolor. % We dump everything together because we only have one kind of mark. % This works because we only use \botmark / \topmark, not \firstmark. % % A mark contains a subexpression of the \ifcase ... \fi construct. % \get*marks macros below extract the needed part using \ifcase. % % Another complication is to let the user choose whether \thischapter % (\thissection) refers to the chapter (section) in effect at the top % of a page, or that at the bottom of a page. The solution is % described on page 260 of The TeXbook. It involves outputting two % marks for the sectioning macros, one before the section break, and % one after. I won't pretend I can describe this better than DEK... \def\domark{% \toks0=\expandafter{\lastchapterdefs}% \toks2=\expandafter{\lastsectiondefs}% \toks4=\expandafter{\prevchapterdefs}% \toks6=\expandafter{\prevsectiondefs}% \toks8=\expandafter{\lastcolordefs}% \mark{% \the\toks0 \the\toks2 \noexpand\or \the\toks4 \the\toks6 \noexpand\else \the\toks8 }% } % \topmark doesn't work for the very first chapter (after the title % page or the contents), so we use \firstmark there -- this gets us % the mark with the chapter defs, unless the user sneaks in, e.g., % @setcolor (or @url, or @link, etc.) between @contents and the very % first @chapter. \def\gettopheadingmarks{% \ifcase0\topmark\fi \ifx\thischapter\empty \ifcase0\firstmark\fi \fi } \def\getbottomheadingmarks{\ifcase1\botmark\fi} \def\getcolormarks{\ifcase2\topmark\fi} % Avoid "undefined control sequence" errors. \def\lastchapterdefs{} \def\lastsectiondefs{} \def\prevchapterdefs{} \def\prevsectiondefs{} \def\lastcolordefs{} % Main output routine. \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} \newbox\headlinebox \newbox\footlinebox % \onepageout takes a vbox as an argument. Note that \pagecontents % does insertions, but you have to call it yourself. \def\onepageout#1{% \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% % {% % Have to do this stuff outside the \shipout because we want it to % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % \indexdummies % don't expand commands in the output. \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. % We don't want .vr (or whatever) entries like this: % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} % "\acronym" won't work when it's read back in; % it needs to be % {\code {{\tt \backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi % \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize \vskip-\topandbottommargin \vtop to0pt{% \line{\ewtop\hfil\ewtop}% \nointerlineskip \line{% \vbox{\moveleft\cornerthick\nstop}% \hfill \vbox{\moveright\cornerthick\nstop}% }% \vss}% \vskip\topandbottommargin \line\bgroup \hfil % center the page within the outer (page) hsize. \ifodd\pageno\hskip\bindingoffset\fi \vbox\bgroup \fi % \unvbox\headlinebox \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. % (We lessened \vsize for it in \oddfootingyyy.) % The \baselineskip=24pt in plain's \makefootline has no effect. \vskip 24pt \unvbox\footlinebox \fi % \ifcropmarks \egroup % end of \vbox\bgroup \hfil\egroup % end of (centering) \line\bgroup \vskip\topandbottommargin plus1fill minus1fill \boxmaxdepth = \cornerthick \vbox to0pt{\vss \line{% \vbox{\moveleft\cornerthick\nsbot}% \hfill \vbox{\moveright\cornerthick\nsbot}% }% \nointerlineskip \line{\ewbot\hfil\ewbot}% }% \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox }% end of group with \indexdummies \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \newinsert\margin \dimen\margin=\maxdimen \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} {\catcode`\@ =11 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi % marginal hacks, juha@viisa.uucp (Juha Takala) \ifvoid\margin\else % marginal info is present \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi \dimen@=\dp#1\relax \unvbox#1\relax \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } % Here are the rules for the cropmarks. Note that they are % offset so that the space between them is truly \outerhsize or \outervsize % (P. A. MacKay, 12 November, 1986) % \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} \def\nstop{\vbox {\hrule height\cornerthick depth\cornerlong width\cornerthick}} \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} \def\nsbot{\vbox {\hrule height\cornerlong depth\cornerthick width\cornerthick}} % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % \def\parsearg{\parseargusing{}} \def\parseargusing#1#2{% \def\argtorun{#2}% \begingroup \obeylines \spaceisspace #1% \parseargline\empty% Insert the \empty token, see \finishparsearg below. } {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. \argremovecomment #1\comment\ArgTerm% }% } % First remove any @comment, then any @c comment. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} % Each occurrence of `\^^M' or `\^^M' is replaced by a single space. % % \argremovec might leave us with trailing space, e.g., % @end itemize @c foo % This space token undergoes the same procedure and is eventually removed % by \finishparsearg. % \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% \def\temp{#3}% \ifx\temp\empty % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: \let\temp\finishparsearg \else \let\temp\argcheckspaces \fi % Put the space token in: \temp#1 #3\ArgTerm } % If a _delimited_ argument is enclosed in braces, they get stripped; so % to get _exactly_ the rest of the line, we had to prevent such situation. % We prepended an \empty token at the very beginning and we expand it now, % just before passing the control to \argtorun. % (Similarly, we have to think about #3 of \argcheckspacesY above: it is % either the null string, or it ends with \^^M---thus there is no danger % that a pair of braces would be stripped. % % But first, we have to remove the trailing space token. % \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} % \parseargdef\foo{...} % is roughly equivalent to % \def\foo{\parsearg\Xfoo} % \def\Xfoo#1{...} % % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my % favourite TeX trick. --kasal, 16nov03 \def\parseargdef#1{% \expandafter \doparseargdef \csname\string#1\endcsname #1% } \def\doparseargdef#1#2{% \def#2{\parsearg#1}% \def#1##1% } % Several utility definitions with active space: { \obeyspaces \gdef\obeyedspace{ } % Make each space character in the input produce a normal interword % space in the output. Don't allow a line break at this space, as this % is used only in environments like @example, where each line of input % should produce a line of output anyway. % \gdef\sepspaces{\obeyspaces\let =\tie} % If an index command is used in an @example environment, any spaces % therein should become regular spaces in the raw index file, not the % expansion of \tie (\leavevmode \penalty \@M \ ). \gdef\unsepspaces{\let =\space} } \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} % Define the framework for environments in texinfo.tex. It's used like this: % % \envdef\foo{...} % \def\Efoo{...} % % It's the responsibility of \envdef to insert \begingroup before the % actual body; @end closes the group after calling \Efoo. \envdef also % defines \thisenv, so the current environment is known; @end checks % whether the environment name matches. The \checkenv macro can also be % used to check whether the current environment is the one expected. % % Non-false conditionals (@iftex, @ifset) don't fit into this, so they % are not treated as environments; they don't open a group. (The % implementation of @end takes care not to call \endgroup in this % special case.) % At run-time, environments start with this: \def\startenvironment#1{\begingroup\def\thisenv{#1}} % initialize \let\thisenv\empty % ... but they get defined via ``\envdef\foo{...}'': \long\def\envdef#1#2{\def#1{\startenvironment#1#2}} \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} % Check whether we're in the right environment: \def\checkenv#1{% \def\temp{#1}% \ifx\thisenv\temp \else \badenverr \fi } % Environment mismatch, #1 expected: \def\badenverr{% \errhelp = \EMsimple \errmessage{This command can appear only \inenvironment\temp, not \inenvironment\thisenv}% } \def\inenvironment#1{% \ifx#1\empty outside of any environment% \else in environment \expandafter\string#1% \fi } % @end foo executes the definition of \Efoo. % But first, it executes a specialized version of \checkenv % \parseargdef\end{% \if 1\csname iscond.#1\endcsname \else % The general wording of \badenverr may not be ideal. \expandafter\checkenv\csname#1\endcsname \csname E#1\endcsname \endgroup \fi } \newhelp\EMsimple{Press RETURN to continue.} % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and % since \penalty is valid in vertical mode, we'd end up putting the % penalty on the vertical list instead of in the new paragraph. {\catcode`@ = 11 % Avoid using \@M directly, because that causes trouble % if the definition is written into an index file. \global\let\tiepenalty = \@M \gdef\tie{\leavevmode\penalty\tiepenalty\ } } % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } % @* forces a line break. \def\*{\unskip\hfil\break\hbox{}\ignorespaces} % @/ allows a line break. \let\/=\allowbreak % @. is an end-of-sentence period. \def\.{.\spacefactor=\endofsentencespacefactor\space} % @! is an end-of-sentence bang. \def\!{!\spacefactor=\endofsentencespacefactor\space} % @? is an end-of-sentence query. \def\?{?\spacefactor=\endofsentencespacefactor\space} % @frenchspacing on|off says whether to put extra space after punctuation. % \def\onword{on} \def\offword{off} % \parseargdef\frenchspacing{% \def\temp{#1}% \ifx\temp\onword \plainfrenchspacing \else\ifx\temp\offword \plainnonfrenchspacing \else \errhelp = \EMsimple \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% \fi\fi } % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would % produce a whole line of output instead of starting the paragraph. \def\w#1{\leavevmode\hbox{#1}} % @group ... @end group forces ... to be all on one page, by enclosing % it in a TeX vbox. We use \vtop instead of \vbox to construct the box % to keep its height that of a normal line. According to the rules for % \topskip (p.114 of the TeXbook), the glue inserted is % max (\topskip - \ht (first item), 0). If that height is large, % therefore, no glue is inserted, and the space between the headline and % the text is small, which looks bad. % % Another complication is that the group might be very large. This can % cause the glue on the previous page to be unduly stretched, because it % does not have much material. In this case, it's better to add an % explicit \vfill so that the extra space is at the bottom. The % threshold for doing this is if the group is more than \vfilllimit % percent of a page (\vfilllimit can be changed inside of @tex). % \newbox\groupbox \def\vfilllimit{0.7} % \envdef\group{% \ifnum\catcode`\^^M=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi \startsavinginserts % \setbox\groupbox = \vtop\bgroup % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after % the `@group' to put extra space in the output. Since @group % should appear on a line by itself (according to the Texinfo % manual), we don't worry about eating any user text. \comment } % % The \vtop produces a box with normal height and large depth; thus, TeX puts % \baselineskip glue before it, and (when the next line of text is done) % \lineskip glue after it. Thus, space below is not quite equal to space % above. But it's pretty close. \def\Egroup{% % To get correct interline space between the last line of the group % and the first line afterwards, we have to propagate \prevdepth. \endgraf % Not \par, as it may have been set to \lisppar. \global\dimen1 = \prevdepth \egroup % End the \vtop. % \dimen0 is the vertical size of the group's box. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox % \dimen2 is how much space is left on the page (more or less). \dimen2 = \pageheight \advance\dimen2 by -\pagetotal % if the group doesn't fit on the current page, and it's a big big % group, force a page break. \ifdim \dimen0 > \dimen2 \ifdim \pagetotal < \vfilllimit\pageheight \page \fi \fi \box\groupbox \prevdepth = \dimen1 \checkinserts } % % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % \newhelp\groupinvalidhelp{% group can only be used in environments such as @example,^^J% where each line of input produces a line of output.} % @need space-in-mils % forces a page break if there is not space-in-mils remaining. \newdimen\mil \mil=0.001in \parseargdef\need{% % Ensure vertical mode, so we don't make a big box in the middle of a % paragraph. \par % % If the @need value is less than one line space, it's useless. \dimen0 = #1\mil \dimen2 = \ht\strutbox \advance\dimen2 by \dp\strutbox \ifdim\dimen0 > \dimen2 % % Do a \strut just to make the height of this box be normal, so the % normal leading is inserted relative to the preceding line. % And a page break here is fine. \vtop to #1\mil{\strut\vfil}% % % TeX does not even consider page breaks if a penalty added to the % main vertical list is 10000 or more. But in order to see if the % empty box we just added fits on the page, we must make it consider % page breaks. On the other hand, we don't want to actually break the % page after the empty box. So we use a penalty of 9999. % % There is an extremely small chance that TeX will actually break the % page at this \penalty, if there are no other feasible breakpoints in % sight. (If the user is using lots of big @group commands, which % almost-but-not-quite fill up a page, TeX will have a hard time doing % good page breaking, for example.) However, I could not construct an % example where a page broke at this \penalty; if it happens in a real % document, then we can reconsider our strategy. \penalty9999 % % Back up by the size of the box, whether we did a page break or not. \kern -#1\mil % % Do not allow a page break right after this kern. \nobreak \fi } % @br forces paragraph break (and is undocumented). \let\br = \par % @page forces the start of a new page. % \def\page{\par\vfill\supereject} % @exdent text.... % outputs text on separate line in roman font, starting at standard page margin % This records the amount of indent in the innermost environment. % That's how much \exdent should take out. \newskip\exdentamount % This defn is used inside fill environments such as @defun. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} % This defn is used inside nofill environments such as @example. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount \leftline{\hskip\leftskip{\rm#1}}}} % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current % paragraph. For more general purposes, use the \margin insertion % class. WHICH is `l' or `r'. Not documented, written for gawk manual. % \newskip\inmarginspacing \inmarginspacing=1cm \def\strutdepth{\dp\strutbox} % \def\doinmargin#1#2{\strut\vadjust{% \nobreak \kern-\strutdepth \vtop to \strutdepth{% \baselineskip=\strutdepth \vss % if you have multiple lines of stuff to put here, you'll need to % make the vbox yourself of the appropriate size. \ifx#1l% \llap{\ignorespaces #2\hskip\inmarginspacing}% \else \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% \fi \null }% }} \def\inleftmargin{\doinmargin l} \def\inrightmargin{\doinmargin r} % % @inmargin{TEXT [, RIGHT-TEXT]} % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; % else use TEXT for both). % \def\inmargin#1{\parseinmargin #1,,\finish} \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \def\lefttext{#1}% have both texts \def\righttext{#2}% \else \def\lefttext{#1}% have only one text \def\righttext{#1}% \fi % \ifodd\pageno \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin \else \def\temp{\inleftmargin\lefttext}% \fi \temp } % @| inserts a changebar to the left of the current line. It should % surround any changed text. This approach does *not* work if the % change spans more than two lines of output. To handle that, we would % have adopt a much more difficult approach (putting marks into the main % vertical list for the beginning and end of each change). This command % is not documented, not supported, and doesn't work. % \def\|{% % \vadjust can only be used in horizontal mode. \leavevmode % % Append this vertical mode material after the current line in the output. \vadjust{% % We want to insert a rule with the height and depth of the current % leading; that is exactly what \strutbox is supposed to record. \vskip-\baselineskip % % \vadjust-items are inserted at the left edge of the type. So % the \llap here moves out into the left-hand margin. \llap{% % % For a thicker or thinner bar, change the `1pt'. \vrule height\baselineskip width1pt % % This is the space between the bar and the text. \hskip 12pt }% }% } % @include FILE -- \input text of FILE. % \def\include{\parseargusing\filenamecatcodes\includezzz} \def\includezzz#1{% \pushthisfilestack \def\thisfile{#1}% {% \makevalueexpandable % we want to expand any @value in FILE. \turnoffactive % and allow special characters in the expansion \indexnofonts % Allow `@@' and other weird things in file names. \wlog{texinfo.tex: doing @include of #1^^J}% \edef\temp{\noexpand\input #1 }% % % This trickery is to read FILE outside of a group, in case it makes % definitions, etc. \expandafter }\temp \popthisfilestack } \def\filenamecatcodes{% \catcode`\\=\other \catcode`~=\other \catcode`^=\other \catcode`_=\other \catcode`|=\other \catcode`<=\other \catcode`>=\other \catcode`+=\other \catcode`-=\other \catcode`\`=\other \catcode`\'=\other } \def\pushthisfilestack{% \expandafter\pushthisfilestackX\popthisfilestack\StackTerm } \def\pushthisfilestackX{% \expandafter\pushthisfilestackY\thisfile\StackTerm } \def\pushthisfilestackY #1\StackTerm #2\StackTerm {% \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% } \def\popthisfilestack{\errthisfilestackempty} \def\errthisfilestackempty{\errmessage{Internal error: the stack of filenames is empty.}} % \def\thisfile{} % @center line % outputs that line, centered. % \parseargdef\center{% \ifhmode \let\centersub\centerH \else \let\centersub\centerV \fi \centersub{\hfil \ignorespaces#1\unskip \hfil}% \let\centersub\relax % don't let the definition persist, just in case } \def\centerH#1{{% \hfil\break \advance\hsize by -\leftskip \advance\hsize by -\rightskip \line{#1}% \break }} % \newcount\centerpenalty \def\centerV#1{% % The idea here is the same as in \startdefun, \cartouche, etc.: if % @center is the first thing after a section heading, we need to wipe % out the negative parskip inserted by \sectionheading, but still % prevent a page break here. \centerpenalty = \lastpenalty \ifnum\centerpenalty>10000 \vskip\parskip \fi \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi \line{\kern\leftskip #1\kern\rightskip}% } % @sp n outputs n lines of vertical space % \parseargdef\sp{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment % \def\comment{\begingroup \catcode`\^^M=\other% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% \commentxxx} {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} % \let\c=\comment % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. % NCHARS can also be the word `asis' or `none'. % We cannot feasibly implement @paragraphindent asis, though. % \def\asisword{asis} % no translation, these are keywords \def\noneword{none} % \parseargdef\paragraphindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \defaultparindent = 0pt \else \defaultparindent = #1em \fi \fi \parindent = \defaultparindent } % @exampleindent NCHARS % We'll use ems for NCHARS like @paragraphindent. % It seems @exampleindent asis isn't necessary, but % I preserve it to make it similar to @paragraphindent. \parseargdef\exampleindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \lispnarrowing = 0pt \else \lispnarrowing = #1em \fi \fi } % @firstparagraphindent WORD % If WORD is `none', then suppress indentation of the first paragraph % after a section heading. If WORD is `insert', then do indent at such % paragraphs. % % The paragraph indentation is suppressed or not by calling % \suppressfirstparagraphindent, which the sectioning commands do. % We switch the definition of this back and forth according to WORD. % By default, we suppress indentation. % \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} \def\insertword{insert} % \parseargdef\firstparagraphindent{% \def\temp{#1}% \ifx\temp\noneword \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent \else\ifx\temp\insertword \let\suppressfirstparagraphindent = \relax \else \errhelp = \EMsimple \errmessage{Unknown @firstparagraphindent option `\temp'}% \fi\fi } % Here is how we actually suppress indentation. Redefine \everypar to % \kern backwards by \parindent, and then reset itself to empty. % % We also make \indent itself not actually do anything until the next % paragraph. % \gdef\dosuppressfirstparagraphindent{% \gdef\indent{% \restorefirstparagraphindent \indent }% \gdef\noindent{% \restorefirstparagraphindent \noindent }% \global\everypar = {% \kern -\parindent \restorefirstparagraphindent }% } \gdef\restorefirstparagraphindent{% \global \let \indent = \ptexindent \global \let \noindent = \ptexnoindent \global \everypar = {}% } % @refill is a no-op. \let\refill=\relax % If working on a large document in chapters, it is convenient to % be able to disable indexing, cross-referencing, and contents, for test runs. % This is done with @novalidate (before @setfilename). % \newif\iflinks \linkstrue % by default we want the aux files. \let\novalidate = \linksfalse % @setfilename is done at the beginning of every texinfo file. % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% \fixbackslash % Turn off hack to swallow `\input texinfo'. \iflinks \tryauxfile % Open the new aux file. TeX will close it automatically at exit. \immediate\openout\auxfile=\jobname.aux \fi % \openindices needs to do some work in any case. \openindices \let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. \openin 1 texinfo.cnf \ifeof 1 \else \input texinfo.cnf \fi \closein 1 % \comment % Ignore the actual filename. } % Called from \setfilename. % \def\openindices{% \newindex{cp}% \newcodeindex{fn}% \newcodeindex{vr}% \newcodeindex{tp}% \newcodeindex{ky}% \newcodeindex{pg}% } % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} \message{pdf,} % adobe `portable' document format \newcount\tempnum \newcount\lnkcount \newtoks\filename \newcount\filenamelength \newcount\pgn \newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD \newbox\boxA \newcount\countA \newif\ifpdf \newif\ifpdfmakepagedest % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 % can be set). So we test for \relax and 0 as well as being undefined. \ifx\pdfoutput\thisisundefined \else \ifx\pdfoutput\relax \else \ifcase\pdfoutput \else \pdftrue \fi \fi \fi % PDF uses PostScript string constants for the names of xref targets, % for display in the outlines, and in other places. Thus, we have to % double any backslashes. Otherwise, a name like "\node" will be % interpreted as a newline (\n), followed by o, d, e. Not good. % % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and % related messages. The final outcome is that it is up to the TeX user % to double the backslashes and otherwise make the string valid, so % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to % do this reliably, so we use it. % #1 is a control sequence in which to do the replacements, % which we \xdef. \def\txiescapepdf#1{% \ifx\pdfescapestring\thisisundefined % No primitive available; should we give a warning or log? % Many times it won't matter. \else % The expandable \pdfescapestring primitive escapes parentheses, % backslashes, and other special chars. \xdef#1{\pdfescapestring{#1}}% \fi } \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images with PDF output, and none of those formats could be found. (.eps cannot be supported due to the design of the PDF format; use regular TeX (DVI output) for that.)} \ifpdf % % Color manipulation macros based on pdfcolor.tex, % except using rgb instead of cmyk; the latter is said to render as a % very dark gray on-screen and a very dark halftone in print, instead % of actual black. \def\rgbDarkRed{0.50 0.09 0.12} \def\rgbBlack{0 0 0} % % k sets the color for filling (usual text, etc.); % K sets the color for stroking (thin rules, e.g., normal _'s). \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} % % Set color, and create a mark which defines \thiscolor accordingly, % so that \makeheadline knows which color to restore. \def\setcolor#1{% \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% \domark \pdfsetcolor{#1}% } % \def\maincolor{\rgbBlack} \pdfsetcolor{\maincolor} \edef\thiscolor{\maincolor} \def\lastcolordefs{} % \def\makefootline{% \baselineskip24pt \line{\pdfsetcolor{\maincolor}\the\footline}% } % \def\makeheadline{% \vbox to 0pt{% \vskip-22.5pt \line{% \vbox to8.5pt{}% % Extract \thiscolor definition from the marks. \getcolormarks % Typeset the headline with \maincolor, then restore the color. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% }% \vss }% \nointerlineskip } % % \pdfcatalog{/PageMode /UseOutlines} % % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). \def\dopdfimage#1#2#3{% \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% % % pdftex (and the PDF format) support .pdf, .png, .jpg (among % others). Let's try in that order, PDF first since if % someone has a scalable image, presumably better to use that than a % bitmap. \let\pdfimgext=\empty \begingroup \openin 1 #1.pdf \ifeof 1 \openin 1 #1.PDF \ifeof 1 \openin 1 #1.png \ifeof 1 \openin 1 #1.jpg \ifeof 1 \openin 1 #1.jpeg \ifeof 1 \openin 1 #1.JPG \ifeof 1 \errhelp = \nopdfimagehelp \errmessage{Could not find image file #1 for pdf}% \else \gdef\pdfimgext{JPG}% \fi \else \gdef\pdfimgext{jpeg}% \fi \else \gdef\pdfimgext{jpg}% \fi \else \gdef\pdfimgext{png}% \fi \else \gdef\pdfimgext{PDF}% \fi \else \gdef\pdfimgext{pdf}% \fi \closein 1 \endgroup % % without \immediate, ancient pdftex seg faults when the same image is % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) \ifnum\pdftexversion < 14 \immediate\pdfimage \else \immediate\pdfximage \fi \ifdim \wd0 >0pt width \pdfimagewidth \fi \ifdim \wd2 >0pt height \pdfimageheight \fi \ifnum\pdftexversion<13 #1.\pdfimgext \else {#1.\pdfimgext}% \fi \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} % \def\pdfmkdest#1{{% % We have to set dummies so commands such as @code, and characters % such as \, aren't expanded when present in a section title. \indexnofonts \turnoffactive \makevalueexpandable \def\pdfdestname{#1}% \txiescapepdf\pdfdestname \safewhatsit{\pdfdest name{\pdfdestname} xyz}% }} % % used to mark target names; must be expandable. \def\pdfmkpgn#1{#1} % % by default, use a color that is dark enough to print on paper as % nearly black, but still distinguishable for online viewing. \def\urlcolor{\rgbDarkRed} \def\linkcolor{\rgbDarkRed} \def\endlink{\setcolor{\maincolor}\pdfendlink} % % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% \else \csname#1\endcsname \fi} \def\advancenumber#1{\tempnum=\expnumber{#1}\relax \advance\tempnum by 1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} % % #1 is the section text, which is what will be displayed in the % outline by the pdf viewer. #2 is the pdf expression for the number % of subentries (or empty, for subsubsections). #3 is the node text, % which might be empty if this toc entry had no corresponding node. % #4 is the page number % \def\dopdfoutline#1#2#3#4{% % Generate a link to the node text if that exists; else, use the % page number. We could generate a destination for the section % text in the case where a section has no node, but it doesn't % seem worth the trouble, since most documents are normally structured. \edef\pdfoutlinedest{#3}% \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}% \else \txiescapepdf\pdfoutlinedest \fi % % Also escape PDF chars in the display string. \edef\pdfoutlinetext{#1}% \txiescapepdf\pdfoutlinetext % \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% } % \def\pdfmakeoutlines{% \begingroup % Read toc silently, to get counts of subentries for \pdfoutline. \def\partentry##1##2##3##4{}% ignore parts in the outlines \def\numchapentry##1##2##3##4{% \def\thischapnum{##2}% \def\thissecnum{0}% \def\thissubsecnum{0}% }% \def\numsecentry##1##2##3##4{% \advancenumber{chap\thischapnum}% \def\thissecnum{##2}% \def\thissubsecnum{0}% }% \def\numsubsecentry##1##2##3##4{% \advancenumber{sec\thissecnum}% \def\thissubsecnum{##2}% }% \def\numsubsubsecentry##1##2##3##4{% \advancenumber{subsec\thissubsecnum}% }% \def\thischapnum{0}% \def\thissecnum{0}% \def\thissubsecnum{0}% % % use \def rather than \let here because we redefine \chapentry et % al. a second time, below. \def\appentry{\numchapentry}% \def\appsecentry{\numsecentry}% \def\appsubsecentry{\numsubsecentry}% \def\appsubsubsecentry{\numsubsubsecentry}% \def\unnchapentry{\numchapentry}% \def\unnsecentry{\numsecentry}% \def\unnsubsecentry{\numsubsecentry}% \def\unnsubsubsecentry{\numsubsubsecentry}% \readdatafile{toc}% % % Read toc second time, this time actually producing the outlines. % The `-' means take the \expnumber as the absolute number of % subentries, which we calculated on our first read of the .toc above. % % We use the node names as the destinations. \def\numchapentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% \def\numsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% \def\numsubsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% \def\numsubsubsecentry##1##2##3##4{% count is always zero \dopdfoutline{##1}{}{##3}{##4}}% % % PDF outlines are displayed using system fonts, instead of % document fonts. Therefore we cannot use special characters, % since the encoding is unknown. For example, the eogonek from % Latin 2 (0xea) gets translated to a | character. Info from % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. % % TODO this right, we have to translate 8-bit characters to % their "best" equivalent, based on the @documentencoding. Too % much work for too little return. Just use the ASCII equivalents % we use for the index sort strings. % \indexnofonts \setupdatafile % We can have normal brace characters in the PDF outlines, unlike % Texinfo index files. So set that up. \def\{{\lbracecharliteral}% \def\}{\rbracecharliteral}% \catcode`\\=\active \otherbackslash \input \tocreadfilename \endgroup } {\catcode`[=1 \catcode`]=2 \catcode`{=\other \catcode`}=\other \gdef\lbracecharliteral[{]% \gdef\rbracecharliteral[}]% ] % \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces \addtokens{\filename}{\PP}% \advance\filenamelength by 1 \fi \nextsp} \def\getfilename#1{% \filenamelength=0 % If we don't expand the argument now, \skipspaces will get % snagged on things like "@value{foo}". \edef\temp{#1}% \expandafter\skipspaces\temp|\relax } \ifnum\pdftexversion < 14 \let \startlink \pdfannotlink \else \let \startlink \pdfstartlink \fi % make a live url in pdf output. \def\pdfurl#1{% \begingroup % it seems we really need yet another set of dummies; have not % tried to figure out what each command should do in the context % of @url. for now, just make @/ a no-op, that's the only one % people have actually reported a problem with. % \normalturnoffactive \def\@{@}% \let\/=\empty \makevalueexpandable % do we want to go so far as to use \indexnofonts instead of just % special-casing \var here? \def\var##1{##1}% % \leavevmode\setcolor{\urlcolor}% \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% \endgroup} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% \expandafter\poptoks\the\toksA|ENDTOKS|\relax \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else \let\next=\maketoks \addtokens{\toksB}{\the\toksD} \ifx\first,\addtokens{\toksB}{\space}\fi \fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next} \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} \setcolor{\linkcolor}#1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \else % non-pdf mode \let\pdfmkdest = \gobble \let\pdfurl = \gobble \let\endlink = \relax \let\setcolor = \gobble \let\pdfsetcolor = \gobble \let\pdfmakeoutlines = \relax \fi % \ifx\pdfoutput \message{fonts,} % Change the current font style to #1, remembering it in \curfontstyle. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in % italics, not bold italics. % \def\setfontstyle#1{% \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. \csname ten#1\endcsname % change the current font } % Select #1 fonts with the current style. % \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} \def\rm{\fam=0 \setfontstyle{rm}} \def\it{\fam=\itfam \setfontstyle{it}} \def\sl{\fam=\slfam \setfontstyle{sl}} \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} \def\tt{\fam=\ttfam \setfontstyle{tt}} % Unfortunately, we have to override this for titles and the like, since % in those cases "rm" is bold. Sigh. \def\rmisbold{\rm\def\curfontstyle{bf}} % Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf. \newfam\sffam \def\sf{\fam=\sffam \setfontstyle{sf}} \let\li = \sf % Sometimes we call it \li, not \sf. % We don't need math for this font style. \def\ttsl{\setfontstyle{ttsl}} % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers % used as factors; they just match (closely enough) what Knuth defined. % \def\lineskipfactor{.08333} \def\strutheightpercent{.70833} \def\strutdepthpercent {.29167} % % can get a sort of poor man's double spacing by redefining this. \def\baselinefactor{1} % \newdimen\textleading \def\setleading#1{% \dimen0 = #1\relax \normalbaselineskip = \baselinefactor\dimen0 \normallineskip = \lineskipfactor\normalbaselineskip \normalbaselines \setbox\strutbox =\hbox{% \vrule width0pt height\strutheightpercent\baselineskip depth \strutdepthpercent \baselineskip }% } % PDF CMaps. See also LaTeX's t1.cmap. % % do nothing with this by default. \expandafter\let\csname cmapOT1\endcsname\gobble \expandafter\let\csname cmapOT1IT\endcsname\gobble \expandafter\let\csname cmapOT1TT\endcsname\gobble % if we are producing pdf, and we have \pdffontattr, then define cmaps. % (\pdffontattr was introduced many years ago, but people still run % older pdftex's; it's easy to conditionalize, so we do.) \ifpdf \ifx\pdffontattr\thisisundefined \else \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1-0) %%Title: (TeX-OT1-0 TeX OT1 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1) /Supplement 0 >> def /CMapName /TeX-OT1-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <23> <26> <0023> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 40 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1IT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1IT-0) %%Title: (TeX-OT1IT-0 TeX OT1IT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1IT) /Supplement 0 >> def /CMapName /TeX-OT1IT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <25> <26> <0025> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 42 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <23> <0023> <24> <00A3> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1IT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1TT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1TT-0) %%Title: (TeX-OT1TT-0 TeX OT1TT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1TT) /Supplement 0 >> def /CMapName /TeX-OT1TT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 5 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <21> <26> <0021> <28> <5F> <0028> <61> <7E> <0061> endbfrange 32 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <2191> <0C> <2193> <0D> <0027> <0E> <00A1> <0F> <00BF> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <20> <2423> <27> <2019> <60> <2018> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1TT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% \fi\fi % Set the font macro #1 to the font named \fontprefix#2. % #3 is the font's design size, #4 is a scale factor, #5 is the CMap % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit). % Example: % #1 = \textrm % #2 = \rmshape % #3 = 10 % #4 = \mainmagstep % #5 = OT1 % \def\setfont#1#2#3#4#5{% \font#1=\fontprefix#2#3 scaled #4 \csname cmap#5\endcsname#1% } % This is what gets called when #5 of \setfont is empty. \let\cmap\gobble % % (end of cmaps) % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix % before you read in texinfo.tex. \ifx\fontprefix\thisisundefined \def\fontprefix{cm} \fi % Support font families that don't use the same naming scheme as CM. \def\rmshape{r} \def\rmbshape{bx} % where the normal face is bold \def\bfshape{b} \def\bxshape{bx} \def\ttshape{tt} \def\ttbshape{tt} \def\ttslshape{sltt} \def\itshape{ti} \def\itbshape{bxti} \def\slshape{sl} \def\slbshape{bxsl} \def\sfshape{ss} \def\sfbshape{ss} \def\scshape{csc} \def\scbshape{csc} % Definitions for a main text size of 11pt. (The default in Texinfo.) % \def\definetextfontsizexi{% % Text fonts (11.2pt, magstep1). \def\textnominalsize{11pt} \edef\mainmagstep{\magstephalf} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1095} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstep1}{OT1} \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\titleecsize{2074} % Chapter (and unnumbered) fonts (17.28pt). \def\chapnominalsize{17pt} \setfont\chaprm\rmbshape{12}{\magstep2}{OT1} \setfont\chapit\itbshape{10}{\magstep3}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep3}{OT1} \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} \setfont\chapsf\sfbshape{17}{1000}{OT1} \let\chapbf=\chaprm \setfont\chapsc\scbshape{10}{\magstep3}{OT1} \font\chapi=cmmi12 scaled \magstep2 \font\chapsy=cmsy10 scaled \magstep3 \def\chapecsize{1728} % Section fonts (14.4pt). \def\secnominalsize{14pt} \setfont\secrm\rmbshape{12}{\magstep1}{OT1} \setfont\secit\itbshape{10}{\magstep2}{OT1IT} \setfont\secsl\slbshape{10}{\magstep2}{OT1} \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\secsf\sfbshape{12}{\magstep1}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep2}{OT1} \font\seci=cmmi12 scaled \magstep1 \font\secsy=cmsy10 scaled \magstep2 \def\sececsize{1440} % Subsection fonts (13.15pt). \def\ssecnominalsize{13pt} \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} \setfont\ssecit\itbshape{10}{1315}{OT1IT} \setfont\ssecsl\slbshape{10}{1315}{OT1} \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1315}{OT1} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 \def\ssececsize{1200} % Reduced fonts for @acro in text (10pt). \def\reducednominalsize{10pt} \setfont\reducedrm\rmshape{10}{1000}{OT1} \setfont\reducedtt\ttshape{10}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{1000}{OT1} \setfont\reducedit\itshape{10}{1000}{OT1IT} \setfont\reducedsl\slshape{10}{1000}{OT1} \setfont\reducedsf\sfshape{10}{1000}{OT1} \setfont\reducedsc\scshape{10}{1000}{OT1} \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} \font\reducedi=cmmi10 \font\reducedsy=cmsy10 \def\reducedecsize{1000} \textleading = 13.2pt % line spacing for 11pt CM \textfonts % reset the current fonts \rm } % end of 11pt text font size definitions, \definetextfontsizexi % Definitions to make the main text be 10pt Computer Modern, with % section, chapter, etc., sizes following suit. This is for the GNU % Press printing of the Emacs 22 manual. Maybe other manuals in the % future. Used with @smallbook, which sets the leading to 12pt. % \def\definetextfontsizex{% % Text fonts (10pt). \def\textnominalsize{10pt} \edef\mainmagstep{1000} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1000} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstephalf}{OT1} \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\titleecsize{2074} % Chapter fonts (14.4pt). \def\chapnominalsize{14pt} \setfont\chaprm\rmbshape{12}{\magstep1}{OT1} \setfont\chapit\itbshape{10}{\magstep2}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep2}{OT1} \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\chapsf\sfbshape{12}{\magstep1}{OT1} \let\chapbf\chaprm \setfont\chapsc\scbshape{10}{\magstep2}{OT1} \font\chapi=cmmi12 scaled \magstep1 \font\chapsy=cmsy10 scaled \magstep2 \def\chapecsize{1440} % Section fonts (12pt). \def\secnominalsize{12pt} \setfont\secrm\rmbshape{12}{1000}{OT1} \setfont\secit\itbshape{10}{\magstep1}{OT1IT} \setfont\secsl\slbshape{10}{\magstep1}{OT1} \setfont\sectt\ttbshape{12}{1000}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} \setfont\secsf\sfbshape{12}{1000}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep1}{OT1} \font\seci=cmmi12 \font\secsy=cmsy10 scaled \magstep1 \def\sececsize{1200} % Subsection fonts (10pt). \def\ssecnominalsize{10pt} \setfont\ssecrm\rmbshape{10}{1000}{OT1} \setfont\ssecit\itbshape{10}{1000}{OT1IT} \setfont\ssecsl\slbshape{10}{1000}{OT1} \setfont\ssectt\ttbshape{10}{1000}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} \setfont\ssecsf\sfbshape{10}{1000}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1000}{OT1} \font\sseci=cmmi10 \font\ssecsy=cmsy10 \def\ssececsize{1000} % Reduced fonts for @acro in text (9pt). \def\reducednominalsize{9pt} \setfont\reducedrm\rmshape{9}{1000}{OT1} \setfont\reducedtt\ttshape{9}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{900}{OT1} \setfont\reducedit\itshape{9}{1000}{OT1IT} \setfont\reducedsl\slshape{9}{1000}{OT1} \setfont\reducedsf\sfshape{9}{1000}{OT1} \setfont\reducedsc\scshape{10}{900}{OT1} \setfont\reducedttsl\ttslshape{10}{900}{OT1TT} \font\reducedi=cmmi9 \font\reducedsy=cmsy9 \def\reducedecsize{0900} \divide\parskip by 2 % reduce space between paragraphs \textleading = 12pt % line spacing for 10pt CM \textfonts % reset the current fonts \rm } % end of 10pt text font size definitions, \definetextfontsizex % We provide the user-level command % @fonttextsize 10 % (or 11) to redefine the text font size. pt is assumed. % \def\xiword{11} \def\xword{10} \def\xwordpt{10pt} % \parseargdef\fonttextsize{% \def\textsizearg{#1}% %\wlog{doing @fonttextsize \textsizearg}% % % Set \globaldefs so that documents can use this inside @tex, since % makeinfo 4.8 does not support it, but we need it nonetheless. % \begingroup \globaldefs=1 \ifx\textsizearg\xword \definetextfontsizex \else \ifx\textsizearg\xiword \definetextfontsizexi \else \errhelp=\EMsimple \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} \fi\fi \endgroup } % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since % texinfo doesn't allow for producing subscripts and superscripts except % in the main text, we don't bother to reset \scriptfont and % \scriptscriptfont (which would also require loading a lot more fonts). % \def\resetmathfonts{% \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf \textfont\ttfam=\tentt \textfont\sffam=\tensf } % The font-changing commands redefine the meanings of \tenSTYLE, instead % of just \STYLE. We do this because \STYLE needs to also set the % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire % \tenSTYLE to set the current font. % % Each font-changing command also sets the names \lsize (one size lower) % and \lllsize (three sizes lower). These relative commands are used in % the LaTeX logo and acronyms. % % This all needs generalizing, badly. % \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl \def\curfontsize{text}% \def\lsize{reduced}\def\lllsize{smaller}% \resetmathfonts \setleading{\textleading}} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl \def\curfontsize{title}% \def\lsize{chap}\def\lllsize{subsec}% \resetmathfonts \setleading{27pt}} \def\titlefont#1{{\titlefonts\rmisbold #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl \def\curfontsize{chap}% \def\lsize{sec}\def\lllsize{text}% \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl \def\curfontsize{sec}% \def\lsize{subsec}\def\lllsize{reduced}% \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl \def\curfontsize{ssec}% \def\lsize{text}\def\lllsize{small}% \resetmathfonts \setleading{15pt}} \let\subsubsecfonts = \subsecfonts \def\reducedfonts{% \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy \let\tenttsl=\reducedttsl \def\curfontsize{reduced}% \def\lsize{small}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallfonts{% \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy \let\tenttsl=\smallttsl \def\curfontsize{small}% \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallerfonts{% \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy \let\tenttsl=\smallerttsl \def\curfontsize{smaller}% \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{9.5pt}} % Fonts for short table of contents. \setfont\shortcontrm\rmshape{12}{1000}{OT1} \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 \setfont\shortcontsl\slshape{12}{1000}{OT1} \setfont\shortconttt\ttshape{12}{1000}{OT1TT} % Define these just so they can be easily changed for other fonts. \def\angleleft{$\langle$} \def\angleright{$\rangle$} % Set the fonts to use with the @small... environments. \let\smallexamplefonts = \smallfonts % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample % can fit this many characters: % 8.5x11=86 smallbook=72 a4=90 a5=69 % If we use \scriptfonts (8pt), then we can fit this many characters: % 8.5x11=90+ smallbook=80 a4=90+ a5=77 % For me, subjectively, the few extra characters that fit aren't worth % the additional smallness of 8pt. So I'm making the default 9pt. % % By the way, for comparison, here's what fits with @example (10pt): % 8.5x11=71 smallbook=60 a4=75 a5=58 % --karl, 24jan03. % Set up the default fonts, so we can use them for creating boxes. % \definetextfontsizexi \message{markup,} % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have % this property, we can check that font parameter. % \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will % define and register \INITMACRO to be called on markup style changes. % \INITMACRO can check \currentmarkupstyle for the innermost % style and the set of \ifmarkupSTYLE switches for all styles % currently in effect. \newif\ifmarkupvar \newif\ifmarkupsamp \newif\ifmarkupkey %\newif\ifmarkupfile % @file == @samp. %\newif\ifmarkupoption % @option == @samp. \newif\ifmarkupcode \newif\ifmarkupkbd %\newif\ifmarkupenv % @env == @code. %\newif\ifmarkupcommand % @command == @code. \newif\ifmarkuptex % @tex (and part of @math, for now). \newif\ifmarkupexample \newif\ifmarkupverb \newif\ifmarkupverbatim \let\currentmarkupstyle\empty \def\setupmarkupstyle#1{% \csname markup#1true\endcsname \def\currentmarkupstyle{#1}% \markupstylesetup } \let\markupstylesetup\empty \def\defmarkupstylesetup#1{% \expandafter\def\expandafter\markupstylesetup \expandafter{\markupstylesetup #1}% \def#1% } % Markup style setup for left and right quotes. \defmarkupstylesetup\markupsetuplq{% \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname \ifx\temp\relax \markupsetuplqdefault \else \temp \fi } \defmarkupstylesetup\markupsetuprq{% \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname \ifx\temp\relax \markupsetuprqdefault \else \temp \fi } { \catcode`\'=\active \catcode`\`=\active \gdef\markupsetuplqdefault{\let`\lq} \gdef\markupsetuprqdefault{\let'\rq} \gdef\markupsetcodequoteleft{\let`\codequoteleft} \gdef\markupsetcodequoteright{\let'\codequoteright} } \let\markupsetuplqcode \markupsetcodequoteleft \let\markupsetuprqcode \markupsetcodequoteright % \let\markupsetuplqexample \markupsetcodequoteleft \let\markupsetuprqexample \markupsetcodequoteright % \let\markupsetuplqkbd \markupsetcodequoteleft \let\markupsetuprqkbd \markupsetcodequoteright % \let\markupsetuplqsamp \markupsetcodequoteleft \let\markupsetuprqsamp \markupsetcodequoteright % \let\markupsetuplqverb \markupsetcodequoteleft \let\markupsetuprqverb \markupsetcodequoteright % \let\markupsetuplqverbatim \markupsetcodequoteleft \let\markupsetuprqverbatim \markupsetcodequoteright % Allow an option to not use regular directed right quote/apostrophe % (char 0x27), but instead the undirected quote from cmtt (char 0x0d). % The undirected quote is ugly, so don't make it the default, but it % works for pasting with more pdf viewers (at least evince), the % lilypond developers report. xpdf does work with the regular 0x27. % \def\codequoteright{% \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax '% \else \char'15 \fi \else \char'15 \fi } % % and a similar option for the left quote char vs. a grave accent. % Modern fonts display ASCII 0x60 as a grave accent, so some people like % the code environments to do likewise. % \def\codequoteleft{% \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax % [Knuth] pp. 380,381,391 % \relax disables Spanish ligatures ?` and !` of \tt font. \relax`% \else \char'22 \fi \else \char'22 \fi } % Commands to set the quote options. % \parseargdef\codequoteundirected{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxicodequoteundirected\endcsname = t% \else\ifx\temp\offword \expandafter\let\csname SETtxicodequoteundirected\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% \fi\fi } % \parseargdef\codequotebacktick{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxicodequotebacktick\endcsname = t% \else\ifx\temp\offword \expandafter\let\csname SETtxicodequotebacktick\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% \fi\fi } % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. \def\noligaturesquoteleft{\relax\lq} % Count depth in font-changes, for error checks \newcount\fontdepth \fontdepth=0 % Font commands. % #1 is the font command (\sl or \it), #2 is the text to slant. % If we are in a monospaced environment, however, 1) always use \ttsl, % and 2) do not add an italic correction. \def\dosmartslant#1#2{% \ifusingtt {{\ttsl #2}\let\next=\relax}% {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% \next } \def\smartslanted{\dosmartslant\sl} \def\smartitalic{\dosmartslant\it} % Output an italic correction unless \next (presumed to be the following % character) is such as not to need one. \def\smartitaliccorrection{% \ifx\next,% \else\ifx\next-% \else\ifx\next.% \else\ptexslash \fi\fi\fi \aftersmartic } % Unconditional use \ttsl, and no ic. @var is set to this for defuns. \def\ttslanted#1{{\ttsl #1}} % @cite is like \smartslanted except unconditionally use \sl. We never want % ttsl for book titles, do we? \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} \def\aftersmartic{} \def\var#1{% \let\saveaftersmartic = \aftersmartic \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% \smartslanted{#1}% } \let\i=\smartitalic \let\slanted=\smartslanted \let\dfn=\smartslanted \let\emph=\smartitalic % Explicit font changes: @r, @sc, undocumented @ii. \def\r#1{{\rm #1}} % roman font \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font % @b, explicit bold. Also @strong. \def\b#1{{\bf #1}} \let\strong=\b % @sansserif, explicit sans. \def\sansserif#1{{\sf #1}} % We can't just use \exhyphenpenalty, because that only has effect at % the end of a paragraph. Restore normal hyphenation at the end of the % group within which \nohyphenation is presumably called. % \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\restorehyphenation{\hyphenchar\font = `- } % Set sfcode to normal for the chars that usually have another value. % Can't use plain's \frenchspacing because it uses the `\x notation, and % sometimes \x has an active definition that messes things up. % \catcode`@=11 \def\plainfrenchspacing{% \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m \def\endofsentencespacefactor{1000}% for @. and friends } \def\plainnonfrenchspacing{% \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 \def\endofsentencespacefactor{3000}% for @. and friends } \catcode`@=\other \def\endofsentencespacefactor{3000}% default % @t, explicit typewriter. \def\t#1{% {\tt \rawbackslash \plainfrenchspacing #1}% \null } % @samp. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} % @indicateurl is \samp, that is, with quotes. \let\indicateurl=\samp % @code (and similar) prints in typewriter, but with spaces the same % size as normal in the surrounding text, without hyphenation, etc. % This is a subroutine for that. \def\tclose#1{% {% % Change normal interword space to be same as for the current font. \spaceskip = \fontdimen2\font % % Switch to typewriter. \tt % % But `\ ' produces the large typewriter interword space. \def\ {{\spaceskip = 0pt{} }}% % % Turn off hyphenation. \nohyphenation % \rawbackslash \plainfrenchspacing #1% }% \null % reset spacefactor to 1000 } % We *must* turn on hyphenation at `-' and `_' in @code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. % % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) % and arrange explicitly to hyphenate at a dash. % -- rms. { \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active \catcode`\`=\active \global\let'=\rq \global\let`=\lq % default definitions % \global\def\code{\begingroup \setupmarkupstyle{code}% % The following should really be moved into \setupmarkupstyle handlers. \catcode\dashChar=\active \catcode\underChar=\active \ifallowcodebreaks \let-\codedash \let_\codeunder \else \let-\normaldash \let_\realunder \fi \codex } } \def\codex #1{\tclose{#1}\endgroup} \def\normaldash{-} \def\codedash{-\discretionary{}{}{}} \def\codeunder{% % this is all so @math{@code{var_name}+1} can work. In math mode, _ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) % will therefore expand the active definition of _, which is us % (inside @code that is), therefore an endless loop. \ifusingtt{\ifmmode \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. \else\normalunderscore \fi \discretionary{}{}{}}% {\_}% } % An additional complication: the above will allow breaks after, e.g., % each of the four underscores in __typeof__. This is bad. % @allowcodebreaks provides a document-level way to turn breaking at - % and _ on and off. % \newif\ifallowcodebreaks \allowcodebreakstrue \def\keywordtrue{true} \def\keywordfalse{false} \parseargdef\allowcodebreaks{% \def\txiarg{#1}% \ifx\txiarg\keywordtrue \allowcodebreakstrue \else\ifx\txiarg\keywordfalse \allowcodebreaksfalse \else \errhelp = \EMsimple \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% \fi\fi } % For @command, @env, @file, @option quotes seem unnecessary, % so use \code rather than \samp. \let\command=\code \let\env=\code \let\file=\code \let\option=\code % @uref (abbreviation for `urlref') takes an optional (comma-separated) % second argument specifying the text to display and an optional third % arg as text to display instead of (rather than in addition to) the url % itself. First (mandatory) arg is the url. % (This \urefnobreak definition isn't used now, leaving it for a while % for comparison.) \def\urefnobreak#1{\dourefnobreak #1,,,\finish} \def\dourefnobreak#1,#2,#3,#4\finish{\begingroup \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf \unhbox0 % PDF: 2nd arg given, show only it \else \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url \fi \else \code{#1}% only url given, so show it \fi \fi \endlink \endgroup} % This \urefbreak definition is the active one. \def\urefbreak{\begingroup \urefcatcodes \dourefbreak} \let\uref=\urefbreak \def\dourefbreak#1{\urefbreakfinish #1,,,\finish} \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf \unhbox0 % PDF: 2nd arg given, show only it \else \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url \fi \else \urefcode{#1}% only url given, so show it \fi \fi \endlink \endgroup} % Allow line breaks around only a few characters (only). \def\urefcatcodes{% \catcode\ampChar=\active \catcode\dotChar=\active \catcode\hashChar=\active \catcode\questChar=\active \catcode\slashChar=\active } { \urefcatcodes % \global\def\urefcode{\begingroup \setupmarkupstyle{code}% \urefcatcodes \let&\urefcodeamp \let.\urefcodedot \let#\urefcodehash \let?\urefcodequest \let/\urefcodeslash \codex } % % By default, they are just regular characters. \global\def&{\normalamp} \global\def.{\normaldot} \global\def#{\normalhash} \global\def?{\normalquest} \global\def/{\normalslash} } % we put a little stretch before and after the breakable chars, to help % line breaking of long url's. The unequal skips make look better in % cmtt at least, especially for dots. \def\urefprestretch{\urefprebreak \hskip0pt plus.13em } \def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em } % \def\urefcodeamp{\urefprestretch \&\urefpoststretch} \def\urefcodedot{\urefprestretch .\urefpoststretch} \def\urefcodehash{\urefprestretch \#\urefpoststretch} \def\urefcodequest{\urefprestretch ?\urefpoststretch} \def\urefcodeslash{\futurelet\next\urefcodeslashfinish} { \catcode`\/=\active \global\def\urefcodeslashfinish{% \urefprestretch \slashChar % Allow line break only after the final / in a sequence of % slashes, to avoid line break between the slashes in http://. \ifx\next/\else \urefpoststretch \fi } } % One more complication: by default we'll break after the special % characters, but some people like to break before the special chars, so % allow that. Also allow no breaking at all, for manual control. % \parseargdef\urefbreakstyle{% \def\txiarg{#1}% \ifx\txiarg\wordnone \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordbefore \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordafter \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} \else \errhelp = \EMsimple \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% \fi\fi\fi } \def\wordafter{after} \def\wordbefore{before} \def\wordnone{none} \urefbreakstyle after % @url synonym for @uref, since that's how everyone uses it. % \let\url=\uref % rms does not like angle brackets --karl, 17may97. % So now @email is just like @uref, unless we are pdf. % %\def\email#1{\angleleft{\tt #1}\angleright} \ifpdf \def\email#1{\doemail#1,,\finish} \def\doemail#1,#2,#3\finish{\begingroup \unsepspaces \pdfurl{mailto:#1}% \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi \endlink \endgroup} \else \let\email=\uref \fi % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). \parseargdef\kbdinputstyle{% \def\txiarg{#1}% \ifx\txiarg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% \else\ifx\txiarg\wordexample \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% \else\ifx\txiarg\wordcode \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \else \errhelp = \EMsimple \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% \fi\fi\fi } \def\worddistinct{distinct} \def\wordexample{example} \def\wordcode{code} % Default is `distinct'. \kbdinputstyle distinct % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}} \def\xkey{\key} \def\kbdsub#1#2#3\par{% \def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi } % definition of @key that produces a lozenge. Doesn't adjust to text size. %\setfont\keyrm\rmshape{8}{1000}{OT1} %\font\keysy=cmsy9 %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% % \vbox{\hrule\kern-0.4pt % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% % \kern-0.4pt\hrule}% % \kern-.06em\raise0.4pt\hbox{\angleright}}}} % definition of @key with no lozenge. If the current font is already % monospace, don't change it; that way, we respect @kbdinputstyle. But % if it isn't monospace, then use \tt. % \def\key#1{{\setupmarkupstyle{key}% \nohyphenation \ifmonospace\else\tt\fi #1}\null} % @clicksequence{File @click{} Open ...} \def\clicksequence#1{\begingroup #1\endgroup} % @clickstyle @arrow (by default) \parseargdef\clickstyle{\def\click{#1}} \def\click{\arrow} % Typeset a dimension, e.g., `in' or `pt'. The only reason for the % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % \def\dmn#1{\thinspace #1} % @l was never documented to mean ``switch to the Lisp font'', % and it is not used as such in any manual I can find. We need it for % Polish suppressed-l. --karl, 22sep96. %\def\l#1{{\li #1}\null} % @acronym for "FBI", "NATO", and the like. % We print this one point size smaller, since it's intended for % all-uppercase. % \def\acronym#1{\doacronym #1,,\finish} \def\doacronym#1,#2,#3\finish{% {\selectfonts\lsize #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi \null % reset \spacefactor=1000 } % @abbr for "Comput. J." and the like. % No font change, but don't do end-of-sentence spacing. % \def\abbr#1{\doabbr #1,,\finish} \def\doabbr#1,#2,#3\finish{% {\plainfrenchspacing #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi \null % reset \spacefactor=1000 } % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} % @math outputs its argument in math mode. % % One complication: _ usually means subscripts, but it could also mean % an actual _ character, as in @math{@var{some_variable} + 1}. So make % _ active, and distinguish by seeing if the current family is \slfam, % which is what @var uses. { \catcode`\_ = \active \gdef\mathunderscore{% \catcode`\_=\active \def_{\ifnum\fam=\slfam \_\else\sb\fi}% } } % Another complication: we want \\ (and @\) to output a math (or tt) \. % FYI, plain.tex uses \\ as a temporary control sequence (for no % particular reason), but this is not advertised and we don't care. % % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % \def\math{% \tex \mathunderscore \let\\ = \mathbackslash \mathactive % make the texinfo accent commands work in math mode \let\"=\ddot \let\'=\acute \let\==\bar \let\^=\hat \let\`=\grave \let\u=\breve \let\v=\check \let\~=\tilde \let\dotaccent=\dot $\finishmath } \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. % Some active characters (such as <) are spaced differently in math. % We have to reset their definitions in case the @math was an argument % to a command which sets the catcodes (such as @item or @section). % { \catcode`^ = \active \catcode`< = \active \catcode`> = \active \catcode`+ = \active \catcode`' = \active \gdef\mathactive{% \let^ = \ptexhat \let< = \ptexless \let> = \ptexgtr \let+ = \ptexplus \let' = \ptexquoteright } } % ctrl is no longer a Texinfo command, but leave this definition for fun. \def\ctrl #1{{\tt \rawbackslash \hat}#1} % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, % except specified as a normal braced arg, so no newlines to worry about. % \def\outfmtnametex{tex} % \long\def\inlinefmt#1{\doinlinefmt #1,\finish} \long\def\doinlinefmt#1,#2,\finish{% \def\inlinefmtname{#1}% \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi } % For raw, must switch into @tex before parsing the argument, to avoid % setting catcodes prematurely. Doing it this way means that, for % example, @inlineraw{html, foo{bar} gets a parse error instead of being % ignored. But this isn't important because if people want a literal % *right* brace they would have to use a command anyway, so they may as % well use a command to get a left brace too. We could re-use the % delimiter character idea from \verb, but it seems like overkill. % \long\def\inlineraw{\tex \doinlineraw} \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} \def\doinlinerawtwo#1,#2,\finish{% \def\inlinerawname{#1}% \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi \endgroup % close group opened by \tex. } \message{glyphs,} % and logos. % @@ prints an @, as does @atchar{}. \def\@{\char64 } \let\atchar=\@ % @{ @} @lbracechar{} @rbracechar{} all generate brace characters. % Unless we're in typewriter, use \ecfont because the CM text fonts do % not have braces, and we don't want to switch into math. \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} \let\{=\mylbrace \let\lbracechar=\{ \let\}=\myrbrace \let\rbracechar=\} \begingroup % Definitions to produce \{ and \} commands for indices, % and @{ and @} for the aux/toc files. \catcode`\{ = \other \catcode`\} = \other \catcode`\[ = 1 \catcode`\] = 2 \catcode`\! = 0 \catcode`\\ = \other !gdef!lbracecmd[\{]% !gdef!rbracecmd[\}]% !gdef!lbraceatcmd[@{]% !gdef!rbraceatcmd[@}]% !endgroup % @comma{} to avoid , parsing problems. \let\comma = , % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. \let\, = \ptexc \let\dotaccent = \ptexdot \def\ringaccent#1{{\accent23 #1}} \let\tieaccent = \ptext \let\ubaraccent = \ptexb \let\udotaccent = \d % Other special characters: @questiondown @exclamdown @ordf @ordm % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} % Dotless i and dotless j, used for accents. \def\imacro{i} \def\jmacro{j} \def\dotless#1{% \def\temp{#1}% \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi \else \errmessage{@dotless can be used only with i or j}% \fi\fi } % The \TeX{} logo, as in plain, but resetting the spacing so that a % period following counts as ending a sentence. (Idea found in latex.) % \edef\TeX{\TeX \spacefactor=1000 } % @LaTeX{} logo. Not quite the same results as the definition in % latex.ltx, since we use a different font for the raised A; it's most % convenient for us to use an explicitly smaller font, rather than using % the \scriptstyle font (since we don't reset \scriptstyle and % \scriptscriptstyle). % \def\LaTeX{% L\kern-.36em {\setbox0=\hbox{T}% \vbox to \ht0{\hbox{% \ifx\textnominalsize\xwordpt % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX. % Revert to plain's \scriptsize, which is 7pt. \count255=\the\fam $\fam\count255 \scriptstyle A$% \else % For 11pt, we can use our lllsize. \selectfonts\lllsize A% \fi }% \vss }}% \kern-.15em \TeX } % Some math mode symbols. \def\bullet{$\ptexbullet$} \def\geq{\ifmmode \ge\else $\ge$\fi} \def\leq{\ifmmode \le\else $\le$\fi} \def\minus{\ifmmode -\else $-$\fi} % @dots{} outputs an ellipsis using the current font. % We do .5em per period so that it has the same spacing in the cm % typewriter fonts as three actual period characters; on the other hand, % in other typewriter fonts three periods are wider than 1.5em. So do % whichever is larger. % \def\dots{% \leavevmode \setbox0=\hbox{...}% get width of three periods \ifdim\wd0 > 1.5em \dimen0 = \wd0 \else \dimen0 = 1.5em \fi \hbox to \dimen0{% \hskip 0pt plus.25fil .\hskip 0pt plus1fil .\hskip 0pt plus1fil .\hskip 0pt plus.5fil }% } % @enddots{} is an end-of-sentence ellipsis. % \def\enddots{% \dots \spacefactor=\endofsentencespacefactor } % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. % % Since these characters are used in examples, they should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. % \def\point{$\star$} \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} % The @error{} command. % Adapted from the TeXbook's \boxit. % \newbox\errorbox % {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} % \setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. \vbox{% \hrule height\dimen2 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. \kern3pt\vrule width\dimen2}% Space to right. \hrule height\dimen2} \hfil} % \def\error{\leavevmode\lower.7ex\copy\errorbox} % @pounds{} is a sterling sign, which Knuth put in the CM italic font. % \def\pounds{{\it\$}} % @euro{} comes from a separate font, depending on the current style. % We use the free feym* fonts from the eurosym package by Henrik % Theiling, which support regular, slanted, bold and bold slanted (and % "outlined" (blackboard board, sort of) versions, which we don't need). % It is available from http://www.ctan.org/tex-archive/fonts/eurosym. % % Although only regular is the truly official Euro symbol, we ignore % that. The Euro is designed to be slightly taller than the regular % font height. % % feymr - regular % feymo - slanted % feybr - bold % feybo - bold slanted % % There is no good (free) typewriter version, to my knowledge. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. % Hmm. % % Also doesn't work in math. Do we need to do math with euro symbols? % Hope not. % % \def\euro{{\eurofont e}} \def\eurofont{% % We set the font at each command, rather than predefining it in % \textfonts and the other font-switching commands, so that % installations which never need the symbol don't have to have the % font installed. % % There is only one designed size (nominal 10pt), so we always scale % that to the current nominal size. % % By the way, simply using "at 1em" works for cmr10 and the like, but % does not work for cmbx10 and other extended/shrunken fonts. % \def\eurosize{\csname\curfontsize nominalsize\endcsname}% % \ifx\curfontstyle\bfstylename % bold: \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize \else % regular: \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize \fi \thiseurofont } % Glyphs from the EC fonts. We don't use \let for the aliases, because % sometimes we redefine the original macro, and the alias should reflect % the redefinition. % % Use LaTeX names for the Icelandic letters. \def\DH{{\ecfont \char"D0}} % Eth \def\dh{{\ecfont \char"F0}} % eth \def\TH{{\ecfont \char"DE}} % Thorn \def\th{{\ecfont \char"FE}} % thorn % \def\guillemetleft{{\ecfont \char"13}} \def\guillemotleft{\guillemetleft} \def\guillemetright{{\ecfont \char"14}} \def\guillemotright{\guillemetright} \def\guilsinglleft{{\ecfont \char"0E}} \def\guilsinglright{{\ecfont \char"0F}} \def\quotedblbase{{\ecfont \char"12}} \def\quotesinglbase{{\ecfont \char"0D}} % % This positioning is not perfect (see the ogonek LaTeX package), but % we have the precomposed glyphs for the most common cases. We put the % tests to use those glyphs in the single \ogonek macro so we have fewer % dummy definitions to worry about for index entries, etc. % % ogonek is also used with other letters in Lithuanian (IOU), but using % the precomposed glyphs for those is not so easy since they aren't in % the same EC font. \def\ogonek#1{{% \def\temp{#1}% \ifx\temp\macrocharA\Aogonek \else\ifx\temp\macrochara\aogonek \else\ifx\temp\macrocharE\Eogonek \else\ifx\temp\macrochare\eogonek \else \ecfont \setbox0=\hbox{#1}% \ifdim\ht0=1ex\accent"0C #1% \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% \fi \fi\fi\fi\fi }% } \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} % % Use the ec* fonts (cm-super in outline format) for non-CM glyphs. \def\ecfont{% % We can't distinguish serif/sans and italic/slanted, but this % is used for crude hacks anyway (like adding French and German % quotes to documents typeset with CM, where we lose kerning), so % hopefully nobody will notice/care. \edef\ecsize{\csname\curfontsize ecsize\endcsname}% \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% \ifmonospace % typewriter: \font\thisecfont = ectt\ecsize \space at \nominalsize \else \ifx\curfontstyle\bfstylename % bold: \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize \else % regular: \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize \fi \fi \thisecfont } % @registeredsymbol - R in a circle. The font for the R should really % be smaller yet, but lllsize is the best we can do for now. % Adapted from the plain.tex definition of \copyright. % \def\registeredsymbol{% $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% \hfil\crcr\Orb}}% }$% } % @textdegree - the normal degrees sign. % \def\textdegree{$^\circ$} % Laurent Siebenmann reports \Orb undefined with: % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 % so we'll define it if necessary. % \ifx\Orb\thisisundefined \def\Orb{\mathhexbox20D} \fi % Quotes. \chardef\quotedblleft="5C \chardef\quotedblright=`\" \chardef\quoteleft=`\` \chardef\quoteright=`\' \message{page headings,} \newskip\titlepagetopglue \titlepagetopglue = 1.5in \newskip\titlepagebottomglue \titlepagebottomglue = 2pc % First the title page. Must do @settitle before @titlepage. \newif\ifseenauthor \newif\iffinishedtitlepage % Do an implicit @contents or @shortcontents after @end titlepage if the % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. % \newif\ifsetcontentsaftertitlepage \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue \newif\ifsetshortcontentsaftertitlepage \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue \parseargdef\shorttitlepage{% \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} \envdef\titlepage{% % Open one extra group, as we want to close it in the middle of \Etitlepage. \begingroup \parindent=0pt \textfonts % Leave some space at the very top of the page. \vglue\titlepagetopglue % No rule at page bottom unless we print one at the top with @title. \finishedtitlepagetrue % % Most title ``pages'' are actually two pages long, with space % at the top of the second. We don't want the ragged left on the second. \let\oldpage = \page \def\page{% \iffinishedtitlepage\else \finishtitlepage \fi \let\page = \oldpage \page \null }% } \def\Etitlepage{% \iffinishedtitlepage\else \finishtitlepage \fi % It is important to do the page break before ending the group, % because the headline and footline are only empty inside the group. % If we use the new definition of \page, we always get a blank page % after the title page, which we certainly don't want. \oldpage \endgroup % % Need this before the \...aftertitlepage checks so that if they are % in effect the toc pages will come out with page numbers. \HEADINGSon % % If they want short, they certainly want long too. \ifsetshortcontentsaftertitlepage \shortcontents \contents \global\let\shortcontents = \relax \global\let\contents = \relax \fi % \ifsetcontentsaftertitlepage \contents \global\let\contents = \relax \global\let\shortcontents = \relax \fi } \def\finishtitlepage{% \vskip4pt \hrule height 2pt width \hsize \vskip\titlepagebottomglue \finishedtitlepagetrue } % Settings used for typesetting titles: no hyphenation, no indentation, % don't worry much about spacing, ragged right. This should be used % inside a \vbox, and fonts need to be set appropriately first. Because % it is always used for titles, nothing else, we call \rmisbold. \par % should be specified before the end of the \vbox, since a vbox is a group. % \def\raggedtitlesettings{% \rmisbold \hyphenpenalty=10000 \parindent=0pt \tolerance=5000 \ptexraggedright } % Macros to be used within @titlepage: \let\subtitlerm=\tenrm \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} \parseargdef\title{% \checkenv\titlepage \vbox{\titlefonts \raggedtitlesettings #1\par}% % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt } \parseargdef\subtitle{% \checkenv\titlepage {\subtitlefont \rightline{#1}}% } % @author should come last, but may come many times. % It can also be used inside @quotation. % \parseargdef\author{% \def\temp{\quotation}% \ifx\thisenv\temp \def\quotationauthor{#1}% printed in \Equotation. \else \checkenv\titlepage \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi {\secfonts\rmisbold \leftline{#1}}% \fi } % Set up page headings and footings. \let\thispage=\folio \newtoks\evenheadline % headline on even pages \newtoks\oddheadline % headline on odd pages \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages % Now make TeX use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}\HEADINGShook} \let\HEADINGShook=\relax % Commands to set those variables. % For example, this is what @headings on does % @evenheading @thistitle|@thispage|@thischapter % @oddheading @thischapter|@thispage|@thistitle % @evenfooting @thisfile|| % @oddfooting ||@thisfile \def\evenheading{\parsearg\evenheadingxxx} \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} \def\evenheadingyyy #1\|#2\|#3\|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddheading{\parsearg\oddheadingxxx} \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} \def\oddheadingyyy #1\|#2\|#3\|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% \def\evenfooting{\parsearg\evenfootingxxx} \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} \def\evenfootingyyy #1\|#2\|#3\|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddfooting{\parsearg\oddfootingxxx} \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} \def\oddfootingyyy #1\|#2\|#3\|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. \global\advance\pageheight by -12pt \global\advance\vsize by -12pt } \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} % @evenheadingmarks top \thischapter <- chapter at the top of a page % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page % % The same set of arguments for: % % @oddheadingmarks % @evenfootingmarks % @oddfootingmarks % @everyheadingmarks % @everyfootingmarks \def\evenheadingmarks{\headingmarks{even}{heading}} \def\oddheadingmarks{\headingmarks{odd}{heading}} \def\evenfootingmarks{\headingmarks{even}{footing}} \def\oddfootingmarks{\headingmarks{odd}{footing}} \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} \headingmarks{odd}{heading}{#1} } \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} \headingmarks{odd}{footing}{#1} } % #1 = even/odd, #2 = heading/footing, #3 = top/bottom. \def\headingmarks#1#2#3 {% \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname \global\expandafter\let\csname get#1#2marks\endcsname \temp } \everyheadingmarks bottom \everyfootingmarks bottom % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. % @headings off turns them off. % @headings on same as @headings double, retained for compatibility. % @headings after turns on double-sided headings after this page. % @headings doubleafter turns on double-sided headings after this page. % @headings singleafter turns on single-sided headings after this page. % By default, they are off at the start of a document, % and turned `on' after @end titlepage. \def\headings #1 {\csname HEADINGS#1\endcsname} \def\headingsoff{% non-global headings elimination \evenheadline={\hfil}\evenfootline={\hfil}% \oddheadline={\hfil}\oddfootline={\hfil}% } \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting \HEADINGSoff % it's the default % When we turn headings on, set the page number to 1. % For double-sided printing, put current file name in lower left corner, % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} \let\HEADINGSdoubleafter=\HEADINGSafter \def\HEADINGSdoublex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } % Subroutines used in generating headings % This produces Day Month Year style of output. % Only define if not already defined, in case a txi-??.tex file has set % up a different format (e.g., txi-cs.tex does this). \ifx\today\thisisundefined \def\today{% \number\day\space \ifcase\month \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec \fi \space\number\year} \fi % @settitle line... specifies the title of the document, for headings. % It generates no output of its own. \def\thistitle{\putwordNoTitle} \def\settitle{\parsearg{\gdef\thistitle}} \message{tables,} % Tables -- @table, @ftable, @vtable, @item(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in % default indentation of @itemize and @enumerate text \newdimen\itemindent \itemindent=.3in % margin between end of table item and start of table text. \newdimen\itemmargin \itemmargin=.1in % used internally for \itemindent minus \itemmargin \newdimen\itemmax % Note @table, @ftable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). \newif\ifitemxneedsnegativevskip \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent \setbox0=\hbox{\itemindicate{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % % If the item text does not fit in the space we have, put it on a line % by itself, and do not allow a page break either before or after that % line. We do not start a paragraph here because then if the next % command is, e.g., @kindex, the whatsit would get put into the % horizontal list on a line by itself, resulting in extra blank space. \ifdim \wd0>\itemmax % % Make this a paragraph so we get the \parskip glue and wrapping, % but leave it ragged-right. \begingroup \advance\leftskip by-\tableindent \advance\hsize by\tableindent \advance\rightskip by0pt plus1fil\relax \leavevmode\unhbox0\par \endgroup % % We're going to be starting a paragraph, but we don't want the % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % % Stop a page break at the \parskip glue coming up. However, if % what follows is an environment such as @example, there will be no % \parskip glue; then the negative vskip we just inserted would % cause the example and the item to crash together. So we use this % bizarre value of 10001 as a signal to \aboveenvbreak to insert % \parskip glue after all. Section titles are handled this way also. % \penalty 10001 \endgroup \itemxneedsnegativevskipfalse \else % The item text fits into the space. Start a paragraph, so that the % following text (if any) will end up on the same line. \noindent % Do this with kerns and \unhbox so that if there is a footnote in % the item text, it can migrate to the main vertical list and % eventually be printed. \nobreak\kern-\tableindent \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 \unhbox0 \nobreak\kern\dimen0 \endgroup \itemxneedsnegativevskiptrue \fi } \def\item{\errmessage{@item while not in a list environment}} \def\itemx{\errmessage{@itemx while not in a list environment}} % @table, @ftable, @vtable. \envdef\table{% \let\itemindex\gobble \tablecheck{table}% } \envdef\ftable{% \def\itemindex ##1{\doind {fn}{\code{##1}}}% \tablecheck{ftable}% } \envdef\vtable{% \def\itemindex ##1{\doind {vr}{\code{##1}}}% \tablecheck{vtable}% } \def\tablecheck#1{% \ifnum \the\catcode`\^^M=\active \endgroup \errmessage{This command won't work in this context; perhaps the problem is that we are \inenvironment\thisenv}% \def\next{\doignore{#1}}% \else \let\next\tablex \fi \next } \def\tablex#1{% \def\itemindicate{#1}% \parsearg\tabley } \def\tabley#1{% {% \makevalueexpandable \edef\temp{\noexpand\tablez #1\space\space\space}% \expandafter }\temp \endtablez } \def\tablez #1 #2 #3 #4\endtablez{% \aboveenvbreak \ifnum 0#1>0 \advance \leftskip by #1\mil \fi \ifnum 0#2>0 \tableindent=#2\mil \fi \ifnum 0#3>0 \advance \rightskip by #3\mil \fi \itemmax=\tableindent \advance \itemmax by -\itemmargin \advance \leftskip by \tableindent \exdentamount=\tableindent \parindent = 0pt \parskip = \smallskipamount \ifdim \parskip=0pt \parskip=2pt \fi \let\item = \internalBitem \let\itemx = \internalBitemx } \def\Etable{\endgraf\afterenvbreak} \let\Eftable\Etable \let\Evtable\Etable \let\Eitemize\Etable \let\Eenumerate\Etable % This is the counter used by @enumerate, which is really @itemize \newcount \itemno \envdef\itemize{\parsearg\doitemize} \def\doitemize#1{% \aboveenvbreak \itemmax=\itemindent \advance\itemmax by -\itemmargin \advance\leftskip by \itemindent \exdentamount=\itemindent \parindent=0pt \parskip=\smallskipamount \ifdim\parskip=0pt \parskip=2pt \fi % % Try typesetting the item mark that if the document erroneously says % something like @itemize @samp (intending @table), there's an error % right away at the @itemize. It's not the best error message in the % world, but it's better than leaving it to the @item. This means if % the user wants an empty mark, they have to say @w{} not just @w. \def\itemcontents{#1}% \setbox0 = \hbox{\itemcontents}% % % @itemize with no arg is equivalent to @itemize @bullet. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi % \let\item=\itemizeitem } % Definition of @item while inside @itemize and @enumerate. % \def\itemizeitem{% \advance\itemno by 1 % for enumerations {\let\par=\endgraf \smallbreak}% reasonable place to break {% % If the document has an @itemize directly after a section title, a % \nobreak will be last on the list, and \sectionheading will have % done a \vskip-\parskip. In that case, we don't want to zero % parskip, or the item text will crash with the heading. On the % other hand, when there is normal text preceding the item (as there % usually is), we do want to zero parskip, or there would be too much % space. In that case, we won't have a \nobreak before. At least % that's the theory. \ifnum\lastpenalty<10000 \parskip=0in \fi \noindent \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% % \vadjust{\penalty 1200}}% not good to break after first line of item. \flushcr } % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. % \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% % Allow an optional argument of an uppercase letter, lowercase letter, % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % \envparseargdef\enumerate{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi % % Detect if the argument is a single token. If so, it might be a % letter. Otherwise, the only valid thing it can be is a number. % (We will always have one token, because of the test we just made. % This is a good thing, since \splitoff doesn't work given nothing at % all -- the first parameter is undelimited.) \expandafter\splitoff\thearg\endmark \ifx\rest\empty % Only one token in the argument. It could still be anything. % A ``lowercase letter'' is one whose \lccode is nonzero. % An ``uppercase letter'' is one whose \lccode is both nonzero, and % not equal to itself. % Otherwise, we assume it's a number. % % We need the \relax at the end of the \ifnum lines to stop TeX from % continuing to look for a . % \ifnum\lccode\expandafter`\thearg=0\relax \numericenumerate % a number (we hope) \else % It's a letter. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax \lowercaseenumerate % lowercase letter \else \uppercaseenumerate % uppercase letter \fi \fi \else % Multiple tokens in the argument. We hope it's a number. \numericenumerate \fi } % An @enumerate whose labels are integers. The starting integer is % given in \thearg. % \def\numericenumerate{% \itemno = \thearg \startenumeration{\the\itemno}% } % The starting (lowercase) letter is in \thearg. \def\lowercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more lowercase letters in @enumerate; get a bigger alphabet}% \fi \char\lccode\itemno }% } % The starting (uppercase) letter is in \thearg. \def\uppercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more uppercase letters in @enumerate; get a bigger alphabet} \fi \char\uccode\itemno }% } % Call \doitemize, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 \doitemize{#1.}\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg % to @enumerate. % \def\alphaenumerate{\enumerate{a}} \def\capsenumerate{\enumerate{A}} \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 % % @multitable ... @end multitable will make as many columns as desired. % Contents of each column will wrap at width given in preamble. Width % can be specified either with sample text given in a template line, % or in percent of \hsize, the current width of text on page. % Table can continue over pages but will only break between lines. % To make preamble: % % Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % % Numbers following @columnfractions are the percent of the total % current hsize to be used for each column. You may use as many % columns as desired. % Or use a template: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. % @item, @tab do not need to be on their own lines, but it will not hurt % if they are. % Sample multitable: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item first col stuff @tab second col stuff @tab third col % @item % first col stuff % @tab % second col stuff % @tab % third col % @item first col stuff @tab second col stuff % @tab Many paragraphs of text may be used in any column. % % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. % @end multitable % Default dimensions may be reset by user. % @multitableparskip is vertical space between paragraphs in table. % @multitableparindent is paragraph indent in table. % @multitablecolmargin is horizontal space to be left between columns. % @multitablelinespace is space to leave between table items, baseline % to baseline. % 0pt means it depends on current normal line spacing. % \newskip\multitableparskip \newskip\multitableparindent \newdimen\multitablecolspace \newskip\multitablelinespace \multitableparskip=0pt \multitableparindent=6pt \multitablecolspace=12pt \multitablelinespace=0pt % Macros used to set up halign preamble: % \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} \let\columnfractions\relax \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent % #1 is the @columnfraction, usually a decimal number like .5, but might % be just 1. We just use it, whatever it is. % \def\pickupwholefraction#1 {% \global\advance\colcount by 1 \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% \setuptable } \newcount\colcount \def\setuptable#1{% \def\firstarg{#1}% \ifx\firstarg\xendsetuptable \let\go = \relax \else \ifx\firstarg\xcolumnfractions \global\setpercenttrue \else \ifsetpercent \let\go\pickupwholefraction \else \global\advance\colcount by 1 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a % separator; typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi \fi \ifx\go\pickupwholefraction % Put the argument back for the \pickupwholefraction call, so % we'll always have a period there to be parsed. \def\go{\pickupwholefraction#1}% \else \let\go = \setuptable \fi% \fi \go } % multitable-only commands. % % @headitem starts a heading row, which we typeset in bold. % Assignments have to be global since we are inside the implicit group % of an alignment entry. \everycr resets \everytab so we don't have to % undo it ourselves. \def\headitemfont{\b}% for people to use in the template row; not changeable \def\headitem{% \checkenv\multitable \crcr \global\everytab={\bf}% can't use \headitemfont since the parsing differs \the\everytab % for the first item }% % % A \tab used to include \hskip1sp. But then the space in a template % line is not enough. That is bad. So let's go back to just `&' until % we again encounter the problem the 1sp was intended to solve. % --karl, nathan@acm.org, 20apr99. \def\tab{\checkenv\multitable &\the\everytab}% % @multitable ... @end multitable definitions: % \newtoks\everytab % insert after every tab. % \envdef\multitable{% \vskip\parskip \startsavinginserts % % @item within a multitable starts a normal row. % We use \def instead of \let so that if one of the multitable entries % contains an @itemize, we don't choke on the \item (seen as \crcr aka % \endtemplate) expanding \doitemize. \def\item{\crcr}% % \tolerance=9500 \hbadness=9500 \setmultitablespacing \parskip=\multitableparskip \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 % \everycr = {% \noalign{% \global\everytab={}% \global\colcount=0 % Reset the column counter. % Check for saved footnotes, etc. \checkinserts % Keeps underfull box messages off when table breaks over pages. %\filbreak % Maybe so, but it also creates really weird page breaks when the % table breaks over pages. Wouldn't \vfil be better? Wait until the % problem manifests itself, so it can be fixed for real --karl. }% }% % \parsearg\domultitable } \def\domultitable#1{% % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. \halign\bgroup &% \global\advance\colcount by 1 \multistrut \vtop{% % Use the current \colcount to find the correct column width: \hsize=\expandafter\csname col\the\colcount\endcsname % % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. % % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % % If the user has set preamble in terms of percent of \hsize we will % use that dimension as the width of the column, and the \leftskip % will keep entries from bumping into each other. Table will start at % left margin and final column will justify at right margin. % % Make sure we don't inherit \rightskip from the outer environment. \rightskip=0pt \ifnum\colcount=1 % The first column will be indented with the surrounding text. \advance\hsize by\leftskip \else \ifsetpercent \else % If user has not set preamble in terms of percent of \hsize % we will advance \hsize by \multitablecolspace. \advance\hsize by \multitablecolspace \fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi % Ignoring space at the beginning and end avoids an occasional spurious % blank line, when TeX decides to break the line at the space before the % box from the multistrut, so the strut ends up on a line by itself. % For example: % @multitable @columnfractions .11 .89 % @item @code{#} % @tab Legal holiday which is valid in major parts of the whole country. % Is automatically provided with highlighting sequences respectively % marking characters. \noindent\ignorespaces##\unskip\multistrut }\cr } \def\Emultitable{% \crcr \egroup % end the \halign \global\setpercentfalse } \def\setmultitablespacing{% \def\multistrut{\strut}% just use the standard line spacing % % Compute \multitablelinespace (if not defined by user) for use in % \multitableparskip calculation. We used define \multistrut based on % this, but (ironically) that caused the spacing to be off. % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. \ifdim\multitablelinespace=0pt \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip \global\advance\multitablelinespace by-\ht0 \fi % Test to see if parskip is larger than space between lines of % table. If not, do nothing. % If so, set to same dimension as multitablelinespace. \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller % than skip between lines in the table. \fi% \ifdim\multitableparskip=0pt \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller % than skip between lines in the table. \fi} \message{conditionals,} % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, % @ifnotxml always succeed. They currently do nothing; we don't % attempt to check whether the conditionals are properly nested. But we % have to remember that they are conditionals, so that @end doesn't % attempt to close an environment group. % \def\makecond#1{% \expandafter\let\csname #1\endcsname = \relax \expandafter\let\csname iscond.#1\endcsname = 1 } \makecond{iftex} \makecond{ifnotdocbook} \makecond{ifnothtml} \makecond{ifnotinfo} \makecond{ifnotplaintext} \makecond{ifnotxml} % Ignore @ignore, @ifhtml, @ifinfo, and the like. % \def\direntry{\doignore{direntry}} \def\documentdescription{\doignore{documentdescription}} \def\docbook{\doignore{docbook}} \def\html{\doignore{html}} \def\ifdocbook{\doignore{ifdocbook}} \def\ifhtml{\doignore{ifhtml}} \def\ifinfo{\doignore{ifinfo}} \def\ifnottex{\doignore{ifnottex}} \def\ifplaintext{\doignore{ifplaintext}} \def\ifxml{\doignore{ifxml}} \def\ignore{\doignore{ignore}} \def\menu{\doignore{menu}} \def\xml{\doignore{xml}} % Ignore text until a line `@end #1', keeping track of nested conditionals. % % A count to remember the depth of nesting. \newcount\doignorecount \def\doignore#1{\begingroup % Scan in ``verbatim'' mode: \obeylines \catcode`\@ = \other \catcode`\{ = \other \catcode`\} = \other % % Make sure that spaces turn into tokens that match what \doignoretext wants. \spaceisspace % % Count number of #1's that we've seen. \doignorecount = 0 % % Swallow text until we reach the matching `@end #1'. \dodoignore{#1}% } { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. \obeylines % % \gdef\dodoignore#1{% % #1 contains the command name as a string, e.g., `ifinfo'. % % Define a command to find the next `@end #1'. \long\def\doignoretext##1^^M@end #1{% \doignoretextyyy##1^^M@#1\_STOP_}% % % And this command to find another #1 command, at the beginning of a % line. (Otherwise, we would consider a line `@c @ifset', for % example, to count as an @ifset for nesting.) \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% % % And now expand that command. \doignoretext ^^M% }% } \def\doignoreyyy#1{% \def\temp{#1}% \ifx\temp\empty % Nothing found. \let\next\doignoretextzzz \else % Found a nested condition, ... \advance\doignorecount by 1 \let\next\doignoretextyyy % ..., look for another. % If we're here, #1 ends with ^^M\ifinfo (for example). \fi \next #1% the token \_STOP_ is present just after this macro. } % We have to swallow the remaining "\_STOP_". % \def\doignoretextzzz#1{% \ifnum\doignorecount = 0 % We have just found the outermost @end. \let\next\enddoignore \else % Still inside a nested condition. \advance\doignorecount by -1 \let\next\doignoretext % Look for the next @end. \fi \next } % Finish off ignored text. { \obeylines% % Ignore anything after the last `@end #1'; this matters in verbatim % environments, where otherwise the newline after an ignored conditional % would result in a blank line in the output. \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% } % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. % % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we % didn't need it. % We rely on the fact that \parsearg sets \catcode`\ =10. % \parseargdef\set{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% {% \makevalueexpandable \def\temp{#2}% \edef\next{\gdef\makecsname{SET#1}}% \ifx\temp\empty \next{}% \else \setzzz#2\endsetzzz \fi }% } % Remove the trailing space \setxxx inserted. \def\setzzz#1 \endsetzzz{\next{#1}} % @clear VAR clears (i.e., unsets) the variable VAR. % \parseargdef\clear{% {% \makevalueexpandable \global\expandafter\let\csname SET#1\endcsname=\relax }% } % @value{foo} gets the text saved in variable foo. \def\value{\begingroup\makevalueexpandable\valuexxx} \def\valuexxx#1{\expandablevalue{#1}\endgroup} { \catcode`\- = \active \catcode`\_ = \active % \gdef\makevalueexpandable{% \let\value = \expandablevalue % We don't want these characters active, ... \catcode`\-=\other \catcode`\_=\other % ..., but we might end up with active ones in the argument if % we're called from @code, as @code{@value{foo-bar_}}, though. % So \let them to their normal equivalents. \let-\normaldash \let_\normalunderscore } } % We have this subroutine so that we can handle at least some @value's % properly in indexes (we call \makevalueexpandable in \indexdummies). % The command has to be fully expandable (if the variable is set), since % the result winds up in the index file. This means that if the % variable's value contains other Texinfo commands, it's almost certain % it will fail (although perhaps we could fix that with sufficient work % to do a one-level expansion on the result, instead of complete). % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% \message{Variable `#1', used in @value, is not set.}% \else \csname SET#1\endcsname \fi } % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % % To get special treatment of `@end ifset,' call \makeond and the redefine. % \makecond{ifset} \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} \def\doifset#1#2{% {% \makevalueexpandable \let\next=\empty \expandafter\ifx\csname SET#2\endcsname\relax #1% If not set, redefine \next. \fi \expandafter }\next } \def\ifsetfail{\doignore{ifset}} % @ifclear VAR ... @end executes the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % % The `\else' inside the `\doifset' parameter is a trick to reuse the % above code: if the variable is not set, do nothing, if it is set, % then redefine \next to \ifclearfail. % \makecond{ifclear} \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} \def\ifclearfail{\doignore{ifclear}} % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written % without the @) is in fact defined. We can only feasibly check at the % TeX level, so something like `mathcode' is going to considered % defined even though it is not a Texinfo command. % \makecond{ifcommanddefined} \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} % \def\doifcmddefined#1#2{{% \makevalueexpandable \let\next=\empty \expandafter\ifx\csname #2\endcsname\relax #1% If not defined, \let\next as above. \fi \expandafter }\next } \def\ifcmddefinedfail{\doignore{ifcommanddefined}} % @ifcommandnotdefined CMD ... handled similar to @ifclear above. \makecond{ifcommandnotdefined} \def\ifcommandnotdefined{% \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}} \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}} % Set the `txicommandconditionals' variable, so documents have a way to % test if the @ifcommand...defined conditionals are available. \set txicommandconditionals % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. \let\dircategory=\comment % @defininfoenclose. \let\definfoenclose=\comment \message{indexing,} % Index generation facilities % Define \newwrite to be identical to plain tex's \newwrite % except not \outer, so it can be used within macros and \if's. \edef\newwrite{\makecsname{ptexnewwrite}} % \newindex {foo} defines an index named foo. % It automatically defines \fooindex such that % \fooindex ...rest of line... puts an entry in the index foo. % It also defines \fooindfile to be the number of the output channel for % the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 % Open the file \fi \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } % @defindex foo == \newindex{foo} % \def\defindex{\parsearg\newindex} % Define @defcodeindex, like @defindex except put all entries in @code. % \def\defcodeindex{\parsearg\newcodeindex} % \def\newcodeindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 \fi \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}}% } % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. % % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. % \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), % #3 the target index (bar). \def\dosynindex#1#2#3{% % Only do \closeout if we haven't already done it, else we'll end up % closing the target index. \expandafter \ifx\csname donesynindex#2\endcsname \relax % The \closeout helps reduce unnecessary open files; the limit on the % Acorn RISC OS is a mere 16 files. \expandafter\closeout\csname#2indfile\endcsname \expandafter\let\csname donesynindex#2\endcsname = 1 \fi % redefine \fooindfile: \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname \expandafter\let\csname#2indfile\endcsname=\temp % redefine \fooindex: \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% } % Define \doindex, the driver for all \fooindex macros. % Argument #1 is generated by the calling \fooindex macro, % and it is "foo", the name of the index. % \doindex just uses \parsearg; it calls \doind for the actual work. % This is because \doind is more useful to call from other macros. % There is also \dosubind {index}{topic}{subtopic} % which makes an entry in a two-level index such as the operation index. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} \def\singleindexer #1{\doind{\indexname}{#1}} % like the previous two, but they put @code around the argument. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} % Take care of Texinfo commands that can appear in an index entry. % Since there are some commands we want to expand, and others we don't, % we have to laboriously prevent expansion for those that we don't. % \def\indexdummies{% \escapechar = `\\ % use backslash in output files. \def\@{@}% change to @@ when we switch to @ as escape char in index files. \def\ {\realbackslash\space }% % % Need these unexpandable (because we define \tt as a dummy) % definitions when @{ or @} appear in index entry text. Also, more % complicated, when \tex is in effect and \{ is a \delimiter again. % We can't use \lbracecmd and \rbracecmd because texindex assumes % braces and backslashes are used only as delimiters. Perhaps we % should define @lbrace and @rbrace commands a la @comma. \def\{{{\tt\char123}}% \def\}{{\tt\char125}}% % % I don't entirely understand this, but when an index entry is % generated from a macro call, the \endinput which \scanmacro inserts % causes processing to be prematurely terminated. This is, % apparently, because \indexsorttmp is fully expanded, and \endinput % is an expandable command. The redefinition below makes \endinput % disappear altogether for that purpose -- although logging shows that % processing continues to some further point. On the other hand, it % seems \endinput does not hurt in the printed index arg, since that % is still getting written without apparent harm. % % Sample source (mac-idx3.tex, reported by Graham Percival to % help-texinfo, 22may06): % @macro funindex {WORD} % @findex xyz % @end macro % ... % @funindex commtest % % The above is not enough to reproduce the bug, but it gives the flavor. % % Sample whatsit resulting: % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} % % So: \let\endinput = \empty % % Do the redefinitions. \commondummies } % For the aux and toc files, @ is the escape character. So we want to % redefine everything using @ as the escape character (instead of % \realbackslash, still used for index files). When everything uses @, % this will be simpler. % \def\atdummies{% \def\@{@@}% \def\ {@ }% \let\{ = \lbraceatcmd \let\} = \rbraceatcmd % % Do the redefinitions. \commondummies \otherbackslash } % Called from \indexdummies and \atdummies. % \def\commondummies{% % % \definedummyword defines \#1 as \string\#1\space, thus effectively % preventing its expansion. This is used only for control words, % not control letters, because the \space would be incorrect for % control characters, but is needed to separate the control word % from whatever follows. % % For control letters, we have \definedummyletter, which omits the % space. % % These can be used both for control words that take an argument and % those that do not. If it is followed by {arg} in the input, then % that will dutifully get written to the index (or wherever). % \def\definedummyword ##1{\def##1{\string##1\space}}% \def\definedummyletter##1{\def##1{\string##1}}% \let\definedummyaccent\definedummyletter % \commondummiesnofonts % \definedummyletter\_% \definedummyletter\-% % % Non-English letters. \definedummyword\AA \definedummyword\AE \definedummyword\DH \definedummyword\L \definedummyword\O \definedummyword\OE \definedummyword\TH \definedummyword\aa \definedummyword\ae \definedummyword\dh \definedummyword\exclamdown \definedummyword\l \definedummyword\o \definedummyword\oe \definedummyword\ordf \definedummyword\ordm \definedummyword\questiondown \definedummyword\ss \definedummyword\th % % Although these internal commands shouldn't show up, sometimes they do. \definedummyword\bf \definedummyword\gtr \definedummyword\hat \definedummyword\less \definedummyword\sf \definedummyword\sl \definedummyword\tclose \definedummyword\tt % \definedummyword\LaTeX \definedummyword\TeX % % Assorted special characters. \definedummyword\arrow \definedummyword\bullet \definedummyword\comma \definedummyword\copyright \definedummyword\registeredsymbol \definedummyword\dots \definedummyword\enddots \definedummyword\entrybreak \definedummyword\equiv \definedummyword\error \definedummyword\euro \definedummyword\expansion \definedummyword\geq \definedummyword\guillemetleft \definedummyword\guillemetright \definedummyword\guilsinglleft \definedummyword\guilsinglright \definedummyword\lbracechar \definedummyword\leq \definedummyword\minus \definedummyword\ogonek \definedummyword\pounds \definedummyword\point \definedummyword\print \definedummyword\quotedblbase \definedummyword\quotedblleft \definedummyword\quotedblright \definedummyword\quoteleft \definedummyword\quoteright \definedummyword\quotesinglbase \definedummyword\rbracechar \definedummyword\result \definedummyword\textdegree % % We want to disable all macros so that they are not expanded by \write. \macrolist % \normalturnoffactive % % Handle some cases of @value -- where it does not contain any % (non-fully-expandable) commands. \makevalueexpandable } % \commondummiesnofonts: common to \commondummies and \indexnofonts. % \def\commondummiesnofonts{% % Control letters and accents. \definedummyletter\!% \definedummyaccent\"% \definedummyaccent\'% \definedummyletter\*% \definedummyaccent\,% \definedummyletter\.% \definedummyletter\/% \definedummyletter\:% \definedummyaccent\=% \definedummyletter\?% \definedummyaccent\^% \definedummyaccent\`% \definedummyaccent\~% \definedummyword\u \definedummyword\v \definedummyword\H \definedummyword\dotaccent \definedummyword\ogonek \definedummyword\ringaccent \definedummyword\tieaccent \definedummyword\ubaraccent \definedummyword\udotaccent \definedummyword\dotless % % Texinfo font commands. \definedummyword\b \definedummyword\i \definedummyword\r \definedummyword\sansserif \definedummyword\sc \definedummyword\slanted \definedummyword\t % % Commands that take arguments. \definedummyword\abbr \definedummyword\acronym \definedummyword\anchor \definedummyword\cite \definedummyword\code \definedummyword\command \definedummyword\dfn \definedummyword\dmn \definedummyword\email \definedummyword\emph \definedummyword\env \definedummyword\file \definedummyword\image \definedummyword\indicateurl \definedummyword\inforef \definedummyword\kbd \definedummyword\key \definedummyword\math \definedummyword\option \definedummyword\pxref \definedummyword\ref \definedummyword\samp \definedummyword\strong \definedummyword\tie \definedummyword\uref \definedummyword\url \definedummyword\var \definedummyword\verb \definedummyword\w \definedummyword\xref } % \indexnofonts is used when outputting the strings to sort the index % by, and when constructing control sequence names. It eliminates all % control sequences and just writes whatever the best ASCII sort string % would be for a given command (usually its argument). % \def\indexnofonts{% % Accent commands should become @asis. \def\definedummyaccent##1{\let##1\asis}% % We can just ignore other control letters. \def\definedummyletter##1{\let##1\empty}% % All control words become @asis by default; overrides below. \let\definedummyword\definedummyaccent % \commondummiesnofonts % % Don't no-op \tt, since it isn't a user-level command % and is used in the definitions of the active chars like <, >, |, etc. % Likewise with the other plain tex font commands. %\let\tt=\asis % \def\ { }% \def\@{@}% \def\_{\normalunderscore}% \def\-{}% @- shouldn't affect sorting % % Unfortunately, texindex is not prepared to handle braces in the % content at all. So for index sorting, we map @{ and @} to strings % starting with |, since that ASCII character is between ASCII { and }. \def\{{|a}% \def\lbracechar{|a}% % \def\}{|b}% \def\rbracechar{|b}% % % Non-English letters. \def\AA{AA}% \def\AE{AE}% \def\DH{DZZ}% \def\L{L}% \def\OE{OE}% \def\O{O}% \def\TH{ZZZ}% \def\aa{aa}% \def\ae{ae}% \def\dh{dzz}% \def\exclamdown{!}% \def\l{l}% \def\oe{oe}% \def\ordf{a}% \def\ordm{o}% \def\o{o}% \def\questiondown{?}% \def\ss{ss}% \def\th{zzz}% % \def\LaTeX{LaTeX}% \def\TeX{TeX}% % % Assorted special characters. % (The following {} will end up in the sort string, but that's ok.) \def\arrow{->}% \def\bullet{bullet}% \def\comma{,}% \def\copyright{copyright}% \def\dots{...}% \def\enddots{...}% \def\equiv{==}% \def\error{error}% \def\euro{euro}% \def\expansion{==>}% \def\geq{>=}% \def\guillemetleft{<<}% \def\guillemetright{>>}% \def\guilsinglleft{<}% \def\guilsinglright{>}% \def\leq{<=}% \def\minus{-}% \def\point{.}% \def\pounds{pounds}% \def\print{-|}% \def\quotedblbase{"}% \def\quotedblleft{"}% \def\quotedblright{"}% \def\quoteleft{`}% \def\quoteright{'}% \def\quotesinglbase{,}% \def\registeredsymbol{R}% \def\result{=>}% \def\textdegree{o}% % \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax \else \indexlquoteignore \fi % % We need to get rid of all macros, leaving only the arguments (if present). % Of course this is not nearly correct, but it is the best we can do for now. % makeinfo does not expand macros in the argument to @deffn, which ends up % writing an index entry, and texindex isn't prepared for an index sort entry % that starts with \. % % Since macro invocations are followed by braces, we can just redefine them % to take a single TeX argument. The case of a macro invocation that % goes to end-of-line is not handled. % \macrolist } % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us % ignore left quotes in the sort term. {\catcode`\`=\active \gdef\indexlquoteignore{\let`=\empty}} \let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? % Most index entries go through here, but \dosubind is the general case. % #1 is the index name, #2 is the entry text. \def\doind#1#2{\dosubind{#1}{#2}{}} % Workhorse for all \fooindexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- % empty if called from \doind, as we usually are (the main exception % is with most defuns, which call us directly). % \def\dosubind#1#2#3{% \iflinks {% % Store the main index entry text (including the third arg). \toks0 = {#2}% % If third arg is present, precede it with a space. \def\thirdarg{#3}% \ifx\thirdarg\empty \else \toks0 = \expandafter{\the\toks0 \space #3}% \fi % \edef\writeto{\csname#1indfile\endcsname}% % \safewhatsit\dosubindwrite }% \fi } % Write the entry in \toks0 to the index file: % \def\dosubindwrite{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% \fi % % Remember, we are within a group. \indexdummies % Must do this here, since \bf, etc expand at this stage \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % % Process the index entry with all font commands turned off, to % get the string to sort by. {\indexnofonts \edef\temp{\the\toks0}% need full expansion \xdef\indexsorttmp{\temp}% }% % % Set up the complete index entry, with both the sort key and % the original text, including any font commands. We write % three arguments to \entry to the .?? file (four in the % subentry case), texindex reduces to two when writing the .??s % sorted result. \edef\temp{% \write\writeto{% \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% }% \temp } % Take care of unwanted page breaks/skips around a whatsit: % % If a skip is the last thing on the list now, preserve it % by backing up by \lastskip, doing the \write, then inserting % the skip again. Otherwise, the whatsit generated by the % \write or \pdfdest will make \lastskip zero. The result is that % sequences like this: % @end defun % @tindex whatever % @defun ... % will have extra space inserted, because the \medbreak in the % start of the @defun won't see the skip inserted by the @end of % the previous defun. % % But don't do any of this if we're not in vertical mode. We % don't want to do a \vskip and prematurely end a paragraph. % % Avoid page breaks due to these extra skips, too. % % But wait, there is a catch there: % We'll have to check whether \lastskip is zero skip. \ifdim is not % sufficient for this purpose, as it ignores stretch and shrink parts % of the skip. The only way seems to be to check the textual % representation of the skip. % % The following is almost like \def\zeroskipmacro{0.0pt} except that % the ``p'' and ``t'' characters have catcode \other, not 11 (letter). % \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} % \newskip\whatsitskip \newcount\whatsitpenalty % % ..., ready, GO: % \def\safewhatsit#1{\ifhmode #1% \else % \lastskip and \lastpenalty cannot both be nonzero simultaneously. \whatsitskip = \lastskip \edef\lastskipmacro{\the\lastskip}% \whatsitpenalty = \lastpenalty % % If \lastskip is nonzero, that means the last item was a % skip. And since a skip is discardable, that means this % -\whatsitskip glue we're inserting is preceded by a % non-discardable item, therefore it is not a potential % breakpoint, therefore no \nobreak needed. \ifx\lastskipmacro\zeroskipmacro \else \vskip-\whatsitskip \fi % #1% % \ifx\lastskipmacro\zeroskipmacro % If \lastskip was zero, perhaps the last item was a penalty, and % perhaps it was >=10000, e.g., a \nobreak. In that case, we want % to re-insert the same penalty (values >10000 are used for various % signals); since we just inserted a non-discardable item, any % following glue (such as a \parskip) would be a breakpoint. For example: % @deffn deffn-whatever % @vindex index-whatever % Description. % would allow a break between the index-whatever whatsit % and the "Description." paragraph. \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi \else % On the other hand, if we had a nonzero \lastskip, % this make-up glue would be preceded by a non-discardable item % (the whatsit from the \write), so we must insert a \nobreak. \nobreak\vskip\whatsitskip \fi \fi} % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} % or % \entry {sortstring}{page}{topic}{subtopic} % The texindex program reads in these files and writes files % containing these kinds of lines: % \initial {c} % before the first topic whose initial is c % \entry {topic}{pagelist} % for a topic that is used without subtopics % \primary {topic} % for the beginning of a topic that is used with subtopics % \secondary {subtopic}{pagelist} % for each subtopic. % Define the user-accessible indexing commands % @findex, @vindex, @kindex, @cindex. \def\findex {\fnindex} \def\kindex {\kyindex} \def\cindex {\cpindex} \def\vindex {\vrindex} \def\tindex {\tpindex} \def\pindex {\pgindex} \def\cindexsub {\begingroup\obeylines\cindexsub} {\obeylines % \gdef\cindexsub "#1" #2^^M{\endgroup % \dosubind{cp}{#2}{#1}}} % Define the macros used in formatting output of the sorted index material. % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % \parseargdef\printindex{\begingroup \dobreak \chapheadingskip{10000}% % \smallfonts \rm \tolerance = 9500 \plainfrenchspacing \everypar = {}% don't want the \kern\-parindent from indentation suppression. % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains % \initial {@} % as its first line, TeX doesn't complain about mismatched braces % (because it thinks @} is a control sequence). \catcode`\@ = 11 \openin 1 \jobname.#1s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. \putwordIndexNonexistent \else % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. \read 1 to \temp \ifeof 1 \putwordIndexIsEmpty \else % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. \def\indexbackslash{\backslashcurfont}% \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns \input \jobname.#1s \enddoublecolumns \fi \fi \closein 1 \endgroup} % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. \def\initial#1{{% % Some minor font changes for the special characters. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt % % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. \nobreak \vskip 0pt plus 3\baselineskip \penalty 0 \vskip 0pt plus -3\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column % to column. It still won't often be perfect, because of the stretch % we need before each entry, but it's better. % % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip \leftline{\secbf #1}% % Do our best not to break after the initial. \nobreak \vskip .33\baselineskip plus .1\baselineskip }} % \entry typesets a paragraph consisting of the text (#1), dot leaders, and % then page number (#2) flushed to the right margin. It is used for index % and table of contents entries. The paragraph is indented by \leftskip. % % A straightforward implementation would start like this: % \def\entry#1#2{... % But this freezes the catcodes in the argument, and can cause problems to % @code, which sets - active. This problem was fixed by a kludge--- % ``-'' was active throughout whole index, but this isn't really right. % The right solution is to prevent \entry from swallowing the whole text. % --kasal, 21nov03 \def\entry{% \begingroup % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. \par % % Do not fill out the last line with white space. \parfillskip = 0in % % No extra space above this paragraph. \parskip = 0in % % Do not prefer a separate line ending with a hyphen to fewer lines. \finalhyphendemerits = 0 % % \hangindent is only relevant when the entry text and page number % don't both fit on one line. In that case, bob suggests starting the % dots pretty far over on the line. Unfortunately, a large % indentation looks wrong when the entry text itself is broken across % lines. So we use a small indentation and put up with long leaders. % % \hangafter is reset to 1 (which is the value we want) at the start % of each paragraph, so we need not do anything with that. \hangindent = 2em % % When the entry text needs to be broken, just fill out the first line % with blank space. \rightskip = 0pt plus1fil % % A bit of stretch before each entry for the benefit of balancing % columns. \vskip 0pt plus1pt % % When reading the text of entry, convert explicit line breaks % from @* into spaces. The user might give these in long section % titles, for instance. \def\*{\unskip\space\ignorespaces}% \def\entrybreak{\hfil\break}% % % Swallow the left brace of the text (first parameter): \afterassignment\doentry \let\temp = } \def\entrybreak{\unskip\space\ignorespaces}% \def\doentry{% \bgroup % Instead of the swallowed brace. \noindent \aftergroup\finishentry % And now comes the text of the entry. } \def\finishentry#1{% % #1 is the page number. % % The following is kludged to not output a line of dots in the index if % there are no page numbers. The next person who breaks this will be % cursed by a Unix daemon. \setbox\boxA = \hbox{#1}% \ifdim\wd\boxA = 0pt \ % \else % % If we must, put the page number on a line of its own, and fill out % this line with blank space. (The \hfil is overwhelmed with the % fill leaders glue in \indexdotfill if the page number does fit.) \hfil\penalty50 \null\nobreak\indexdotfill % Have leaders before the page number. % % The `\ ' here is removed by the implicit \unskip that TeX does as % part of (the primitive) \par. Without it, a spurious underfull % \hbox ensues. \ifpdf \pdfgettoks#1.% \ \the\toksA \else \ #1% \fi \fi \par \endgroup } % Like plain.tex's \dotfill, except uses up at least 1 em. \def\indexdotfill{\cleaders \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} \def\primary #1{\line{#1\hfil}} \newskip\secondaryindent \secondaryindent=0.5cm \def\secondary#1#2{{% \parfillskip=0in \parskip=0in \hangindent=1in \hangafter=1 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else #2 \fi \par }} % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. \catcode`\@=11 \newbox\partialpage \newdimen\doublecolumnhsize \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. \output = {% % % Here is a possibility not foreseen in manmac: if we accumulate a % whole lot of material, we might end up calling this \output % routine twice in a row (see the doublecol-lose test, which is % essentially a couple of indexes with @setchapternewpage off). In % that case we just ship out what is in \partialpage with the normal % output routine. Generally, \partialpage will be empty when this % runs and this will be a no-op. See the indexspread.tex test case. \ifvoid\partialpage \else \onepageout{\pagecontents\partialpage}% \fi % \global\setbox\partialpage = \vbox{% % Unvbox the main output page. \unvbox\PAGE \kern-\topskip \kern\baselineskip }% }% \eject % run that output routine to set \partialpage % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% % % Change the page size parameters. We could do this once outside this % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 % format, but then we repeat the same computation. Repeating a couple % of assignments once per index is clearly meaningless for the % execution time, so we may as well do it in one place. % % First we halve the line length, less a little for the gutter between % the columns. We compute the gutter based on the line length, so it % changes automatically with the paper format. The magic constant % below is chosen so that the gutter has the same value (well, +-<1pt) % as it did when we hard-coded it. % % We put the result in a separate register, \doublecolumhsize, so we % can restore it in \pagesofar, after \hsize itself has (potentially) % been clobbered. % \doublecolumnhsize = \hsize \advance\doublecolumnhsize by -.04154\hsize \divide\doublecolumnhsize by 2 \hsize = \doublecolumnhsize % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) \vsize = 2\vsize } % The double-column output routine for all double-column pages except % the last. % \def\doublecolumnout{% \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the % previous page. \dimen@ = \vsize \divide\dimen@ by 2 \advance\dimen@ by -\ht\partialpage % % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ \onepageout\pagesofar \unvbox255 \penalty\outputpenalty } % % Re-output the contents of the output page -- any previous material, % followed by the two boxes we just split, in box0 and box2. \def\pagesofar{% \unvbox\partialpage % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } % % All done with double columns. \def\enddoublecolumns{% % The following penalty ensures that the page builder is exercised % _before_ we change the output routine. This is necessary in the % following situation: % % The last section of the index consists only of a single entry. % Before this section, \pagetotal is less than \pagegoal, so no % break occurs before the last section starts. However, the last % section, consisting of \initial and the single \entry, does not % fit on the page and has to be broken off. Without the following % penalty the page builder will not be exercised until \eject % below, and by that time we'll already have changed the output % routine to the \balancecolumns version, so the next-to-last % double-column page will be processed with \balancecolumns, which % is wrong: The two columns will go to the main vertical list, with % the broken-off section in the recent contributions. As soon as % the output routine finishes, TeX starts reconsidering the page % break. The two columns and the broken-off section both fit on the % page, because the two columns now take up only half of the page % goal. When TeX sees \eject from below which follows the final % section, it invokes the new output routine that we've set after % \balancecolumns below; \onepageout will try to fit the two columns % and the final section into the vbox of \pageheight (see % \pagebody), causing an overfull box. % % Note that glue won't work here, because glue does not exercise the % page builder, unlike penalties (see The TeXbook, pp. 280-281). \penalty0 % \output = {% % Split the last of the double-column material. Leave it on the % current page, no automatic page break. \balancecolumns % % If we end up splitting too much material for the current page, % though, there will be another page break right after this \output % invocation ends. Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal % definition right away. (We hope \balancecolumns will never be % called on to balance too much material, but if it is, this makes % the output somewhat more palatable.) \global\output = {\onepageout{\pagecontents\PAGE}}% }% \eject \endgroup % started in \begindoublecolumns % % \pagegoal was set to the doubled \vsize above, since we restarted % the current page. We're now back to normal single-column % typesetting, so reset \pagegoal to the normal \vsize (after the % \endgroup where \vsize got restored). \pagegoal = \vsize } % % Called at the end of the double column material. \def\balancecolumns{% \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip \divide\dimen@ by 2 % target to split to %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% \splittopskip = \topskip % Loop until we get a decent breakpoint. {% \vbadness = 10000 \loop \global\setbox3 = \copy0 \global\setbox1 = \vsplit3 to \dimen@ \ifdim\ht3>\dimen@ \global\advance\dimen@ by 1pt \repeat }% %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% \setbox0=\vbox to\dimen@{\unvbox1}% \setbox2=\vbox to\dimen@{\unvbox3}% % \pagesofar } \catcode`\@ = \other \message{sectioning,} % Chapters, sections, etc. % Let's start with @part. \outer\parseargdef\part{\partzzz{#1}} \def\partzzz#1{% \chapoddpage \null \vskip.3\vsize % move it down on the page a bit \begingroup \noindent \titlefonts\rmisbold #1\par % the text \let\lastnode=\empty % no node to associate with \writetocentry{part}{#1}{}% but put it in the toc \headingsoff % no headline or footline on the part page \chapoddpage \endgroup } % \unnumberedno is an oxymoron. But we count the unnumbered % sections so that we can refer to them unambiguously in the pdf % outlines by their "section number". We avoid collisions with chapter % numbers by starting them at 10000. (If a document ever has 10000 % chapters, we're in trouble anyway, I'm sure.) \newcount\unnumberedno \unnumberedno = 10000 \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 \newcount\subsubsecno \subsubsecno=0 % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ % % \def\appendixletter{\char\the\appendixno} % We do the following ugly conditional instead of the above simple % construct for the sake of pdftex, which needs the actual % letter in the expansion, not just typeset. % \def\appendixletter{% \ifnum\appendixno=`A A% \else\ifnum\appendixno=`B B% \else\ifnum\appendixno=`C C% \else\ifnum\appendixno=`D D% \else\ifnum\appendixno=`E E% \else\ifnum\appendixno=`F F% \else\ifnum\appendixno=`G G% \else\ifnum\appendixno=`H H% \else\ifnum\appendixno=`I I% \else\ifnum\appendixno=`J J% \else\ifnum\appendixno=`K K% \else\ifnum\appendixno=`L L% \else\ifnum\appendixno=`M M% \else\ifnum\appendixno=`N N% \else\ifnum\appendixno=`O O% \else\ifnum\appendixno=`P P% \else\ifnum\appendixno=`Q Q% \else\ifnum\appendixno=`R R% \else\ifnum\appendixno=`S S% \else\ifnum\appendixno=`T T% \else\ifnum\appendixno=`U U% \else\ifnum\appendixno=`V V% \else\ifnum\appendixno=`W W% \else\ifnum\appendixno=`X X% \else\ifnum\appendixno=`Y Y% \else\ifnum\appendixno=`Z Z% % The \the is necessary, despite appearances, because \appendixletter is % expanded while writing the .toc file. \char\appendixno is not % expandable, thus it is written literally, thus all appendixes come out % with the same letter (or @) in the toc without it. \else\char\the\appendixno \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} % Each @chapter defines these (using marks) as the number+name, number % and name of the chapter. Page headings and footings can use % these. @section does likewise. \def\thischapter{} \def\thischapternum{} \def\thischaptername{} \def\thissection{} \def\thissectionnum{} \def\thissectionname{} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} \let\up=\raisesections % original BFox name % @lowersections: treat @chapter as section, @section as subsection, etc. \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name % we only have subsub. \chardef\maxseclevel = 3 % % A numbered section within an unnumbered changes to unnumbered too. % To achieve this, remember the "biggest" unnum. sec. we are currently in: \chardef\unnlevel = \maxseclevel % % Trace whether the current chapter is an appendix or not: % \chapheadtype is "N" or "A", unnumbered chapters are ignored. \def\chapheadtype{N} % Choose a heading macro % #1 is heading type % #2 is heading level % #3 is text for heading \def\genhead#1#2#3{% % Compute the abs. sec. level: \absseclevel=#2 \advance\absseclevel by \secbase % Make sure \absseclevel doesn't fall outside the range: \ifnum \absseclevel < 0 \absseclevel = 0 \else \ifnum \absseclevel > 3 \absseclevel = 3 \fi \fi % The heading type: \def\headtype{#1}% \if \headtype U% \ifnum \absseclevel < \unnlevel \chardef\unnlevel = \absseclevel \fi \else % Check for appendix sections: \ifnum \absseclevel = 0 \edef\chapheadtype{\headtype}% \else \if \headtype A\if \chapheadtype N% \errmessage{@appendix... within a non-appendix chapter}% \fi\fi \fi % Check for numbered within unnumbered: \ifnum \absseclevel > \unnlevel \def\headtype{U}% \else \chardef\unnlevel = 3 \fi \fi % Now print the heading: \if \headtype U% \ifcase\absseclevel \unnumberedzzz{#3}% \or \unnumberedseczzz{#3}% \or \unnumberedsubseczzz{#3}% \or \unnumberedsubsubseczzz{#3}% \fi \else \if \headtype A% \ifcase\absseclevel \appendixzzz{#3}% \or \appendixsectionzzz{#3}% \or \appendixsubseczzz{#3}% \or \appendixsubsubseczzz{#3}% \fi \else \ifcase\absseclevel \chapterzzz{#3}% \or \seczzz{#3}% \or \numberedsubseczzz{#3}% \or \numberedsubsubseczzz{#3}% \fi \fi \fi \suppressfirstparagraphindent } % an interface: \def\numhead{\genhead N} \def\apphead{\genhead A} \def\unnmhead{\genhead U} % @chapter, @appendix, @unnumbered. Increment top-level counter, reset % all lower-level sectioning counters to zero. % % Also set \chaplevelprefix, which we prepend to @float sequence numbers % (e.g., figures), q.v. By default (before any chapter), that is empty. \let\chaplevelprefix = \empty % \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz \def\chapterzzz#1{% % section resetting is \global in case the chapter is in a group, such % as an @include file. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\chapno by 1 % % Used for \float. \gdef\chaplevelprefix{\the\chapno.}% \resetallfloatnos % % \putwordChapter can contain complex things in translations. \toks0=\expandafter{\putwordChapter}% \message{\the\toks0 \space \the\chapno}% % % Write the actual heading. \chapmacro{#1}{Ynumbered}{\the\chapno}% % % So @section and the like are numbered underneath this chapter. \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec } \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz % \def\appendixzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\appendixno by 1 \gdef\chaplevelprefix{\appendixletter.}% \resetallfloatnos % % \putwordAppendix can contain complex things in translations. \toks0=\expandafter{\putwordAppendix}% \message{\the\toks0 \space \appendixletter}% % \chapmacro{#1}{Yappendix}{\appendixletter}% % \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec } % normally unnmhead0 calls unnumberedzzz: \outer\parseargdef\unnumbered{\unnmhead0{#1}} \def\unnumberedzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\unnumberedno by 1 % % Since an unnumbered has no number, no prefix for figures. \global\let\chaplevelprefix = \empty \resetallfloatnos % % This used to be simply \message{#1}, but TeX fully expands the % argument to \message. Therefore, if #1 contained @-commands, TeX % expanded them. For example, in `@unnumbered The @cite{Book}', TeX % expanded @cite (which turns out to cause errors because \cite is meant % to be executed, not expanded). % % Anyway, we don't want the fully-expanded definition of @cite to appear % as a result of the \message, we just want `@cite' itself. We use % \the to achieve this: TeX expands \the only once, % simply yielding the contents of . (We also do this for % the toc entries.) \toks0 = {#1}% \message{(\the\toks0)}% % \chapmacro{#1}{Ynothing}{\the\unnumberedno}% % \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec } % @centerchap is like @unnumbered, but the heading is centered. \outer\parseargdef\centerchap{% % Well, we could do the following in a group, but that would break % an assumption that \chapmacro is called at the outermost level. % Thus we are safer this way: --kasal, 24feb04 \let\centerparametersmaybe = \centerparameters \unnmhead0{#1}% \let\centerparametersmaybe = \relax } % @top is like @unnumbered. \let\top\unnumbered % Sections. % \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz \def\seczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% } % normally calls appendixsectionzzz: \outer\parseargdef\appendixsection{\apphead1{#1}} \def\appendixsectionzzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% } \let\appendixsec\appendixsection % normally calls unnumberedseczzz: \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} \def\unnumberedseczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% } % Subsections. % % normally calls numberedsubseczzz: \outer\parseargdef\numberedsubsec{\numhead2{#1}} \def\numberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% } % normally calls appendixsubseczzz: \outer\parseargdef\appendixsubsec{\apphead2{#1}} \def\appendixsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno}% } % normally calls unnumberedsubseczzz: \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} \def\unnumberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno}% } % Subsubsections. % % normally numberedsubsubseczzz: \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} \def\numberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynumbered}% {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% } % normally appendixsubsubseczzz: \outer\parseargdef\appendixsubsubsec{\apphead3{#1}} \def\appendixsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% } % normally unnumberedsubsubseczzz: \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} \def\unnumberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% } % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. \let\section = \numberedsec \let\subsection = \numberedsubsec \let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading \def\majorheading{% {\advance\chapheadingskip by 10pt \chapbreak }% \parsearg\chapheadingzzz } \def\chapheading{\chapbreak \parsearg\chapheadingzzz} \def\chapheadingzzz#1{% \vbox{\chapfonts \raggedtitlesettings #1\par}% \nobreak\bigskip \nobreak \suppressfirstparagraphindent } % @heading, @subheading, @subsubheading. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), % given all the information in convenient, parsed form. % Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} % Parameter controlling skip before chapter headings (if needed) \newskip\chapheadingskip % Define plain chapter starts, and page on/off switching for it. \def\chapbreak{\dobreak \chapheadingskip {-4000}} \def\chappager{\par\vfill\supereject} % Because \domark is called before \chapoddpage, the filler page will % get the headings for the next chapter, which is wrong. But we don't % care -- we just disable all headings on the filler page. \def\chapoddpage{% \chappager \ifodd\pageno \else \begingroup \headingsoff \null \chappager \endgroup \fi } \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} \def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{% \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} \CHAPPAGon % Chapter opening. % % #1 is the text, #2 is the section type (Ynumbered, Ynothing, % Yappendix, Yomitfromtoc), #3 the chapter number. % % To test against our argument. \def\Ynothingkeyword{Ynothing} \def\Yomitfromtockeyword{Yomitfromtoc} \def\Yappendixkeyword{Yappendix} % \def\chapmacro#1#2#3{% % Insert the first mark before the heading break (see notes for \domark). \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% \gdef\thissection{}}% % \def\temptype{#2}% \ifx\temptype\Ynothingkeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{\thischaptername}}% \else\ifx\temptype\Yomitfromtockeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{}}% \else\ifx\temptype\Yappendixkeyword \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\appendixletter}% % \noexpand\putwordAppendix avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \else \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\the\chapno}% % \noexpand\putwordChapter avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thischapter{\noexpand\putwordChapter{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \fi\fi\fi % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert the chapter heading break. \pchapsepmacro % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \domark % {% \chapfonts \rmisbold % % Have to define \lastsection before calling \donoderef, because the % xref code eventually uses it. On the other hand, it has to be called % after \pchapsepmacro, or the headline will change too soon. \gdef\lastsection{#1}% % % Only insert the separating space if we have a chapter/appendix % number, and don't print the unnumbered ``number''. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unnchap}% \else\ifx\temptype\Yomitfromtockeyword \setbox0 = \hbox{}% contents like unnumbered, but no toc entry \def\toctype{omit}% \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% \def\toctype{app}% \else \setbox0 = \hbox{#3\enspace}% \def\toctype{numchap}% \fi\fi\fi % % Write the toc entry for this chapter. Must come before the % \donoderef, because we include the current node name in the toc % entry, and \donoderef resets it to empty. \writetocentry{\toctype}{#1}{#3}% % % For pdftex, we have to write out the node definition (aka, make % the pdfdest) after any page break, but before the actual text has % been typeset. If the destination for the pdf outline is after the % text, then jumping from the outline may wind up with the text not % being visible, for instance under high magnification. \donoderef{#2}% % % Typeset the actual heading. \nobreak % Avoid page breaks at the interline glue. \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax \def\centerparameters{% \advance\rightskip by 3\rightskip \leftskip = \rightskip \parfillskip = 0pt } % I don't think this chapter style is supported any more, so I'm not % updating it with the new noderef stuff. We'll see. --karl, 11aug03. % \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} % \def\unnchfopen #1{% \chapoddpage \vbox{\chapfonts \raggedtitlesettings #1\par}% \nobreak\bigskip\nobreak } \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } \def\centerchfopen #1{% \chapoddpage \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}% \nobreak\bigskip \nobreak } \def\CHAPFopen{% \global\let\chapmacro=\chfopen \global\let\centerchapmacro=\centerchfopen} % Section titles. These macros combine the section number parts and % call the generic \sectionheading to do the printing. % \newskip\secheadingskip \def\secheadingbreak{\dobreak \secheadingskip{-1000}} % Subsection titles. \newskip\subsecheadingskip \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} % Subsubsection titles. \def\subsubsecheadingskip{\subsecheadingskip} \def\subsubsecheadingbreak{\subsecheadingbreak} % Print any size, any type, section title. % % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the % section number. % \def\seckeyword{sec} % \def\sectionheading#1#2#3#4{% {% \checkenv{}% should not be in an environment. % % Switch to the right set of fonts. \csname #2fonts\endcsname \rmisbold % \def\sectionlevel{#2}% \def\temptype{#3}% % % Insert first mark before the heading break (see notes for \domark). \let\prevsectiondefs=\lastsectiondefs \ifx\temptype\Ynothingkeyword \ifx\sectionlevel\seckeyword \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% \gdef\thissection{\thissectionname}}% \fi \else\ifx\temptype\Yomitfromtockeyword % Don't redefine \thissection. \else\ifx\temptype\Yappendixkeyword \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thissection{\noexpand\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \else \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thissection{\noexpand\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \fi\fi\fi % % Go into vertical mode. Usually we'll already be there, but we % don't want the following whatsit to end up in a preceding paragraph % if the document didn't happen to have a blank line. \par % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert space above the heading. \csname #2headingbreak\endcsname % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevsectiondefs=\lastsectiondefs \domark % % Only insert the space after the number if we have a section number. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unn}% \gdef\lastsection{#1}% \else\ifx\temptype\Yomitfromtockeyword % for @headings -- no section number, don't include in toc, % and don't redefine \lastsection. \setbox0 = \hbox{}% \def\toctype{omit}% \let\sectionlevel=\empty \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{#4\enspace}% \def\toctype{app}% \gdef\lastsection{#1}% \else \setbox0 = \hbox{#4\enspace}% \def\toctype{num}% \gdef\lastsection{#1}% \fi\fi\fi % % Write the toc entry (before \donoderef). See comments in \chapmacro. \writetocentry{\toctype\sectionlevel}{#1}{#4}% % % Write the node reference (= pdf destination for pdftex). % Again, see comments in \chapmacro. \donoderef{#3}% % % Interline glue will be inserted when the vbox is completed. % That glue will be a valid breakpoint for the page, since it'll be % preceded by a whatsit (usually from the \donoderef, or from the % \writetocentry if there was no node). We don't want to allow that % break, since then the whatsits could end up on page n while the % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. \nobreak % % Output the actual section heading. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright \hangindent=\wd0 % zero if no section number \unhbox0 #1}% }% % Add extra space after the heading -- half of whatever came above it. % Don't allow stretch, though. \kern .5 \csname #2headingskip\endcsname % % Do not let the kern be a potential breakpoint, as it would be if it % was followed by glue. \nobreak % % We'll almost certainly start a paragraph next, so don't let that % glue accumulate. (Not a breakpoint because it's preceded by a % discardable item.) However, when a paragraph is not started next % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out % or the negative glue will cause weirdly wrong output, typically % obscuring the section heading with something else. \vskip-\parskip % % This is so the last item on the main vertical list is a known % \penalty > 10000, so \startdefun, etc., can recognize the situation % and do the needful. \penalty 10001 } \message{toc,} % Table of contents. \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. % Called from @chapter, etc. % % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} % We append the current node name (if any) and page number as additional % arguments for the \{chap,sec,...}entry macros which will eventually % read this. The node name is used in the pdf outlines as the % destination to jump to. % % We open the .toc file for writing here instead of at @setfilename (or % any other fixed time) so that @contents can be anywhere in the document. % But if #1 is `omit', then we don't do anything. This is used for the % table of contents chapter openings themselves. % \newif\iftocfileopened \def\omitkeyword{omit}% % \def\writetocentry#1#2#3{% \edef\writetoctype{#1}% \ifx\writetoctype\omitkeyword \else \iftocfileopened\else \immediate\openout\tocfile = \jobname.toc \global\tocfileopenedtrue \fi % \iflinks {\atdummies \edef\temp{% \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% \temp }% \fi \fi % % Tell \shipout to create a pdf destination on each page, if we're % writing pdf. These are used in the table of contents. We can't % just write one on every page because the title pages are numbered % 1 and 2 (the page numbers aren't printed), and so are the first % two pages of the document. Thus, we'd have two destinations named % `1', and two named `2'. \ifpdf \global\pdfmakepagedesttrue \fi } % These characters do not print properly in the Computer Modern roman % fonts, so we must take special care. This is more or less redundant % with the Texinfo input format setup at the end of this file. % \def\activecatcodes{% \catcode`\"=\active \catcode`\$=\active \catcode`\<=\active \catcode`\>=\active \catcode`\\=\active \catcode`\^=\active \catcode`\_=\active \catcode`\|=\active \catcode`\~=\active } % Read the toc file, which is essentially Texinfo input. \def\readtocfile{% \setupdatafile \activecatcodes \input \tocreadfilename } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 % Prepare to read what we've written to \tocfile. % \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should % start on an odd page, unlike chapters. Thus, we maintain % \contentsalignmacro in parallel with \pagealignmacro. % From: Torbjorn Granlund \contentsalignmacro \immediate\closeout\tocfile % % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \chapmacro{#1}{Yomitfromtoc}{}% % \savepageno = \pageno \begingroup % Set up to handle contents files properly. \raggedbottom % Worry more about breakpoints than the bottom. \advance\hsize by -\contentsrightmargin % Don't use the full line length. % % Roman numerals for page numbers. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi } % redefined for the two-volume lispref. We always output on % \jobname.toc even if this is redefined. % \def\tocreadfilename{\jobname.toc} % Normal (long) toc. % \def\contents{% \startcontents{\putwordTOC}% \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \ifeof 1 \else \pdfmakeoutlines \fi \closein 1 \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } % And just the chapters. \def\summarycontents{% \startcontents{\putwordShortTOC}% % \let\partentry = \shortpartentry \let\numchapentry = \shortchapentry \let\appentry = \shortchapentry \let\unnchapentry = \shortunnchapentry % We want a true roman here for the page numbers. \secfonts \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl \let\tt=\shortconttt \rm \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\numsecentry##1##2##3##4{} \let\appsecentry = \numsecentry \let\unnsecentry = \numsecentry \let\numsubsecentry = \numsecentry \let\appsubsecentry = \numsecentry \let\unnsubsecentry = \numsecentry \let\numsubsubsecentry = \numsecentry \let\appsubsubsecentry = \numsecentry \let\unnsubsubsecentry = \numsecentry \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \closein 1 \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } \let\shortcontents = \summarycontents % Typeset the label for a chapter or appendix for the short contents. % The arg is, e.g., `A' for an appendix, or `3' for a chapter. % \def\shortchaplabel#1{% % This space should be enough, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. % But use \hss just in case. % (This space doesn't include the extra space that gets added after % the label; that gets put in by \shortchapentry above.) % % We'd like to right-justify chapter numbers, but that looks strange % with appendix letters. And right-justifying numbers and % left-justifying letters looks strange when there is less than 10 % chapters. Have to read the whole toc once to know how many chapters % there are before deciding ... \hbox to 1em{#1\hss}% } % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. % The last argument is the page number. % The arguments in between are the chapter number, section number, ... % Parts, in the main contents. Replace the part number, which doesn't % exist, with an empty box. Let's hope all the numbers have the same width. % Also ignore the page number, which is conventionally not printed. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}} % % Parts, in the short toc. \def\shortpartentry#1#2#3#4{% \penalty-300 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip \shortchapentry{{\bf #1}}{\numeralbox}{}{}% } % Chapters, in the main contents. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} % % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3#4{% \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% } % Appendices, in the main contents. % Need the word Appendix, and a fixed-size box. % \def\appendixbox#1{% % We use M since it's probably the widest letter. \setbox0 = \hbox{\putwordAppendix{} M}% \hbox to \wd0{\putwordAppendix{} #1\hss}} % \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} % Unnumbered chapters. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} % Sections. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} \let\appsecentry=\numsecentry \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} % Subsections. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} \let\appsubsecentry=\numsubsecentry \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} % And subsubsections. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} \let\appsubsubsecentry=\numsubsubsecentry \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} % This parameter controls the indentation of the various levels. % Same as \defaultparindent. \newdimen\tocindent \tocindent = 15pt % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. % % If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. \def\dochapentry#1#2{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup \chapentryfonts \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup \secentryfonts \leftskip=\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsecentry#1#2{\begingroup \subsecentryfonts \leftskip=2\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsubsecentry#1#2{\begingroup \subsubsecentryfonts \leftskip=3\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} % We use the same \entry macro as for the index entries. \let\tocentry = \entry % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} \def\dopageno#1{{\rm #1}} \def\doshortpageno#1{{\rm #1}} \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} \def\subsecentryfonts{\textfonts} \def\subsubsecentryfonts{\textfonts} \message{environments,} % @foo ... @end foo. % @tex ... @end tex escapes into raw TeX temporarily. % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain @ character. \envdef\tex{% \setupmarkupstyle{tex}% \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie \catcode `\%=14 \catcode `\+=\other \catcode `\"=\other \catcode `\|=\other \catcode `\<=\other \catcode `\>=\other \catcode`\`=\other \catcode`\'=\other \escapechar=`\\ % % ' is active in math mode (mathcode"8000). So reset it, and all our % other math active characters (just in case), to plain's definitions. \mathactive % \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc \let\,=\ptexcomma \let\.=\ptexdot \let\dots=\ptexdots \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi \let\indent=\ptexindent \let\noindent=\ptexnoindent \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace \let\/=\ptexslash \let\*=\ptexstar \let\t=\ptext \expandafter \let\csname top\endcsname=\ptextop % outer \let\frenchspacing=\plainfrenchspacing % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% } % There is no need to define \Etex. % Define @lisp ... @end lisp. % @lisp environment forms a group so it can rebind things, % including the definition of @end lisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. \newskip\lispnarrowing \lispnarrowing=0.4in % This is the definition that ^^M gets inside @lisp, @example, and other % such environments. \null is better than a space, since it doesn't % have any width. \def\lisppar{\null\endgraf} % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt % Make spacing and below environment symmetrical. We use \parskip here % to help in doing that, since in @example-like environments \parskip % is reset to zero; thus the \afterenvbreak inserts no space -- but the % start of the next paragraph will insert \parskip. % \def\aboveenvbreak{{% % =10000 instead of <10000 because of a special case in \itemzzz and % \sectionheading, q.v. \ifnum \lastpenalty=10000 \else \advance\envskipamount by \parskip \endgraf \ifdim\lastskip<\envskipamount \removelastskip % it's not a good place to break if the last penalty was \nobreak % or better ... \ifnum\lastpenalty<10000 \penalty-50 \fi \vskip\envskipamount \fi \fi }} \let\afterenvbreak = \aboveenvbreak % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will % also clear it, so that its embedded environments do the narrowing again. \let\nonarrowing=\relax % @cartouche ... @end cartouche: draw rectangle w/rounded corners around % environment contents. \font\circle=lcircle10 \newdimen\circthick \newdimen\cartouter\newdimen\cartinner \newskip\normbskip\newskip\normpskip\newskip\normlskip \circthick=\fontdimen8\circle % \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth \def\ctr{{\hskip 6pt\circle\char'010}} \def\cbl{{\circle\char'012\hskip -6pt}} \def\cbr{{\hskip 6pt\circle\char'011}} \def\carttop{\hbox to \cartouter{\hskip\lskip \ctl\leaders\hrule height\circthick\hfil\ctr \hskip\rskip}} \def\cartbot{\hbox to \cartouter{\hskip\lskip \cbl\leaders\hrule height\circthick\hfil\cbr \hskip\rskip}} % \newskip\lskip\newskip\rskip \envdef\cartouche{% \ifhmode\par\fi % can't be in the midst of a paragraph. \startsavinginserts \lskip=\leftskip \rskip=\rightskip \leftskip=0pt\rightskip=0pt % we want these *outside*. \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip \cartouter=\hsize \advance\cartouter by 18.4pt % allow for 3pt kerns on either % side, and for 6pt waste from % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing = t% % % If this cartouche directly follows a sectioning command, we need the % \parskip glue (backspaced over by default) or the cartouche can % collide with the section heading. \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi % \vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop \hbox\bgroup \hskip\lskip \vrule\kern3pt \vbox\bgroup \kern3pt \hsize=\cartinner \baselineskip=\normbskip \lineskip=\normlskip \parskip=\normpskip \vskip -\parskip \comment % For explanation, see the end of def\group. } \def\Ecartouche{% \ifhmode\par\fi \kern3pt \egroup \kern3pt\vrule \hskip\rskip \egroup \cartbot \egroup \checkinserts } % This macro is called at the beginning of all the @example variants, % inside a group. \newdimen\nonfillparindent \def\nonfillstart{% \aboveenvbreak \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt % Turn off paragraph indentation but redefine \indent to emulate % the normal \indent. \nonfillparindent=\parindent \parindent = 0pt \let\indent\nonfillindent % \emergencystretch = 0pt % don't try to avoid overfull boxes \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing \else \let\nonarrowing = \relax \fi \let\exdent=\nofillexdent } \begingroup \obeyspaces % We want to swallow spaces (but not other tokens) after the fake % @indent in our nonfill-environments, where spaces are normally % active and set to @tie, resulting in them not being ignored after % @indent. \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% \gdef\nonfillindentcheck{% \ifx\temp % \expandafter\nonfillindentgobble% \else% \leavevmode\nonfillindentbox% \fi% }% \endgroup \def\nonfillindentgobble#1{\nonfillindent} \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} % If you want all examples etc. small: @set dispenvsize small. % If you want even small examples the full size: @set dispenvsize nosmall. % This affects the following displayed environments: % @example, @display, @format, @lisp % \def\smallword{small} \def\nosmallword{nosmall} \let\SETdispenvsize\relax \def\setnormaldispenv{% \ifx\SETdispenvsize\smallword % end paragraph for sake of leading, in case document has no blank % line. This is redundant with what happens in \aboveenvbreak, but % we need to do it before changing the fonts, and it's inconvenient % to change the fonts afterward. \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } \def\setsmalldispenv{% \ifx\SETdispenvsize\nosmallword \else \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } % We often define two environments, @foo and @smallfoo. % Let's do it in one command. #1 is the env name, #2 the definition. \def\makedispenvdef#1#2{% \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% \expandafter\let\csname E#1\endcsname \afterenvbreak \expandafter\let\csname Esmall#1\endcsname \afterenvbreak } % Define two environment synonyms (#1 and #2) for an environment. \def\maketwodispenvdef#1#2#3{% \makedispenvdef{#1}{#3}% \makedispenvdef{#2}{#3}% } % % @lisp: indented, narrowed, typewriter font; % @example: same as @lisp. % % @smallexample and @smalllisp: use smaller fonts. % Originally contributed by Pavel@xerox. % \maketwodispenvdef{lisp}{example}{% \nonfillstart \tt\setupmarkupstyle{example}% \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } % @display/@smalldisplay: same as @lisp except keep current font. % \makedispenvdef{display}{% \nonfillstart \gobble } % @format/@smallformat: same as @display except don't narrow margins. % \makedispenvdef{format}{% \let\nonarrowing = t% \nonfillstart \gobble } % @flushleft: same as @format, but doesn't obey \SETdispenvsize. \envdef\flushleft{% \let\nonarrowing = t% \nonfillstart \gobble } \let\Eflushleft = \afterenvbreak % @flushright. % \envdef\flushright{% \let\nonarrowing = t% \nonfillstart \advance\leftskip by 0pt plus 1fill\relax \gobble } \let\Eflushright = \afterenvbreak % @raggedright does more-or-less normal line breaking but no right % justification. From plain.tex. \envdef\raggedright{% \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax } \let\Eraggedright\par \envdef\raggedleft{% \parindent=0pt \leftskip0pt plus2em \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt \hbadness=10000 % Last line will usually be underfull, so turn off % badness reporting. } \let\Eraggedleft\par \envdef\raggedcenter{% \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt \hbadness=10000 % Last line will usually be underfull, so turn off % badness reporting. } \let\Eraggedcenter\par % @quotation does normal linebreaking (hence we can't use \nonfillstart) % and narrows the margins. We keep \parskip nonzero in general, since % we're doing normal filling. So, when using \aboveenvbreak and % \afterenvbreak, temporarily make \parskip 0. % \makedispenvdef{quotation}{\quotationstart} % \def\quotationstart{% \indentedblockstart % same as \indentedblock, but increase right margin too. \ifx\nonarrowing\relax \advance\rightskip by \lispnarrowing \fi \parsearg\quotationlabel } % We have retained a nonzero parskip for the environment, since we're % doing normal filling. % \def\Equotation{% \par \ifx\quotationauthor\thisisundefined\else % indent a bit. \leftline{\kern 2\leftskip \sl ---\quotationauthor}% \fi {\parskip=0pt \afterenvbreak}% } \def\Esmallquotation{\Equotation} % If we're given an argument, typeset it in bold with a colon after. \def\quotationlabel#1{% \def\temp{#1}% \ifx\temp\empty \else {\bf #1: }% \fi } % @indentedblock is like @quotation, but indents only on the left and % has no optional argument. % \makedispenvdef{indentedblock}{\indentedblockstart} % \def\indentedblockstart{% {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \parindent=0pt % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax \advance\leftskip by \lispnarrowing \exdentamount = \lispnarrowing \else \let\nonarrowing = \relax \fi } % Keep a nonzero parskip for the environment, since we're doing normal filling. % \def\Eindentedblock{% \par {\parskip=0pt \afterenvbreak}% } \def\Esmallindentedblock{\Eindentedblock} % LaTeX-like @verbatim...@end verbatim and @verb{...} % If we want to allow any as delimiter, % we need the curly braces so that makeinfo sees the @verb command, eg: % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org % % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. % % [Knuth] p.344; only we need to do the other characters Texinfo sets % active too. Otherwise, they get lost as the first character on a % verbatim line. \def\dospecials{% \do\ \do\\\do\{\do\}\do\$\do\&% \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% \do\<\do\>\do\|\do\@\do+\do\"% % Don't do the quotes -- if we do, @set txicodequoteundirected and % @set txicodequotebacktick will not have effect on @verb and % @verbatim, and ?` and !` ligatures won't get disabled. %\do\`\do\'% } % % [Knuth] p. 380 \def\uncatcodespecials{% \def\do##1{\catcode`##1=\other}\dospecials} % % Setup for the @verb command. % % Eight spaces for a tab \begingroup \catcode`\^^I=\active \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} \endgroup % \def\setupverb{% \tt % easiest (and conventionally used) font for verbatim \def\par{\leavevmode\endgraf}% \setupmarkupstyle{verb}% \tabeightspaces % Respect line breaks, % print special symbols as themselves, and % make each space count % must do in this order: \obeylines \uncatcodespecials \sepspaces } % Setup for the @verbatim environment % % Real tab expansion. \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % % We typeset each line of the verbatim in an \hbox, so we can handle % tabs. The \global is in case the verbatim line starts with an accent, % or some other command that starts with a begin-group. Otherwise, the % entire \verbbox would disappear at the corresponding end-group, before % it is typeset. Meanwhile, we can't have nested verbatim commands % (can we?), so the \global won't be overwriting itself. \newbox\verbbox \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} % \begingroup \catcode`\^^I=\active \gdef\tabexpand{% \catcode`\^^I=\active \def^^I{\leavevmode\egroup \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab \divide\dimen\verbbox by\tabw \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox }% } \endgroup % start the verbatim environment. \def\setupverbatim{% \let\nonarrowing = t% \nonfillstart \tt % easiest (and conventionally used) font for verbatim % The \leavevmode here is for blank lines. Otherwise, we would % never \starttabox and the \egroup would end verbatim mode. \def\par{\leavevmode\egroup\box\verbbox\endgraf}% \tabexpand \setupmarkupstyle{verbatim}% % Respect line breaks, % print special symbols as themselves, and % make each space count. % Must do in this order: \obeylines \uncatcodespecials \sepspaces \everypar{\starttabbox}% } % Do the @verb magic: verbatim text is quoted by unique % delimiter characters. Before first delimiter expect a % right brace, after last delimiter expect closing brace: % % \def\doverb'{'#1'}'{#1} % % [Knuth] p. 382; only eat outer {} \begingroup \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] \endgroup % \def\verb{\begingroup\setupverb\doverb} % % % Do the @verbatim magic: define the macro \doverbatim so that % the (first) argument ends when '@end verbatim' is reached, ie: % % \def\doverbatim#1@end verbatim{#1} % % For Texinfo it's a lot easier than for LaTeX, % because texinfo's \verbatim doesn't stop at '\end{verbatim}': % we need not redefine '\', '{' and '}'. % % Inspired by LaTeX's verbatim command set [latex.ltx] % \begingroup \catcode`\ =\active \obeylines % % ignore everything up to the first ^^M, that's the newline at the end % of the @verbatim input line itself. Otherwise we get an extra blank % line in the output. \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% % We really want {...\end verbatim} in the body of the macro, but % without the active space; thus we have to use \xdef and \gobble. \endgroup % \envdef\verbatim{% \setupverbatim\doverbatim } \let\Everbatim = \afterenvbreak % @verbatiminclude FILE - insert text of file in verbatim environment. % \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} % \def\doverbatiminclude#1{% {% \makevalueexpandable \setupverbatim \indexnofonts % Allow `@@' and other weird things in file names. \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% \input #1 \afterenvbreak }% } % @copying ... @end copying. % Save the text away for @insertcopying later. % % We save the uninterpreted tokens, rather than creating a box. % Saving the text in a box would be much easier, but then all the % typesetting commands (@smallbook, font changes, etc.) have to be done % beforehand -- and a) we want @copying to be done first in the source % file; b) letting users define the frontmatter in as flexible order as % possible is very desirable. % \def\copying{\checkenv{}\begingroup\scanargctxt\docopying} \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} % \def\insertcopying{% \begingroup \parindent = 0pt % paragraph indentation looks wrong on title page \scanexp\copyingtext \endgroup } \message{defuns,} % @defun etc. \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt \newskip\deflastargmargin \deflastargmargin=18pt \newcount\defunpenalty % Start the processing of @deffn: \def\startdefun{% \ifnum\lastpenalty<10000 \medbreak \defunpenalty=10003 % Will keep this @deffn together with the % following @def command, see below. \else % If there are two @def commands in a row, we'll have a \nobreak, % which is there to keep the function description together with its % header. But if there's nothing but headers, we need to allow a % break somewhere. Check specifically for penalty 10002, inserted % by \printdefunline, instead of 10000, since the sectioning % commands also insert a nobreak penalty, and we don't want to allow % a break between a section heading and a defun. % % As a further refinement, we avoid "club" headers by signalling % with penalty of 10003 after the very first @deffn in the % sequence (see above), and penalty of 10002 after any following % @def command. \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi % % Similarly, after a section heading, do not allow a break. % But do insert the glue. \medskip % preceded by discardable penalty, so not a breakpoint \fi % \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent } \def\dodefunx#1{% % First, check whether we are in the right environment: \checkenv#1% % % As above, allow line break if we have multiple x headers in a row. % It's not a great place, though. \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi % % And now, it's time to reuse the body of the original defun: \expandafter\gobbledefun#1% } \def\gobbledefun#1\startdefun{} % \printdefunline \deffnheader{text} % \def\printdefunline#1#2{% \begingroup % call \deffnheader: #1#2 \endheader % common ending: \interlinepenalty = 10000 \advance\rightskip by 0pt plus 1fil\relax \endgraf \nobreak\vskip -\parskip \penalty\defunpenalty % signal to \startdefun and \dodefunx % Some of the @defun-type tags do not enable magic parentheses, % rendering the following check redundant. But we don't optimize. \checkparencounts \endgroup } \def\Edefun{\endgraf\medbreak} % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; % the only thing remaining is to define \deffnheader. % \def\makedefun#1{% \expandafter\let\csname E#1\endcsname = \Edefun \edef\temp{\noexpand\domakedefun \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% \temp } % \domakedefun \deffn \deffnx \deffnheader % % Define \deffn and \deffnx, without parameters. % \deffnheader has to be defined explicitly. % \def\domakedefun#1#2#3{% \envdef#1{% \startdefun \doingtypefnfalse % distinguish typed functions from all else \parseargusing\activeparens{\printdefunline#3}% }% \def#2{\dodefunx#1}% \def#3% } \newif\ifdoingtypefn % doing typed function? \newif\ifrettypeownline % typeset return type on its own line? % @deftypefnnewline on|off says whether the return type of typed functions % are printed on their own line. This affects @deftypefn, @deftypefun, % @deftypeop, and @deftypemethod. % \parseargdef\deftypefnnewline{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxideftypefnnl\endcsname = \empty \else\ifx\temp\offword \expandafter\let\csname SETtxideftypefnnl\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @txideftypefnnl value `\temp', must be on|off}% \fi\fi } % Untyped functions: % @deffn category name args \makedefun{deffn}{\deffngeneral{}} % @deffn category class name args \makedefun{defop}#1 {\defopon{#1\ \putwordon}} % \defopon {category on}class name args \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deffngeneral {subind}category name args % \def\deffngeneral#1#2 #3 #4\endheader{% % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. \dosubind{fn}{\code{#3}}{#1}% \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% } % Typed functions: % @deftypefn category type name args \makedefun{deftypefn}{\deftypefngeneral{}} % @deftypeop category class type name args \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} % \deftypeopon {category on}class type name args \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deftypefngeneral {subind}category type name args % \def\deftypefngeneral#1#2 #3 #4 #5\endheader{% \dosubind{fn}{\code{#4}}{#1}% \doingtypefntrue \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } % Typed variables: % @deftypevr category type var args \makedefun{deftypevr}{\deftypecvgeneral{}} % @deftypecv category class type var args \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} % \deftypecvof {category of}class type var args \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } % \deftypecvgeneral {subind}category type var args % \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% \dosubind{vr}{\code{#4}}{#1}% \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } % Untyped variables: % @defvr category var args \makedefun{defvr}#1 {\deftypevrheader{#1} {} } % @defcv category class var args \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} % \defcvof {category of}class var args \def\defcvof#1#2 {\deftypecvof{#1}#2 {} } % Types: % @deftp category name args \makedefun{deftp}#1 #2 #3\endheader{% \doind{tp}{\code{#2}}% \defname{#1}{}{#2}\defunargs{#3\unskip}% } % Remaining @defun-like shortcuts: \makedefun{defun}{\deffnheader{\putwordDeffunc} } \makedefun{defmac}{\deffnheader{\putwordDefmac} } \makedefun{defspec}{\deffnheader{\putwordDefspec} } \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } \makedefun{defvar}{\defvrheader{\putwordDefvar} } \makedefun{defopt}{\defvrheader{\putwordDefopt} } \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } \makedefun{defmethod}{\defopon\putwordMethodon} \makedefun{deftypemethod}{\deftypeopon\putwordMethodon} \makedefun{defivar}{\defcvof\putwordInstanceVariableof} \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} % \defname, which formats the name of the @def (not the args). % #1 is the category, such as "Function". % #2 is the return type, if any. % #3 is the function name. % % We are followed by (but not passed) the arguments, if any. % \def\defname#1#2#3{% \par % Get the values of \leftskip and \rightskip as they were outside the @def... \advance\leftskip by -\defbodyindent % % Determine if we are typesetting the return type of a typed function % on a line by itself. \rettypeownlinefalse \ifdoingtypefn % doing a typed function specifically? % then check user option for putting return type on its own line: \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else \rettypeownlinetrue \fi \fi % % How we'll format the category name. Putting it in brackets helps % distinguish it from the body text that may end up on the next line % just below it. \def\temp{#1}% \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} % % Figure out line sizes for the paragraph shape. We'll always have at % least two. \tempnum = 2 % % The first line needs space for \box0; but if \rightskip is nonzero, % we need only space for the part of \box0 which exceeds it: \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip % % If doing a return type on its own line, we'll have another line. \ifrettypeownline \advance\tempnum by 1 \def\maybeshapeline{0in \hsize}% \else \def\maybeshapeline{}% \fi % % The continuations: \dimen2=\hsize \advance\dimen2 by -\defargsindent % % The final paragraph shape: \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2 % % Put the category name at the right margin. \noindent \hbox to 0pt{% \hfil\box0 \kern-\hsize % \hsize has to be shortened this way: \kern\leftskip % Intentionally do not respect \rightskip, since we need the space. }% % % Allow all lines to be underfull without complaint: \tolerance=10000 \hbadness=10000 \exdentamount=\defbodyindent {% % defun fonts. We use typewriter by default (used to be bold) because: % . we're printing identifiers, they should be in tt in principle. % . in languages with many accents, such as Czech or French, it's % common to leave accents off identifiers. The result looks ok in % tt, but exceedingly strange in rm. % . we don't want -- and --- to be treated as ligatures. % . this still does not fix the ?` and !` ligatures, but so far no % one has made identifiers using them :). \df \tt \def\temp{#2}% text of the return type \ifx\temp\empty\else \tclose{\temp}% typeset the return type \ifrettypeownline % put return type on its own line; prohibit line break following: \hfil\vadjust{\nobreak}\break \else \space % type on same line, so just followed by a space \fi \fi % no return type #3% output function name }% {\rm\enskip}% hskip 0.5 em of \tenrm % \boldbrax % arguments will be output next, if any. } % Print arguments in slanted roman (not ttsl), inconsistently with using % tt for the name. This is because literal text is sometimes needed in % the argument list (groff manual), and ttsl and tt are not very % distinguishable. Prevent hyphenation at `-' chars. % \def\defunargs#1{% % use sl by default (not ttsl), % tt for the names. \df \sl \hyphenchar\font=0 % % On the other hand, if an argument has two dashes (for instance), we % want a way to get ttsl. We used to recommend @var for that, so % leave the code in, but it's strange for @var to lead to typewriter. % Nowadays we recommend @code, since the difference between a ttsl hyphen % and a tt hyphen is pretty tiny. @code also disables ?` !`. \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% #1% \sl\hyphenchar\font=45 } % We want ()&[] to print specially on the defun line. % \def\activeparens{% \catcode`\(=\active \catcode`\)=\active \catcode`\[=\active \catcode`\]=\active \catcode`\&=\active } % Make control sequences which act like normal parenthesis chars. \let\lparen = ( \let\rparen = ) % Be sure that we always have a definition for `(', etc. For example, % if the fn name has parens in it, \boldbrax will not be in effect yet, % so TeX would otherwise complain about undefined control sequence. { \activeparens \global\let(=\lparen \global\let)=\rparen \global\let[=\lbrack \global\let]=\rbrack \global\let& = \& \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} \gdef\magicamp{\let&=\amprm} } \newcount\parencount % If we encounter &foo, then turn on ()-hacking afterwards \newif\ifampseen \def\amprm#1 {\ampseentrue{\bf\ }} \def\parenfont{% \ifampseen % At the first level, print parens in roman, % otherwise use the default font. \ifnum \parencount=1 \rm \fi \else % The \sf parens (in \boldbrax) actually are a little bolder than % the contained text. This is especially needed for [ and ] . \sf \fi } \def\infirstlevel#1{% \ifampseen \ifnum\parencount=1 #1% \fi \fi } \def\bfafterword#1 {#1 \bf} \def\opnr{% \global\advance\parencount by 1 {\parenfont(}% \infirstlevel \bfafterword } \def\clnr{% {\parenfont)}% \infirstlevel \sl \global\advance\parencount by -1 } \newcount\brackcount \def\lbrb{% \global\advance\brackcount by 1 {\bf[}% } \def\rbrb{% {\bf]}% \global\advance\brackcount by -1 } \def\checkparencounts{% \ifnum\parencount=0 \else \badparencount \fi \ifnum\brackcount=0 \else \badbrackcount \fi } % these should not use \errmessage; the glibc manual, at least, actually % has such constructs (when documenting function pointers). \def\badparencount{% \message{Warning: unbalanced parentheses in @def...}% \global\parencount=0 } \def\badbrackcount{% \message{Warning: unbalanced square brackets in @def...}% \global\brackcount=0 } \message{macros,} % @macro. % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. \ifx\eTeXversion\thisisundefined \newwrite\macscribble \def\scantokens#1{% \toks0={#1}% \immediate\openout\macscribble=\jobname.tmp \immediate\write\macscribble{\the\toks0}% \immediate\closeout\macscribble \input \jobname.tmp } \fi \def\scanmacro#1{\begingroup \newlinechar`\^^M \let\xeatspaces\eatspaces % % Undo catcode changes of \startcontents and \doprintindex % When called from @insertcopying or (short)caption, we need active % backslash to get it printed correctly. Previously, we had % \catcode`\\=\other instead. We'll see whether a problem appears % with macro expansion. --kasal, 19aug04 \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ % % ... and for \example: \spaceisspace % % The \empty here causes a following catcode 5 newline to be eaten as % part of reading whitespace after a control sequence. It does not % eat a catcode 13 newline. There's no good way to handle the two % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX % would then have different behavior). See the Macro Details node in % the manual for the workaround we recommend for macros and % line-oriented commands. % \scantokens{#1\empty}% \endgroup} \def\scanexp#1{% \edef\temp{\noexpand\scanmacro{#1}}% \temp } \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? % List of all defined macros in the form % \definedummyword\macro1\definedummyword\macro2... % Currently is also contains all @aliases; the list can be split % if there is a need. \def\macrolist{} % Add the macro to \macrolist \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} \def\addtomacrolistxxx#1{% \toks0 = \expandafter{\macrolist\definedummyword#1}% \xdef\macrolist{\the\toks0}% } % Utility routines. % This does \let #1 = #2, with \csnames; that is, % \let \csname#1\endcsname = \csname#2\endcsname % (except of course we have to play expansion games). % \def\cslet#1#2{% \expandafter\let \csname#1\expandafter\endcsname \csname#2\endcsname } % Trim leading and trailing spaces off a string. % Concepts from aro-bend problem 15 (see CTAN). {\catcode`\@=11 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} \def\unbrace#1{#1} \unbrace{\gdef\trim@@@ #1 } #2@{#1} } % Trim a single trailing ^^M off a string. {\catcode`\^^M=\other \catcode`\Q=3% \gdef\eatcr #1{\eatcra #1Q^^MQ}% \gdef\eatcra#1^^MQ{\eatcrb#1Q}% \gdef\eatcrb#1Q#2Q{#1}% } % Macro bodies are absorbed as an argument in a context where % all characters are catcode 10, 11 or 12, except \ which is active % (as in normal texinfo). It is necessary to change the definition of \ % to recognize macro arguments; this is the job of \mbodybackslash. % % Non-ASCII encodings make 8-bit characters active, so un-activate % them to avoid their expansion. Must do this non-globally, to % confine the change to the current group. % % It's necessary to have hard CRs when the macro is executed. This is % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. % \def\scanctxt{% used as subroutine \catcode`\"=\other \catcode`\+=\other \catcode`\<=\other \catcode`\>=\other \catcode`\@=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\~=\other \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi } \def\scanargctxt{% used for copying and captions, not macros. \scanctxt \catcode`\\=\other \catcode`\^^M=\other } \def\macrobodyctxt{% used for @macro definitions \scanctxt \catcode`\{=\other \catcode`\}=\other \catcode`\^^M=\other \usembodybackslash } \def\macroargctxt{% used when scanning invocations \scanctxt \catcode`\\=0 } % why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes" % for the single characters \ { }. Thus, we end up with the "commands" % that would be written @\ @{ @} in a Texinfo document. % % We already have @{ and @}. For @\, we define it here, and only for % this purpose, to produce a typewriter backslash (so, the @\ that we % define for @math can't be used with @macro calls): % \def\\{\normalbackslash}% % % We would like to do this for \, too, since that is what makeinfo does. % But it is not possible, because Texinfo already has a command @, for a % cedilla accent. Documents must use @comma{} instead. % % \anythingelse will almost certainly be an error of some kind. % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N % where N is the macro parameter number. % We define \csname macarg.\endcsname to be \realbackslash, so % \\ in macro replacement text gets you a backslash. % {\catcode`@=0 @catcode`@\=@active @gdef@usembodybackslash{@let\=@mbodybackslash} @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} } \expandafter\def\csname macarg.\endcsname{\realbackslash} \def\margbackslash#1{\char`\#1 } \def\macro{\recursivefalse\parsearg\macroxxx} \def\rmacro{\recursivetrue\parsearg\macroxxx} \def\macroxxx#1{% \getargs{#1}% now \macname is the macname and \argl the arglist \ifx\argl\empty % no arguments \paramno=0\relax \else \expandafter\parsemargdef \argl;% \if\paramno>256\relax \ifx\eTeXversion\thisisundefined \errhelp = \EMsimple \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} \fi \fi \fi \if1\csname ismacro.\the\macname\endcsname \message{Warning: redefining \the\macname}% \else \expandafter\ifx\csname \the\macname\endcsname \relax \else \errmessage{Macro name \the\macname\space already defined}\fi \global\cslet{macsave.\the\macname}{\the\macname}% \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% \addtomacrolist{\the\macname}% \fi \begingroup \macrobodyctxt \ifrecursive \expandafter\parsermacbody \else \expandafter\parsemacbody \fi} \parseargdef\unmacro{% \if1\csname ismacro.#1\endcsname \global\cslet{#1}{macsave.#1}% \global\expandafter\let \csname ismacro.#1\endcsname=0% % Remove the macro name from \macrolist: \begingroup \expandafter\let\csname#1\endcsname \relax \let\definedummyword\unmacrodo \xdef\macrolist{\macrolist}% \endgroup \else \errmessage{Macro #1 not defined}% \fi } % Called by \do from \dounmacro on each macro. The idea is to omit any % macro definitions that have been changed to \relax. % \def\unmacrodo#1{% \ifx #1\relax % remove this \else \noexpand\definedummyword \noexpand#1% \fi } % This makes use of the obscure feature that if the last token of a % is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname#1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} % For macro processing make @ a letter so that we can make Texinfo private macro names. \edef\texiatcatcode{\the\catcode`\@} \catcode `@=11\relax % Parse the optional {params} list. Set up \paramno and \paramlist % so \defmacro knows what to do. Define \macarg.BLAH for each BLAH % in the params list to some hook where the argument si to be expanded. If % there are less than 10 arguments that hook is to be replaced by ##N where N % is the position in that list, that is to say the macro arguments are to be % defined `a la TeX in the macro body. % % That gets used by \mbodybackslash (above). % % We need to get `macro parameter char #' into several definitions. % The technique used is stolen from LaTeX: let \hash be something % unexpandable, insert that wherever you need a #, and then redefine % it to # just before using the token list produced. % % The same technique is used to protect \eatspaces till just before % the macro is used. % % If there are 10 or more arguments, a different technique is used, where the % hook remains in the body, and when macro is to be expanded the body is % processed again to replace the arguments. % % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the % argument N value and then \edef the body (nothing else will expand because of % the catcode regime underwhich the body was input). % % If you compile with TeX (not eTeX), and you have macros with 10 or more % arguments, you need that no macro has more than 256 arguments, otherwise an % error is produced. \def\parsemargdef#1;{% \paramno=0\def\paramlist{}% \let\hash\relax \let\xeatspaces\relax \parsemargdefxxx#1,;,% % In case that there are 10 or more arguments we parse again the arguments % list to set new definitions for the \macarg.BLAH macros corresponding to % each BLAH argument. It was anyhow needed to parse already once this list % in order to count the arguments, and as macros with at most 9 arguments % are by far more frequent than macro with 10 or more arguments, defining % twice the \macarg.BLAH macros does not cost too much processing power. \ifnum\paramno<10\relax\else \paramno0\relax \parsemmanyargdef@@#1,;,% 10 or more arguments \fi } \def\parsemargdefxxx#1,{% \if#1;\let\next=\relax \else \let\next=\parsemargdefxxx \advance\paramno by 1 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname {\xeatspaces{\hash\the\paramno}}% \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} \def\parsemmanyargdef@@#1,{% \if#1;\let\next=\relax \else \let\next=\parsemmanyargdef@@ \edef\tempb{\eatspaces{#1}}% \expandafter\def\expandafter\tempa \expandafter{\csname macarg.\tempb\endcsname}% % Note that we need some extra \noexpand\noexpand, this is because we % don't want \the to be expanded in the \parsermacbody as it uses an % \xdef . \expandafter\edef\tempa {\noexpand\noexpand\noexpand\the\toks\the\paramno}% \advance\paramno by 1\relax \fi\next} % These two commands read recursive and nonrecursive macro bodies. % (They're different since rec and nonrec macros end differently.) % \catcode `\@\texiatcatcode \long\def\parsemacbody#1@end macro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \long\def\parsermacbody#1@end rmacro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \catcode `\@=11\relax \let\endargs@\relax \let\nil@\relax \def\nilm@{\nil@}% \long\def\nillm@{\nil@}% % This macro is expanded during the Texinfo macro expansion, not during its % definition. It gets all the arguments values and assigns them to macros % macarg.ARGNAME % % #1 is the macro name % #2 is the list of argument names % #3 is the list of argument values \def\getargvals@#1#2#3{% \def\macargdeflist@{}% \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. \def\paramlist{#2,\nil@}% \def\macroname{#1}% \begingroup \macroargctxt \def\argvaluelist{#3,\nil@}% \def\@tempa{#3}% \ifx\@tempa\empty \setemptyargvalues@ \else \getargvals@@ \fi } % \def\getargvals@@{% \ifx\paramlist\nilm@ % Some sanity check needed here that \argvaluelist is also empty. \ifx\argvaluelist\nillm@ \else \errhelp = \EMsimple \errmessage{Too many arguments in macro `\macroname'!}% \fi \let\next\macargexpandinbody@ \else \ifx\argvaluelist\nillm@ % No more arguments values passed to macro. Set remaining named-arg % macros to empty. \let\next\setemptyargvalues@ \else % pop current arg name into \@tempb \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% \expandafter\@tempa\expandafter{\paramlist}% % pop current argument value into \@tempc \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% \expandafter\@tempa\expandafter{\argvaluelist}% % Here \@tempb is the current arg name and \@tempc is the current arg value. % First place the new argument macro definition into \@tempd \expandafter\macname\expandafter{\@tempc}% \expandafter\let\csname macarg.\@tempb\endcsname\relax \expandafter\def\expandafter\@tempe\expandafter{% \csname macarg.\@tempb\endcsname}% \edef\@tempd{\long\def\@tempe{\the\macname}}% \push@\@tempd\macargdeflist@ \let\next\getargvals@@ \fi \fi \next } \def\push@#1#2{% \expandafter\expandafter\expandafter\def \expandafter\expandafter\expandafter#2% \expandafter\expandafter\expandafter{% \expandafter#1#2}% } % Replace arguments by their values in the macro body, and place the result % in macro \@tempa \def\macvalstoargs@{% % To do this we use the property that token registers that are \the'ed % within an \edef expand only once. So we are going to place all argument % values into respective token registers. % % First we save the token context, and initialize argument numbering. \begingroup \paramno0\relax % Then, for each argument number #N, we place the corresponding argument % value into a new token list register \toks#N \expandafter\putargsintokens@\saveparamlist@,;,% % Then, we expand the body so that argument are replaced by their % values. The trick for values not to be expanded themselves is that they % are within tokens and that tokens expand only once in an \edef . \edef\@tempc{\csname mac.\macroname .body\endcsname}% % Now we restore the token stack pointer to free the token list registers % which we have used, but we make sure that expanded body is saved after % group. \expandafter \endgroup \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% } \def\macargexpandinbody@{% %% Define the named-macro outside of this group and then close this group. \expandafter \endgroup \macargdeflist@ % First the replace in body the macro arguments by their values, the result % is in \@tempa . \macvalstoargs@ % Then we point at the \norecurse or \gobble (for recursive) macro value % with \@tempb . \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname % Depending on whether it is recursive or not, we need some tailing % \egroup . \ifx\@tempb\gobble \let\@tempc\relax \else \let\@tempc\egroup \fi % And now we do the real job: \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% \@tempd } \def\putargsintokens@#1,{% \if#1;\let\next\relax \else \let\next\putargsintokens@ % First we allocate the new token list register, and give it a temporary % alias \@tempb . \toksdef\@tempb\the\paramno % Then we place the argument value into that token list register. \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname \expandafter\@tempb\expandafter{\@tempa}% \advance\paramno by 1\relax \fi \next } % Save the token stack pointer into macro #1 \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} % Restore the token stack pointer from number in macro #1 \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} % newtoks that can be used non \outer . \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} % Tailing missing arguments are set to empty \def\setemptyargvalues@{% \ifx\paramlist\nilm@ \let\next\macargexpandinbody@ \else \expandafter\setemptyargvaluesparser@\paramlist\endargs@ \let\next\setemptyargvalues@ \fi \next } \def\setemptyargvaluesparser@#1,#2\endargs@{% \expandafter\def\expandafter\@tempa\expandafter{% \expandafter\def\csname macarg.#1\endcsname{}}% \push@\@tempa\macargdeflist@ \def\paramlist{#2}% } % #1 is the element target macro % #2 is the list macro % #3,#4\endargs@ is the list value \def\pop@#1#2#3,#4\endargs@{% \def#1{#3}% \def#2{#4}% } \long\def\longpop@#1#2#3,#4\endargs@{% \long\def#1{#3}% \long\def#2{#4}% } % This defines a Texinfo @macro. There are eight cases: recursive and % nonrecursive macros of zero, one, up to nine, and many arguments. % Much magic with \expandafter here. % \xdef is used so that macro definitions will survive the file % they're defined in; @include reads the file inside a group. % \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars \ifrecursive \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\scanmacro{\temp}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup\noexpand\scanmacro{\temp}}% \else \ifnum\paramno<10\relax % at most 9 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{\egroup\noexpand\scanmacro{\temp}}% \else % 10 or more \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% }% \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble \fi \fi \else \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % at most 9 \ifnum\paramno<10\relax \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \expandafter\noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % 10 or more: \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% }% \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse \fi \fi \fi} \catcode `\@\texiatcatcode\relax \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} % \braceorline decides whether the next nonwhitespace character is a % {. If so it reads up to the closing }, if not, it reads the whole % line. Whatever was read is then fed to the next control sequence % as an argument (by \parsebrace or \parsearg). % \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% \ifx\nchar\bgroup\else \expandafter\parsearg \fi \macnamexxx} % @alias. % We need some trickery to remove the optional spaces around the equal % sign. Make them active and then expand them all to nothing. % \def\alias{\parseargusing\obeyspaces\aliasxxx} \def\aliasxxx #1{\aliasyyy#1\relax} \def\aliasyyy #1=#2\relax{% {% \expandafter\let\obeyedspace=\empty \addtomacrolist{#1}% \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% }% \next } \message{cross references,} \newwrite\auxfile \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. % @inforef is relatively simple. \def\inforef #1{\inforefzzz #1,,,,**} \def\inforefzzz #1,#2,#3,#4**{% \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} % @node's only job in TeX is to define \lastnode, which is used in % cross-references. The @node line might or might not have commas, and % might or might not have spaces before the first comma, like: % @node foo , bar , ... % We don't want such trailing spaces in the node name. % \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} % % also remove a trailing comma, in case of something like this: % @node Help-Cross, , , Cross-refs \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} \let\nwnode=\node \let\lastnode=\empty % Write a cross-reference definition for the current node. #1 is the % type (Ynumbered, Yappendix, Ynothing). % \def\donoderef#1{% \ifx\lastnode\empty\else \setref{\lastnode}{#1}% \global\let\lastnode=\empty \fi } % @anchor{NAME} -- define xref target at arbitrary point. % \newcount\savesfregister % \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an % anchor), which consists of three parts: % 1) NAME-title - the current sectioning name taken from \lastsection, % or the anchor name. % 2) NAME-snt - section number and type, passed as the SNT arg, or % empty for anchors. % 3) NAME-pg - the page number. % % This is called from \donoderef, \anchor, and \dofloat. In the case of % floats, there is an additional part, which is not written here: % 4) NAME-lof - the text as it should appear in a @listoffloats. % \def\setref#1#2{% \pdfmkdest{#1}% \iflinks {% \atdummies % preserve commands, but don't expand them \edef\writexrdef##1##2{% \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef ##1}{##2}}% these are parameters of \writexrdef }% \toks0 = \expandafter{\lastsection}% \immediate \writexrdef{title}{\the\toks0 }% \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout }% \fi } % @xrefautosectiontitle on|off says whether @section(ing) names are used % automatically in xrefs, if the third arg is not explicitly specified. % This was provided as a "secret" @set xref-automatic-section-title % variable, now it's official. % \parseargdef\xrefautomaticsectiontitle{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETxref-automatic-section-title\endcsname = \empty \else\ifx\temp\offword \expandafter\let\csname SETxref-automatic-section-title\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', must be on|off}% \fi\fi } % % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]} % \newbox\toprefbox \newbox\printedrefnamebox \newbox\infofilenamebox \newbox\printedmanualbox % \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \unsepspaces % % Get args without leading/trailing spaces. \def\printedrefname{\ignorespaces #3}% \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% % \def\infofilename{\ignorespaces #4}% \setbox\infofilenamebox = \hbox{\infofilename\unskip}% % \def\printedmanual{\ignorespaces #5}% \setbox\printedmanualbox = \hbox{\printedmanual\unskip}% % % If the printed reference name (arg #3) was not explicitly given in % the @xref, figure out what we want to use. \ifdim \wd\printedrefnamebox = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax % Not auto section-title: use node name inside the square brackets. \def\printedrefname{\ignorespaces #1}% \else % Auto section-title: use chapter/section title inside % the square brackets if we have it. \ifdim \wd\printedmanualbox > 0pt % It is in another manual, so we don't have it; use node name. \def\printedrefname{\ignorespaces #1}% \else \ifhavexrefs % We (should) know the real title if we have the xref values. \def\printedrefname{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. \def\printedrefname{\ignorespaces #1}% \fi% \fi \fi \fi % % Make link in pdf output. \ifpdf {\indexnofonts \turnoffactive \makevalueexpandable % This expands tokens, so do it after making catcode changes, so _ % etc. don't get their TeX definitions. This ignores all spaces in % #4, including (wrongly) those in the middle of the filename. \getfilename{#4}% % % This (wrongly) does not take account of leading or trailing % spaces in #1, which should be ignored. \edef\pdfxrefdest{#1}% \ifx\pdfxrefdest\empty \def\pdfxrefdest{Top}% no empty targets \else \txiescapepdf\pdfxrefdest % escape PDF special chars \fi % \leavevmode \startlink attr{/Border [0 0 0]}% \ifnum\filenamelength>0 goto file{\the\filename.pdf} name{\pdfxrefdest}% \else goto name{\pdfmkpgn{\pdfxrefdest}}% \fi }% \setcolor{\linkcolor}% \fi % % Float references are printed completely differently: "Figure 1.2" % instead of "[somenode], p.3". We distinguish them by the % LABEL-title being set to a magic string. {% % Have to otherify everything special to allow the \csname to % include an _ in the xref name, etc. \indexnofonts \turnoffactive \expandafter\global\expandafter\let\expandafter\Xthisreftitle \csname XR#1-title\endcsname }% \iffloat\Xthisreftitle % If the user specified the print name (third arg) to the ref, % print it instead of our usual "Figure 1.2". \ifdim\wd\printedrefnamebox = 0pt \refx{#1-snt}{}% \else \printedrefname \fi % % If the user also gave the printed manual name (fifth arg), append % "in MANUALNAME". \ifdim \wd\printedmanualbox > 0pt \space \putwordin{} \cite{\printedmanual}% \fi \else % node/anchor (non-float) references. % % If we use \unhbox to print the node names, TeX does not insert % empty discretionaries after hyphens, which means that it will not % find a line break at a hyphen in a node names. Since some manuals % are best written with fairly long node names, containing hyphens, % this is a loss. Therefore, we give the text of the node name % again, so it is as if TeX is seeing it for the first time. % \ifdim \wd\printedmanualbox > 0pt % Cross-manual reference with a printed manual name. % \crossmanualxref{\cite{\printedmanual\unskip}}% % \else\ifdim \wd\infofilenamebox > 0pt % Cross-manual reference with only an info filename (arg 4), no % printed manual name (arg 5). This is essentially the same as % the case above; we output the filename, since we have nothing else. % \crossmanualxref{\code{\infofilename\unskip}}% % \else % Reference within this manual. % % _ (for example) has to be the character _ for the purposes of the % control sequence corresponding to the node, but it has to expand % into the usual \leavevmode...\vrule stuff for purposes of % printing. So we \turnoffactive for the \refx-snt, back on for the % printing, back off for the \refx-pg. {\turnoffactive % Only output a following space if the -snt ref is nonempty; for % @unnumbered and @anchor, it won't be. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi }% % output the `[mynode]' via the macro below so it can be overridden. \xrefprintnodename\printedrefname % % But we always want a comma and a space: ,\space % % output the `page 3'. \turnoffactive \putwordpage\tie\refx{#1-pg}{}% \fi\fi \fi \endlink \endgroup} % Output a cross-manual xref to #1. Used just above (twice). % % Only include the text "Section ``foo'' in" if the foo is neither % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply % "see The Foo Manual", the idea being to refer to the whole manual. % % But, this being TeX, we can't easily compare our node name against the % string "Top" while ignoring the possible spaces before and after in % the input. By adding the arbitrary 7sp below, we make it much less % likely that a real node name would have the same width as "Top" (e.g., % in a monospaced font). Hopefully it will never happen in practice. % % For the same basic reason, we retypeset the "Top" at every % reference, since the current font is indeterminate. % \def\crossmanualxref#1{% \setbox\toprefbox = \hbox{Top\kern7sp}% \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% \ifdim \wd2 > 7sp % nonempty? \ifdim \wd2 = \wd\toprefbox \else % same as Top? \putwordSection{} ``\printedrefname'' \putwordin{}\space \fi \fi #1% } % This macro is called from \xrefX for the `[nodename]' part of xref % output. It's a separate macro only so it can be changed more easily, % since square brackets don't work well in some documents. Particularly % one that Bob is working on :). % \def\xrefprintnodename#1{[#1]} % Things referred to by \setref. % \def\Ynothing{} \def\Yomitfromtoc{} \def\Ynumbered{% \ifnum\secno=0 \putwordChapter@tie \the\chapno \else \ifnum\subsecno=0 \putwordSection@tie \the\chapno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno \else \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } \def\Yappendix{% \ifnum\secno=0 \putwordAppendix@tie @char\the\appendixno{}% \else \ifnum\subsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno \else \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % If its value is nonempty, SUFFIX is output afterward. % \def\refx#1#2{% {% \indexnofonts \otherbackslash \expandafter\global\expandafter\let\expandafter\thisrefX \csname XR#1\endcsname }% \ifx\thisrefX\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright \iflinks \ifhavexrefs {\toks0 = {#1}% avoid expansion of possibly-complex value \message{\linenumber Undefined cross reference `\the\toks0'.}}% \else \ifwarnedxrefs\else \global\warnedxrefstrue \message{Cross reference values unknown; you must run TeX again.}% \fi \fi \fi \else % It's defined, so just use it. \thisrefX \fi #2% Output the suffix in any case. } % This is the macro invoked by entries in the aux file. Usually it's % just a \def (we prepend XR to the control sequence name to avoid % collisions). But if this is a float type, we have more work to do. % \def\xrdef#1#2{% {% The node name might contain 8-bit characters, which in our current % implementation are changed to commands like @'e. Don't let these % mess up the control sequence name. \indexnofonts \turnoffactive \xdef\safexrefname{#1}% }% % \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref % % Was that xref control sequence that we just defined for a float? \expandafter\iffloat\csname XR\safexrefname\endcsname % it was a float, and we have the (safe) float type in \iffloattype. \expandafter\let\expandafter\floatlist \csname floatlist\iffloattype\endcsname % % Is this the first time we've seen this float type? \expandafter\ifx\floatlist\relax \toks0 = {\do}% yes, so just \do \else % had it before, so preserve previous elements in list. \toks0 = \expandafter{\floatlist\do}% \fi % % Remember this xref in the control sequence \floatlistFLOATTYPE, % for later use in \listoffloats. \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 {\safexrefname}}% \fi } % Read the last existing aux file, if any. No error if none exists. % \def\tryauxfile{% \openin 1 \jobname.aux \ifeof 1 \else \readdatafile{aux}% \global\havexrefstrue \fi \closein 1 } \def\setupdatafile{% \catcode`\^^@=\other \catcode`\^^A=\other \catcode`\^^B=\other \catcode`\^^C=\other \catcode`\^^D=\other \catcode`\^^E=\other \catcode`\^^F=\other \catcode`\^^G=\other \catcode`\^^H=\other \catcode`\^^K=\other \catcode`\^^L=\other \catcode`\^^N=\other \catcode`\^^P=\other \catcode`\^^Q=\other \catcode`\^^R=\other \catcode`\^^S=\other \catcode`\^^T=\other \catcode`\^^U=\other \catcode`\^^V=\other \catcode`\^^W=\other \catcode`\^^X=\other \catcode`\^^Z=\other \catcode`\^^[=\other \catcode`\^^\=\other \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. % in xref tags, i.e., node names. But since ^^e4 notation isn't % supported in the main text, it doesn't seem desirable. Furthermore, % that is not enough: for node names that actually contain a ^ % character, we would end up writing a line like this: 'xrdef {'hat % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first % argument, and \hat is not an expandable control sequence. It could % all be worked out, but why? Either we support ^^ or we don't. % % The other change necessary for this was to define \auxhat: % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter % and then to call \auxhat in \setq. % \catcode`\^=\other % % Special characters. Should be turned off anyway, but... \catcode`\~=\other \catcode`\[=\other \catcode`\]=\other \catcode`\"=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other \catcode`\%=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % % This is to support \ in node names and titles, since the \ % characters end up in a \csname. It's easier than % leaving it active and making its active definition an actual \ % character. What I don't understand is why it works in the *value* % of the xrdef. Seems like it should be a catcode12 \, and that % should not typeset properly. But it works, so I'm moving on for % now. --karl, 15jan04. \catcode`\\=\other % % Make the characters 128-255 be printing characters. {% \count1=128 \def\loop{% \catcode\count1=\other \advance\count1 by 1 \ifnum \count1<256 \loop \fi }% }% % % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 \catcode`\}=2 \catcode`\@=0 } \def\readdatafile#1{% \begingroup \setupdatafile \input\jobname.#1 \endgroup} \message{insertions,} % including footnotes. \newcount \footnoteno % The trailing space in the following definition for supereject is % vital for proper filling; pages come out unaligned when you do a % pagealignmacro call if that space before the closing brace is % removed. (Generally, numeric constants should always be followed by a % space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } % @footnotestyle is meaningful for Info output only. \let\footnotestyle=\comment {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% \let\indent=\ptexindent \let\noindent=\ptexnoindent \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip \thisfootno\@sf \dofootnote }% % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % % Oh yes, they do; otherwise, @ifset (and anything else that uses % \parseargline) fails inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % \gdef\dofootnote{% \insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. \hsize=\pagewidth \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox \floatingpenalty\@MM \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip \parindent\defaultparindent % \smallfonts \rm % % Because we use hanging indentation in footnotes, a @noindent appears % to exdent this text, so make it be a no-op. makeinfo does not use % hanging indentation so @noindent can still be needed within footnote % text after an @example or the like (not that this is good style). \let\noindent = \relax % % Hang the footnote text off the number. Use \everypar in case the % footnote extends for more than one paragraph. \everypar = {\hang}% \textindent{\thisfootno}% % % Don't crash into the line above the footnote text. Since this % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut % % Invoke rest of plain TeX footnote routine. \futurelet\next\fo@t } }%end \catcode `\@=11 % In case a @footnote appears in a vbox, save the footnote text and create % the real \insert just after the vbox finished. Otherwise, the insertion % would be lost. % Similarly, if a @footnote appears inside an alignment, save the footnote % text to a box and make the \insert when a row of the table is finished. % And the same can be done for other insert classes. --kasal, 16nov03. % Replace the \insert primitive by a cheating macro. % Deeper inside, just make sure that the saved insertions are not spilled % out prematurely. % \def\startsavinginserts{% \ifx \insert\ptexinsert \let\insert\saveinsert \else \let\checkinserts\relax \fi } % This \insert replacement works for both \insert\footins{foo} and % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. % \def\saveinsert#1{% \edef\next{\noexpand\savetobox \makeSAVEname#1}% \afterassignment\next % swallow the left brace \let\temp = } \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} \def\placesaveins#1{% \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname {\box#1}% } % eat @SAVE -- beware, all of them have catcode \other: { \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) \gdef\gobblesave @SAVE{} } % initialization: \def\newsaveins #1{% \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% \next } \def\newsaveinsX #1{% \csname newbox\endcsname #1% \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts \checksaveins #1}% } % initialize: \let\checkinserts\empty \newsaveins\footins \newsaveins\margin % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. % % Check for and read epsf.tex up front. If we read it only at @image % time, we might be inside a group, and then its definitions would get % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else % Do not bother showing banner with epsf.tex v2.7k (available in % doc/epsf.tex and on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi \closein 1 % % We will only complain once about lack of epsf.tex. \newif\ifwarnednoepsf \newhelp\noepsfhelp{epsf.tex must be installed for images to work. It is also included in the Texinfo distribution, or you can get it from ftp://tug.org/tex/epsf.tex.} % \def\image#1{% \ifx\epsfbox\thisisundefined \ifwarnednoepsf \else \errhelp = \noepsfhelp \errmessage{epsf.tex not found, images will be ignored}% \global\warnednoepsftrue \fi \else \imagexxx #1,,,,,\finish \fi } % % Arguments to @image: % #1 is (mandatory) image filename; we tack on .eps extension. % #2 is (optional) width, #3 is (optional) height. % #4 is (ignored optional) html alt text. % #5 is (ignored optional) extension. % #6 is just the usual extra ignored arg for parsing stuff. \newif\ifimagevmode \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \catcode`\^^M = 5 % in case we're inside an example \normalturnoffactive % allow _ et al. in names % If the image is by itself, center it. \ifvmode \imagevmodetrue \else \ifx\centersub\centerV % for @center @image, we need a vbox so we can have our vertical space \imagevmodetrue \vbox\bgroup % vbox has better behavior than vtop herev \fi\fi % \ifimagevmode \nobreak\medskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space % above and below. \nobreak\vskip\parskip \nobreak \fi % % Leave vertical mode so that indentation from an enclosing % environment such as @quotation is respected. % However, if we're at the top level, we don't want the % normal paragraph indentation. % On the other hand, if we are in the case of @center @image, we don't % want to start a paragraph, which will create a hsize-width box and % eradicate the centering. \ifx\centersub\centerV\else \noindent \fi % % Output the image. \ifpdf \dopdfimage{#1}{#2}{#3}% \else % \epsfbox itself resets \epsf?size at each figure. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi \epsfbox{#1.eps}% \fi % \ifimagevmode \medskip % space after a standalone image \fi \ifx\centersub\centerV \egroup \fi \endgroup} % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, % etc. We don't actually implement floating yet, we always include the % float "here". But it seemed the best name for the future. % \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} % There may be a space before second and/or third parameter; delete it. \def\eatcommaspace#1, {#1,} % #1 is the optional FLOATTYPE, the text label for this float, typically % "Figure", "Table", "Example", etc. Can't contain commas. If omitted, % this float will not be numbered and cannot be referred to. % % #2 is the optional xref label. Also must be present for the float to % be referable. % % #3 is the optional positioning argument; for now, it is ignored. It % will somehow specify the positions allowed to float to (here, top, bottom). % % We keep a separate counter for each FLOATTYPE, which we reset at each % chapter-level command. \let\resetallfloatnos=\empty % \def\dofloat#1,#2,#3,#4\finish{% \let\thiscaption=\empty \let\thisshortcaption=\empty % % don't lose footnotes inside @float. % % BEWARE: when the floats start float, we have to issue warning whenever an % insert appears inside a float which could possibly float. --kasal, 26may04 % \startsavinginserts % % We can't be used inside a paragraph. \par % \vtop\bgroup \def\floattype{#1}% \def\floatlabel{#2}% \def\floatloc{#3}% we do nothing with this yet. % \ifx\floattype\empty \let\safefloattype=\empty \else {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% \fi % % If label is given but no type, we handle that as the empty type. \ifx\floatlabel\empty \else % We want each FLOATTYPE to be numbered separately (Figure 1, % Table 1, Figure 2, ...). (And if no label, no number.) % \expandafter\getfloatno\csname\safefloattype floatno\endcsname \global\advance\floatno by 1 % {% % This magic value for \lastsection is output by \setref as the % XREFLABEL-title value. \xrefX uses it to distinguish float % labels (which have a completely different output format) from % node and anchor labels. And \xrdef uses it to construct the % lists of floats. % \edef\lastsection{\floatmagic=\safefloattype}% \setref{\floatlabel}{Yfloat}% }% \fi % % start with \parskip glue, I guess. \vskip\parskip % % Don't suppress indentation if a float happens to start a section. \restorefirstparagraphindent } % we have these possibilities: % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap % @float Foo,lbl & no caption: Foo 1.1 % @float Foo & @caption{Cap}: Foo: Cap % @float Foo & no caption: Foo % @float ,lbl & Caption{Cap}: 1.1: Cap % @float ,lbl & no caption: 1.1 % @float & @caption{Cap}: Cap % @float & no caption: % \def\Efloat{% \let\floatident = \empty % % In all cases, if we have a float type, it comes first. \ifx\floattype\empty \else \def\floatident{\floattype}\fi % % If we have an xref label, the number comes next. \ifx\floatlabel\empty \else \ifx\floattype\empty \else % if also had float type, need tie first. \appendtomacro\floatident{\tie}% \fi % the number. \appendtomacro\floatident{\chaplevelprefix\the\floatno}% \fi % % Start the printed caption with what we've constructed in % \floatident, but keep it separate; we need \floatident again. \let\captionline = \floatident % \ifx\thiscaption\empty \else \ifx\floatident\empty \else \appendtomacro\captionline{: }% had ident, so need a colon between \fi % % caption text. \appendtomacro\captionline{\scanexp\thiscaption}% \fi % % If we have anything to print, print it, with space before. % Eventually this needs to become an \insert. \ifx\captionline\empty \else \vskip.5\parskip \captionline % % Space below caption. \vskip\parskip \fi % % If have an xref label, write the list of floats info. Do this % after the caption, to avoid chance of it being a breakpoint. \ifx\floatlabel\empty \else % Write the text that goes in the lof to the aux file as % \floatlabel-lof. Besides \floatident, we include the short % caption if specified, else the full caption if specified, else nothing. {% \atdummies % % since we read the caption text in the macro world, where ^^M % is turned into a normal character, we have to scan it back, so % we don't write the literal three characters "^^M" into the aux file. \scanexp{% \xdef\noexpand\gtemp{% \ifx\thisshortcaption\empty \thiscaption \else \thisshortcaption \fi }% }% \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident \ifx\gtemp\empty \else : \gtemp \fi}}% }% \fi \egroup % end of \vtop % % place the captured inserts % % BEWARE: when the floats start floating, we have to issue warning % whenever an insert appears inside a float which could possibly % float. --kasal, 26may04 % \checkinserts } % Append the tokens #2 to the definition of macro #1, not expanding either. % \def\appendtomacro#1#2{% \expandafter\def\expandafter#1\expandafter{#1#2}% } % @caption, @shortcaption % \def\caption{\docaption\thiscaption} \def\shortcaption{\docaption\thisshortcaption} \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} \def\defcaption#1#2{\egroup \def#1{#2}} % The parameter is the control sequence identifying the counter we are % going to use. Create it if it doesn't exist and assign it to \floatno. \def\getfloatno#1{% \ifx#1\relax % Haven't seen this figure type before. \csname newcount\endcsname #1% % % Remember to reset this floatno at the next chap. \expandafter\gdef\expandafter\resetallfloatnos \expandafter{\resetallfloatnos #1=0 }% \fi \let\floatno#1% } % \setref calls this to get the XREFLABEL-snt value. We want an @xref % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we % first read the @float command. % \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% % Magic string used for the XREFLABEL-title value, so \xrefX can % distinguish floats from other xref types. \def\floatmagic{!!float!!} % #1 is the control sequence we are passed; we expand into a conditional % which is true if #1 represents a float ref. That is, the magic % \lastsection value which we \setref above. % \def\iffloat#1{\expandafter\doiffloat#1==\finish} % % #1 is (maybe) the \floatmagic string. If so, #2 will be the % (safe) float type for this float. We set \iffloattype to #2. % \def\doiffloat#1=#2=#3\finish{% \def\temp{#1}% \def\iffloattype{#2}% \ifx\temp\floatmagic } % @listoffloats FLOATTYPE - print a list of floats like a table of contents. % \parseargdef\listoffloats{% \def\floattype{#1}% floattype {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% % % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax \ifhavexrefs % if the user said @listoffloats foo but never @float foo. \message{\linenumber No `\safefloattype' floats to list.}% \fi \else \begingroup \leftskip=\tocindent % indent these entries like a toc \let\do=\listoffloatsdo \csname floatlist\safefloattype\endcsname \endgroup \fi } % This is called on each entry in a list of floats. We're passed the % xref label, in the form LABEL-title, which is how we save it in the % aux file. We strip off the -title and look up \XRLABEL-lof, which % has the text we're supposed to typeset here. % % Figures without xref labels will not be included in the list (since % they won't appear in the aux file). % \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} \def\listoffloatsdoentry#1-title\finish{{% % Can't fully expand XR#1-lof because it can contain anything. Just % pass the control sequence. On the other hand, XR#1-pg is just the % page number, and we want to fully expand that so we can get a link % in pdf output. \toksA = \expandafter{\csname XR#1-lof\endcsname}% % % use the same \entry macro we use to generate the TOC and index. \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% \writeentry }} \message{localization,} % For single-language documents, @documentlanguage is usually given very % early, just after @documentencoding. Single argument is the language % (de) or locale (de_DE) abbreviation. % { \catcode`\_ = \active \globaldefs=1 \parseargdef\documentlanguage{\begingroup \let_=\normalunderscore % normal _ character for filenames \tex % read txi-??.tex file in plain TeX. % Read the file by the name they passed if it exists. \openin 1 txi-#1.tex \ifeof 1 \documentlanguagetrywithoutunderscore{#1_\finish}% \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 \endgroup % end raw TeX \endgroup} % % If they passed de_DE, and txi-de_DE.tex doesn't exist, % try txi-de.tex. % \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% \openin 1 txi-#1.tex \ifeof 1 \errhelp = \nolanghelp \errmessage{Cannot read language file txi-#1.tex}% \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 } }% end of special _ catcode % \newhelp\nolanghelp{The given language definition file cannot be found or is empty. Maybe you need to install it? Putting it in the current directory should work if nowhere else does.} % This macro is called from txi-??.tex files; the first argument is the % \language name to set (without the "\lang@" prefix), the second and % third args are \{left,right}hyphenmin. % % The language names to pass are determined when the format is built. % See the etex.log file created at that time, e.g., % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. % % With TeX Live 2008, etex now includes hyphenation patterns for all % available languages. This means we can support hyphenation in % Texinfo, at least to some extent. (This still doesn't solve the % accented characters problem.) % \catcode`@=11 \def\txisetlanguage#1#2#3{% % do not set the language if the name is undefined in the current TeX. \expandafter\ifx\csname lang@#1\endcsname \relax \message{no patterns for #1}% \else \global\language = \csname lang@#1\endcsname \fi % but there is no harm in adjusting the hyphenmin values regardless. \global\lefthyphenmin = #2\relax \global\righthyphenmin = #3\relax } % Helpers for encodings. % Set the catcode of characters 128 through 255 to the specified number. % \def\setnonasciicharscatcode#1{% \count255=128 \loop\ifnum\count255<256 \global\catcode\count255=#1\relax \advance\count255 by 1 \repeat } \def\setnonasciicharscatcodenonglobal#1{% \count255=128 \loop\ifnum\count255<256 \catcode\count255=#1\relax \advance\count255 by 1 \repeat } % @documentencoding sets the definition of non-ASCII characters % according to the specified encoding. % \parseargdef\documentencoding{% % Encoding being declared for the document. \def\declaredencoding{\csname #1.enc\endcsname}% % % Supported encodings: names converted to tokens in order to be able % to compare them with \ifx. \def\ascii{\csname US-ASCII.enc\endcsname}% \def\latnine{\csname ISO-8859-15.enc\endcsname}% \def\latone{\csname ISO-8859-1.enc\endcsname}% \def\lattwo{\csname ISO-8859-2.enc\endcsname}% \def\utfeight{\csname UTF-8.enc\endcsname}% % \ifx \declaredencoding \ascii \asciichardefs % \else \ifx \declaredencoding \lattwo \setnonasciicharscatcode\active \lattwochardefs % \else \ifx \declaredencoding \latone \setnonasciicharscatcode\active \latonechardefs % \else \ifx \declaredencoding \latnine \setnonasciicharscatcode\active \latninechardefs % \else \ifx \declaredencoding \utfeight \setnonasciicharscatcode\active \utfeightchardefs % \else \message{Unknown document encoding #1, ignoring.}% % \fi % utfeight \fi % latnine \fi % latone \fi % lattwo \fi % ascii } % A message to be logged when using a character that isn't available % the default font encoding (OT1). % \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} % Take account of \c (plain) vs. \, (Texinfo) difference. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} % First, make active non-ASCII characters in order for them to be % correctly categorized when TeX reads the replacement text of % macros containing the character definitions. \setnonasciicharscatcode\active % % Latin1 (ISO-8859-1) character definitions. \def\latonechardefs{% \gdef^^a0{\tie} \gdef^^a1{\exclamdown} \gdef^^a2{\missingcharmsg{CENT SIGN}} \gdef^^a3{{\pounds}} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\missingcharmsg{YEN SIGN}} \gdef^^a6{\missingcharmsg{BROKEN BAR}} \gdef^^a7{\S} \gdef^^a8{\"{}} \gdef^^a9{\copyright} \gdef^^aa{\ordf} \gdef^^ab{\guillemetleft} \gdef^^ac{$\lnot$} \gdef^^ad{\-} \gdef^^ae{\registeredsymbol} \gdef^^af{\={}} % \gdef^^b0{\textdegree} \gdef^^b1{$\pm$} \gdef^^b2{$^2$} \gdef^^b3{$^3$} \gdef^^b4{\'{}} \gdef^^b5{$\mu$} \gdef^^b6{\P} % \gdef^^b7{$^.$} \gdef^^b8{\cedilla\ } \gdef^^b9{$^1$} \gdef^^ba{\ordm} % \gdef^^bb{\guillemetright} \gdef^^bc{$1\over4$} \gdef^^bd{$1\over2$} \gdef^^be{$3\over4$} \gdef^^bf{\questiondown} % \gdef^^c0{\`A} \gdef^^c1{\'A} \gdef^^c2{\^A} \gdef^^c3{\~A} \gdef^^c4{\"A} \gdef^^c5{\ringaccent A} \gdef^^c6{\AE} \gdef^^c7{\cedilla C} \gdef^^c8{\`E} \gdef^^c9{\'E} \gdef^^ca{\^E} \gdef^^cb{\"E} \gdef^^cc{\`I} \gdef^^cd{\'I} \gdef^^ce{\^I} \gdef^^cf{\"I} % \gdef^^d0{\DH} \gdef^^d1{\~N} \gdef^^d2{\`O} \gdef^^d3{\'O} \gdef^^d4{\^O} \gdef^^d5{\~O} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\O} \gdef^^d9{\`U} \gdef^^da{\'U} \gdef^^db{\^U} \gdef^^dc{\"U} \gdef^^dd{\'Y} \gdef^^de{\TH} \gdef^^df{\ss} % \gdef^^e0{\`a} \gdef^^e1{\'a} \gdef^^e2{\^a} \gdef^^e3{\~a} \gdef^^e4{\"a} \gdef^^e5{\ringaccent a} \gdef^^e6{\ae} \gdef^^e7{\cedilla c} \gdef^^e8{\`e} \gdef^^e9{\'e} \gdef^^ea{\^e} \gdef^^eb{\"e} \gdef^^ec{\`{\dotless i}} \gdef^^ed{\'{\dotless i}} \gdef^^ee{\^{\dotless i}} \gdef^^ef{\"{\dotless i}} % \gdef^^f0{\dh} \gdef^^f1{\~n} \gdef^^f2{\`o} \gdef^^f3{\'o} \gdef^^f4{\^o} \gdef^^f5{\~o} \gdef^^f6{\"o} \gdef^^f7{$\div$} \gdef^^f8{\o} \gdef^^f9{\`u} \gdef^^fa{\'u} \gdef^^fb{\^u} \gdef^^fc{\"u} \gdef^^fd{\'y} \gdef^^fe{\th} \gdef^^ff{\"y} } % Latin9 (ISO-8859-15) encoding character definitions. \def\latninechardefs{% % Encoding is almost identical to Latin1. \latonechardefs % \gdef^^a4{\euro} \gdef^^a6{\v S} \gdef^^a8{\v s} \gdef^^b4{\v Z} \gdef^^b8{\v z} \gdef^^bc{\OE} \gdef^^bd{\oe} \gdef^^be{\"Y} } % Latin2 (ISO-8859-2) character definitions. \def\lattwochardefs{% \gdef^^a0{\tie} \gdef^^a1{\ogonek{A}} \gdef^^a2{\u{}} \gdef^^a3{\L} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\v L} \gdef^^a6{\'S} \gdef^^a7{\S} \gdef^^a8{\"{}} \gdef^^a9{\v S} \gdef^^aa{\cedilla S} \gdef^^ab{\v T} \gdef^^ac{\'Z} \gdef^^ad{\-} \gdef^^ae{\v Z} \gdef^^af{\dotaccent Z} % \gdef^^b0{\textdegree} \gdef^^b1{\ogonek{a}} \gdef^^b2{\ogonek{ }} \gdef^^b3{\l} \gdef^^b4{\'{}} \gdef^^b5{\v l} \gdef^^b6{\'s} \gdef^^b7{\v{}} \gdef^^b8{\cedilla\ } \gdef^^b9{\v s} \gdef^^ba{\cedilla s} \gdef^^bb{\v t} \gdef^^bc{\'z} \gdef^^bd{\H{}} \gdef^^be{\v z} \gdef^^bf{\dotaccent z} % \gdef^^c0{\'R} \gdef^^c1{\'A} \gdef^^c2{\^A} \gdef^^c3{\u A} \gdef^^c4{\"A} \gdef^^c5{\'L} \gdef^^c6{\'C} \gdef^^c7{\cedilla C} \gdef^^c8{\v C} \gdef^^c9{\'E} \gdef^^ca{\ogonek{E}} \gdef^^cb{\"E} \gdef^^cc{\v E} \gdef^^cd{\'I} \gdef^^ce{\^I} \gdef^^cf{\v D} % \gdef^^d0{\DH} \gdef^^d1{\'N} \gdef^^d2{\v N} \gdef^^d3{\'O} \gdef^^d4{\^O} \gdef^^d5{\H O} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\v R} \gdef^^d9{\ringaccent U} \gdef^^da{\'U} \gdef^^db{\H U} \gdef^^dc{\"U} \gdef^^dd{\'Y} \gdef^^de{\cedilla T} \gdef^^df{\ss} % \gdef^^e0{\'r} \gdef^^e1{\'a} \gdef^^e2{\^a} \gdef^^e3{\u a} \gdef^^e4{\"a} \gdef^^e5{\'l} \gdef^^e6{\'c} \gdef^^e7{\cedilla c} \gdef^^e8{\v c} \gdef^^e9{\'e} \gdef^^ea{\ogonek{e}} \gdef^^eb{\"e} \gdef^^ec{\v e} \gdef^^ed{\'{\dotless{i}}} \gdef^^ee{\^{\dotless{i}}} \gdef^^ef{\v d} % \gdef^^f0{\dh} \gdef^^f1{\'n} \gdef^^f2{\v n} \gdef^^f3{\'o} \gdef^^f4{\^o} \gdef^^f5{\H o} \gdef^^f6{\"o} \gdef^^f7{$\div$} \gdef^^f8{\v r} \gdef^^f9{\ringaccent u} \gdef^^fa{\'u} \gdef^^fb{\H u} \gdef^^fc{\"u} \gdef^^fd{\'y} \gdef^^fe{\cedilla t} \gdef^^ff{\dotaccent{}} } % UTF-8 character definitions. % % This code to support UTF-8 is based on LaTeX's utf8.def, with some % changes for Texinfo conventions. It is included here under the GPL by % permission from Frank Mittelbach and the LaTeX team. % \newcount\countUTFx \newcount\countUTFy \newcount\countUTFz \gdef\UTFviiiTwoOctets#1#2{\expandafter \UTFviiiDefined\csname u8:#1\string #2\endcsname} % \gdef\UTFviiiThreeOctets#1#2#3{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} % \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} \gdef\UTFviiiDefined#1{% \ifx #1\relax \message{\linenumber Unicode char \string #1 not defined for Texinfo}% \else \expandafter #1% \fi } \begingroup \catcode`\~13 \catcode`\"12 \def\UTFviiiLoop{% \global\catcode\countUTFx\active \uccode`\~\countUTFx \uppercase\expandafter{\UTFviiiTmp}% \advance\countUTFx by 1 \ifnum\countUTFx < \countUTFy \expandafter\UTFviiiLoop \fi} \countUTFx = "C2 \countUTFy = "E0 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiTwoOctets\string~}} \UTFviiiLoop \countUTFx = "E0 \countUTFy = "F0 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiThreeOctets\string~}} \UTFviiiLoop \countUTFx = "F0 \countUTFy = "F4 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiFourOctets\string~}} \UTFviiiLoop \endgroup \begingroup \catcode`\"=12 \catcode`\<=12 \catcode`\.=12 \catcode`\,=12 \catcode`\;=12 \catcode`\!=12 \catcode`\~=13 \gdef\DeclareUnicodeCharacter#1#2{% \countUTFz = "#1\relax %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% \begingroup \parseXMLCharref \def\UTFviiiTwoOctets##1##2{% \csname u8:##1\string ##2\endcsname}% \def\UTFviiiThreeOctets##1##2##3{% \csname u8:##1\string ##2\string ##3\endcsname}% \def\UTFviiiFourOctets##1##2##3##4{% \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter \gdef\UTFviiiTmp{#2}% \endgroup} \gdef\parseXMLCharref{% \ifnum\countUTFz < "A0\relax \errhelp = \EMsimple \errmessage{Cannot define Unicode char value < 00A0}% \else\ifnum\countUTFz < "800\relax \parseUTFviiiA,% \parseUTFviiiB C\UTFviiiTwoOctets.,% \else\ifnum\countUTFz < "10000\relax \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% \else \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiA!% \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% \fi\fi\fi } \gdef\parseUTFviiiA#1{% \countUTFx = \countUTFz \divide\countUTFz by 64 \countUTFy = \countUTFz \multiply\countUTFz by 64 \advance\countUTFx by -\countUTFz \advance\countUTFx by 128 \uccode `#1\countUTFx \countUTFz = \countUTFy} \gdef\parseUTFviiiB#1#2#3#4{% \advance\countUTFz by "#10\relax \uccode `#3\countUTFz \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} \endgroup \def\utfeightchardefs{% \DeclareUnicodeCharacter{00A0}{\tie} \DeclareUnicodeCharacter{00A1}{\exclamdown} \DeclareUnicodeCharacter{00A3}{\pounds} \DeclareUnicodeCharacter{00A8}{\"{ }} \DeclareUnicodeCharacter{00A9}{\copyright} \DeclareUnicodeCharacter{00AA}{\ordf} \DeclareUnicodeCharacter{00AB}{\guillemetleft} \DeclareUnicodeCharacter{00AD}{\-} \DeclareUnicodeCharacter{00AE}{\registeredsymbol} \DeclareUnicodeCharacter{00AF}{\={ }} \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} \DeclareUnicodeCharacter{00B4}{\'{ }} \DeclareUnicodeCharacter{00B8}{\cedilla{ }} \DeclareUnicodeCharacter{00BA}{\ordm} \DeclareUnicodeCharacter{00BB}{\guillemetright} \DeclareUnicodeCharacter{00BF}{\questiondown} \DeclareUnicodeCharacter{00C0}{\`A} \DeclareUnicodeCharacter{00C1}{\'A} \DeclareUnicodeCharacter{00C2}{\^A} \DeclareUnicodeCharacter{00C3}{\~A} \DeclareUnicodeCharacter{00C4}{\"A} \DeclareUnicodeCharacter{00C5}{\AA} \DeclareUnicodeCharacter{00C6}{\AE} \DeclareUnicodeCharacter{00C7}{\cedilla{C}} \DeclareUnicodeCharacter{00C8}{\`E} \DeclareUnicodeCharacter{00C9}{\'E} \DeclareUnicodeCharacter{00CA}{\^E} \DeclareUnicodeCharacter{00CB}{\"E} \DeclareUnicodeCharacter{00CC}{\`I} \DeclareUnicodeCharacter{00CD}{\'I} \DeclareUnicodeCharacter{00CE}{\^I} \DeclareUnicodeCharacter{00CF}{\"I} \DeclareUnicodeCharacter{00D0}{\DH} \DeclareUnicodeCharacter{00D1}{\~N} \DeclareUnicodeCharacter{00D2}{\`O} \DeclareUnicodeCharacter{00D3}{\'O} \DeclareUnicodeCharacter{00D4}{\^O} \DeclareUnicodeCharacter{00D5}{\~O} \DeclareUnicodeCharacter{00D6}{\"O} \DeclareUnicodeCharacter{00D8}{\O} \DeclareUnicodeCharacter{00D9}{\`U} \DeclareUnicodeCharacter{00DA}{\'U} \DeclareUnicodeCharacter{00DB}{\^U} \DeclareUnicodeCharacter{00DC}{\"U} \DeclareUnicodeCharacter{00DD}{\'Y} \DeclareUnicodeCharacter{00DE}{\TH} \DeclareUnicodeCharacter{00DF}{\ss} \DeclareUnicodeCharacter{00E0}{\`a} \DeclareUnicodeCharacter{00E1}{\'a} \DeclareUnicodeCharacter{00E2}{\^a} \DeclareUnicodeCharacter{00E3}{\~a} \DeclareUnicodeCharacter{00E4}{\"a} \DeclareUnicodeCharacter{00E5}{\aa} \DeclareUnicodeCharacter{00E6}{\ae} \DeclareUnicodeCharacter{00E7}{\cedilla{c}} \DeclareUnicodeCharacter{00E8}{\`e} \DeclareUnicodeCharacter{00E9}{\'e} \DeclareUnicodeCharacter{00EA}{\^e} \DeclareUnicodeCharacter{00EB}{\"e} \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} \DeclareUnicodeCharacter{00F0}{\dh} \DeclareUnicodeCharacter{00F1}{\~n} \DeclareUnicodeCharacter{00F2}{\`o} \DeclareUnicodeCharacter{00F3}{\'o} \DeclareUnicodeCharacter{00F4}{\^o} \DeclareUnicodeCharacter{00F5}{\~o} \DeclareUnicodeCharacter{00F6}{\"o} \DeclareUnicodeCharacter{00F8}{\o} \DeclareUnicodeCharacter{00F9}{\`u} \DeclareUnicodeCharacter{00FA}{\'u} \DeclareUnicodeCharacter{00FB}{\^u} \DeclareUnicodeCharacter{00FC}{\"u} \DeclareUnicodeCharacter{00FD}{\'y} \DeclareUnicodeCharacter{00FE}{\th} \DeclareUnicodeCharacter{00FF}{\"y} \DeclareUnicodeCharacter{0100}{\=A} \DeclareUnicodeCharacter{0101}{\=a} \DeclareUnicodeCharacter{0102}{\u{A}} \DeclareUnicodeCharacter{0103}{\u{a}} \DeclareUnicodeCharacter{0104}{\ogonek{A}} \DeclareUnicodeCharacter{0105}{\ogonek{a}} \DeclareUnicodeCharacter{0106}{\'C} \DeclareUnicodeCharacter{0107}{\'c} \DeclareUnicodeCharacter{0108}{\^C} \DeclareUnicodeCharacter{0109}{\^c} \DeclareUnicodeCharacter{0118}{\ogonek{E}} \DeclareUnicodeCharacter{0119}{\ogonek{e}} \DeclareUnicodeCharacter{010A}{\dotaccent{C}} \DeclareUnicodeCharacter{010B}{\dotaccent{c}} \DeclareUnicodeCharacter{010C}{\v{C}} \DeclareUnicodeCharacter{010D}{\v{c}} \DeclareUnicodeCharacter{010E}{\v{D}} \DeclareUnicodeCharacter{0112}{\=E} \DeclareUnicodeCharacter{0113}{\=e} \DeclareUnicodeCharacter{0114}{\u{E}} \DeclareUnicodeCharacter{0115}{\u{e}} \DeclareUnicodeCharacter{0116}{\dotaccent{E}} \DeclareUnicodeCharacter{0117}{\dotaccent{e}} \DeclareUnicodeCharacter{011A}{\v{E}} \DeclareUnicodeCharacter{011B}{\v{e}} \DeclareUnicodeCharacter{011C}{\^G} \DeclareUnicodeCharacter{011D}{\^g} \DeclareUnicodeCharacter{011E}{\u{G}} \DeclareUnicodeCharacter{011F}{\u{g}} \DeclareUnicodeCharacter{0120}{\dotaccent{G}} \DeclareUnicodeCharacter{0121}{\dotaccent{g}} \DeclareUnicodeCharacter{0124}{\^H} \DeclareUnicodeCharacter{0125}{\^h} \DeclareUnicodeCharacter{0128}{\~I} \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} \DeclareUnicodeCharacter{012A}{\=I} \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} \DeclareUnicodeCharacter{012C}{\u{I}} \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} \DeclareUnicodeCharacter{0130}{\dotaccent{I}} \DeclareUnicodeCharacter{0131}{\dotless{i}} \DeclareUnicodeCharacter{0132}{IJ} \DeclareUnicodeCharacter{0133}{ij} \DeclareUnicodeCharacter{0134}{\^J} \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} \DeclareUnicodeCharacter{0139}{\'L} \DeclareUnicodeCharacter{013A}{\'l} \DeclareUnicodeCharacter{0141}{\L} \DeclareUnicodeCharacter{0142}{\l} \DeclareUnicodeCharacter{0143}{\'N} \DeclareUnicodeCharacter{0144}{\'n} \DeclareUnicodeCharacter{0147}{\v{N}} \DeclareUnicodeCharacter{0148}{\v{n}} \DeclareUnicodeCharacter{014C}{\=O} \DeclareUnicodeCharacter{014D}{\=o} \DeclareUnicodeCharacter{014E}{\u{O}} \DeclareUnicodeCharacter{014F}{\u{o}} \DeclareUnicodeCharacter{0150}{\H{O}} \DeclareUnicodeCharacter{0151}{\H{o}} \DeclareUnicodeCharacter{0152}{\OE} \DeclareUnicodeCharacter{0153}{\oe} \DeclareUnicodeCharacter{0154}{\'R} \DeclareUnicodeCharacter{0155}{\'r} \DeclareUnicodeCharacter{0158}{\v{R}} \DeclareUnicodeCharacter{0159}{\v{r}} \DeclareUnicodeCharacter{015A}{\'S} \DeclareUnicodeCharacter{015B}{\'s} \DeclareUnicodeCharacter{015C}{\^S} \DeclareUnicodeCharacter{015D}{\^s} \DeclareUnicodeCharacter{015E}{\cedilla{S}} \DeclareUnicodeCharacter{015F}{\cedilla{s}} \DeclareUnicodeCharacter{0160}{\v{S}} \DeclareUnicodeCharacter{0161}{\v{s}} \DeclareUnicodeCharacter{0162}{\cedilla{t}} \DeclareUnicodeCharacter{0163}{\cedilla{T}} \DeclareUnicodeCharacter{0164}{\v{T}} \DeclareUnicodeCharacter{0168}{\~U} \DeclareUnicodeCharacter{0169}{\~u} \DeclareUnicodeCharacter{016A}{\=U} \DeclareUnicodeCharacter{016B}{\=u} \DeclareUnicodeCharacter{016C}{\u{U}} \DeclareUnicodeCharacter{016D}{\u{u}} \DeclareUnicodeCharacter{016E}{\ringaccent{U}} \DeclareUnicodeCharacter{016F}{\ringaccent{u}} \DeclareUnicodeCharacter{0170}{\H{U}} \DeclareUnicodeCharacter{0171}{\H{u}} \DeclareUnicodeCharacter{0174}{\^W} \DeclareUnicodeCharacter{0175}{\^w} \DeclareUnicodeCharacter{0176}{\^Y} \DeclareUnicodeCharacter{0177}{\^y} \DeclareUnicodeCharacter{0178}{\"Y} \DeclareUnicodeCharacter{0179}{\'Z} \DeclareUnicodeCharacter{017A}{\'z} \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} \DeclareUnicodeCharacter{017C}{\dotaccent{z}} \DeclareUnicodeCharacter{017D}{\v{Z}} \DeclareUnicodeCharacter{017E}{\v{z}} \DeclareUnicodeCharacter{01C4}{D\v{Z}} \DeclareUnicodeCharacter{01C5}{D\v{z}} \DeclareUnicodeCharacter{01C6}{d\v{z}} \DeclareUnicodeCharacter{01C7}{LJ} \DeclareUnicodeCharacter{01C8}{Lj} \DeclareUnicodeCharacter{01C9}{lj} \DeclareUnicodeCharacter{01CA}{NJ} \DeclareUnicodeCharacter{01CB}{Nj} \DeclareUnicodeCharacter{01CC}{nj} \DeclareUnicodeCharacter{01CD}{\v{A}} \DeclareUnicodeCharacter{01CE}{\v{a}} \DeclareUnicodeCharacter{01CF}{\v{I}} \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} \DeclareUnicodeCharacter{01D1}{\v{O}} \DeclareUnicodeCharacter{01D2}{\v{o}} \DeclareUnicodeCharacter{01D3}{\v{U}} \DeclareUnicodeCharacter{01D4}{\v{u}} \DeclareUnicodeCharacter{01E2}{\={\AE}} \DeclareUnicodeCharacter{01E3}{\={\ae}} \DeclareUnicodeCharacter{01E6}{\v{G}} \DeclareUnicodeCharacter{01E7}{\v{g}} \DeclareUnicodeCharacter{01E8}{\v{K}} \DeclareUnicodeCharacter{01E9}{\v{k}} \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} \DeclareUnicodeCharacter{01F1}{DZ} \DeclareUnicodeCharacter{01F2}{Dz} \DeclareUnicodeCharacter{01F3}{dz} \DeclareUnicodeCharacter{01F4}{\'G} \DeclareUnicodeCharacter{01F5}{\'g} \DeclareUnicodeCharacter{01F8}{\`N} \DeclareUnicodeCharacter{01F9}{\`n} \DeclareUnicodeCharacter{01FC}{\'{\AE}} \DeclareUnicodeCharacter{01FD}{\'{\ae}} \DeclareUnicodeCharacter{01FE}{\'{\O}} \DeclareUnicodeCharacter{01FF}{\'{\o}} \DeclareUnicodeCharacter{021E}{\v{H}} \DeclareUnicodeCharacter{021F}{\v{h}} \DeclareUnicodeCharacter{0226}{\dotaccent{A}} \DeclareUnicodeCharacter{0227}{\dotaccent{a}} \DeclareUnicodeCharacter{0228}{\cedilla{E}} \DeclareUnicodeCharacter{0229}{\cedilla{e}} \DeclareUnicodeCharacter{022E}{\dotaccent{O}} \DeclareUnicodeCharacter{022F}{\dotaccent{o}} \DeclareUnicodeCharacter{0232}{\=Y} \DeclareUnicodeCharacter{0233}{\=y} \DeclareUnicodeCharacter{0237}{\dotless{j}} \DeclareUnicodeCharacter{02DB}{\ogonek{ }} \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} \DeclareUnicodeCharacter{1E20}{\=G} \DeclareUnicodeCharacter{1E21}{\=g} \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} \DeclareUnicodeCharacter{1E26}{\"H} \DeclareUnicodeCharacter{1E27}{\"h} \DeclareUnicodeCharacter{1E30}{\'K} \DeclareUnicodeCharacter{1E31}{\'k} \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} \DeclareUnicodeCharacter{1E3E}{\'M} \DeclareUnicodeCharacter{1E3F}{\'m} \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} \DeclareUnicodeCharacter{1E54}{\'P} \DeclareUnicodeCharacter{1E55}{\'p} \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} \DeclareUnicodeCharacter{1E7C}{\~V} \DeclareUnicodeCharacter{1E7D}{\~v} \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} \DeclareUnicodeCharacter{1E80}{\`W} \DeclareUnicodeCharacter{1E81}{\`w} \DeclareUnicodeCharacter{1E82}{\'W} \DeclareUnicodeCharacter{1E83}{\'w} \DeclareUnicodeCharacter{1E84}{\"W} \DeclareUnicodeCharacter{1E85}{\"w} \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} \DeclareUnicodeCharacter{1E8C}{\"X} \DeclareUnicodeCharacter{1E8D}{\"x} \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} \DeclareUnicodeCharacter{1E90}{\^Z} \DeclareUnicodeCharacter{1E91}{\^z} \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} \DeclareUnicodeCharacter{1E97}{\"t} \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} \DeclareUnicodeCharacter{1EBC}{\~E} \DeclareUnicodeCharacter{1EBD}{\~e} \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} \DeclareUnicodeCharacter{1EF2}{\`Y} \DeclareUnicodeCharacter{1EF3}{\`y} \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} \DeclareUnicodeCharacter{1EF8}{\~Y} \DeclareUnicodeCharacter{1EF9}{\~y} \DeclareUnicodeCharacter{2013}{--} \DeclareUnicodeCharacter{2014}{---} \DeclareUnicodeCharacter{2018}{\quoteleft} \DeclareUnicodeCharacter{2019}{\quoteright} \DeclareUnicodeCharacter{201A}{\quotesinglbase} \DeclareUnicodeCharacter{201C}{\quotedblleft} \DeclareUnicodeCharacter{201D}{\quotedblright} \DeclareUnicodeCharacter{201E}{\quotedblbase} \DeclareUnicodeCharacter{2022}{\bullet} \DeclareUnicodeCharacter{2026}{\dots} \DeclareUnicodeCharacter{2039}{\guilsinglleft} \DeclareUnicodeCharacter{203A}{\guilsinglright} \DeclareUnicodeCharacter{20AC}{\euro} \DeclareUnicodeCharacter{2192}{\expansion} \DeclareUnicodeCharacter{21D2}{\result} \DeclareUnicodeCharacter{2212}{\minus} \DeclareUnicodeCharacter{2217}{\point} \DeclareUnicodeCharacter{2261}{\equiv} }% end of \utfeightchardefs % US-ASCII character definitions. \def\asciichardefs{% nothing need be done \relax } % Make non-ASCII characters printable again for compatibility with % existing Texinfo documents that may use them, even without declaring a % document encoding. % \setnonasciicharscatcode \other \message{formatting,} \newdimen\defaultparindent \defaultparindent = 15pt \chapheadingskip = 15pt plus 4pt minus 2pt \secheadingskip = 12pt plus 3pt minus 2pt \subsecheadingskip = 9pt plus 2pt minus 2pt % Prevent underfull vbox error messages. \vbadness = 10000 % Don't be very finicky about underfull hboxes, either. \hbadness = 6666 % Following George Bush, get rid of widows and orphans. \widowpenalty=10000 \clubpenalty=10000 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're % using an old version of TeX, don't do anything. We want the amount of % stretch added to depend on the line length, hence the dependence on % \hsize. We call this whenever the paper size is set. % \def\setemergencystretch{% \ifx\emergencystretch\thisisundefined % Allow us to assign to \emergencystretch anyway. \def\emergencystretch{\dimen0}% \else \emergencystretch = .15\hsize \fi } % Parameters in order: 1) textheight; 2) textwidth; % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; % 7) physical page height; 8) physical page width. % % We also call \setleading{\textleading}, so the caller should define % \textleading. The caller should also set \parskip. % \def\internalpagesizes#1#2#3#4#5#6#7#8{% \voffset = #3\relax \topskip = #6\relax \splittopskip = \topskip % \vsize = #1\relax \advance\vsize by \topskip \outervsize = \vsize \advance\outervsize by 2\topandbottommargin \pageheight = \vsize % \hsize = #2\relax \outerhsize = \hsize \advance\outerhsize by 0.5in \pagewidth = \hsize % \normaloffset = #4\relax \bindingoffset = #5\relax % \ifpdf \pdfpageheight #7\relax \pdfpagewidth #8\relax % if we don't reset these, they will remain at "1 true in" of % whatever layout pdftex was dumped with. \pdfhorigin = 1 true in \pdfvorigin = 1 true in \fi % \setleading{\textleading} % \parindent = \defaultparindent \setemergencystretch } % @letterpaper (the default). \def\letterpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % If page is nothing but text, make it come out even. \internalpagesizes{607.2pt}{6in}% that's 46 lines {\voffset}{.25in}% {\bindingoffset}{36pt}% {11in}{8.5in}% }} % Use @smallbook to reset parameters for 7x9.25 trim size. \def\smallbook{{\globaldefs = 1 \parskip = 2pt plus 1pt \textleading = 12pt % \internalpagesizes{7.5in}{5in}% {-.2in}{0in}% {\bindingoffset}{16pt}% {9.25in}{7in}% % \lispnarrowing = 0.3in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .5cm }} % Use @smallerbook to reset parameters for 6x9 trim size. % (Just testing, parameters still in flux.) \def\smallerbook{{\globaldefs = 1 \parskip = 1.5pt plus 1pt \textleading = 12pt % \internalpagesizes{7.4in}{4.8in}% {-.2in}{-.4in}% {0pt}{14pt}% {9in}{6in}% % \lispnarrowing = 0.25in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .4cm }} % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % Double-side printing via postscript on Laserjet 4050 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. % To change the settings for a different printer or situation, adjust % \normaloffset until the front-side and back-side texts align. Then % do the same for \bindingoffset. You can set these for testing in % your texinfo source file like this: % @tex % \global\normaloffset = -6mm % \global\bindingoffset = 10mm % @end tex \internalpagesizes{673.2pt}{160mm}% that's 51 lines {\voffset}{\hoffset}% {\bindingoffset}{44pt}% {297mm}{210mm}% % \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = 5mm }} % Use @afivepaper to print on European A5 paper. % From romildo@urano.iceb.ufop.br, 2 July 2000. % He also recommends making @example and @lisp be small. \def\afivepaper{{\globaldefs = 1 \parskip = 2pt plus 1pt minus 0.1pt \textleading = 12.5pt % \internalpagesizes{160mm}{120mm}% {\voffset}{\hoffset}% {\bindingoffset}{8pt}% {210mm}{148mm}% % \lispnarrowing = 0.2in \tolerance = 800 \hfuzz = 1.2pt \contentsrightmargin = 0pt \defbodyindent = 2mm \tableindent = 12mm }} % A specific text layout, 24x15cm overall, intended for A4 paper. \def\afourlatex{{\globaldefs = 1 \afourpaper \internalpagesizes{237mm}{150mm}% {\voffset}{4.6mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% % % Must explicitly reset to 0 because we call \afourpaper. \globaldefs = 0 }} % Use @afourwide to print on A4 paper in landscape format. \def\afourwide{{\globaldefs = 1 \afourpaper \internalpagesizes{241mm}{165mm}% {\voffset}{-2.95mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% \globaldefs = 0 }} % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % \parseargdef\pagesizes{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 % \parskip = 3pt plus 2pt minus 1pt \setleading{\textleading}% % \dimen0 = #1\relax \advance\dimen0 by \voffset % \dimen2 = \hsize \advance\dimen2 by \normaloffset % \internalpagesizes{#1}{\hsize}% {\voffset}{\normaloffset}% {\bindingoffset}{44pt}% {\dimen0}{\dimen2}% }} % Set default to letter. % \letterpaper \message{and turning on texinfo input format.} \def^^L{\par} % remove \outer, so ^L can appear in an @comment % DEL is a comment character, in case @c does not suffice. \catcode`\^^? = 14 % Define macros to output various characters with catcode for normal text. \catcode`\"=\other \def\normaldoublequote{"} \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix \catcode`\+=\other \def\normalplus{+} \catcode`\<=\other \def\normalless{<} \catcode`\>=\other \def\normalgreater{>} \catcode`\^=\other \def\normalcaret{^} \catcode`\_=\other \def\normalunderscore{_} \catcode`\|=\other \def\normalverticalbar{|} \catcode`\~=\other \def\normaltilde{~} % This macro is used to make a character print one way in \tt % (where it can probably be output as-is), and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print % otherwise. Since all the Computer Modern typewriter fonts have zero % interword stretch (and shrink), and it is reasonable to expect all % typewriter fonts to have this, we can check that font parameter. % \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} % Same as above, but check for italic font. Actually this also catches % non-italic slanted fonts since it is impossible to distinguish them from % italic fonts. But since this is only used by $ and it uses \sl anyway % this is not a problem. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} % Turn off all special characters except @ % (and those which the user can use as if they were ordinary). % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active \def~{{\tt\char126}} \chardef\hat=`\^ \catcode`\^=\active \def^{{\tt \hat}} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} \let\realunder=_ % Subroutine for the previous macro. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } \catcode`\|=\active \def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def<{{\tt \less}} \chardef \gtr=`\> \catcode`\>=\active \def>{{\tt \gtr}} \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. % So turn them off again, and have \everyjob (or @setfilename) turn them on. % \otherifyactive is called near the end of this file. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other} % Used sometimes to turn off (effectively) the active characters even after % parsing them. \def\turnoffactive{% \normalturnoffactive \otherbackslash } \catcode`\@=0 % \backslashcurfont outputs one backslash character in current font, % as in \char`\\. \global\chardef\backslashcurfont=`\\ \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work % \realbackslash is an actual character `\' with catcode other, and % \doublebackslash is two of them (for the pdf outlines). {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} % In texinfo, backslash is an active character; it prints the backslash % in fixed width font. \catcode`\\=\active % @ for escape char from now on. % The story here is that in math mode, the \char of \backslashcurfont % ends up printing the roman \ from the math symbol font (because \char % in math mode uses the \mathcode, and plain.tex sets % \mathcode`\\="026E). It seems better for @backslashchar{} to always % print a typewriter backslash, hence we use an explicit \mathchar, % which is the decimal equivalent of "715c (class 7, e.g., use \fam; % ignored family value; char position "5C). We can't use " for the % usual hex value because it has already been made active. @def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} @let@backslashchar = @normalbackslash % @backslashchar{} is for user documents. % On startup, @fixbackslash assigns: % @let \ = @normalbackslash % \rawbackslash defines an active \ to do \backslashcurfont. % \otherbackslash defines an active \ to be a literal `\' character with % catcode other. We switch back and forth between these. @gdef@rawbackslash{@let\=@backslashcurfont} @gdef@otherbackslash{@let\=@realbackslash} % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of % the literal character `\'. Also revert - to its normal character, in % case the active - from code has slipped in. % {@catcode`- = @active @gdef@normalturnoffactive{% @let-=@normaldash @let"=@normaldoublequote @let$=@normaldollar %$ font-lock fix @let+=@normalplus @let<=@normalless @let>=@normalgreater @let\=@normalbackslash @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let~=@normaltilde @markupsetuplqdefault @markupsetuprqdefault @unsepspaces } } % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. @otherifyactive % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. % @gdef@eatinput input texinfo{@fixbackslash} @global@let\ = @eatinput % On the other hand, perhaps the file did not have a `\input texinfo'. Then % the first `\' in the file would cause an error. This macro tries to fix % that, assuming it is called before the first `\' could plausibly occur. % Also turn back on active characters that might appear in the input % file name, in case not using a pre-dumped format. % @gdef@fixbackslash{% @ifx\@eatinput @let\ = @normalbackslash @fi @catcode`+=@active @catcode`@_=@active } % Say @foo, not \foo, in error messages. @escapechar = `@@ % These (along with & and #) are made active for url-breaking, so need % active definitions as the normal characters. @def@normaldot{.} @def@normalquest{?} @def@normalslash{/} % These look ok in all fonts, so just make them not special. % @hashchar{} gets its own user-level command, because of #line. @catcode`@& = @other @def@normalamp{&} @catcode`@# = @other @def@normalhash{#} @catcode`@% = @other @def@normalpercent{%} @let @hashchar = @normalhash @c Finally, make ` and ' active, so that txicodequoteundirected and @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we @c don't make ` and ' active, @code will not get them as active chars. @c Do this last of all since we use ` in the previous @catcode assignments. @catcode`@'=@active @catcode`@`=@active @markupsetuplqdefault @markupsetuprqdefault @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) @c page-delimiter: "^\\\\message" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @c End: @c vim:sw=2: @ignore arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 @end ignore libisoburn-1.5.4/configure.ac0000644000175700017510000004127214005265213013114 00000000000000AC_INIT([libisoburn], [1.5.4], [http://libburnia-project.org]) AC_PREREQ([2.50]) dnl AC_CONFIG_HEADER([config.h]) AC_CANONICAL_HOST AC_CANONICAL_TARGET LIBBURNIA_SET_FLAGS AM_INIT_AUTOMAKE([subdir-objects]) AC_CONFIG_MACRO_DIR([./]) dnl Hint: Search list for version code aspects: dnl /AC_INIT( dnl /ISOBURN_.*_VERSION dnl /LT_.* dnl /LIB.*_REQUIRED dnl The API version codes are defined in libisoburn/libisoburn.h dnl #define isoburn_header_version_* dnl configure.ac only rules the libtool revision numbering about dnl LT_CURREN, LT_AGE, LT_REVISION where SONAME becomes LT_CURRENT - LT_AGE dnl dnl These three are only copies to provide libtool with unused LT_RELEASE ISOBURN_MAJOR_VERSION=1 ISOBURN_MINOR_VERSION=5 ISOBURN_MICRO_VERSION=4 dnl ISOBURN_VERSION=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION.$ISOBURN_MICRO_VERSION AC_SUBST(ISOBURN_MAJOR_VERSION) AC_SUBST(ISOBURN_MINOR_VERSION) AC_SUBST(ISOBURN_MICRO_VERSION) dnl AC_SUBST(ISOBURN_VERSION) dnl Libtool versioning dnl Generate libisoburn.so.1.x.y dnl SONAME will become LT_CURRENT - LT_AGE dnl dnl ts C10130 dnl This is the release version 1.5.4 = libisoburn.so.1.111.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 = 112 - 111 = 1 . Library name = libisoburn.so.1.111.0 LT_RELEASE=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION LT_CURRENT=112 LT_AGE=111 LT_REVISION=0 LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE` AC_SUBST(LT_RELEASE) AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) AC_SUBST(LT_CURRENT_MINUS_AGE) AC_PREFIX_DEFAULT([/usr/local]) test "$prefix" = "NONE" && prefix=$ac_default_prefix dnl ts B90405 : Disabled on advise of Ross Burton dnl AM_MAINTAINER_MODE AM_PROG_CC_C_O AC_C_CONST AC_C_INLINE AC_C_BIGENDIAN dnl Large file support AC_SYS_LARGEFILE AC_FUNC_FSEEKO AC_CHECK_FUNC([fseeko]) if test ! $ac_cv_func_fseeko; then AC_ERROR([Libburn requires largefile support.]) fi if test x$LIBISOBURN_OLD_ICONV_CONFIGURE = x then dnl ts B00410 : To detect the need for -liconv and const argument of iconv() LIBBURNIA_CHECK_ICONV else dnl Outdated: produces double -liconv and warnings about parameter mismatch dnl If iconv(3) is in an extra lib, then it gets added to variable LIBS. dnl If not, then no -liconv will be added. AC_CHECK_LIB(iconv, iconv, , ) dnl GNU iconv has no function iconv() but libiconv() and a macro iconv() AC_CHECK_LIB(iconv, libiconv, , ) fi AC_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) # LIBTOOL="$LIBTOOL --silent" AC_PROG_INSTALL AC_CHECK_HEADERS() dnl Check for tm_gmtoff field in struct tm AC_CHECK_MEMBER([struct tm.tm_gmtoff], [AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define this if tm structure includes a tm_gmtoff entry.])], , [#include ]) dnl Whether timezone is an integer variable AH_TEMPLATE([Libburnia_timezonE], [Either timezone or 0]) LIBBURNIA_TRY_TIMEZONE if test x$LIBBURNIA_TIMEZONE = xtimezone then AC_DEFINE([Libburnia_timezonE], [timezone]) else AC_DEFINE([Libburnia_timezonE], [0]) fi THREAD_LIBS=-lpthread AC_SUBST(THREAD_LIBS) TARGET_SHIZZLE AC_SUBST(ARCH) AC_SUBST(LIBBURNIA_PKGCONFDIR) AC_SUBST(LIBBURN_ARCH_LIBS) # Do not link libcam or libvolmgt if not available. # (They are indirect dependency on FreeBSD or Solaris.) LIBBURNIA_CHECK_ARCH_LIBS(optional) dnl Determine target directory for libisoburn-*.pc dnl Important: Must be performed _after_ TARGET_SHIZZLE dnl LIBBURNIA_SET_PKGCONFIG 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], , enable_libreadline=yes) if test x$enable_libreadline = xyes; then dnl Check whether there is readline-devel and readline-runtime. dnl If not, erase this macro which would enable use of readline(),add_history() READLINE_DEF="-DXorriso_with_readlinE" if test x$XORRISO_OLD_READLINE_CONFIGURE = x then dnl ts B00411 : To disable readline if not all needed functions are present LIBBURNIA_ASSERT_READLINE else dnl The empty yes case obviously causes -lreadline to be linked AC_CHECK_HEADER(readline/readline.h, AC_CHECK_LIB(readline, readline, , READLINE_DEF= ), READLINE_DEF= ) dnl The X= in the yes case prevents that -lreadline gets linked twice AC_CHECK_HEADER(readline/history.h, AC_CHECK_LIB(readline, add_history, X= , READLINE_DEF= ), READLINE_DEF= ) fi else READLINE_DEF= echo "disabled libreadline" fi if test x$READLINE_DEF = x; then if test x$enable_libreadline = xyes; then libedit_deflt=yes else libedit_deflt=no fi AC_ARG_ENABLE(libedit, [ --enable-libedit Enable use of libedit by xorriso if not libreadline, default= setting of --enable-libreadline], , enable_libedit=$libedit_deflt) if test x$enable_libedit = xyes; then READLINE_DEF="-DXorriso_with_editlinE" LIBBURNIA_ASSERT_EDITLINE else READLINE_DEF= echo "disabled libedit" fi fi AC_SUBST(READLINE_DEF) dnl ts A90329 dnl ACL and xattr do not need to be enabled in libisoburn or xorriso source dnl but without AC_CHECK_LIB() xorriso will not be linked with -lacl . dnl On my Linux this does work with an ACL enabled libisofs but in general dnl it seems not be right. dnl So for now it seems to be best to do the same configuration for libisoburn dnl and xorriso as for libisofs. AC_ARG_ENABLE(libacl, [ --enable-libacl Enable use of libacl by libisofs, default=yes], , enable_libacl=yes) LIBACL_DEF= if test x$LIBBURNIA_SUPP_ACL = xlibacl then if test x$enable_libacl = xyes; then dnl Check whether there is libacl-devel and libacl-runtime. dnl If not, erase this macro which would enable use of acl_to_text and others LIBACL_DEF="-DLibisofs_with_aaip_acL" dnl The empty yes case obviously causes -lacl to be linked has_acl_h_but_no_func=0 AC_CHECK_HEADER(sys/acl.h, AC_CHECK_LIB(acl, acl_to_text, , has_acl_h_but_no_libacl=1 ), LIBACL_DEF= ) if test "$has_acl_h_but_no_libacl" = 1 then AC_CHECK_LIB(c, acl_to_text, X= , LIBACL_DEF= ) fi fi fi if test x$LIBACL_DEF = x-DLibisofs_with_aaip_acL then if test x$has_acl_h_but_no_libacl = x1 then echo "enabled local processing of ACL" else echo "enabled libacl, local processing of ACL" fi else echo "disabled local processing of ACL" fi AC_SUBST(LIBACL_DEF) AC_ARG_ENABLE(xattr, [ --enable-xattr Enable use of extended file attributes by libisofs, default=yes], , enable_xattr=yes) XATTR_DEF= if test x"$LIBBURNIA_SUPP_FATTR" = xxattr then if test "x$enable_xattr" = xyes; then dnl Check whether there is the header for Linux xattr. dnl If not, erase this macro which would enable use of listxattr and others XATTR_DEF="-DLibisofs_with_aaip_xattR" AC_CHECK_HEADER(attr/xattr.h, AC_CHECK_LIB(c, listxattr, X= , XATTR_DEF= ), XATTR_DEF= ) fi elif test x"$LIBBURNIA_SUPP_FATTR" = xextattr then if test "x$enable_xattr" = xyes; then XATTR_DEF="-DLibisofs_with_freebsd_extattR" AC_CHECK_HEADER(sys/extattr.h, AC_CHECK_LIB(c, extattr_list_file, X=, XATTR_DEF= ), XATTR_DEF= ) fi fi if test x$XATTR_DEF = x-DLibisofs_with_aaip_xattR then echo "enabled xattr, local processing of extended file attributes Linux style" elif test x$XATTR_DEF = x-DLibisofs_with_freebsd_extattR then echo "enabled extattr, local processing of extended file attributes FreeBSD style" else echo "disabled local processing of extended file attributes" fi AC_SUBST(XATTR_DEF) dnl ts A90409 dnl Same situation as with xattr and ACL: libisoburn does not depend directly dnl on zlib. But if it is enabled in libisofs then it seems wise to link it dnl with libisoburn apps. AC_ARG_ENABLE(zlib, [ --enable-zlib Enable use of zlib by libisofs, default=yes], , enable_zlib=yes) if test x$enable_zlib = xyes; then dnl Check whether there is the header for zlib. dnl If not, erase this macro which would enable use of compress2() and others. dnl Linking fails on SuSE 9.0 because zlib has compress2() but lacks dnl compressBound(). So compressBound is the more modern thing to test. dnl The empty parameter after "compressBound" causes -lz. ZLIB_DEF="-DLibisofs_with_zliB" AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, compressBound, , ZLIB_DEF= ), ZLIB_DEF= ) else ZLIB_DEF= fi AC_SUBST(ZLIB_DEF) dnl ts B00928 AC_ARG_ENABLE(libjte, [ --enable-libjte Enable use of libjte >= 2.0 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= ) else LIBJTE_DEF= fi AC_SUBST(LIBJTE_DEF) dnl ts B00107 dnl Just for the case that it is necessary to give link option -lcdio not only dnl with libburn but also with libburn apps like xorriso. dnl On SuSE 10.2 this is not needed. libburn finds libcdio on its own. case $host_os in cygwin*|mingw*) default_libcdio=yes ;; *) default_libcdio=no ;; esac AC_ARG_ENABLE(libcdio, [ --enable-libcdio Enable use of libcdio as system adapter, default=no (except on MSWindows)], , enable_libcdio=$default_libcdio) if test x$enable_libcdio = xyes; then dnl Check whether there is libcdio-devel and libcdio-runtime. dnl If not, erase this macro LIBCDIO_DEF="-DLibburn_use_libcdiO" dnl The empty yes case obviously causes -lcdio to be linked AC_CHECK_HEADER(cdio/cdio.h, AC_CHECK_LIB(cdio, mmc_last_cmd_sense, , LIBCDIO_DEF= ), LIBCDIO_DEF= ) else LIBCDIO_DEF= fi if test x$LIBCDIO_DEF = x then if test x$enable_libcdio = xyes then echo "WARNING: could not enable use of libcdio as system adapter" fi else echo "enabled use of libcdio as system adapter" fi AC_SUBST(LIBCDIO_DEF) AC_ARG_ENABLE(external-filters, [ --enable-external-filters Enable use of external filter programs by xorriso, default=yes], , enable_external_filters=yes) if test x"$enable_external_filters" = xyes; then EXTF_DEF="-DXorriso_allow_external_filterS" echo "enabled xorriso external filter programs" else EXTF_DEF= echo "disabled xorriso external filter programs" fi AC_SUBST(EXTF_DEF) AC_ARG_ENABLE(external-filters-setuid, [ --enable-external-filters-setuid Enable xorriso external filter programs under setuid, default=no], , enable_external_filters_setuid=no) if test x$enable_external_filters_setuid = xyes; then EXTF_SUID_DEF="-DXorriso_allow_extf_suiD" echo "enabled xorriso external filter programs under setuid" else EXTF_SUID_DEF= echo "disabled xorriso external filter programs under setuid" fi AC_SUBST(EXTF_SUID_DEF) AC_ARG_ENABLE(launch-frontend, [ --enable-launch-frontend Enable start of piped frontend program by xorriso, default=yes], , enable_launch_frontend=yes) if test x"$enable_launch_frontend" = xyes; then LFRONT_DEF="-DXorriso_allow_launch_frontenD" echo "enabled xorriso command -launch_frontend" else LFRONT_DEF= echo "disabled xorriso command -launch_frontend" fi AC_SUBST(LFRONT_DEF) AC_ARG_ENABLE(launch-frontend-setuid, [ --enable-launch-frontend-setuid Enable start of piped frontend program under setuid, default=no], , enable_launch_frontend_setuid=no) if test x$enable_launch_frontend_setuid = xyes; then LFRONT_SUID_DEF="-DXorriso_allow_extf_suiD" echo "enabled xorriso command -launch_frontend under setuid" else LFRONT_SUID_DEF= echo "disabled xorriso command -launch_frontend under setuid" fi AC_SUBST(LFRONT_SUID_DEF) AC_ARG_ENABLE(dvd-obs-64k, [ --enable-dvd-obs-64k 64 KB default size for xorriso DVD writing, default=no], , enable_dvd_obs_64=no) if test x$enable_dvd_obs_64k = xyes; then XORRISO_DVD_OBS_64K="-DXorriso_dvd_obs_default_64K" echo "enabled xorriso write size default 64 KB on DVD" else XORRISO_DVD_OBS_64K= echo "disabled xorriso write size default 64 KB on DVD" fi AC_SUBST(XORRISO_DVD_OBS_64K) # Library versioning normally serves a complex purpose. # Since libisoburn obeys strict ABI backward compatibility, it needs only the # simple feature to declare function names "global:" or "local:". Only the # global ones are visible to applications at library load time. AC_ARG_ENABLE(versioned-libs, [ --enable-versioned-libs Enable strict symbol encapsulation , default=yes], , enable_versioned_libs=yes) if test x$enable_versioned_libs = xyes; then vers_libs_test=no LIBISOBURN_ASSERT_VERS_LIBS if test x$vers_libs_test = xno then echo "disabled strict symbol encapsulation (test failed)" else echo "enabled strict symbol encapsulation" fi else echo "disabled strict symbol encapsulation" fi AC_ARG_ENABLE(ldconfig-at-install, [ --enable-ldconfig-at-install On GNU/Linux run ldconfig, default=yes], , ldconfig_at_install=yes) if test x$ldconfig_at_install = xyes; then dummy=dummy else LIBBURNIA_LDCONFIG_CMD="echo 'NOTE: ldconfig is disabled. If needed, configure manually for:'" echo "disabled run of ldconfig during installation on GNU/Linux" fi AC_SUBST(LIBBURNIA_LDCONFIG_CMD) AC_CHECK_HEADER(libburn/libburn.h, LIBBURNIA_HAVE_LIBBURN=1, LIBBURNIA_HAVE_LIBBURN=0) AC_CHECK_HEADER(libisofs/libisofs.h, LIBBURNIA_HAVE_LIBISOFS=1, LIBBURNIA_HAVE_LIBISOFS=0) if test x$LIBBURNIA_HAVE_LIBBURN = x0; then echo "FATAL: Lacking libburn development header file " 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 " 2>&1 echo "HINT: You first have to install libisofs before you can build libisoburn" 2>&1 fi if test x$LIBBURNIA_HAVE_LIBBURN = x0 -o x$LIBBURNIA_HAVE_LIBISOFS = x0; then echo "ABORT: Lacking mandatory prerequisites" 2>&1 exit 1 fi # ------- Visible mark in configure : Start of library check # Check for proper library versions if this is desired. # (It fails too often on too many systems.) AC_ARG_ENABLE(pkg-check-modules, [ --enable-pkg-check-modules Enable pkg-config check for libburn and libisofs , default=no], , enable_pkg_check_modules=no) if test x$enable_pkg_check_modules = xyes; then dnl If PKG_CHECK_MODULES is to be used after this if-block, dnl then it might be necessary to perform PKG_PROG_PKG_CONFIG before the block. LIBBURN_REQUIRED=1.5.4 LIBISOFS_REQUIRED=1.5.4 PKG_CHECK_MODULES(LIBBURN, libburn-1 >= $LIBBURN_REQUIRED) PKG_CHECK_MODULES(LIBISOFS, libisofs-1 >= $LIBISOFS_REQUIRED) if test x$LIBCDIO_DEF = x; then dummy=dummy else LIBCDIO_REQUIRED=0.83 PKG_CHECK_MODULES(LIBCDIO, libcdio >= $LIBCDIO_REQUIRED) fi else echo "checking for LIBBURN... skipped, no --enable-pkg-check-modules" echo "checking for LIBISOFS... skipped, no --enable-pkg-check-modules" if test x$LIBCDIO_DEF = x; then dummy=dummy else echo "checking for LIBCDIO... skipped, no --enable-pkg-check-modules" fi fi # ------- Visible mark in configure : End of library check dnl Add compiler-specific flags dnl See if the user wants aggressive optimizations of the code AC_ARG_ENABLE(debug, [ --enable-debug Disable aggressive optimizations [default=yes]], , enable_debug=yes) if test x$enable_debug != xyes; then if test x$GCC = xyes; then CFLAGS="-O3 $CFLAGS" CFLAGS="-fexpensive-optimizations $CFLAGS" fi CFLAGS="-DNDEBUG $CFLAGS" else if test x$GCC = xyes; then CFLAGS="-g -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-char-subscripts $CFLAGS" fi CFLAGS="-DDEBUG $CFLAGS" fi CFLAGS="$READLINE_DEF $LIBACL_DEF $XATTR_DEF $EXTF_DEF $EXTF_SUID_DEF $LFRONT_DEF $LFRONT_SUID_DEF $ZLIB_DEF $LIBJTE_DEF $XORRISO_DVD_OBS_64K $CFLAGS" AC_CONFIG_FILES([ Makefile doc/doxygen.conf version.h libisoburn-1.pc ]) AC_OUTPUT